Can we have an AWS Glue job scheduled to perform MSCK repair commands so that the metadata for newly added partition gets added to Glue Catalog?
Can Glue ETL script perform MSCK REPAIR TABLE command without calling Athena?
Can we have an AWS Glue job scheduled to perform MSCK repair commands so that the metadata for newly added partition gets added to Glue Catalog?
Can Glue ETL script perform MSCK REPAIR TABLE command without calling Athena?
This is achieved by Glue Crawlers. If you create a crawler it will update the table based on new fields and add new partitions.
You can call batch_create_partition() API to do it. It doesn't require expensive operations like MSCK REPAIR TABLE or re-crawling. Below is my detailed answer with code sample -