Skip to content

Conversation

@fivetran-kwoodbeck
Copy link
Collaborator

@fivetran-kwoodbeck fivetran-kwoodbeck commented Dec 4, 2025

Mainly just tests for Snowflake, but in testing I noticed an inconsistency in naming on duckdb. It uses the alias of VAR_SAMP called VARIANCE. I made it consistent so it's VAR_SAMP and VAR_POP, instead of VARIANCE and VAR_POP. sqlglot/dialects/duckdb.py references a VARIANCE_POP which does not seem to exist.

Copy link
Collaborator

@VaggelisD VaggelisD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the iterations @fivetran-kwoodbeck, this was tricky once again! One final comment to consider, will go ahead and amend it:


MAX_PRECISION = 38

MIN_SCALE = 12
Copy link
Collaborator

@VaggelisD VaggelisD Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd advise against making this a global for now, technically the minimum scale is 0 and we haven't observed anything similar besides VARIANCE iirc.

We can inline this back into the if scale branch and also document that this was found by reverse-engineering Snowflake

Suggested change
MIN_SCALE = 12

@VaggelisD VaggelisD merged commit 2e8105e into main Dec 10, 2025
8 checks passed
@VaggelisD VaggelisD deleted the feature/annotatetype-variancefuncs branch December 10, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants