Unfortunately, it is currently not possible to add/create partitions to Glue table via the Glue console. However, it is possible to edit table schema which means you can add or remove partition columns in the console.
If you want to edit the partition columns, you may follow the below steps, however, partitions would still need to be added to the table:
- Under Data catalog, select Tables, then select the table in which you want to create a partition.
- Select Edit schema option.
- Click on Add column and enter the preferred name, select the partition key checkbox, then Click Add.
- Click Save on the top right corner.
5 Go back to the table details and you can click on View partitions option to check the partitions.
I see that your Glue table had been created via a crawler. Ideally, a Glue crawler also adds partitions to the table if the data in S3 is stored in a partitioned format. I suspect that the data in S3 might not be in a partitioned format which is why crawler might not have created the partitions.
You can manually add partitions to your table using the following approaches:
- Add Glue Table Partition using Boto 3 SDK
You can use AWS Boto 3 SDK to create glue partitions using the batch_create_partition() or create_partition() APIs.
- Using Alter Table Add Partition command
You can run the Alter Table Add Partition SQL command via Athena to add the partitions manually into the table.
How to avoid transforming data for a dropped column without updating glue catalogasked 4 months ago
Data Catalog schema table getting modified when I run my Glue ETL job
What is the sizekey parameter in AWS Glue Catalog Data properties?Accepted Answerasked 2 years ago
Can't get Partitions to work with my Glue Data CatalogAccepted Answer
AWS Glue ETL Job: IllegalArgumentException: Missing collection name.asked 3 months ago
Get Glue Data Catalog Name/IDasked a month ago
Delete partitions in Glue Data Catalog using crawler not working.asked 3 months ago
AWS Glue partitions for data catalog tableasked 17 days ago
I need to read S3 data, transform and put into Data Catalog. Should I be using a Crawler?Accepted Answerasked 5 months ago
How to connect a Sagemaker Notebook to Glue CatalogAccepted Answerasked 2 years ago