-
Notifications
You must be signed in to change notification settings - Fork 191
fix(extensions): add signatures with distribution enum arg for std_dev and variance #1011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
26ddf93
fix(extensions)!: change distribution option to enum arg for std_dev …
nielspardon 9b5f945
fix: add deprecated flag and deprecate old sigs
nielspardon eed9e41
doc: add deprecated field to docs
nielspardon 02dd601
fix: use new deprecation mechanism
nielspardon 8e570e2
fix: also change variance function to new deprecation
nielspardon 1330e33
fix: test case nullability
nielspardon b364972
fix: update deprecation version
nielspardon 6275d23
fix: remove deprecated field
nielspardon 8175a73
fix: reverse argument order
nielspardon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| ### SUBSTRAIT_AGGREGATE_TEST: v1.0 | ||
| ### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
|
||
| # basic: Basic examples without any special cases | ||
| ((1.0, 2.0, 3.0, 4.0, 5.0)) std_dev(SAMPLE::enum, col0::fp32) = 1.5811388::fp32? | ||
| ((1.0, 2.0, 3.0, 4.0, 5.0)) std_dev(SAMPLE::enum, col0::fp64) = 1.5811388300841898::fp64? | ||
| ((1.0, 2.0, 3.0, 4.0, 5.0)) std_dev(POPULATION::enum, col0::fp32) = 1.4142135::fp32? | ||
| ((1.0, 2.0, 3.0, 4.0, 5.0)) std_dev(POPULATION::enum, col0::fp64) = 1.4142135623730951::fp64? | ||
|
|
||
| # uniform_values: Standard deviation of uniform values | ||
| ((5.0, 5.0, 5.0, 5.0)) std_dev(SAMPLE::enum, col0::fp32) = 0.0::fp32? | ||
| ((5.0, 5.0, 5.0, 5.0)) std_dev(POPULATION::enum, col0::fp64) = 0.0::fp64? | ||
|
|
||
| # single_value: Standard deviation with single value | ||
| ((42.0)) std_dev(SAMPLE::enum, col0::fp32) = Null::fp32? | ||
| ((42.0)) std_dev(POPULATION::enum, col0::fp64) = 0.0::fp64? | ||
|
|
||
| # negative_values: Standard deviation with negative values | ||
| ((-5.0, -3.0, -1.0, 1.0, 3.0, 5.0)) std_dev(SAMPLE::enum, col0::fp32) = 3.8944404::fp32? | ||
| ((-5.0, -3.0, -1.0, 1.0, 3.0, 5.0)) std_dev(SAMPLE::enum, col0::fp64) = 3.8944404818493075::fp64? | ||
| ((-10.0, -5.0, 0.0, 5.0, 10.0)) std_dev(POPULATION::enum, col0::fp32) = 7.0710678::fp32? | ||
| ((-10.0, -5.0, 0.0, 5.0, 10.0)) std_dev(POPULATION::enum, col0::fp64) = 7.0710678118654755::fp64? | ||
|
|
||
| # decimal_precision: Standard deviation with decimal values | ||
| ((1.5, 2.5, 3.5, 4.5, 5.5)) std_dev(SAMPLE::enum, col0::fp32) = 1.5811388::fp32? | ||
| ((1.5, 2.5, 3.5, 4.5, 5.5)) std_dev(SAMPLE::enum, col0::fp64) = 1.5811388300841898::fp64? | ||
| ((0.1, 0.2, 0.3, 0.4, 0.5)) std_dev(POPULATION::enum, col0::fp64) = 0.14142135623730953::fp64? | ||
|
|
||
| # large_values: Standard deviation with large values | ||
| ((1000.0, 2000.0, 3000.0, 4000.0, 5000.0)) std_dev(SAMPLE::enum, col0::fp32) = 1581.1388::fp32? | ||
| ((1000.0, 2000.0, 3000.0, 4000.0, 5000.0)) std_dev(SAMPLE::enum, col0::fp64) = 1581.1388300841898::fp64? | ||
|
|
||
| # small_values: Standard deviation with small values | ||
| ((0.001, 0.002, 0.003, 0.004, 0.005)) std_dev(SAMPLE::enum, col0::fp64) = 0.0015811388300841896::fp64? | ||
| ((0.001, 0.002, 0.003, 0.004, 0.005)) std_dev(POPULATION::enum, col0::fp64) = 0.0014142135623730951::fp64? | ||
|
|
||
| # null_handling: Examples with null as input or output | ||
| ((Null, Null, Null)) std_dev(SAMPLE::enum, col0::fp32?) = Null::fp32? | ||
| (()) std_dev(SAMPLE::enum, col0::fp32) = Null::fp32? | ||
| ((1.0, Null, 3.0, Null, 5.0)) std_dev(SAMPLE::enum, col0::fp32?) = 2.0::fp32? | ||
| ((1.0, Null, 3.0, Null, 5.0)) std_dev(POPULATION::enum, col0::fp64?) = 1.632993161855452::fp64? | ||
|
|
||
| # rounding: Examples with different rounding modes | ||
| ((1.1, 2.2, 3.3, 4.4, 5.5)) std_dev(SAMPLE::enum, col0::fp32) [rounding:TIE_TO_EVEN] = 1.7406897::fp32? | ||
| ((1.1, 2.2, 3.3, 4.4, 5.5)) std_dev(SAMPLE::enum, col0::fp64) [rounding:TRUNCATE] = 1.7406897166664838::fp64? | ||
|
|
||
| # two_values: Standard deviation with two values | ||
| ((10.0, 20.0)) std_dev(SAMPLE::enum, col0::fp32) = 7.071068::fp32? | ||
| ((10.0, 20.0)) std_dev(POPULATION::enum, col0::fp64) = 5.0::fp64? | ||
|
|
||
| # mixed_range: Standard deviation with mixed range values | ||
| ((0.0, 100.0, 50.0, 25.0, 75.0)) std_dev(SAMPLE::enum, col0::fp32) = 41.010193::fp32? | ||
| ((0.0, 100.0, 50.0, 25.0, 75.0)) std_dev(POPULATION::enum, col0::fp64) = 36.66060555964672::fp64? |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| ### SUBSTRAIT_AGGREGATE_TEST: v1.0 | ||
| ### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
|
||
| # basic: Basic examples without any special cases | ||
| ((1.0, 2.0, 3.0, 4.0, 5.0)) variance(SAMPLE::enum, col0::fp32) = 2.5::fp32? | ||
| ((1.0, 2.0, 3.0, 4.0, 5.0)) variance(SAMPLE::enum, col0::fp64) = 2.5::fp64? | ||
| ((1.0, 2.0, 3.0, 4.0, 5.0)) variance(POPULATION::enum, col0::fp32) = 2.0::fp32? | ||
| ((1.0, 2.0, 3.0, 4.0, 5.0)) variance(POPULATION::enum, col0::fp64) = 2.0::fp64? | ||
|
|
||
| # uniform_values: Variance of uniform values | ||
| ((5.0, 5.0, 5.0, 5.0)) variance(SAMPLE::enum, col0::fp32) = 0.0::fp32? | ||
| ((5.0, 5.0, 5.0, 5.0)) variance(POPULATION::enum, col0::fp64) = 0.0::fp64? | ||
|
|
||
| # single_value: Variance with single value | ||
| ((42.0)) variance(SAMPLE::enum, col0::fp32) = Null::fp32? | ||
| ((42.0)) variance(POPULATION::enum, col0::fp64) = 0.0::fp64? | ||
|
|
||
| # negative_values: Variance with negative values | ||
| ((-5.0, -3.0, -1.0, 1.0, 3.0, 5.0)) variance(SAMPLE::enum, col0::fp32) = 15.166667::fp32? | ||
| ((-5.0, -3.0, -1.0, 1.0, 3.0, 5.0)) variance(SAMPLE::enum, col0::fp64) = 15.166666666666666::fp64? | ||
| ((-10.0, -5.0, 0.0, 5.0, 10.0)) variance(POPULATION::enum, col0::fp32) = 50.0::fp32? | ||
| ((-10.0, -5.0, 0.0, 5.0, 10.0)) variance(POPULATION::enum, col0::fp64) = 50.0::fp64? | ||
|
|
||
| # decimal_precision: Variance with decimal values | ||
| ((1.5, 2.5, 3.5, 4.5, 5.5)) variance(SAMPLE::enum, col0::fp32) = 2.5::fp32? | ||
| ((1.5, 2.5, 3.5, 4.5, 5.5)) variance(SAMPLE::enum, col0::fp64) = 2.5::fp64? | ||
| ((0.1, 0.2, 0.3, 0.4, 0.5)) variance(POPULATION::enum, col0::fp64) = 0.020000000000000004::fp64? | ||
|
|
||
| # large_values: Variance with large values | ||
| ((1000.0, 2000.0, 3000.0, 4000.0, 5000.0)) variance(SAMPLE::enum, col0::fp32) = 2500000.0::fp32? | ||
| ((1000.0, 2000.0, 3000.0, 4000.0, 5000.0)) variance(SAMPLE::enum, col0::fp64) = 2500000.0::fp64? | ||
|
|
||
| # small_values: Variance with small values | ||
| ((0.001, 0.002, 0.003, 0.004, 0.005)) variance(SAMPLE::enum, col0::fp64) = 0.0000025::fp64? | ||
| ((0.001, 0.002, 0.003, 0.004, 0.005)) variance(POPULATION::enum, col0::fp64) = 0.000002::fp64? | ||
|
|
||
| # null_handling: Examples with null as input or output | ||
| ((Null, Null, Null)) variance(SAMPLE::enum, col0::fp32?) = Null::fp32? | ||
| (()) variance(SAMPLE::enum, col0::fp32) = Null::fp32? | ||
| ((1.0, Null, 3.0, Null, 5.0)) variance(SAMPLE::enum, col0::fp32?) = 4.0::fp32? | ||
| ((1.0, Null, 3.0, Null, 5.0)) variance(POPULATION::enum, col0::fp64?) = 2.666666666666667::fp64? | ||
|
|
||
| # rounding: Examples with different rounding modes | ||
| ((1.1, 2.2, 3.3, 4.4, 5.5)) variance(SAMPLE::enum, col0::fp32) [rounding:TIE_TO_EVEN] = 3.03::fp32? | ||
| ((1.1, 2.2, 3.3, 4.4, 5.5)) variance(SAMPLE::enum, col0::fp64) [rounding:TRUNCATE] = 3.0299999999999994::fp64? | ||
|
|
||
| # two_values: Variance with two values | ||
| ((10.0, 20.0)) variance(SAMPLE::enum, col0::fp32) = 50.0::fp32? | ||
| ((10.0, 20.0)) variance(POPULATION::enum, col0::fp64) = 25.0::fp64? | ||
|
|
||
| # mixed_range: Variance with mixed range values | ||
| ((0.0, 100.0, 50.0, 25.0, 75.0)) variance(SAMPLE::enum, col0::fp32) = 1681.25::fp32? | ||
| ((0.0, 100.0, 50.0, 25.0, 75.0)) variance(POPULATION::enum, col0::fp64) = 1345.0::fp64? | ||
|
|
||
| # zero_mean: Variance with values around zero | ||
| ((-2.0, -1.0, 0.0, 1.0, 2.0)) variance(SAMPLE::enum, col0::fp32) = 2.5::fp32? | ||
| ((-2.0, -1.0, 0.0, 1.0, 2.0)) variance(POPULATION::enum, col0::fp64) = 2.0::fp64? | ||
|
|
||
| # three_values: Variance with three values | ||
| ((10.0, 20.0, 30.0)) variance(SAMPLE::enum, col0::fp32) = 100.0::fp32? | ||
| ((10.0, 20.0, 30.0)) variance(POPULATION::enum, col0::fp64) = 66.66666666666667::fp64? |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.