QuestionQ284

VerifiedEnsuring Data Security and Compliance

A data engineer is reviewing PySpark code that copies a portion of the production dataset into the sandbox environment and must ensure that no PII (Personally Identifiable Information) is copied. After reviewing the sales table, the engineer finds that user emails are the only PII it contains and are also the only column that identifies the user.

from pyspark.sql import functions as F  

Question Image

Which anonymized code should be used to achieve the required outcome?

Explanation

Replacing the user identifier with a randomly generated UUID prevents the sandbox dataset from containing the original email address while retaining a non-PII value for each row. A deterministic email hash can still enable linkage or re-identification and is therefore not equivalent to removing the direct identifier.

Community Discussion

No comments yet. Be the first to start the discussion!