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

Add test cases for bitwise not for decimal type #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
75 changes: 75 additions & 0 deletions cases/arithmetic_decimal/bitwise_not_decimal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
base_uri: https://github.com/substrait-io/substrait/blob/main/extensions/substrait/extensions/functions_arithmetic_decimal.yaml
function: bitwise_not
cases:
- group:
id: basic
description: Basic examples without any special cases
args:
- value: 0
type: decimal<38, 0>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we do decimal<1, 0>? Make it more precise, like we did to all the other decimal yamls.

result:
value: -1
type: decimal<38, 0>
- group: basic
args:
- value: 1
type: decimal<38, 0>
result:
value: -2
type: decimal<38, 0>
- group: basic
args:
- value: -127
type: decimal<38, 0>
result:
value: 126
type: decimal<38, 0>
- group: basic
args:
- value: 31766
type: decimal<38, 0>
result:
value: -31767
type: decimal<38, 0>
- group: basic
args:
- value: -31766
type: decimal<38, 0>
result:
value: 31765
type: decimal<38, 0>
- group: basic
args:
- value: 2147483647
type: decimal<38, 0>
result:
value: -2147483648
type: decimal<38, 0>
- group: basic
args:
- value: 2147483647
type: decimal<38, 0>
result:
value: -2147483648
type: decimal<38, 0>
- group: basic
args:
- value: 9223372036854775807
type: decimal<38, 0>
result:
value: -9223372036854775808
type: decimal<38, 0>
- group: basic
args:
- value: -9223372036854775807
type: decimal<38, 0>
result:
value: 9223372036854775806
type: decimal<38, 0>
- group: basic
args:
- value: null
type: decimal<38, 0>
result:
value: null
type: decimal<38, 0>
5 changes: 5 additions & 0 deletions dialects/snowflake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -372,3 +372,8 @@ aggregate_functions:
aggregate: true
supported_kernels:
- bool
- name: arithmetic_decimal.bitwise_not
local_name: bitnot
required_options:
supported_kernels:
- dec
Loading