Parks wants a lightweight integration test that proves a COPY INTO replay does not double picnic-permit rows. What should the test assert?
Select an answer to reveal the explanation.
Short Explanation
If you dump the same picnic permits into the hopper twice and the count doubles, the test should yell—idempotent loads don't clone the picnic. You'll fail if you just check that the source grew, that COPY INTO skipped its loaded files, or that an Auto Loader offset moved, since none of those prove you didn't double the rows.
Full Explanation
Parks needs a lightweight integration test that proves COPY INTO replay does not double picnic-permit rows, so the test should assert that replaying the same landing files fails the scenario if row counts double—that is, it should detect non-idempotent load behavior. Idempotent civic ingest is operationally critical: storm retries, late file drops, and pipeline restarts must not invent duplicate permits. Asserting that replaying the same landing files fails the test if row counts double in the source (raw growth) fails because the source set is identical on replay, so raw growth does not measure COPY INTO idempotency and does not detect whether the target table doubled rows. Asserting that replaying the same landing files fails the test if COPY INTO skips loaded files (deduplicated load) fails because skipping already-loaded files is the correct idempotent outcome, not a failure — the test should fail only if row counts double. Asserting that replaying the same landing files fails the test if Auto Loader offset advances (streamed offset) fails because offset advance proves streaming progress, not COPY INTO replay idempotency, and Auto Loader is a different ingest mechanism that does not detect doubled rows. Exam caveat: DP-750 integration testing for file ingest emphasizes idempotent behavior under replay, not failing when COPY INTO skips loaded files (deduplicated load). Operational check: run the integration test twice against the same landing set, confirm the second run does not double rows (or the test fails if it would), and keep that check in the parks PR pipeline.
Prefer to study offline? Printable PDF study book + test engine ($7.50, unofficial). These questions stay free here.