Question 40
A data engineering group transforms complex string and numerical fields from a large Spark DataFrame. An auditor must prove the outcome of Create a suitable Unity Catalog SQL function and grant EXECUTE where needed for this requirement: A custom function should be callable by analysts from supported SQL workloads with governed permissions. Which test result is best?
Explanation
Correct Answer
The acceptance criterion for “A custom function should be callable by analysts from supported SQL workloads with governed permissions” is Authorized SQL users can invoke the function while unauthorized users cannot; this is the expected evidence after Create a suitable Unity Catalog SQL function and grant EXECUTE where needed.
Incorrect Answers
That observation is a valid indicator for “A built-in SQL expression can normalize a simple string column” when using Use the Spark SQL built-in function rather than introducing a Python UDF. The scenario instead tests “A custom function should be callable by analysts from supported SQL workloads with governed permissions”; the relevant result is Authorized SQL users can invoke the function while unauthorized users cannot.
The output column matches expected unit-test values and schema pertains to a different control (Register and call a standard Python UDF with explicit output type) and a different need (A custom row transformation is required and a plain scalar Python UDF is the simplest supported choice). It cannot establish that Create a suitable Unity Catalog SQL function and grant EXECUTE where needed met the stated goal.
This signal belongs to the adjacent case “A vectorizable numerical transformation needs batch processing through Arrow-compatible pandas objects,” whose remedy is Use an appropriate pandas UDF with declared return type. The observed result for the present requirement is Authorized SQL users can invoke the function while unauthorized users cannot.