Noos
PT EN
RAN-DBDEA-00229
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: medium

The bronze orders table stores an ARRAY<STRING> column named coupon_codes. The attribution notebook needs one row per order_id and coupon pair, but many orders carry no coupons at all — their array is empty or NULL — and those orders must still appear in the output, with NULL in the coupon position, so that order totals reconcile. Which expression should the notebook use?

Options (Reading Mode) Click to filter discussion →
  1. A. explode(coupon_codes) — rows whose array is empty or NULL are preserved, with NULL in the generated column
  2. B. explode_outer(coupon_codes) — rows whose array is empty or NULL are preserved, with NULL in the generated column
  3. C. posexplode(coupon_codes) — as the positional variant of explode, it is the one that preserves rows with empty or NULL arrays
  4. D. No generator is safe here — an empty array aborts the query, so orders without coupons must be filtered out before exploding
Reveal answer

Correct answer: explode_outer(coupon_codes) — rows whose array is empty or NULL are preserved, with NULL in the generated column

Reference: https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-functions

02 — The Myelin Layer · Canonical Discussion

Where the exam tries to trick you — and how those who passed solved it.

0 Passed

contributed to this question

Answer Distractor Matrix Click an option to filter or open its dissection.
✦ Consolidated Synthesis (Wiki) rev. #1 (baseline) · CC BY-SA 4.0
Start synthesis for this question →

No community synthesis consolidated for this question yet. Below is the verifiable official starting point — if you passed the exam, open the option dissection.

Official Answer (B): explode_outer(coupon_codes) — rows whose array is empty or NULL are preserved, with NULL in the generated column

Ranvier · DBDEA

Contribute to this Question

Your contribution builds your Orbital Sheath

Peer contributions

No public contribution yet. Be the first who passed to explain why the distractors trick candidates — your contribution builds your Orbital Sheath.