-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test cases for arithmetic decimal function "sqrt" and "factorial" (…
…#92)
- Loading branch information
1 parent
136a324
commit 573adcb
Showing
5 changed files
with
198 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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 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,59 @@ | ||
base_uri: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_arithmetic_decimal.yaml | ||
function: factorial | ||
cases: | ||
- group: | ||
id: basic | ||
description: Basic examples without any special cases | ||
args: | ||
- value: 0 | ||
type: decimal<1,0> | ||
result: | ||
value: 1 | ||
type: decimal<38,0> | ||
- group: basic | ||
args: | ||
- value: 1 | ||
type: decimal<1,0> | ||
result: | ||
value: 1 | ||
type: decimal<38,0> | ||
- group: basic | ||
args: | ||
- value: 20 | ||
type: decimal<2,0> | ||
result: | ||
value: 2432902008176640000 | ||
type: decimal<38,0> | ||
- group: | ||
id: overflow | ||
description: Examples demonstrating overflow behavior | ||
args: | ||
- value: 34 | ||
type: decimal<2,0> | ||
result: | ||
special: error | ||
- group: | ||
id: negative_value | ||
description: Examples demonstrating behavior on negative value | ||
args: | ||
- value: -1 | ||
type: decimal<1,0> | ||
result: | ||
special: error | ||
- group: | ||
id: null_values | ||
description: test with null values | ||
args: | ||
- value: null | ||
type: decimal<38, 0> | ||
result: | ||
value: null | ||
type: decimal<38, 0> | ||
- group: null_values | ||
args: | ||
- value: null | ||
type: decimal<1, 0> | ||
result: | ||
value: null | ||
type: decimal<38, 0> | ||
|
This file contains 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,112 @@ | ||
base_uri: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_arithmetic_decimal.yaml | ||
function: sqrt | ||
cases: | ||
- group: | ||
id: basic | ||
description: Basic examples without any special cases | ||
args: | ||
- value: 25 | ||
type: decimal<2,0> | ||
result: | ||
value: 5 | ||
type: fp64 | ||
- group: basic | ||
args: | ||
- value: 0 | ||
type: decimal<1,0> | ||
result: | ||
value: 0 | ||
type: fp64 | ||
- group: | ||
id: max_input | ||
description: max allowed input returns correct result | ||
args: | ||
- value: 99999999999999999999999999999999999999 | ||
type: decimal<38,0> | ||
result: | ||
value: 1e+19 | ||
type: fp64 | ||
- group: | ||
id: real_number | ||
description: real number as input | ||
args: | ||
- value: 6.25 | ||
type: decimal<3,2> | ||
result: | ||
value: 2.5 | ||
type: fp64 | ||
- group: real_number | ||
args: | ||
- value: 2.0000007152557373046875 | ||
type: decimal<23,22> | ||
result: | ||
value: 1.4142138152541635 | ||
type: fp64 | ||
- group: | ||
id: verify_real_number | ||
description: verify real number operation are different and doesn't behave as nearby int | ||
args: | ||
- value: 9 | ||
type: decimal<1,0> | ||
result: | ||
value: 3 | ||
type: fp64 | ||
- group: verify_real_number | ||
args: | ||
- value: 8.3 | ||
type: decimal<2,1> | ||
result: | ||
value: 2.8809720581775866 | ||
type: fp64 | ||
- group: verify_real_number | ||
args: | ||
- value: 8.5 | ||
type: decimal<2,1> | ||
result: | ||
value: 2.9154759474226504 | ||
type: fp64 | ||
- group: verify_real_number | ||
args: | ||
- value: 8.7 | ||
type: decimal<2,1> | ||
result: | ||
value: 2.949576240750525 | ||
type: fp64 | ||
- group: verify_real_number | ||
args: | ||
- value: 9.2 | ||
type: decimal<2,1> | ||
result: | ||
value: 3.03315017762062 | ||
type: fp64 | ||
- group: | ||
id: negative_input | ||
description: negative input returns error | ||
args: | ||
- value: -9223372036854775800 | ||
type: decimal<19,0> | ||
result: | ||
special: error | ||
- group: negative_input | ||
args: | ||
- value: -2.5 | ||
type: decimal<2,1> | ||
result: | ||
special: error | ||
- group: | ||
id: null_values | ||
description: test with null values | ||
args: | ||
- value: null | ||
type: decimal<38, 0> | ||
result: | ||
value: null | ||
type: fp64 | ||
- group: null_values | ||
args: | ||
- value: null | ||
type: decimal<1, 0> | ||
result: | ||
value: null | ||
type: fp64 | ||
|
This file contains 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 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