# Row Filters Stop at the Edge of a Share, So Filter in the View Instead

> Table-level filters make a table unshareable, ABAC-protected tables arrive unfiltered, and the only per-recipient control that travels is a dynamic view.

- Canonical: https://lakenaut.dev/blog/row-filters-stop-at-the-edge-of-a-share-so-filter-in-the-view-instead-jp0p/
- Author: Fernando De Nitto
- Published: 2026-11-13
- Kind: pattern
- Tags: Databricks, Data Engineering, Unity Catalog, Data Governance, Data Sharing
- Concepts: [Sharing data with OpenSharing](https://lakenaut.dev/concepts/opensharing-overview.md), [Row filters and column masks](https://lakenaut.dev/concepts/row-filters-column-masks.md), [ABAC policies in Unity Catalog](https://lakenaut.dev/concepts/abac-policies.md)
- Licence: CC BY-NC-SA 4.0

A partner, a subsidiary or another business unit asks for a slice of a gold table. The table already carries row-level security, because it holds customer-level data and the rules about who sees which rows were settled months ago. Putting it in a share looks like the last easy step: the controls are on the table, the share points at the table, so the controls come along. They do not. Depending on which of the three Unity Catalog mechanisms you used, the table either cannot be shared at all, or it is shared with every row and every column intact.

That is the design problem worth an afternoon: the boundary between your metastore and someone else's is not the boundary your filters were written for, and you have to build it on purpose.

## What a share does with each kind of control

There are three ways to restrict rows and columns inside a metastore, and OpenSharing (formerly Delta Sharing) treats each of them differently.

**Table-level filters and masks** are the ones attached with `ALTER TABLE ... SET ROW FILTER` or `ALTER COLUMN ... SET MASK`, owned by the table owner. The documentation on [row filters and column masks](https://docs.databricks.com/aws/en/data-governance/unity-catalog/filters-and-masks) is short about what happens next: an OpenSharing provider cannot share a table that has one. Not shared unfiltered — not shareable. The same page notes the mirror case on the other side: a recipient can apply their own filters and masks to shared tables and foreign tables, but not to shared streaming tables or materialized views.

**Sharing a whole schema** makes that refusal quiet. Schema sharing is attractive because assets added later are included automatically, but unsupported assets are filtered out rather than rejected: tables with row filters or column masks, `SHALLOW CLONE` tables, tables with collations enabled, tables using liquid clustering with partition filtering, R2 tables with V2 checkpoint. Foreign key constraints do not survive into a shared table either. Nobody gets an error. The share lists what it could take, the protected table is not in it, and the gap surfaces as a partner asking why a table they were promised is missing.

**ABAC policies** behave in the way that is most likely to hurt. A table or schema protected by an attribute-based row filter or column mask policy can be added to a share — but only by a privileged user, meaning the share owner who is also excluded from the policies on that asset. Read the consequence slowly, because [the share documentation](https://docs.databricks.com/aws/en/opensharing/create-share) states it plainly: the policy does not govern the recipient's access, and recipients have full access to the shared asset. The central policy that masks tax IDs for everybody in your own account masks nothing for the partner reading through the share. An exempt owner sharing a governed table is, from the recipient's side, sharing the raw table. If your governance story is the policy, your sharing story is now a hole in it. Worth noting while you plan: ABAC row and column security on *views* is [Beta](https://docs.databricks.com/aws/en/data-governance/unity-catalog/abac/), so the view path should not be built on it yet.

![What each control does when the table enters a share](https://lakenaut.dev/social/229c9dae8fea1921f01a1d4ff825b.png)
## The shape that holds

The only control that filters by who is reading, through a share, is a view that asks who is reading. `CURRENT_RECIPIENT` reads a property off the recipient object, and the view body does the rest.

The properties come in two kinds. Defaults exist for every recipient — the account ID and metastore ID (Databricks-to-Databricks only) and the recipient's name — and you can set any custom property you like when you create or alter the recipient. Recipient properties need Databricks Runtime 12.2 or above; `CURRENT_RECIPIENT` needs 14.2 or above; adding a view to a share needs a SQL warehouse or Databricks Runtime 13.3 LTS or above. Three different thresholds, which is normal for this corner of the product and worth checking before the design meeting ends.

![The slice is a property on the recipient, not a copy of the table](https://lakenaut.dev/social/229c9dae8fea1921f11a1d4ff825b.png)
Two things that design buys you. The first is one share for many recipients: the same view serves every partner, and each sees their own slice because the slice is a property on their recipient object, not a copy of the table. The second is that the filtering logic lives in a view definition you can read in a pull request, rather than in a UDF attached to a table plus a policy attached to a catalog.

If the column you filter on is a partition column, there is a cheaper variant: a partition specification on the share itself, written as `PARTITION (country = CURRENT_RECIPIENT().country)`. It does the same job with no view and no query-time materialisation. It also disqualifies the table from cloud-token access, which is the performance trade this whole area keeps asking you to make.

Where the recipient's slice does not line up with a column — a partner who should see three regions, not one — the documented alternative is a mapping table on the provider's side that maps fact-table values to recipient properties, joined inside the view. It keeps the fact table free of recipient-shaped columns.

Two constraints to design around rather than discover: shareable views have to be defined on Delta tables, foreign tables, other shareable views, or local materialized views and streaming tables; and you cannot share a view that references shared tables or shared views, nor create a view that references a dynamic view. Re-sharing something you received is not a thing.

## What goes wrong in production

**You cannot test your own view.** Because of the sharing context, a provider cannot query a view that calls `CURRENT_RECIPIENT` directly. The documented way to test one is to share it with yourself and read it as a recipient. That turns a test recipient from a nice-to-have into part of the design, and it is the only way anyone on your side ever sees what the partner sees. Build it first, with properties set, before the real recipient exists.

**`WITH HISTORY` is a disclosure decision, not a performance setting.** Sharing a table with history is what makes time travel, streaming reads and transactions work for the recipient, and it is what makes the table eligible for cloud tokens — temporary credentials scoped to the table's root directory. Those credentials grant read access to the data files *and* the Delta log, which carries the commit history for every version, who committed, and deleted data that has not been vacuumed yet. For Databricks-to-Databricks sharing, eligibility means shared with full history and without a partition filter; for Databricks-to-Open sharing, it also has to be a managed or external Delta table, not a CCv2 table and not on default storage. A table that is not eligible is served through pre-signed URLs instead, and then the recipient cannot run `DESCRIBE DETAIL`, `DESCRIBE HISTORY` or `DEEP CLONE`. Decide which of those two worlds the partner is in before you write the `ALTER SHARE`, not after they ask why a command fails.

**A query with `LIMIT 10` is not a small query.** When the recipient does not have direct access to the underlying data, neither `LIMIT` clauses nor predicate pushdown are supported: the system fully materialises all query results before returning them, whatever the filters in the query said. An exploratory `SELECT *` against a shared view is a full materialisation on somebody's compute. The materialised data lands in the storage location of the view's parent schema or catalog, or in the metastore root location — which is a storage location worth looking at before the first partner is onboarded, not after.

**The privileges are a running dependency, not a setup step.** You need `SELECT` on the asset to add it to a share, and you have to keep it: lose it and the recipient loses access through the share. For the same reason the documentation recommends making a group the share owner. A share owned by one named person is a person-shaped dependency on a path that external parties depend on. And deleting the catalog or schema behind a share cascades through the share even for assets in it, after which the asset name is burned for that share.

**The network path is yours to check.** If the storage location sits behind a firewall or private link, recipients have to be allowlisted to reach it, or you broker access with SecureConnect instead of maintaining per-recipient allowlists.

![Three ways this design fails quietly](https://lakenaut.dev/social/229c9dae8fea1921f21a1d4ff825b.png)
## Who pays for the filtering

Cost in sharing arises exactly where this design puts it: on views, materialized views and streaming tables. [The FAQ](https://docs.databricks.com/aws/en/opensharing/) sets out four cases. A recipient on serverless, in any account, and a recipient on classic compute in your own account both get direct access to the underlying data and pay for their own reads, with no incremental charge for materialising the asset. A recipient on classic compute in a different account has the filtering done on your side, on the provider's interactive serverless, and is billed for it. An open-sharing connector — the non-Databricks partner — has the filtering done on your side too, and **you** pay, on your interactive serverless.

Read that last row again next to the reason you chose a view: the recipient is not on Databricks, so a view was the only way to hand them a filtered slice, and that is precisely the case where every query they run is compute on your account. It does not make the design wrong. It makes it a design with a bill attached, which should be known before a partner's analyst discovers dashboards.

Egress behaves separately: nothing is replicated, so sharing within a region incurs no egress cost, while across regions or clouds the cloud vendor charges for the bytes — or Databricks does, if you route it through SecureConnect.

## Running it

Audit logging and system tables cover both halves: the creation and modification of shares and recipients, and recipient activity against them. For money, billing attribution is queryable through the billable usage system table and the OpenSharing materialization history system table. One detail there changes how you build the dashboard — when the recipient pays for the attribution, only the recipient can see the record. Your own view of the cost is incomplete by design, so the number to watch on your side is the materialisation your account is charged for, not a total you cannot see.

The alert worth having is not "a query failed". It is the test recipient: a scheduled read, as a recipient, against each shared view, checking that the row count for a known property value is what it should be. Everything else in this stack fails loudly. A dynamic view whose property was never set on a new recipient, or a schema share that quietly dropped a protected table, fails by returning the wrong amount of data to somebody outside your company.

## Where to start

Three steps that fit in a morning. First, list the tables you share or intend to share and check each one for a table-level filter or mask and for an ABAC policy — the first group cannot be shared, the second is being shared unfiltered right now if an exempt owner put it in a share. Second, create a recipient pointing at your own metastore, set the properties a real partner would have, and read every shared view through it; keep it as the canary. Third, go through each share and decide `WITH HISTORY` deliberately, knowing it hands over the Delta log along with the data.

If the Lakenaut concept pages help with the background, the ones behind this piece are [OpenSharing](https://lakenaut.dev/concepts/opensharing-overview/) and [row filters and column masks](https://lakenaut.dev/concepts/row-filters-column-masks/).

## Sources

- https://docs.databricks.com/aws/en/data-governance/unity-catalog/filters-and-masks
- https://docs.databricks.com/aws/en/opensharing/create-share
- https://docs.databricks.com/aws/en/data-governance/unity-catalog/abac/
- https://docs.databricks.com/aws/en/opensharing/
- https://lakenaut.dev/concepts/opensharing-overview/
- https://lakenaut.dev/concepts/row-filters-column-masks/
- https://lakenaut.dev/concepts/abac-policies/
