Noos
PT EN
RAN-DBDEA-00218
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: medium

Phone numbers arrive in the bronze table in five different formats — '(11) 98888-7777', '5511988887777', '+55 11 98888-7777', among others. The silver contract requires every number normalized to E.164, such as +5511988887777. The transformation must run as native Spark expressions in the pipeline, with no custom code registered on the cluster. Which function fits this requirement?

Options (Reading Mode) Click to filter discussion →
  1. A. A Python UDF — regex-based reformatting always requires custom code registered on the cluster before the pipeline can run it
  2. B. regexp_extract() — Spark's regex functions can only pull matching groups out of a string; rewriting the full value is not supported
  3. C. regexp_replace() — it matches a pattern with capture groups and rebuilds the string in the normalized form in one native call
  4. D. split() with a limit — cutting on every non-digit character resolves any phone format in a single pass of the expression
Reveal answer

Correct answer: regexp_replace() — it matches a pattern with capture groups and rebuilds the string in the normalized form in one native call

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 (C): regexp_replace() — it matches a pattern with capture groups and rebuilds the string in the normalized form in one native call

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.