-
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 bitwise and/or/xor for decimal type
- Loading branch information
1 parent
91056da
commit 0961d79
Showing
5 changed files
with
438 additions
and
0 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,121 @@ | ||
base_uri: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_arithmetic_decimal.yaml | ||
function: bitwise_and | ||
cases: | ||
- group: | ||
id: basic | ||
description: Basic examples without any special cases | ||
args: | ||
- value: 0 | ||
type: decimal<1, 0> | ||
- value: 1 | ||
type: decimal<1, 0> | ||
result: | ||
value: 0 | ||
type: decimal<1, 0> | ||
- group: basic | ||
args: | ||
- value: 127 | ||
type: decimal<3, 0> | ||
- value: 127 | ||
type: decimal<3, 0> | ||
result: | ||
value: 127 | ||
type: decimal<3, 0> | ||
- group: basic | ||
args: | ||
- value: -127 | ||
type: decimal<3, 0> | ||
- value: -10 | ||
type: decimal<2, 0> | ||
result: | ||
value: -128 | ||
type: decimal<3, 0> | ||
- group: basic | ||
args: | ||
- value: 31766 | ||
type: decimal<5, 0> | ||
- value: 900 | ||
type: decimal<3, 0> | ||
result: | ||
value: 4 | ||
type: decimal<5, 0> | ||
- group: basic | ||
args: | ||
- value: -31766 | ||
type: decimal<5, 0> | ||
- value: 900 | ||
type: decimal<3, 0> | ||
result: | ||
value: 896 | ||
type: decimal<5, 0> | ||
- group: basic | ||
args: | ||
- value: 2147483647 | ||
type: decimal<10, 0> | ||
- value: 1234567 | ||
type: decimal<7, 0> | ||
result: | ||
value: 1234567 | ||
type: decimal<10, 0> | ||
- group: basic | ||
args: | ||
- value: 2147483647 | ||
type: decimal<10, 0> | ||
- value: 1234567 | ||
type: decimal<7, 0> | ||
result: | ||
value: 1234567 | ||
type: decimal<10, 0> | ||
- group: basic | ||
args: | ||
- value: 9223372036854775807 | ||
type: decimal<19, 0> | ||
- value: 127 | ||
type: decimal<3, 0> | ||
result: | ||
value: 127 | ||
type: decimal<19, 0> | ||
- group: basic | ||
args: | ||
- value: -9223372036854775807 | ||
type: decimal<19, 0> | ||
- value: 127 | ||
type: decimal<3, 0> | ||
result: | ||
value: 1 | ||
type: decimal<19, 0> | ||
- group: | ||
id: max_values | ||
description: test with max values | ||
args: | ||
# 38 9s | ||
- value: 99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
# 38 9s | ||
- value: 99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
result: | ||
value: 99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
- group: max_values | ||
args: | ||
# 38 9s | ||
- value: 99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
# 38 0s | ||
- value: 00000000000000000000000000000000000000 | ||
type: decimal<38, 0> | ||
result: | ||
value: 0 | ||
type: decimal<38, 0> | ||
- group: max_values | ||
args: | ||
# negative 38 9s | ||
- value: -99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
# negative 38 9s | ||
- value: -99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
result: | ||
value: -99999999999999999999999999999999999999 | ||
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,143 @@ | ||
base_uri: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_arithmetic_decimal.yaml | ||
function: bitwise_or | ||
cases: | ||
- group: | ||
id: basic | ||
description: Basic examples without any special cases | ||
args: | ||
- value: 0 | ||
type: decimal<1, 0> | ||
- value: 1 | ||
type: decimal<1, 0> | ||
result: | ||
value: 1 | ||
type: decimal<1, 0> | ||
- group: basic | ||
args: | ||
- value: 127 | ||
type: decimal<3, 0> | ||
- value: 127 | ||
type: decimal<3, 0> | ||
result: | ||
value: 127 | ||
type: decimal<3, 0> | ||
- group: basic | ||
args: | ||
- value: -127 | ||
type: decimal<3, 0> | ||
- value: -10 | ||
type: decimal<2, 0> | ||
result: | ||
value: -9 | ||
type: decimal<3, 0> | ||
- group: basic | ||
args: | ||
- value: 31766 | ||
type: decimal<5, 0> | ||
- value: 900 | ||
type: decimal<3, 0> | ||
result: | ||
value: 32662 | ||
type: decimal<5, 0> | ||
- group: basic | ||
args: | ||
- value: -31766 | ||
type: decimal<5, 0> | ||
- value: 900 | ||
type: decimal<3, 0> | ||
result: | ||
value: -31762 | ||
type: decimal<5, 0> | ||
- group: basic | ||
args: | ||
- value: 2147483647 | ||
type: decimal<10, 0> | ||
- value: 123456789 | ||
type: decimal<9, 0> | ||
result: | ||
value: 2147483647 | ||
type: decimal<10, 0> | ||
- group: basic | ||
args: | ||
- value: 2147483647 | ||
type: decimal<10, 0> | ||
- value: 123456789 | ||
type: decimal<9, 0> | ||
result: | ||
value: 2147483647 | ||
type: decimal<10, 0> | ||
- group: basic | ||
args: | ||
- value: 9223372036854775807 | ||
type: decimal<19, 0> | ||
- value: 127 | ||
type: decimal<3, 0> | ||
result: | ||
value: 9223372036854775807 | ||
type: decimal<10, 0> | ||
- group: basic | ||
args: | ||
- value: -9223372036854775807 | ||
type: decimal<19, 0> | ||
- value: 127 | ||
type: decimal<3, 0> | ||
result: | ||
value: -9223372036854775681 | ||
type: decimal<19, 0> | ||
- group: | ||
id: max_values | ||
description: test with max values | ||
args: | ||
# 38 9s | ||
- value: 99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
# 38 9s | ||
- value: 99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
result: | ||
value: 99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
- group: max_values | ||
args: | ||
# 38 9s | ||
- value: 99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
# 38 0s | ||
- value: 00000000000000000000000000000000000000 | ||
type: decimal<38, 0> | ||
result: | ||
# 38 9s | ||
value: 99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
- group: max_values | ||
args: | ||
# negative 38 9s | ||
- value: -99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
# negative 38 9s | ||
- value: -99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
result: | ||
# negative 38 9s | ||
value: -99999999999999999999999999999999999999 | ||
type: decimal<38, 0> | ||
- group: | ||
id: null_values | ||
description: test with null values | ||
args: | ||
- value: null | ||
type: decimal<1, 0> | ||
- value: 127 | ||
type: decimal<3, 0> | ||
result: | ||
value: null | ||
type: decimal<3, 0> | ||
- group: null_values | ||
args: | ||
- value: null | ||
type: decimal<1, 0> | ||
- value: null | ||
type: decimal<1, 0> | ||
result: | ||
value: null | ||
type: decimal<1, 0> |
Oops, something went wrong.