More patterns · Open reference architecture
Policy pushdown and open lineage
Cedar policies compiled to CEL, enforced in Spark and DataFusion, with OpenLineage
Write access rules once, enforce them inside every engine, and record where every column came from.
In one paragraph
Policy pushdown and open lineage is a governance architecture for multi-engine lakehouses. Access rules are authored once in the Cedar policy language, compiled to portable CEL expressions, and enforced inside each query engine's plan as row filters and column masks, so no engine depends on SQL views or per-engine rewrites. Alongside, every job emits OpenLineage events, which are stored as lakehouse tables and served through a lineage API, so auditors can trace a published number back to its sources.
More patterns
Cedar policies compiled to CEL, enforced in Spark and DataFusion, with OpenLineage
Sources
Ingestion
Open lakehouse platform
Engine access
How agents, apps and people reach compute: a client session per identity.
Execution
Spark's execution modes, plus engines that read the same tables.
Data foundation
Open tables in a governed catalog, on storage you own.
Governance
Serving
Teams
When to use it
- Several engines read the same sensitive tables.
- You need row filters and column masks that cannot be bypassed by choosing a different engine.
- Regulators or auditors ask where a value came from.
When to pick something else
- Production lineage storage today without evaluation: headwaters describes itself as experimental and recommends Marquez for production.
Walkthrough
How data moves through it
- 1
Author once
A policy author writes Cedar policies, including tag-based templates that apply to every column tagged, for example, as PHI.
- 2
Compile
policast compiles the policies to CEL expressions that any engine can evaluate.
- 3
Enforce in the plan
Spark applies them as Catalyst rules and DataFusion as plan rewrites, so filters and masks run inside the query, not in a view.
- 4
Emit lineage
A Spark 4 plugin emits OpenLineage events with column-level lineage for each job.
- 5
Store lineage as tables
An ingest service writes the events to Delta or Iceberg tables, which a lineage API and UI read.
Bill of materials
Components and versions
| Capability | Component | Role in this architecture | Version | License |
|---|---|---|---|---|
| SourcesSource systems | Policy authors | Write Cedar policies and tag templates | ||
| ExecutionBatch and SQL | Apache Spark | Enforcement as Catalyst rules | 4.2 plugin | Apache-2.0 |
| ExecutionOther engines | Apache DataFusion | Enforcement as plan rewrites | 53.1 | Apache-2.0 |
| Data foundationCatalog and credentials | Unity Catalog OSSor unitycatalog-rs, Lakekeeper | Policy decision point resolving tags | 0.4.1 in the demo | Apache-2.0 |
| Data foundationOpen table format | Apache Icebergor Delta Lake | Lineage event tables, written through Lakekeeper (Delta also supported) | Apache-2.0 | |
| Data foundationObject storage | RustFSor MinIO, Amazon S3 | Demo object store | Apache-2.0 | |
| GovernanceAccess control and policy | Cedar | Policy language; deny always wins | cedar-policy 4 | Apache-2.0 |
| GovernanceAccess control and policy | policast | Compiles Cedar to CEL and injects enforcement into the physical plan | ||
| GovernanceAccess control and policy | breakwater | Row filters and column masks inside the DataFusion planner | Apache-2.0 | |
| GovernanceLineage | OpenLineage | Lineage events from every job, column level from Spark | Apache-2.0 | |
| GovernanceLineage | open-lineage-connect | Ingests events and writes them to Delta and Iceberg tables | Apache-2.0 | |
| GovernanceLineage | headwatersor Marquez | Lineage read API and UI | Apache-2.0 |
People and agents
Who works with it
Data engineers
Pipelines that are correct, idempotent and cheap to rerun.
Works with: Batch and SQL, Open table format
Analysts and analytics engineers
One definition of each metric, fast SQL, and dashboards that match.
Works with: Other engines, Batch and SQL
Platform engineers
A platform that is boring to run: deployable from code, observable, with identities for every person, service and agent.
Works with: Object storage, Catalog and credentials
Governance and security
Policies that hold in every engine and for every agent, lineage for audits, and least privilege by default.
Works with: Access control and policy, Lineage, Catalog and credentials
Run it
Reference code
Author governance once in Cedar, compile it to portable CEL, and push enforcement into Spark and DataFusion physical plans.
cp docker/.env.example .env
docker compose up -d sidecar
docker compose --profile demo run --rm datafusion-demo
# Same policies enforced on Spark (Catalyst rules, no sidecar):
docker compose --profile spark run --rm spark-demo # or: just spark-demoOpenLineage end to end: a Go ingest service, a Rust service that writes events to Delta and Iceberg tables, and a Spark 4 plugin for column-level lineage.
make docker-compose-up # builds both images, starts both services + MinIO
curl -sf http://localhost:8090/health
curl -sf http://localhost:8091/health
make docker-compose-down # tears it down and removes the Delta volumeCedar fine-grained access control for DataFusion, with OCI-distributed policy bundles and a policy decision point service.
Experimental Rust OpenLineage service with a Marquez-inspired read API and UI.
Caveats from the reference repos
- In policast, deny always wins and grants never bypass column masks.
- headwaters is experimental and not a drop-in Marquez replacement.
- The policast demo pins Unity Catalog 0.4.1 as its policy decision point.
Industry lenses
Where this architecture shows up
Each card opens the board with that industry's sources. Full industry pages: Banking, Healthcare providers, Telecommunications, Cybersecurity.
Answers
Frequently asked questions
- How do you enforce the same access policy in Spark and other engines?
- Compile one policy source into an engine-neutral form and inject it into each engine's query plan. policast compiles Cedar policies to CEL and enforces them as Catalyst rules in Spark and as plan rewrites in DataFusion.
- What is OpenLineage?
- An open standard, hosted by the LF AI & Data Foundation, for lineage events that describe jobs, runs and the datasets they read and write. Spark, Airflow, Flink and dbt have integrations.
- Can lineage be stored in the lakehouse itself?
- Yes. open-lineage-connect writes OpenLineage events to Delta tables, Iceberg tables through a REST catalog, or both.
Related architectures
All architecturesMore patterns
Arrow-native serving
Arrow Flight SQL and Spark Connect clients over lakehouse tables
Platform
The agentic lakehouse
Omnigent and MLflow over sandboxed Spark Connect sessions, on Iceberg and Unity Catalog
More patterns
ML and GenAI lifecycle on the lakehouse
MLflow tracking, registry and AI Gateway over open tables
