Verified, then logged.
Sat 5 Dec 2026 · 18:49 KST / 09:49 UTC한국어 | ENSearch /

01 / AI · Analysis

Databricks enables direct SQL joins across metric views

The SQL engine prevents double counting, while AI agents discover stored relationships between datasets.

Databricks introduced a beta feature in Unity Catalog Semantics on 4 Dec 2026 that allows independently managed business metrics to be joined directly in SQL. The company also announced beta support for relationship constraints between metric views in its official blog.

Previously, metric views could be queried in SQL but had to appear alone in the FROM clause. Users can now join them with ordinary tables, views and other metric views, analysing sales and customer support figures together without changing their original calculation rules.

Metric views contain two types of columns: fields and measures. Fields classify data by attributes such as region or sales channel, while measures store aggregate calculations, such as totals and ratios, alongside the identities of the underlying source rows.

Two black squares and a grid of six black squares illustrate row multiplication during a data join.
Illustration: AI-generated (Codex)

How the SQL engine prevents double counting

Databricks built protection against duplicate aggregation into its SQL engine. The company said each source row contributes to a measure no more than once per group, regardless of how many times it appears in the joined results.

In the company's example, the East region has two sales records and three customer support tickets. Joining the datasets by region produces six rows.

The standard SUM() function returns a sales total of 900 instead of the original 300. Using MEASURE(), an aggregate function that evaluates measures defined in metric views, preserves the original total. Support tickets are also counted without duplication.

The protection does not change the rules of the join itself. An inner join retains only regions present in both datasets, excluding North, which has only sales records, and South, which has only support tickets.

How agents discover join paths

Calculating metrics correctly and determining which datasets to join are separate tasks. Relationship constraints record the direction of a relationship, how records correspond across datasets and the conditions for joining them in Unity Catalog. They support both one-to-one and many-to-many relationships.

If sales and support records share a customer identifier, both can be connected through a metric view containing customer attributes. An AI agent can read these stored relationships and generate SQL to analyse sales and support ticket counts by customer segment.

Previously, joins specified within metric view definitions required the SQL engine to follow a predetermined path. Relationship constraints defer that choice until query time, allowing users or agents to select a path appropriate to the analysis, such as one based on shipping or billing addresses.

Metrics across existing analytics tools

Genie, Databricks' data analytics agent, can use metric views and relationship constraints together. AI/BI Dashboards can import relationships defined in Unity Catalog or publish relationships created within dashboards back to the catalogue for reuse.

External business intelligence (BI) tools can continue generating SQL while leaving measure calculations to Databricks. The company said it had begun integration work with several BI vendors but did not disclose their names or a release schedule.

Databricks is developing support for using the results of SQL joins between metric views as the source of a new metric view. The current beta supports joining independently defined metric views when a query is executed.