Semantic views: Querying FACTS with DIMENSIONS is no longer supported (Pending)

Attention

This behavior change is in the 2026_07 bundle.

For the current status of the bundle, refer to Bundle history.

Queries against a semantic view that specify both FACTS and DIMENSIONS together now fail at compile time. Previously, such queries produced non-deterministic results: the system arbitrarily picked a fact value per dimension group, so customers could be making decisions based on unreliable data without realizing it. This change enforces correct, deterministic query semantics.

Before the change:

A query specifying both FACTS and DIMENSIONS executes and returns results. However, fact values are non-deterministic, because the system arbitrarily picks a fact value per dimension group:

SELECT *
FROM SEMANTIC_VIEW(
  sv
  FACTS f1
  DIMENSIONS d1
);
After the change:

When the 2026_07 behavior change bundle is enabled in your account, the same query fails at compile time with the following error:

SQL compilation error:
Querying FACTS with DIMENSIONS in a semantic view is not supported.

Queries that specify only FACTS, only DIMENSIONS, only METRICS, or DIMENSIONS combined with METRICS are not affected.

Identify affected queries

Use the following query to find affected queries in your account from the last 30 days:

SELECT *
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE start_time >= DATEADD('day', -30, CURRENT_TIMESTAMP())
  AND RLIKE(query_text,
    $$.*from\s+semantic_view.*(facts.*dimensions|dimensions.*facts).*$$, 'is')
ORDER BY start_time DESC;

You can also enable the 2026_07 bundle on a development or QA account and run your workloads. Any affected query fails immediately with the explicit compile-time error.

Rewrite affected queries

The FACTS and DIMENSIONS clauses at query time determine the behavior independently of how columns are categorized in the semantic view definition. A column defined as a FACT can be queried in the DIMENSIONS clause, and vice versa. Choose the option that matches your intent:

Option 1: Return unique rows by moving the column to the DIMENSIONS clause

If your intent is to retrieve unique row-level values, move the fact column to the DIMENSIONS clause:

SELECT *
FROM SEMANTIC_VIEW(
  sv
  DIMENSIONS f1, d1
);

-- Alternatively, using direct semantic view syntax:
SELECT f1, d1
FROM sv
GROUP BY f1, d1;

Option 2: Return non-unique rows by moving the column to the FACTS clause

If your intent is to retrieve non-unique row-level values, move the dimension column to the FACTS clause:

SELECT *
FROM SEMANTIC_VIEW(
  sv
  FACTS f1, d1
);

-- Alternatively, using direct semantic view syntax:
SELECT f1, d1
FROM sv;

Ref: 2287