- Newest
- Most votes
- Most comments
As to my understanding, the data duplication issue is caused by using an AWS Glue Crawler on the target S3 bucket.
Here is what I think, and is happening and how to fix it …
- Root Cause: AWS Glue Zero-ETL integrations use the Apache Iceberg table format natively to handle UPSERT and MERGE operations automatically. Iceberg uses a metadata layer to track the latest state of your records, even though old Parquet files remain in S3. When you run a standard AWS Glue Crawler directly on the S3 bucket, it bypasses the Iceberg metadata and reads all raw Parquet files (both the initial load and all historical CDC updates). This is why you see old and new values as duplicate records in Athena.
- Solution: You do not need (and should not use) a Glue Crawler for this pipeline. The Zero-ETL integration automatically creates and maintains the destination table in the AWS Glue Data Catalog as an Apache Iceberg table. To see the correct, deduplicated data, simply query this automatically registered Iceberg table directly in Amazon Athena.
- Native Support: Yes, the integration natively supports Iceberg. You do not need to build manual AWS Glue ETL jobs for deduplication.
Official Reference: You can verify how Athena relies on Iceberg's metadata to resolve the latest state of records (and why crawling raw files breaks this) in the official AWS documentation: https://docs.aws.amazon.com/athena/latest/ug/querying-iceberg.html
The behavior you're experiencing is expected for Zero-ETL integrations with DynamoDB as a source. The CDC process is designed to append change records to S3 rather than overwrite existing files, which can result in multiple versions of the same record appearing in your Glue Data Catalog when queried through Athena.
To address the deduplication challenge, here are the recommended approaches:
Deduplication Strategy: The most common approach is to use AWS Glue ETL jobs to handle deduplication. You can create a Glue job that reads the data from S3, identifies the most recent version of each record (typically using a timestamp or version field from the CDC data), and writes the deduplicated results to a separate location or table. This gives you control over the deduplication logic and allows you to maintain a clean, queryable dataset.
Data Quality Checks: AWS Glue Data Quality includes features to help identify duplicate records. You can use the FileUniqueness rule to detect duplicate files in your S3 folders, though this focuses on file-level rather than record-level duplicates. For record-level deduplication, you'll need to implement custom logic in your ETL jobs.
Refresh Interval Considerations: Be aware that for DynamoDB sources with refresh intervals of 1440 minutes (24 hours) or greater, the integration uses sequential daily batch processing instead of a single export operation. This is due to DynamoDB's export window limitation. The integration will wait for the full refresh interval, then perform multiple sequential exports covering up to 24-hour windows each, with CDC jobs processing each batch sequentially.
Best Practices:
- Implement a Glue ETL job that runs after CDC updates to deduplicate records based on primary keys and timestamps
- Consider partitioning your target S3 data by date or other relevant dimensions to improve query performance
- Use the AWS Glue Data Catalog's versioning capabilities to track schema changes
- Set up appropriate refresh intervals based on your data freshness requirements and the volume of changes
Regarding Apache Iceberg support: While AWS Glue does support Apache Iceberg table format for certain use cases, you should verify the current capabilities for Zero-ETL integrations with DynamoDB specifically, as native UPSERT/MERGE handling may require additional configuration or ETL processing.
For your specific architecture, the recommended pattern is: DynamoDB → Zero-ETL Integration → S3 (raw CDC data) → Glue ETL Job (deduplication) → S3 (curated data) → Glue Data Catalog → Athena queries.
Sources
Configuring an integration - AWS Glue
FileUniqueness - AWS Glue
Relevant content
asked 6 months ago
asked 2 years ago
asked 5 months ago

Thank you for the clear and detailed explanation. Your response helped me understand the root cause immediately.
I have stopped using the Glue Crawler and queried the Iceberg table that was automatically created by the Zero-ETL integration directly in Athena. The data is now correct and deduplicated as expected.
The issue is fully resolved. I appreciate your support!
Best regards