Repository navigation
fix: refuse COUNT over a qualified or modified star - #121
Merged
Merged
Conversation
COUNT(t.*), COUNT(* EXCLUDE ...), COUNT(* ILIKE ...), COUNT(* RENAME ...), COUNT(DISTINCT t.*) and their windowed forms converted to count(*), which counts every row. Snowflake counts other rows for them, so they refuse until recordings show what to convert them to.
kvlonge
added a commit
that referenced
this pull request
Nov 6, 2026
Contributor
Author
|
Gate at 144dc45 (based on main 287f275):
The hosted CI run did not start (Actions billing), so this local gate stands in for it. |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
COUNT over a qualified or modified star converted to
count(*), which counts every row. Snowflake counts other rows for these shapes: C's held receipts show COUNT(alias.) giving 3, and COUNT( EXCLUDE …) and COUNT(* ILIKE …) giving 4, wherecount(*)gives 5. That is a wrong answer. Until a conversion is recorded for each shape, they refuse.Changes
fn:COUNT) over a qualified star (t.*) and over a star with EXCLUDE, ILIKE, RENAME or REPLACE, including DISTINCT and windowed forms. COUNT(*), COUNT(x), COUNT(DISTINCT x) and COUNT(DISTINCT x, y) are unchanged.*as COUNT(*).Other calls over a star were checked and need no change. ARRAY_AGG, OBJECT_AGG, MAX, SUM, MIN_BY, ANY_VALUE, COUNT_IF, HASH_AGG, APPROX_COUNT_DISTINCT, LISTAGG and ARRAY_UNIQUE_AGG over a qualified or modified star already refuse. OBJECT_CONSTRUCT, HASH and ARRAY_CONSTRUCT expand the star themselves, honour EXCLUDE, and refuse ILIKE, RENAME and REPLACE.
Verification
t.*, EXCLUDE, ILIKE, RENAME,t.*with EXCLUDE, DISTINCTt.*, andt.*over a window) and checks that it refuses.make check-ci,make test-rustandmake verify-recorded.