New to AWS, trying to create a table through glue crawler from a .json file that i uploaded into S3.


Hello, any help would be much appreciated. I have two files that I need to make tables for one is a csv file that I was able to get the table loaded for through glue crawler. The other file i was not able to load a table for which is a .json file. I have both files uploaded in my s3 bucket but glue crawler crawls through the .json file and returns no records. Please help!

  • Each file should be under each own path, otherwise the crawler cannot create two tables, is that your case?

asked a year ago1006 views
1 Answer

To create a table in AWS Glue from a JSON file, you can follow these steps:

  1. Create an IAM role with permissions for AWS Glue to access your S3 bucket. Make sure this role has the necessary permissions to read from your S3 bucket.
  2. Create a Glue Crawler to crawl your JSON file. Here are the steps:
* a. Go to the AWS Glue console and select "Crawlers" in the left navigation pane.
* b. Click on the "Add crawler" button.
* c. Give your crawler a name and select the IAM role you created in step 1.
* d. In the "Specify crawler source" section, select "Data stores" and then "S3". Enter the path to your S3 bucket and the folder where your JSON file is stored.
* e. In the "Add another data store" section, select "No" and click "Next".
* f. In the "Choose an IAM role" section, select the same IAM role you created in step 1 and click "Next".
* g. In the "Create a schedule for this crawler" section, choose "Run on demand" and click "Next".
* h. In the "Configure the crawler's output" section, choose "Add database" and enter a name for your database. Click "Next".
* i. Review your crawler settings and click "Finish".
  1. Run your Glue Crawler by selecting it in the AWS Glue console and clicking "Run crawler".
  2. Once the crawler has finished running, go to the AWS Glue console and select "Tables" in the left navigation pane.
  3. Find the table that was created for your JSON file and click on it.
  4. In the table details page, click on the "Edit schema" button to edit the schema for your table. Here, you can specify the columns in your JSON file and their data types.
  5. Save the changes to your table schema.

That's it! You should now have a table in AWS Glue that was created from your JSON file.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions