Skip to main content
Back

Bauplan Labs Builds an Open-Source Engine Querying 50 Data Branches at Once

A prototype from Bauplan Labs treats disagreeing lakehouse branches as first-class citizens, letting SQL queries reason across every version at once.

Pro

  • Bauplan Labs open-sourced a demo system that queries across all lakehouse branches at once.
  • Uses supervaluationary logic to reason over disagreeing versions of tables written by AI agents.
  • Native DataFusion engine hits 12x speedup over ad hoc on JOIN with window functions at 50 branches.
  • Boolean queries stay flat at ~11 ms via short-circuit evaluation when two branches disagree.
  • Results dispatched by type: numbers per branch, boolean verdicts, list diffs Git-style.
  • Full paper available on arXiv, built on Iceberg, DataFusion, and bauplan.

When a swarm of AI agents starts writing data pipelines in parallel, your lakehouse quietly turns into a multiverse. Different agents produce different versions of the same table, all sitting in isolated branches, and none of them is obviously the canonical one. A new demo system out of Bauplan Labs proposes a way to stop treating that as a bug and start querying it as a feature.

The paper, titled Querying Everything Everywhere All at Once, introduces a query path that evaluates SQL across every branch of a lakehouse simultaneously, using a non-classical logic borrowed from philosophy called supervaluationism. The demo code is open source under a permissive license on GitHub, aimed at the OLAP community as a concrete baseline since no major lakehouse platform currently ships anything comparable.

The multiverse problem

Modern lakehouses on Iceberg support Git-like branches, and agentic workflows lean on them heavily. Bauplan reports that across its deployments, over a million data branches were created in the last quarter, with multiple versions of the same table routinely coexisting because pipelines are still running, PRs haven't merged, or the underlying question is genuinely ambiguous.

Meanwhile, the slow business-to-analyst-to-engineering handover is being dismantled by text-to-SQL and data agents, so a business user now types an English question and expects an answer. But which branch should the engine query? Time travel answers "query at snapshot t"; the goal here is to answer "query across all branches".

Three parallel agents producing divergent prediction tables in branches, feeding a single user question

Supervaluationism, in plain terms

Classical SQL wants one truth value per row. Supervaluationism (technically subvaluationism, as the authors note) allows a statement to be simultaneously true and false depending on which branch you look at, while still preserving useful logical structure. Consider revenue across branches: the statement "conversion is >2%" may be true in one branch and false in another, yet the disjunction "conversion is >2% OR revenues are non-negative" is still definitely true because it holds no matter how you resolve the disagreement.

The engine turns this into three answer shapes, dispatched by result type:

  • Numbers get shown per branch with a compact summary
  • Booleans yield a verdict of true, false, or mixed
  • Lists are compared with a Git-style diff view

Two engines, very different behavior

The prototype implements two execution strategies. The ad hoc engine simply runs the query once per branch and tags each row with a __branch_id. The native engine takes a more interesting route: it uses a custom DataFusion TableProvider that exposes all branch variants of a table as a single virtual relation with an injected __branch_id column, letting the optimizer see the whole plan for predicate pushdown, projection pruning, and shared-subplan reuse.

For boolean questions, the native engine adds a trick that pure SQL can't easily express: it runs per-branch evaluations in parallel and terminates as soon as two branches disagree, since the verdict is already determined.

System architecture: text-to-SQL layer feeds a modified DataFusion engine that reads from Iceberg branches via Bauplan

Where the numbers land

The team benchmarked on 54 branch variants of a 2.5M-row predictions table joined against a shared 3M-row dimension table, sweeping branch count from 1 to 50 on an Apple M3. The results are a mixed but honest picture:

QueryEngineB=1B=8B=50
Q1 (simple count)Ad hoc1 ms11 ms62 ms
Q1 (simple count)Native3 ms25 ms136 ms
Q3 (JOIN + window)Ad hoc288 ms1390 ms7856 ms
Q3 (JOIN + window)Native366 ms412 ms657 ms
Q4 (boolean)Ad hoc4 ms19 ms103 ms
Q4 (boolean)Native4 ms9 ms11 ms

For a JOIN with window functions over the shared dimension table, the ad hoc engine recomputes the expensive CTE per branch while the native engine computes it once and reuses the hash-join, yielding a 12x speedup at 50 branches. Boolean queries stay flat at around 11 ms thanks to short-circuiting. For simple single-table counts, however, the unified plan's coordination overhead outweighs the benefit, giving the native engine a 0.5x ratio at 50 branches.

What it's actually good for

This is a demonstration paper, not a production release, and the authors are explicit that the semantics currently cover three question shapes: scalar aggregates, booleans, and set-valued queries. Complex non-scalar queries, on-the-fly precisifications of ambiguous business concepts like "customer lifetime value," and modeling inter-branch commit histories as a modal structure are all listed as future work.

The pragmatic value is threefold. First, it decouples data producers from consumers: agentic pipelines and business users can be less tightly coupled if we can reason consistently across multiple versions of the same tables. Second, it makes disagreement observable instead of hidden in stale snapshots. Third, for anyone building on Iceberg and DataFusion, the TableProvider-based approach shows a concrete pattern for pushing multi-version semantics down into the query planner rather than bolting it on above.

The full demo repository ships with both engines, the D3-based UI, and a replay mode over exported Parquet files so you can poke at the query paths without cloud dependencies. Given that Databricks, Snowflake, and Fabric all lack multi-branch querying APIs, it's currently the only place to see this idea running end to end.