Skip to content

[MAINTENANCE] Add a BigQuery integration test for bundled metric alias collisions - #12025

Open
joshua-stauffer wants to merge 1 commit into
developfrom
b/10926-bigquery-alias-dedup
Open

[MAINTENANCE] Add a BigQuery integration test for bundled metric alias collisions#12025
joshua-stauffer wants to merge 1 commit into
developfrom
b/10926-bigquery-alias-dedup

Conversation

@joshua-stauffer

Copy link
Copy Markdown
Collaborator

Summary

Adds a single BigQuery integration test that validates an expectation suite whose expectations all resolve to the same metric name (column_values.nonnull.unexpected_count on three different columns).

This test is expected to fail on develop. It is being pushed to confirm that BigQuery reproduces the duplicate-alias failure described in #10926, so the fix proposed in #11905 can be validated against a backend that actually rejects the query.

Why

The SQL execution engine bundles the metrics a suite needs into as few queries as possible. Expectations on different columns can resolve to the same metric name, and today every one of them is labeled with that bare metric name — so a bundled query emits several identical output column aliases:

['column_values.nonnull.unexpected_count',
 'column_values.nonnull.unexpected_count',
 'column_values.nonnull.unexpected_count']

Permissive backends (SQLite, Postgres) accept that; strict ones reject the query outright. ClickHouse is currently worked around with a dialect-specific random-suffix branch in _organize_metrics_by_domain; the question this test answers is whether BigQuery needs the same treatment, which would argue for making the deduplication general rather than dialect-specific.

User impact

None — test-only change, no library code is touched.

How to review

Check the marker-tests (bigquery, ...) job. A failure there is the intended signal: it confirms BigQuery rejects the bundled query. If it passes, BigQuery tolerates duplicate aliases and the reproduction needs another angle.

Note this PR is intentionally open as non-draft: the marker test jobs are gated on github.event.pull_request.draft == false, so BigQuery CI does not run otherwise.

Validating a suite whose expectations resolve to the same metric name
produces a single bundled query with one column alias per metric. Those
aliases are currently identical, which backends that reject duplicate
output column names refuse to compile.
@netlify

netlify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Deploy Preview for niobium-lead-7998 canceled.

Name Link
🔨 Latest commit 7274ea1
🔍 Latest deploy log https://app.netlify.com/projects/niobium-lead-7998/deploys/6a74916471b52c0008e4ae52

@TemidayoA

Copy link
Copy Markdown
Contributor

Hii @joshua-stauffer I saw the BigQuery CI passed on develop, so BigQuery handles duplicate aliases just fine. Let me know if you'd like me to pull your new test into my branch so they can merge together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants