Learning Objectives
By the end of this chapter, you will be able to:
- Differentiate between managed and external tables in Unity Catalog and perform basic operations (create, modify, delete, and convert between them).
- Configure access controls via UI and SQL by applying GRANT, REVOKE, and DENY privileges to principals (users, groups, service principals) at the appropriate levels of the security hierarchy.
- Understand column-level masking and row-level security to restrict data visibility by user group.
- Understand Unity Catalog ABAC policies to centrally control row-level filtering and column masking for sensitive data.
Executive Summary
- Managed tables live in Unity Catalog-controlled storage and follow drop-equals-delete semantics, while external tables point at customer-owned paths under an external location and survive a
DROP TABLEas files on object storage. - Privileges flow down the metastore, catalog, schema, securable hierarchy:
GRANTextends access,REVOKErolls it back, andDENYblocks it even when an inherited grant would otherwise allow it. - Column masks and row filters are SQL UDFs attached to a table; they run on every read and typically branch on
is_account_group_member()so visibility varies by who issued the query. - ABAC policies define one mask or row filter once and apply it to every column or table that carries a matching tag, replacing the per-table attachment pattern.
Assumptions
- Unity Catalog is enabled at the account level with a metastore attached to the workspace, as described in Chapter 1.
- The reader has owner or sufficient privileges to create schemas, tables, functions, and policies, and to grant privileges in the workspace.
- All examples assume the catalog
fin_lakehouse, the schemasbronze,silver, andgold, and the customer and transaction tables built in earlier chapters. - Group names follow the convention
grp_<role>_<env>(for examplegrp_analyst_prod,grp_pii_reader_prod) and are managed at the account level, then assigned into the workspace.
