- Newest
- Most votes
- Most comments
The error "GENERIC_INTERNAL_ERROR: No partition found with values [2025, 5, 27]" suggests that your INSERT INTO statement is trying to write data to a partition that doesn't exist in your target table (s3_download_summary).
This typically happens when:
- Your target table is partitioned by year, month, and day (as indicated by your query)
- Your query is generating data for a partition (2025, 5, 27) that doesn't exist yet in the target table
There are a few ways to resolve this:
-
Create the partitions first: Before running your INSERT INTO query, you need to ensure the partitions exist in your target table. You can create them using ALTER TABLE ADD PARTITION statements.
-
Use CTAS and INSERT INTO approach: A common pattern in Athena is to:
- First create a table with the right structure using CREATE TABLE AS SELECT (CTAS)
- Then use INSERT INTO to add data to it
-
Check your data: Verify if your source data actually contains records for 2025-05-27. This could be a data issue where your timestamp parsing is resulting in future dates.
-
Modify your table properties: If you're frequently inserting data into new partitions, you might want to consider setting up your target table to automatically add partitions as needed.
When using INSERT INTO with partitioned tables in Athena, remember that:
- Athena doesn't modify existing files but writes new ones
- The INSERT operation will create new files in the S3 location corresponding to the partition
- The partition must exist before you can insert data into it
- The columns in your SELECT statement must match the order and data types of the target table
For your specific case, I recommend checking if the 2025-05-27 partition exists in your target table and creating it if needed, or investigating why your query is generating data for a future date.
Having said this if you are still facing this issue, I would suggest you to reach out to AWS support via AWS support ticket.
Sources
INSERT INTO - Amazon Athena
Use CTAS and INSERT INTO for ETL and data analysis - Amazon Athena
Relevant content
- asked 3 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 9 months ago
