AWS Data Engineer DEA-C01 · Data Operations and Support · medium

To ensure a daily batch pipeline writing to s3://curated/sales/dt=2026-10-28/ is idempotent (so re-running the job for 2026-10-28 after a partial failure never produces duplicate sales rows), which write strategy should the PySpark job use?

Published · Last updated · checked before publication — how we verify questions

Options

  • ASaveMode.Append with random UUID filenames on retry attempts
  • BSaveMode.Ignore so retries skip writing when a folder exists
  • COverwriting the root S3 bucket across 5 years of history
  • DDynamic partition overwrite or Iceberg MERGE on the partitionCorrect answer

Answer: D. Dynamic partition overwrite or Iceberg MERGE on the partition

Writing with dynamic partition overwrite (SaveMode.Overwrite scoped to partitionOverwriteMode = dynamic or an Iceberg INSERT OVERWRITE / MERGE INTO on the target dt=2026-10-28 partition) atomically replaces only that day's partition output on retry, guaranteeing idempotency without duplicating rows.

Why the other options are wrong

  • A. SaveMode.Append with random UUID filenames on retry attempts — Appending new files on retry without clearing the previous attempt's files duplicates every row in the partition.
  • B. SaveMode.Ignore so retries skip writing when a folder exists — SaveMode.Ignore leaves partial or corrupted output untouched if the directory already exists.
  • C. Overwriting the root S3 bucket across 5 years of history — Static overwrite at the root table path deletes all historical partitions when writing a single day.

All Data Operations and Support questions and the topic overview →

AWS and Amazon Web Services are trademarks of Amazon.com, Inc. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Amazon Web Services.