Why doesn't my MSCK REPAIR TABLE query add partitions to the AWS Glue Data Catalog?
"When I run MSCK REPAIR TABLE, Amazon Athena returns a list of partitions, but then fails to add the partitions to the table in the AWS Glue Data Catalog."
"When I run MSCK REPAIR TABLE, Amazon Athena returns a list of partitions, but then fails to add the partitions to the table in the AWS Glue Data Catalog.Short descriptionHere are some common causes of this behavior:The AWS Identity and Access Management (IAM) user or role doesn't have a policy that allows the glue:BatchCreatePartition action.The Amazon Simple Storage Service (Amazon S3) path is in camel case instead of lower case (for example, userId instead of userid).ResolutionAllow glue:BatchCreatePartition in the IAM policyReview the IAM policies attached to the user or role that you're using to run MSCK REPAIR TABLE. When you use the AWS Glue Data Catalog with Athena, the IAM policy must allow the glue:BatchCreatePartition action. If the policy doesn't allow that action, then Athena can't add partitions to the metastore. For an example of an IAM policy that allows the glue:BatchCreatePartition action, see AmazonAthenaFullAccess managed policy.Change the Amazon S3 path to lower caseThe Amazon S3 path name must be in lower case. If the path is in camel case, then MSCK REPAIR TABLE doesn't add the partitions to the AWS Glue Data Catalog. For example, if the Amazon S3 path is userId, the following partitions aren't added to the AWS Glue Data Catalog:s3://awsdoc-example-bucket/path/userId=1/s3://awsdoc-example-bucket/path/userId=2/s3://awsdoc-example-bucket/path/userId=3/To resolve this issue, use lower case instead of camel case:s3://awsdoc-example-bucket/path/userid=1/s3://awsdoc-example-bucket/path/userid=2/s3://awsdoc-example-bucket/path/userid=3/Related informationPartitioning data in AthenaActions, resources, and condition keys for Amazon AthenaActions, resources, and condition keys for AWS GlueFollow"