- Newest
- Most votes
- Most comments
I determined the root cause here:
One of my partition columns is a date in the format "YYYY-MM-DD HH:MM:SS"
If I replace that whitespace by removing it or replacing it with something like an underscore, this whole problem goes away.
But it is interesting that I can have the white space in the original table (created with data wrangler) and in the glue-created table (created with the crawler), but it fails if I create a copy manually.
answered a year ago
When you're getting zero results (not errors) from your Athena query after copying data to a new location, there are several potential issues to consider:
-
S3 Location Format: Athena is very particular about the S3 location format in table definitions. Make sure your location path doesn't include any wildcards or file patterns. The location should be a directory path ending with a forward slash, not pointing to specific files.
-
Partition Path Structure: When you copied the data, ensure that the partition directory structure was preserved exactly. The partition directories must match the partition column names and values defined in your table.
-
MSCK REPAIR TABLE Behavior: The "Partitions missing from filesystem" message suggests that Glue is expecting partitions that don't exist in the physical location. This could indicate a mismatch between the partition structure in your table definition and the actual directory structure in S3.
-
File Format Compatibility: Ensure the parquet files were copied correctly and maintain their format integrity.
-
Partition Format Issues: If your partitions use date/time values or numbers with specific formatting (like leading zeros), there might be a mismatch between how the partitions are defined and how they're physically stored.
Since a Glue crawler successfully creates a working table, this suggests the data is accessible and properly formatted. The difference is likely in how the partitions are defined or recognized.
Try these approaches:
- Compare the table properties between the crawler-generated table and your manually created one
- Check if there are any hidden properties or settings in the crawler-generated table
- Verify the exact partition path structure in S3 matches what's expected in your table definition
- Consider using ALTER TABLE ADD PARTITION statements to manually add partitions instead of MSCK REPAIR
Since the crawler-generated table works, you might want to use that as your starting point rather than trying to recreate the table definition manually.
Sources
Athena query to table stored as parquet files on s3 returns empty result | AWS re:Post
Athena partition projection BUG | AWS re:Post
Amazon Athena returns no records for Amazon Connect CTR data on S3 | AWS re:Post
answered a year ago
Relevant content
asked 3 years ago
- AWS OFFICIALUpdated 10 months ago

I have taken all of these suggestions into consideration. I can use the EXACT syntax from the crawler table and simply change the name, and am unable to query the new table. I could really use some ideas, here.