Skip to content
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

feat: add bft function testcases in new substrait testfile format #738

Merged
merged 3 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/cases/aggregate_approx/approx_count_distinct.test
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
9 changes: 9 additions & 0 deletions tests/cases/aggregate_generic/count.test
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
18 changes: 18 additions & 0 deletions tests/cases/arithmetic/abs.test
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>
8 changes: 8 additions & 0 deletions tests/cases/arithmetic/acos.test
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
12 changes: 12 additions & 0 deletions tests/cases/arithmetic/acosh.test
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
8 changes: 2 additions & 6 deletions tests/cases/arithmetic/add.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,16 @@ add(120::i8, 10::i8) [overflow:ERROR] = <!ERROR>
add(30000::i16, 30000::i16) [overflow:ERROR] = <!ERROR>
add(2000000000::i32, 2000000000::i32) [overflow:ERROR] = <!ERROR>
add(9223372036854775807::i64, 1::i64) [overflow:ERROR] = <!ERROR>

# overflow: Examples demonstrating overflow behavior tests: overflow with SATURATE
add(120::i8, 10::i8) [overflow:SATURATE] = 127::i8
add(-120::i8, -10::i8) [overflow:SATURATE] = -128::i8

# overflow: Examples demonstrating overflow behavior tests: overflow with SILENT
add(120::i8, 10::i8) [overflow:SILENT] = <!UNDEFINED>

# floating_exception: Examples demonstrating exceptional floating point cases
add(1.5e+308::fp64, 1.5e+308::fp64) = inf::fp64
add(-1.5e+308::fp64, -1.5e+308::fp64) = -inf::fp64

# rounding: Examples demonstrating floating point rounding behavior
add(4.5::fp32, 2.500001::fp32) [rounding:TIE_TO_EVEN] = 7.000001::fp32
add(4.5::fp32, 2.5000007152557373046875::fp32) [rounding:TIE_TO_EVEN] = 7.00000095367431640625::fp32

# types: Examples demonstrating behavior of different data types
add(4.5::fp64, 2.5000007152557373::fp64) = 7.00000071525573::fp64
add(4.5::fp64, 2.5000007152557373046875::fp64) = 7.0000007152557373046875::fp64
9 changes: 9 additions & 0 deletions tests/cases/arithmetic/asin.test
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
8 changes: 8 additions & 0 deletions tests/cases/arithmetic/asinh.test
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
9 changes: 9 additions & 0 deletions tests/cases/arithmetic/atan.test
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
8 changes: 8 additions & 0 deletions tests/cases/arithmetic/atan2.test
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
9 changes: 9 additions & 0 deletions tests/cases/arithmetic/atanh.test
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
15 changes: 15 additions & 0 deletions tests/cases/arithmetic/bitwise_and.test
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
14 changes: 14 additions & 0 deletions tests/cases/arithmetic/bitwise_not.test
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
14 changes: 14 additions & 0 deletions tests/cases/arithmetic/bitwise_or.test
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
srikrishnak marked this conversation as resolved.
Show resolved Hide resolved
bitwise_or(127::i64, null::i64) = null::i64
15 changes: 15 additions & 0 deletions tests/cases/arithmetic/bitwise_xor.test
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
9 changes: 9 additions & 0 deletions tests/cases/arithmetic/cos.test
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
9 changes: 9 additions & 0 deletions tests/cases/arithmetic/cosh.test
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
20 changes: 20 additions & 0 deletions tests/cases/arithmetic/divide.test
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
11 changes: 11 additions & 0 deletions tests/cases/arithmetic/exp.test
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
11 changes: 11 additions & 0 deletions tests/cases/arithmetic/factorial.test
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>
18 changes: 18 additions & 0 deletions tests/cases/arithmetic/min.test
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
20 changes: 20 additions & 0 deletions tests/cases/arithmetic/modulus.test
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
24 changes: 24 additions & 0 deletions tests/cases/arithmetic/multiply.test
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
19 changes: 19 additions & 0 deletions tests/cases/arithmetic/negate.test
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>
11 changes: 11 additions & 0 deletions tests/cases/arithmetic/power.test
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
9 changes: 9 additions & 0 deletions tests/cases/arithmetic/sin.test
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
9 changes: 9 additions & 0 deletions tests/cases/arithmetic/sinh.test
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
12 changes: 12 additions & 0 deletions tests/cases/arithmetic/sqrt.test
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
Loading
Loading