-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: port function testcases from bft (#738)
- Loading branch information
1 parent
3d2ff77
commit d84ccd1
Showing
107 changed files
with
1,681 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
### SUBSTRAIT_AGGREGATE_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_aggregate_approx.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
approx_count_distinct((1, -2, 3, -4, 5, 6)::i8) = 6::i64 | ||
approx_count_distinct((-32767, -20000, 30000, 5, 32767)::i16) = 5::i64 | ||
approx_count_distinct((-2147483648, -10000000, 30000000, 2147483647)::i32) = 4::i64 | ||
approx_count_distinct((-214748364800000, -1000000000, 0, 922337203685477580)::i64) = 4::i64 | ||
approx_count_distinct((1)::i8) = 1::i64 | ||
approx_count_distinct(('abc', 'def', 'ghi')::str) = 3::i64 | ||
approx_count_distinct(('abc', Null, 'ghi')::str) = 2::i64 | ||
approx_count_distinct(()::i8) = 0::i64 | ||
approx_count_distinct((Null, Null, Null)::i8) = 0::i64 | ||
approx_count_distinct((Null, Null, 4, 3, Null, 922337203685477580, 12833888)::i64) = 4::i64 |
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,9 @@ | ||
### SUBSTRAIT_AGGREGATE_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_aggregate_generic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
count((100, -200, 300, -400, 5, 6)::i16) = 6::i64 | ||
count((1000)::i16) = 1::i64 | ||
count(()::i16) = 0::i64 | ||
count((Null, Null, Null)::i16) = 0::i64 | ||
count((Null, Null, Null, 1000)::i16) = 1::i64 |
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,18 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
abs(25::i8) = 25::i8 | ||
abs(-200::i16) = 200::i16 | ||
abs(30000::i32) = 30000::i32 | ||
abs(-9223372036854775800::i64) = 9223372036854775800::i64 | ||
abs(2.55::fp32) = 2.55::fp32 | ||
abs(-2.0000007152557373046875::fp64) = 2.0000007152557373046875::fp64 | ||
|
||
# null_input: Examples with null as input | ||
abs(null::i8) = null::i8 | ||
|
||
# overflow: Examples demonstrating overflow behavior | ||
abs(-128::i8) [overflow:ERROR] = <!ERROR> | ||
abs(-128::i8) [overflow:SATURATE] = 127::i8 | ||
abs(-128::i8) [overflow:SILENT] = <!UNDEFINED> |
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,8 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
acos(0.00::fp32) = 1.5707963267948966::fp32 | ||
acos(1.0::fp64) = 0.0::fp64 | ||
acos(-0.0000009::fp64) = 1.5707972267948966::fp64 | ||
acos(null::fp64) = null::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
acosh(1.0::fp64) = 0.0::fp64 | ||
acosh(10.0005::fp64) = 2.9932730967481995::fp64 | ||
acosh(null::fp64) = null::fp64 | ||
|
||
# On_domain_error: Examples demonstrating On_domain_error behavior | ||
acosh(0.01::fp32) [on_domain_error:ERROR] = <!ERROR> | ||
acosh(0.5::fp64) [on_domain_error:NAN] = nan::fp64 | ||
acosh(0.5::fp32) [on_domain_error:NONE] = null::fp32 |
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,9 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
asin(0.0::fp32) = 0.0::fp32 | ||
asin(1.0::fp64) = 1.5707963267948966::fp64 | ||
asin(0.009::fp64) = 0.009000121504428887::fp64 | ||
asin(-0.009::fp64) = -0.009000121504428887::fp64 | ||
asin(null::fp64) = null::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
asinh(0.01::fp32) = 0.009999833340832886::fp32 | ||
asinh(1.0::fp64) = 0.881373587019543::fp64 | ||
asinh(0.0009::fp64) = 0.0008999998785000443::fp64 | ||
asinh(null::fp64) = null::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
atan(0.0::fp32) = 0.0::fp32 | ||
atan(1.0::fp64) = 0.7853981633974483::fp64 | ||
atan(7.01::fp64) = 1.4290989925795292::fp64 | ||
atan(-7.01::fp64) = -1.4290989925795292::fp64 | ||
atan(null::fp64) = null::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
atan2(0.0::fp32, 0.0::fp32) = 0.0::fp32 | ||
atan2(1.0::fp64, 1.0::fp64) = 0.7853981633974483::fp64 | ||
atan2(0.009::fp64, 0.0008::fp64) = 1.482140444927459::fp64 | ||
atan2(null::fp64, 0.0008::fp64) = null::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
atanh(0.0::fp32) = 0.0::fp32 | ||
atanh(1.0::fp64) = inf::fp64 | ||
atanh(0.009::fp64) = 0.009000243011810481::fp64 | ||
atanh(-0.009::fp64) = -0.009000243011810481::fp64 | ||
atanh(null::fp64) = null::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
bitwise_and(0::i8, 1::i8) = 0::i8 | ||
bitwise_and(127::i8, 127::i8) = 127::i8 | ||
bitwise_and(-127::i8, -10::i8) = -128::i8 | ||
bitwise_and(31766::i16, 900::i16) = 4::i16 | ||
bitwise_and(-31766::i16, 900::i16) = 896::i16 | ||
bitwise_and(2147483647::i32, 1234567::i32) = 1234567::i32 | ||
bitwise_and(2147483647::i32, 1234567::i32) = 1234567::i32 | ||
bitwise_and(9223372036854775807::i64, 127::i64) = 127::i64 | ||
bitwise_and(-9223372036854775807::i64, 127::i64) = 1::i64 | ||
bitwise_and(null::i64, 127::i64) = null::i64 | ||
bitwise_and(127::i64, null::i64) = null::i64 |
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,14 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
bitwise_not(0::i8) = -1::i8 | ||
bitwise_not(1::i8) = -2::i8 | ||
bitwise_not(-127::i8) = 126::i8 | ||
bitwise_not(31766::i16) = -31767::i16 | ||
bitwise_not(-31766::i16) = 31765::i16 | ||
bitwise_not(2147483647::i32) = -2147483648::i32 | ||
bitwise_not(2147483647::i32) = -2147483648::i32 | ||
bitwise_not(9223372036854775807::i64) = -9223372036854775808::i64 | ||
bitwise_not(-9223372036854775807::i64) = 9223372036854775806::i64 | ||
bitwise_not(null::i64) = null::i64 |
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,14 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
bitwise_or(0::i8, 1::i8) = 1::i8 | ||
bitwise_or(127::i8, 127::i8) = 127::i8 | ||
bitwise_or(-127::i8, -10::i8) = -9::i8 | ||
bitwise_or(31766::i16, 900::i16) = 32662::i16 | ||
bitwise_or(-31766::i16, 900::i16) = -31762::i16 | ||
bitwise_or(2147483647::i32, 123456789::i32) = 2147483647::i32 | ||
bitwise_or(9223372036854775807::i64, 127::i64) = 9223372036854775807::i64 | ||
bitwise_or(-9223372036854775807::i64, 127::i64) = -9223372036854775681::i64 | ||
bitwise_or(null::i64, 127::i64) = null::i64 | ||
bitwise_or(127::i64, null::i64) = null::i64 |
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,15 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
bitwise_xor(0::i8, 1::i8) = 1::i8 | ||
bitwise_xor(127::i8, 127::i8) = 0::i8 | ||
bitwise_xor(-127::i8, -10::i8) = 119::i8 | ||
bitwise_xor(31766::i16, 900::i16) = 32658::i16 | ||
bitwise_xor(-31766::i16, 900::i16) = -32658::i16 | ||
bitwise_xor(2147483647::i32, 123456789::i32) = 2024026858::i32 | ||
bitwise_xor(2147483647::i32, 123456789::i32) = 2024026858::i32 | ||
bitwise_xor(9223372036854775807::i64, 127::i64) = 9223372036854775680::i64 | ||
bitwise_xor(-9223372036854775807::i64, 127::i64) = -9223372036854775682::i64 | ||
bitwise_xor(null::i64, 127::i64) = null::i64 | ||
bitwise_xor(127::i64, null::i64) = null::i64 |
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,9 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
cos(0.00::fp32) = 1.0::fp32 | ||
cos(1.0::fp64) = 0.5403023058681398::fp64 | ||
cos(7.0000009::fp64) = 0.7539016630550606::fp64 | ||
cos(-7.00000095::fp64) = 0.7539016302056953::fp64 | ||
cos(null::fp64) = null::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
cosh(0.00::fp32) = 1.0::fp32 | ||
cosh(1.0::fp64) = 1.5430806348152437::fp64 | ||
cosh(7.0000009::fp64) = 548.3175286399451::fp64 | ||
cosh(-7.00000095::fp64) = 548.3175560557769::fp64 | ||
cosh(null::fp64) = null::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
divide(25::i8, 5::i8) = 5::i8 | ||
divide(200::i16, -100::i16) = -2::i16 | ||
divide(60000::i32, 200::i32) = 300::i32 | ||
divide(4000000000::i64, -5000::i64) = -800000::i64 | ||
|
||
# division_by_zero: Examples demonstrating division by zero | ||
divide(5::i8, 0::i8) [on_division_by_zero:NAN] = null::i8 | ||
divide(5::i8, 0::i8) [on_division_by_zero:ERROR] = <!ERROR> | ||
|
||
# overflow: Examples demonstrating overflow behavior | ||
divide(-9223372036854775808::i64, -1::i64) [overflow:ERROR] = <!ERROR> | ||
divide(-128::i8, -1::i8) [overflow:SATURATE] = 127::i8 | ||
|
||
# floating_exception: Examples demonstrating exceptional floating point cases | ||
divide(1.5e+208::fp64, 1.5e-200::fp64) = inf::fp64 | ||
divide(1.5e+200::fp64, -1.5e-208::fp64) = -inf::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
exp(100::i64) = 2.6881171418161356e+43::fp64 | ||
exp(0.25::fp32) = 1.2840254166877414::fp32 | ||
exp(0.693::fp64) = 1.9997056605411638::fp64 | ||
exp(2.0000007152557373046875::fp64) = 7.3890613839973085::fp64 | ||
exp(0.0::fp64) = 1.0::fp64 | ||
exp(null::fp64) = null::fp64 | ||
exp(1000::i64) = inf::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
factorial(0::i32) = 1::i32 | ||
factorial(1::i32) = 1::i32 | ||
factorial(20::i64) = 2432902008176640000::i64 | ||
factorial(null::i32) = null::i32 | ||
|
||
# overflow: Examples demonstrating overflow behavior | ||
factorial(1000000::i32) [overflow:ERROR] = <!ERROR> |
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,18 @@ | ||
### SUBSTRAIT_AGGREGATE_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
min((20, -3, 1, -10, 0, 5)::i8) = -10::i8 | ||
min((-32768, 32767, 20000, -30000)::i16) = -32768::i16 | ||
min((-214748648, 214748647, 21470048, 4000000)::i32) = -214748648::i32 | ||
min((2000000000, -3217908979, 629000000, -100000000, 0, 987654321)::i64) = -3217908979::i64 | ||
min((2.5, 0, 5.0, -2.5, -7.5)::fp32) = -7.5::fp32 | ||
min((1.5e+308, 1.5e+10, -1.5e+8, -1.5e+7, -1.5e+70)::fp64) = -1.5e+70::fp64 | ||
|
||
# null_handling: Examples with null as input or output | ||
min((Null, inf)::fp64) = inf::fp64 | ||
min((Null, Null, Null)::i16) = Null::i16 | ||
min(()::i16) = Null::i16 | ||
min((2000000000, Null, 629000000, -100000000, Null, 987654321)::i64) = -100000000::i64 | ||
min((Null, -inf, -1.5e+8, -1.5e+7, -1.5e+70)::fp64) = -inf::fp64 | ||
min((1.5e+308, 1.5e+10, Null, -1.5e+7, Null)::fp64) = -1.5e+7::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
modulus(9::i8, 3::i8) = 0::i8 | ||
modulus(10::i8, -3::i8) = 1::i8 | ||
modulus(32767::i16, 1000::i16) = 767::i16 | ||
modulus(-2147483647::i32, 300000000::i32) = -47483647::i32 | ||
modulus(-9223372036854775800::i64, -80000000000000::i64) = -12036854775800::i64 | ||
modulus(5::i8, null::i8) = null::i8 | ||
modulus(null::i64, 1::i64) = null::i64 | ||
modulus(null::i64, null::i64) = null::i64 | ||
|
||
# on_domain_error: Examples demonstrating operation when the divisor is 0 | ||
modulus(5::i8, 0::i8) [on_domain_error:NULL] = null::i8 | ||
modulus(5::i8, 0::i8) [on_domain_error:ERROR] = <!ERROR> | ||
|
||
# division_type: Examples demonstrating truncate and floor division types | ||
modulus(8::i8, -3::i8) [division_type:TRUNCATE] = 2::i8 | ||
modulus(8::i8, -3::i8) [division_type:FLOOR] = -1::i8 |
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,24 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
multiply(25::i8, 5::i8) = 125::i8 | ||
multiply(2::i16, -100::i16) = -200::i16 | ||
multiply(300::i32, 200::i32) = 60000::i32 | ||
multiply(80000::i64, -5000::i64) = -400000000::i64 | ||
|
||
# overflow: Examples demonstrating overflow behavior | ||
multiply(13::i8, 10::i8) [overflow:ERROR] = <!ERROR> | ||
multiply(11::i16, 3000::i16) [overflow:ERROR] = <!ERROR> | ||
multiply(3::i32, 1000000000::i32) [overflow:ERROR] = <!ERROR> | ||
multiply(1000000000000000000::i64, 10::i64) [overflow:ERROR] = <!ERROR> | ||
multiply(13::i8, 10::i8) [overflow:SATURATE] = 127::i8 | ||
multiply(-13::i8, -10::i8) [overflow:SATURATE] = -128::i8 | ||
multiply(13::i8, 10::i8) [overflow:SILENT] = <!UNDEFINED> | ||
|
||
# floating_exception: Examples demonstrating exceptional floating point cases | ||
multiply(1.5e+100::fp64, 1.5e+208::fp64) = inf::fp64 | ||
multiply(1.5e+100::fp64, -1.5e+208::fp64) = -inf::fp64 | ||
|
||
# types: Examples demonstrating behavior of different data types | ||
multiply(4.5::fp64, 2.5000007152557373046875::fp64) = 11.250003218650818::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
negate(25::i8) = -25::i8 | ||
negate(-200::i16) = 200::i16 | ||
negate(30000::i32) = -30000::i32 | ||
negate(9223372036854775800::i64) = -9223372036854775800::i64 | ||
negate(2.50::fp32) = -2.50::fp32 | ||
negate(2.000002861022949::fp64) = -2.000002861022949::fp64 | ||
negate(inf::fp64) = -inf::fp64 | ||
|
||
# null_input: Examples with null as input | ||
negate(null::i8) = null::i8 | ||
|
||
# overflow: Examples demonstrating overflow behavior | ||
negate(-128::i8) [overflow:ERROR] = <!ERROR> | ||
negate(-128::i8) [overflow:SATURATE] = 127::i8 | ||
negate(-128::i8) [overflow:SILENT] = <!UNDEFINED> |
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,11 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
power(8::i64, 2::i64) = 64::i64 | ||
power(1.0::fp32, -1.0::fp32) = 1.0::fp32 | ||
power(2.0::fp64, -2.0::fp64) = 0.25::fp64 | ||
power(13::i64, 10::i64) = 137858491849::i64 | ||
|
||
# floating_exception: Examples demonstrating exceptional floating point cases | ||
power(1.5e+100::fp64, 1.5e+208::fp64) = inf::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
sin(0.0::fp32) = 0.0::fp32 | ||
sin(1.0::fp64) = 0.8414709848078965::fp64 | ||
sin(7.0000009::fp64) = 0.6569872772305518::fp64 | ||
sin(-7.0000009::fp64) = -0.6569872772305518::fp64 | ||
sin(null::fp64) = null::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
sinh(0.0::fp32) = 0.0::fp32 | ||
sinh(1.0::fp64) = 1.1752011936438014::fp64 | ||
sinh(7.0000009::fp64) = 548.3166167588001::fp64 | ||
sinh(-7.0000009::fp64) = -548.3166167588001::fp64 | ||
sinh(null::fp64) = null::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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
### SUBSTRAIT_SCALAR_TEST: v1.0 | ||
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml' | ||
|
||
# basic: Basic examples without any special cases | ||
sqrt(25::i64) = 5::fp64 | ||
sqrt(0::i64) = 0::fp64 | ||
sqrt(-1::i64) [on_domain_error:NAN] = null::fp64 | ||
sqrt(-9223372036854775800::i64) [on_domain_error:NAN] = null::fp64 | ||
sqrt(9223372036854775800::i64) = 3037000499.97605::fp64 | ||
sqrt(null::i64) = null::fp64 | ||
sqrt(6.25::fp32) = 2.5::fp32 | ||
sqrt(2.0000007152557373046875::fp64) = 1.4142138152541635::fp64 |
Oops, something went wrong.