1 Answer
- Newest
- Most votes
- Most comments
1
To create a table in AWS Glue from a JSON file, you can follow these steps:
- 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.
- 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".
- Run your Glue Crawler by selecting it in the AWS Glue console and clicking "Run crawler".
- Once the crawler has finished running, go to the AWS Glue console and select "Tables" in the left navigation pane.
- Find the table that was created for your JSON file and click on it.
- 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.
- 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 2 years ago
Relevant content
- Accepted Answerasked 3 years ago
- Accepted Answerasked 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 days ago
- AWS OFFICIALUpdated 2 years ago
Each file should be under each own path, otherwise the crawler cannot create two tables, is that your case?