Skip to content

fix(extensions): add signatures with distribution enum arg for std_dev and variance#1011

Merged
vbarua merged 9 commits intosubstrait-io:mainfrom
nielspardon:par-stddev-dist
Mar 24, 2026
Merged

fix(extensions): add signatures with distribution enum arg for std_dev and variance#1011
vbarua merged 9 commits intosubstrait-io:mainfrom
nielspardon:par-stddev-dist

Conversation

@nielspardon
Copy link
Copy Markdown
Member

@nielspardon nielspardon commented Mar 17, 2026

Given the recent clarification around function options vs enum arguments I do believe the std_dev and variance function definitions should change the distribution function to be an enum argument.

The distribution parameter changes the semantic behavior of these functions which is why SQL systems typically model the different distribution values as distinct functions e.g. STDDEV_SAMP and STDDEV_POP. Providing the distribution parameter thus is not optional but required.

This PR deprecates the existing function signatures for std_dev and variance and adds new signatures that use a distribution enum argument instead of a function option.

This PR depends on #1010 whose changes are included in this PR since it uses the new enum argument syntax in the test cases I generated using AI for the two functions.

The main changes for this PR are in the second commit 8ec63ae.

@github-actions

This comment was marked as resolved.

@nielspardon nielspardon changed the title fix(extensions)!: change distribution option to enum arg for std_dev and variance fix(extensions)!: change distribution option to enum arg for std_dev and variance Mar 17, 2026
@nielspardon nielspardon changed the title fix(extensions)!: change distribution option to enum arg for std_dev and variance fix(extensions): change distribution option to enum arg for std_dev and variance Mar 17, 2026
@benbellick
Copy link
Copy Markdown
Member

I'm in support of this change, but think we should wait until #1005 lands to make sure we all agree on the meaning of options / enums.

@nielspardon
Copy link
Copy Markdown
Member Author

Rebased, resolved conflicts, used the new deprecation syntax.

@nielspardon nielspardon requested a review from yongchul March 20, 2026 20:01
Copy link
Copy Markdown
Contributor

@yongchul yongchul left a comment

Choose a reason for hiding this comment

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

+1 thank you for incorporating the deprecation path and making this non-breaking change! 😄

@nielspardon
Copy link
Copy Markdown
Member Author

I merged #1010 and rebased this PR

@nielspardon nielspardon changed the title fix(extensions): change distribution option to enum arg for std_dev and variance fix(extensions): add signatures with distribution enum arg for std_dev and variance Mar 23, 2026
@nielspardon nielspardon added the PMC Ready PRs ready for review by PMCs label Mar 23, 2026
…and variance

BREAKING CHANGE: changes the function signature of existing functions std_dev and variance

Signed-off-by: Niels Pardon <par@zurich.ibm.com>
Signed-off-by: Niels Pardon <par@zurich.ibm.com>
Signed-off-by: Niels Pardon <par@zurich.ibm.com>
Signed-off-by: Niels Pardon <par@zurich.ibm.com>
Signed-off-by: Niels Pardon <par@zurich.ibm.com>
Signed-off-by: Niels Pardon <par@zurich.ibm.com>
Signed-off-by: Niels Pardon <par@zurich.ibm.com>
@nielspardon

This comment was marked as outdated.

Signed-off-by: Niels Pardon <par@zurich.ibm.com>
@nielspardon
Copy link
Copy Markdown
Member Author

removed the deprecation of the old function signatures per conversation on Slack

Copy link
Copy Markdown
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

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

Left a minor suggestions about argument ordering. Want to hear what you think about it, but other than that this looks good to me.

Signed-off-by: Niels Pardon <par@zurich.ibm.com>
Copy link
Copy Markdown
Member

@vbarua vbarua left a comment

Choose a reason for hiding this comment

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

Changes look good. Thanks for updating thee argument order.

@vbarua vbarua merged commit 00bc3c2 into substrait-io:main Mar 24, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PMC Ready PRs ready for review by PMCs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants