Databricks Access Control Granularity Row

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up databricks access control granularity row rules with Unity Catalog row filters. These filters check user groups and hide rows that do not match your rules. Most data teams start by granting full table read rights to broad user roles. When roles are too broad, analysts can read private records from every region or customer. Tight row rules fix this problem by filtering table data during each query run. How databricks access control granularity row filters work Unity Catalog lets you

Row-Level Security: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up databricks access control granularity row rules with Unity Catalog row filters. These filters check user groups and hide rows that do not match your rules. Most data teams start by granting full table read rights to broad user roles. When roles are too broad, analysts can read private records from every region or customer. Tight row rules fix this problem by filtering table data during each query run.

How databricks access control granularity row filters work

Unity Catalog lets you attach a custom SQL function directly to a table. This function acts as a filter that runs whenever someone queries that table. The filter checks the active user or group identity inside the workspace session. It compares that identity against a specific column, like a region or department code. If the rule returns true, the query returns that specific row to the user. If the rule returns false, the engine drops the row from the query result.

Before row filters existed, teams built separate dynamic views for each user group. Dynamic views forced admins to manage dozens of extra objects across every catalog. Row filters simplify this setup because you keep just one base table. Users query the main table name without knowing a filter runs behind the scenes. You can also combine row filters with column masks on the same table. Column masks rewrite matched fields in results, such as emails, phone numbers, or card numbers.

How teams manage filter rules and lookup tables

Most teams do not hardcode user names inside their row filter functions. Hardcoding names forces you to edit the function every time someone joins a team. Instead, admins create a separate mapping table that links group names to allowed row values. The row filter function joins or checks this mapping table during the query run. When a user moves to a new team, you update the mapping table row.

This pattern keeps your security rules clean, but it adds performance costs. Every query on the main table now runs an extra lookup check first. Large mapping tables can slow down big analytical joins across billions of rows. Admins must test filter logic with care so queries stay fast for analysts. You also must lock down write permissions on the mapping table itself. If a user can edit the mapping table, they can grant themselves full read rights.

Row-Level Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native row rules solve and where gaps remain

Native row filters work well for steady BI dashboards and standard catalog queries. They keep analysts inside their assigned business unit or regional slice of data. They also centralize rule changes inside Unity Catalog for standard SQL compute clusters.

Still, catalog filters only govern tables managed inside that specific catalog engine. Engineers and scripts often log in using shared service principals or admin roles. When an admin troubleshoots a pipeline, they often bypass group filters with elevated privileges. Native setup decides who logs in, not what individual statements do in flight. It does not require real-time peer approval before a risky query runs. It also cannot apply one unified masking rule across Postgres, MySQL, and warehouse tools together. Teams with mixed data stacks still end up managing separate rules in every database.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

What is the difference between dynamic views and row filters?

Dynamic views require a new view object, while row filters attach to the base table. Row filters let users query the original table name without changing their scripts.

Do row filters slow down query speed in Unity Catalog?

Yes, complex filter logic or large mapping table joins can add query overhead. Keep filter functions simple and index or partition the columns used for filtering.

Can admins still read filtered rows when debugging pipelines?

Users or service principals with elevated admin roles can often bypass standard group checks. You must write explicit rules in your function to handle admin and superuser identities.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.