Subdomain 1.3: Develop User-Defined Functions (UDFs) using Pandas, Python, and SQL, including Unity Catalog functions for the given constraints.
1.A platform team is rolling out governed Python and SQL functions in Unity Catalog. A new analyst reports `PERMISSION_DENIED` errors both when trying to register a new function in the `analytics` schema and when trying to call an existing function owned by someone else. Which two grants resolve these two specific failures?(Select 2)
- A.`GRANT USAGE, CREATE ON SCHEMA main.analytics` plus `GRANT USAGE ON CATALOG main` to the analyst, enabling new function registration.
- B.`GRANT EXECUTE ON FUNCTION main.analytics.existing_func` to the analyst, enabling the analyst to call the function someone else owns.
- C.`GRANT MODIFY ON FUNCTION main.analytics.existing_func` to the analyst, enabling the analyst to call a function owned by another principal.
- D.`GRANT ALL PRIVILEGES ON METASTORE main` to the analyst, enabling both registering and calling any function in the catalog at once.
- E.`GRANT OWNERSHIP ON SCHEMA main.analytics` to the analyst, enabling new function registration without any catalog-level grant.
- F.`GRANT SELECT ON SCHEMA main.analytics` to the analyst, enabling the analyst to call any function defined within that schema.
Show answer & explanation
Correct answers: A, B — `GRANT USAGE, CREATE ON SCHEMA main.analytics` plus `GRANT USAGE ON CATALOG main` to the analyst, enabling new function registration.; `GRANT EXECUTE ON FUNCTION main.analytics.existing_func` to the analyst, enabling the analyst to call the function someone else owns.
- A. Registering a new function requires `USAGE` and `CREATE` on the target schema together with `USAGE` on the containing catalog; without both, the registration attempt fails with a permission error.
- B. Calling a function owned by another principal requires an explicit `EXECUTE` grant on that function; ownership of the schema or catalog alone does not confer the right to run someone else's function.
- C. `MODIFY` is not the privilege that governs invoking a function; running a function is controlled by the `EXECUTE` privilege, and `MODIFY`-style grants do not substitute for it.
- D. Granting metastore-wide `ALL PRIVILEGES` is a far broader change than needed for either failure and is not the targeted grant Unity Catalog uses to resolve schema-level or function-level permission errors.
- E. Transferring ownership of the whole schema is unnecessary and overly broad just to let one analyst create functions there, and it still would not resolve the separate failure to call another owner's existing function.
- F. `SELECT` is a table- and view-level privilege; it has no effect on the ability to invoke a function, so granting it on the schema would not resolve either reported failure.