Skip to content

Commit

Permalink
fix substrait signature mismatches in ported tests
Browse files Browse the repository at this point in the history
  • Loading branch information
srikrishnak committed Nov 19, 2024
1 parent a5adfec commit cf8851f
Show file tree
Hide file tree
Showing 52 changed files with 244 additions and 181 deletions.
2 changes: 1 addition & 1 deletion tests/cases/arithmetic/acosh.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ 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::fp32) [on_domain_error:NAN] = nan::fp64
acosh(0.5::fp64) [on_domain_error:NAN] = nan::fp64
acosh(0.5::fp32) [on_domain_error:NONE] = null::fp32
4 changes: 2 additions & 2 deletions tests/cases/arithmetic/atanh.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# basic: Basic examples without any special cases
atanh(0.0::fp32) = 0.0::fp32
atanh(1.0::fp64) = inf::fp64
atanh(0.009::fp32) = 0.009000243011810481::fp64
atanh(-0.009::fp32) = -0.009000243011810481::fp64
atanh(0.009::fp64) = 0.009000243011810481::fp64
atanh(-0.009::fp64) = -0.009000243011810481::fp64
atanh(null::fp64) = null::fp64
1 change: 1 addition & 0 deletions tests/cases/arithmetic/bitwise_and.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ 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
2 changes: 1 addition & 1 deletion tests/cases/arithmetic/bitwise_or.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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(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
1 change: 1 addition & 0 deletions tests/cases/arithmetic/bitwise_xor.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ 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
1 change: 0 additions & 1 deletion tests/cases/arithmetic/divide.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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>
divide(5::i64, 0::i64) [on_division_by_zero:LIMIT] = inf::fp64

# overflow: Examples demonstrating overflow behavior
divide(-9223372036854775808::i64, -1::i64) [overflow:ERROR] = <!ERROR>
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/arithmetic/max.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ max((2000000000, -3217908979, 629000000, -100000000, 0, 987654321)::i64) = 20000
max((2.5, 0, 5.0, -2.5, -7.5)::fp32) = 5.0::fp32
max((1.5e+308, 1.5e+10, -1.5e+8, -1.5e+7, -1.5e+70)::fp64) = 1.5e+308::fp64

# null_handling: Examples with null as unput or output
# null_handling: Examples with null as input or output
max((Null, Null, Null)::i16) = Null::i16
max(()::i16) = Null::i16
max((2000000000, Null, 629000000, -100000000, Null, 987654321)::i64) = 2000000000::i64
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/arithmetic/min.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ 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
min((Null, inf)::fp64) = inf::fp64

# null_handling: Examples with null as unput or output
# 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
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/arithmetic/modulus.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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:NULL] = null::i8
modulus(5::i8, 0::i8) [on_domain_error:ERROR] = <!ERROR>

# division_type: Examples demonstrating truncate and floor division types
Expand Down
3 changes: 1 addition & 2 deletions tests/cases/arithmetic/sqrt.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
# basic: Basic examples without any special cases
sqrt(25::i64) = 5::fp64
sqrt(0::i64) = 0::fp64
sqrt(-9223372036854775800::i64) [on_domain_error:NAN] = null::fp64
sqrt(-9223372036854775800::i64) [on_domain_error:NAN] = null::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
Expand Down
14 changes: 7 additions & 7 deletions tests/cases/arithmetic/sum.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic.yaml'

# basic: Basic examples without any special cases
sum((0, -1, 2, 20)::i8) = 21::i8
sum((2000000, -3217908, 629000, -100000, 0, 987654)::i32) = 298746::i32
sum((2.5, 0, 5.0, -2.5, -7.5)::fp32) = -2.5::fp32
sum((0, -1, 2, 20)::i8) = 21::i64
sum((2000000, -3217908, 629000, -100000, 0, 987654)::i32) = 298746::i64
sum((2.5, 0, 5.0, -2.5, -7.5)::fp32) = -2.5::fp64
sum((2.5000007152557373046875, 7.0000007152557373046875, 0, 7.0000007152557373046875)::fp64) = 16.500002145767212::fp64

# overflow: Examples demonstrating overflow behavior
Expand All @@ -16,7 +16,7 @@ sum((-1.5e+308, -1.5e+308, -1.5e+308)::fp64) = -inf::fp64
sum((2.500000715, inf, 2.500000715)::fp64) = inf::fp64
sum((2.5000007, -inf, 2.5000007, 10.0)::fp64) = -inf::fp64

# null_handling: Examples with null as unput or output
sum((Null, Null, Null)::i16) = Null::i16
sum(()::i16) = Null::i16
sum((200000, Null, 629000, -10000, 0, 987621)::i32) = 1806621::i32
# null_handling: Examples with null as input or output
sum((Null, Null, Null)::i16) = Null::i64
sum(()::i16) = Null::i64
sum((200000, Null, 629000, -10000, 0, 987621)::i32) = 1806621::i64
4 changes: 4 additions & 0 deletions tests/cases/arithmetic_decimal/bitwise_and.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ bitwise_and(-9223372036854775807::dec<19, 0>, 127::dec<3, 0>) = 1::dec<19, 0>
bitwise_and(99999999999999999999999999999999999999::dec<38, 0>, 99999999999999999999999999999999999999::dec<38, 0>) = 99999999999999999999999999999999999999::dec<38, 0>
bitwise_and(99999999999999999999999999999999999999::dec<38, 0>, 00000000000000000000000000000000000000::dec<38, 0>) = 0::dec<38, 0>
bitwise_and(-99999999999999999999999999999999999999::dec<38, 0>, -99999999999999999999999999999999999999::dec<38, 0>) = -99999999999999999999999999999999999999::dec<38, 0>

# null_values: test with null values
bitwise_and(null::dec<1, 0>, 127::dec<3, 0>) = null::dec<3, 0>
bitwise_and(null::dec<1, 0>, null::dec<1, 0>) = null::dec<1, 0>
10 changes: 5 additions & 5 deletions tests/cases/arithmetic_decimal/factorial_decimal.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic_decimal.yaml'

# basic: Basic examples without any special cases
factorial(0::dec<1,0>) = 1::dec<38,0>
factorial(1::dec<1,0>) = 1::dec<38,0>
factorial(20::dec<2,0>) = 2432902008176640000::dec<38,0>
factorial(0::dec<1, 0>) = 1::dec<38, 0>
factorial(1::dec<1, 0>) = 1::dec<38, 0>
factorial(20::dec<2, 0>) = 2432902008176640000::dec<38, 0>

# overflow: Examples demonstrating overflow behavior
factorial(34::dec<2,0>) = <!ERROR>
factorial(34::dec<2, 0>) = <!ERROR>

# negative_value: Examples demonstrating behavior on negative value
factorial(-1::dec<1,0>) = <!ERROR>
factorial(-1::dec<1, 0>) = <!ERROR>

# null_values: test with null values
factorial(null::dec<38, 0>) = null::dec<38, 0>
Expand Down
10 changes: 5 additions & 5 deletions tests/cases/arithmetic_decimal/max_decimal.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ max((2000000000, -3217908979, 629000000, -100000000, 0, 987654321)::dec<10, 0>)
max((2.5, 0, 5.0, -2.5, -7.5)::dec<2, 1>) = 5.0::dec<2, 1>
max((99999999999999999999999999999999999999, 0, -99999999999999999999999999999999999998, 111111111, -76)::dec<38, 0>) = 99999999999999999999999999999999999999::dec<38, 0>

# null_handling: Examples with null as unput or output
max((Null, Null, Null)::dec<1, 0>) = Null::dec<1, 0>
max(()::dec<1, 0>) = Null::dec<1, 0>
# null_handling: Examples with null as input or output
max((Null, Null, Null)::dec<1, 0>) = null::dec<1, 0>
max(()::dec<1, 0>) = null::dec<1, 0>
max((2000000000, Null, 629000000, -100000000, Null, 987654321)::dec<10, 0>) = 2000000000::dec<10, 0>
max((Null, Null)::dec<1, 0>) = Null::dec<1, 0>
max(()::dec<1, 0>) = Null::dec<1, 0>
max((Null, Null)::dec<1, 0>) = null::dec<1, 0>
max(()::dec<1, 0>) = null::dec<1, 0>
max((99999999999999999999999999999999999999, -99999999999999999999999999999999999998, Null, 11111111111111111111111111111111111111, Null)::dec<38, 0>) = 99999999999999999999999999999999999999::dec<38, 0>
2 changes: 1 addition & 1 deletion tests/cases/arithmetic_decimal/min_decimal.test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ min((2000000000, -3217908979, 629000000, -100000000, 0, 987654321)::dec<10, 0>)
min((2.5, 0, 5.0, -2.5, -7.5)::dec<2, 1>) = -7.5::dec<2, 1>
min((99999999999999999999999999999999999999, -99999999999999999999999999999999999998, -99999999999999999999999999999999999997, 0, 1111)::dec<38, 0>) = -99999999999999999999999999999999999998::dec<38, 0>

# null_handling: Examples with null as unput or output
# null_handling: Examples with null as input or output
min((Null, Null, Null)::dec<1, 0>) = Null::dec<1, 0>
min(()::dec<1, 0>) = Null::dec<1, 0>
min((2000000000, Null, 629000000, -100000000, Null, 987654321)::dec<10, 0>) = -100000000::dec<10, 0>
Expand Down
8 changes: 3 additions & 5 deletions tests/cases/arithmetic_decimal/power.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ power(1.0::dec<38, 0>, -1.0::dec<38, 0>) = 1.0::fp64
power(2.0::dec<38, 0>, -2.0::dec<38, 0>) = 0.25::fp64
power(13::dec<38, 0>, 10::dec<38, 0>) = 137858491849::fp64

# result_more_than_input_precison: Examples demonstrating result with more precision than input
# result_more_than_input_precision: Examples demonstrating result with more precision than input
power(16::dec<2, 0>, 4::dec<38, 0>) = 65536::fp64

# floating_exception: Examples demonstrating exceptional floating point cases
power(1.5e+10::dec<38, 0>, 1.5e+20::dec<38, 0>) = inf::fp64
power(-16::dec<4, 0>, 1001::dec<4, 0>) = -inf::fp64

# complex_number: Examples demonstrating complex number output
power(-1::dec, 0.5::dec<38,1>) [complex_number_result:NAN] = nan::fp64

# complex_number: Examples demonstrating complex number output tests: complex_number_result with ERROR
power(-1::dec, 0.5::dec<38,1>) [complex_number_result:ERROR] = <!ERROR>
power(-1::dec, 0.5::dec<38, 1>) [complex_number_result:NAN] = nan::fp64
power(-1::dec, 0.5::dec<38, 1>) [complex_number_result:ERROR] = <!ERROR>
10 changes: 5 additions & 5 deletions tests/cases/arithmetic_decimal/power_decimal.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ power(1.0::dec, -1.0::dec<38, 0>) = 1.0::fp64
power(2.0::dec<38, 0>, -2.0::dec<38, 0>) = 0.25::fp64
power(13::dec<38, 0>, 10::dec<38, 0>) = 137858491849::fp64

# result_more_than_input_precison: Examples demonstrating result with more precision than input
# result_more_than_input_precision: Examples demonstrating result with more precision than input
power(16::dec<2, 0>, 4::dec<38, 0>) = 65536::fp64

# floating_exception: Examples demonstrating exceptional floating point cases
power(1.5e+10::dec<38, 0>, 1.5e+20::dec<38, 0>) = inf::fp64
power(-16::dec<4, 0>, 1001::dec<4, 0>) = -inf::fp64

# complex_number: Examples demonstrating complex number output
power(-1::dec, 0.5::dec<38,1>) [complex_number_result:NAN] = nan::fp64
power(-1::dec, 0.5::dec<38,1>) [complex_number_result:ERROR] = <!ERROR>
power(-1::dec, 0.5::dec<38, 1>) [complex_number_result:NAN] = nan::fp64
power(-1::dec, 0.5::dec<38, 1>) [complex_number_result:ERROR] = <!ERROR>

# null_values: test with null values
power(null::dec<38, 0>, 127::dec<38, 0>) = null::dec<38, 0>
power(null::dec<38, 0>, null::dec<38, 0>) = null::dec<38, 0>
power(null::dec<38, 0>, 127::dec<38, 0>) = null::fp64
power(null::dec<38, 0>, null::dec<38, 0>) = null::fp64
26 changes: 13 additions & 13 deletions tests/cases/arithmetic_decimal/sqrt_decimal.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
### SUBSTRAIT_INCLUDE: '/extensions/functions_arithmetic_decimal.yaml'

# basic: Basic examples without any special cases
sqrt(25::dec<2,0>) = 5::fp64
sqrt(0::dec<1,0>) = 0::fp64
sqrt(25::dec<2, 0>) = 5::fp64
sqrt(0::dec<1, 0>) = 0::fp64

# max_input: max allowed input returns correct result
sqrt(99999999999999999999999999999999999999::dec<38,0>) = 1e+19::fp64
sqrt(99999999999999999999999999999999999999::dec<38, 0>) = 1e+19::fp64

# real_number: real number as input
sqrt(6.25::dec<3,2>) = 2.5::fp64
sqrt(2.0000007152557373046875::dec<23,22>) = 1.4142138152541635::fp64
sqrt(6.25::dec<3, 2>) = 2.5::fp64
sqrt(2.0000007152557373046875::dec<23, 22>) = 1.4142138152541635::fp64

# verify_real_number: verify real number operation are different and doesn't behave as nearby int
sqrt(9::dec<1,0>) = 3::fp64
sqrt(8.3::dec<2,1>) = 2.8809720581775866::fp64
sqrt(8.5::dec<2,1>) = 2.9154759474226504::fp64
sqrt(8.7::dec<2,1>) = 2.949576240750525::fp64
sqrt(9.2::dec<2,1>) = 3.03315017762062::fp64
# verify_real_number: verify real number operation are different and doesnt behave as nearby int
sqrt(9::dec<1, 0>) = 3::fp64
sqrt(8.3::dec<2, 1>) = 2.8809720581775866::fp64
sqrt(8.5::dec<2, 1>) = 2.9154759474226504::fp64
sqrt(8.7::dec<2, 1>) = 2.949576240750525::fp64
sqrt(9.2::dec<2, 1>) = 3.03315017762062::fp64

# negative_input: negative input returns error
sqrt(-9223372036854775800::dec<19,0>) = <!ERROR>
sqrt(-2.5::dec<2,1>) = <!ERROR>
sqrt(-9223372036854775800::dec<19, 0>) = <!ERROR>
sqrt(-2.5::dec<2, 1>) = <!ERROR>

# null_values: test with null values
sqrt(null::dec<38, 0>) = null::fp64
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/arithmetic_decimal/sum_decimal.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sum((2.5000007152557373046875, 7.0000007152557373046875, 0, 7.000000715255737304
# overflow: Examples demonstrating overflow behavior
sum((99999999999999999999999999999999999999, 1, 1, 1, 1, 99999999999999999999999999999999999999)::dec<38, 0>) [overflow:ERROR] = <!ERROR>

# null_handling: Examples with null as unput or output
# null_handling: Examples with null as input or output
sum((Null, Null, Null)::dec<1, 0>) = Null::dec<38, 0>
sum(()::dec<1, 0>) = Null::dec<38, 0>
sum((200000, Null, 629000, -10000, 0, 987621)::dec<6, 0>) = 1806621::dec<38, 0>
3 changes: 2 additions & 1 deletion tests/cases/boolean/bool_and.test
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
### SUBSTRAIT_AGGREGATE_TEST: v1.0
### SUBSTRAIT_SCALAR_TEST: v1.0
### SUBSTRAIT_INCLUDE: '/extensions/functions_boolean.yaml'

# basic: Basic examples without any special cases
bool_and((true, true)::bool) = true::bool
bool_and((true, false)::bool) = false::bool
bool_and((false, false)::bool) = false::bool
bool_and((false)::bool) = false::bool
bool_and((true)::bool) = true::bool
bool_and((true, null)::bool) = true::bool
bool_and((null, null)::bool) = null::bool
Expand Down
18 changes: 10 additions & 8 deletions tests/cases/comparison/between.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ between(5::i8, 0::i8, 127::i8) = true::bool
between(20000::i16, 1::i16, 30000::i16) = true::bool
between(1030000000::i32, 1000000000::i32, 2000000000::i32) = true::bool
between(10300000000900::i64, 1000000000::i64, 9223372036854775807::i64) = true::bool
between(2::i8, 1::i8, -120::i8) = False::bool
between(-10000::i16, -20000::i16, -30000::i16) = False::bool
between(-100000000::i32, -1000000000::i32, -2000000000::i32) = False::bool
between(92233720368547758::i64, 1::i64, -9223372036854775807::i64) = False::bool
between(14.01::fp32, 20.90::fp32, 88.00::fp32) = False::bool
between(14.011::fp64, 0.00::fp64, inf::fp64) = True::bool
between(inf::fp64, 0.00::fp64, 100.09::fp64) = False::bool
between(-100.0011::fp64, -inf::fp64, 0.00::fp64) = True::bool
between(2::i8, 1::i8, -120::i8) = false::bool
between(2::i8, 2::i8, 3::i8) = true::bool
between(2::i8, 1::i8, 2::i8) = true::bool
between(-10000::i16, -20000::i16, -30000::i16) = false::bool
between(-100000000::i32, -1000000000::i32, -2000000000::i32) = false::bool
between(92233720368547758::i64, 1::i64, -9223372036854775807::i64) = false::bool
between(14.01::fp32, 20.90::fp32, 88.00::fp32) = false::bool
between(14.011::fp64, 0.00::fp64, inf::fp64) = true::bool
between(inf::fp64, 0.00::fp64, 100.09::fp64) = false::bool
between(-100.0011::fp64, -inf::fp64, 0.00::fp64) = true::bool

# null_input: Examples with null as input
between(null::i8, 1::i8, 10::i8) = null::bool
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/comparison/gt.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ gt(7.25::fp32, 2.50::fp32) = true::bool
gt(-922337203685775808::dec<38, 0>, -922337203685775807::dec<38, 0>) = false::bool
gt(7.25::dec<38, 2>, 2.50::dec<38, 2>) = true::bool
gt(-1.5e+308::fp64, -inf::fp64) = true::bool
gt(null::i16, 100::i16) = null::bool
gt(inf::fp64, 1.5e+308::fp64) = true::bool

# null_input: Examples with null as input
gt(inf::fp64, 1.5e+308::fp64) = true::bool
gt(null::i16, 100::i16) = null::bool
gt(2::i16, null::i16) = null::bool
gt(null::i16, null::i16) = null::bool
gt(2::dec<38, 2>, null::dec<38, 2>) = null::bool
Expand Down
4 changes: 2 additions & 2 deletions tests/cases/comparison/gte.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ gte(7.25::dec<38, 2>, 7.27::dec<38, 2>) = false::bool
gte(inf::fp64, 1.5e+308::fp64) = true::bool
gte(inf::fp64, inf::fp64) = true::bool
gte(-inf::fp64, -1.5e+308::fp64) = false::bool
gte(null::dec<38, 2>, 7.25::dec<38, 2>) = null::bool
gte(null::dec<38, 2>, null::dec<38, 2>) = null::bool

# null_input: Examples with null as input
gte(null::dec<38, 2>, 7.25::dec<38, 2>) = null::bool
gte(null::dec<38, 2>, null::dec<38, 2>) = null::bool
gte(null::i16, 1::i16) = null::bool
gte(2::i16, null::i16) = null::bool
gte(null::i16, null::i16) = null::bool
2 changes: 1 addition & 1 deletion tests/cases/comparison/is_not_null.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ is_not_null(25::i16) = true::bool
is_not_null(true::bool) = true::bool
is_not_null(7.25::fp32) = true::bool
is_not_null(7.25::dec<38, 3>) = true::bool
is_not_null(null::i8) = False::bool
is_not_null(null::i8) = false::bool
is_not_null(null::dec<38, 3>) = false::bool
4 changes: 2 additions & 2 deletions tests/cases/comparison/lt.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ lt(7.25::dec<38, 2>, 7.25::dec<38, 2>) = false::bool
lt(2.49::dec<38, 2>, 2.50::dec<38, 2>) = true::bool
lt(1.5e+308::fp64, inf::fp64) = true::bool
lt(-1.5e+308::fp64, -inf::fp64) = false::bool
lt(null::dec<38, 2>, 2.50::dec<38, 2>) = null::bool
lt(null::dec<38, 2>, null::dec<38, 2>) = null::bool

# null_input: Examples with null as input
lt(null::dec<38, 2>, 2.50::dec<38, 2>) = null::bool
lt(null::dec<38, 2>, null::dec<38, 2>) = null::bool
lt(null::i16, 1::i16) = null::bool
lt(2::i16, null::i16) = null::bool
lt(null::i16, null::i16) = null::bool
4 changes: 2 additions & 2 deletions tests/cases/comparison/lte.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ lte(2.59::dec<38, 2>, 2.50::dec<38, 2>) = false::bool
lte(1.5e+308::fp64, inf::fp64) = true::bool
lte(inf::fp64, inf::fp64) = true::bool
lte(-1.5e+308::fp64, -inf::fp64) = false::bool
lte(null::dec<38, 2>, 2.50::dec<38, 2>) = null::bool
lte(null::dec<38, 2>, null::dec<38, 2>) = null::bool

# null_input: Examples with null as input
lte(null::dec<38, 2>, 2.50::dec<38, 2>) = null::bool
lte(null::dec<38, 2>, null::dec<38, 2>) = null::bool
lte(null::i16, 1::i16) = null::bool
lte(2::i16, null::i16) = null::bool
lte(null::i16, null::i16) = null::bool
4 changes: 2 additions & 2 deletions tests/cases/comparison/not_equal.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ not_equal(9223372036854775804::dec<38, 0>, 9223372036854775804::dec<38, 0>) = fa
not_equal(inf::fp64, inf::fp64) = false::bool
not_equal(inf::fp64, 1.5e+308::fp64) = true::bool
not_equal(inf::fp64, -inf::fp64) = true::bool
not_equal(null::dec<38, 2>, 2.50::dec<38, 2>) = null::bool
not_equal(null::dec<38, 2>, null::dec<38, 2>) = null::bool

# null_input: Examples with null as input
not_equal(null::dec<38, 2>, 2.50::dec<38, 2>) = null::bool
not_equal(null::dec<38, 2>, null::dec<38, 2>) = null::bool
not_equal(null::i16, 1::i16) = null::bool
not_equal(null::i16, null::i16) = null::bool
2 changes: 1 addition & 1 deletion tests/cases/datetime/add_datetime.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ add('2020-12-31'::date, 'P5Y'::iyear) = '2025-12-31T00:00:00'::ts
add('2020-12-31'::date, 'P5M'::iyear) = '2021-05-31T00:00:00'::ts

# null_input: examples with null args or return
add(null::date, 'P5D'::iday) = null::date
add(null::date, 'P5D'::iday) = null::ts
11 changes: 11 additions & 0 deletions tests/cases/datetime/add_intervals.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### SUBSTRAIT_SCALAR_TEST: v1.0
### SUBSTRAIT_INCLUDE: '/extensions/functions_datetime.yaml'

# basic: Basic examples without any special cases
add_intervals('PT10H'::iday, 'PT5H'::iday) = 'P0DT15H0M0S'::iday
add_intervals('P10D'::iday, 'P5D'::iday) = 'P15D'::iday
add_intervals('P1D'::iday, 'PT10H'::iday) = 'P1DT10H0M0S'::iday

# null_input: Basic examples where the input args or return is null
add_intervals(null::iyear, 'P1Y'::iyear) = null::iyear
add_intervals(null::iday, 'P1D'::iday) = null::iday
Loading

0 comments on commit cf8851f

Please sign in to comment.