From 70d0cbd3ed13fcf64250c08ad0d988cfa7d82671 Mon Sep 17 00:00:00 2001 From: Anshul Data Date: Thu, 1 Aug 2024 13:26:54 +0530 Subject: [PATCH] Add test cases for bitwise not for decimal type --- .../bitwise_not_decimal.yaml | 75 +++++++++++++++++++ dialects/snowflake.yaml | 5 ++ 2 files changed, 80 insertions(+) create mode 100644 cases/arithmetic_decimal/bitwise_not_decimal.yaml diff --git a/cases/arithmetic_decimal/bitwise_not_decimal.yaml b/cases/arithmetic_decimal/bitwise_not_decimal.yaml new file mode 100644 index 00000000..fcdc06b0 --- /dev/null +++ b/cases/arithmetic_decimal/bitwise_not_decimal.yaml @@ -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> + 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> diff --git a/dialects/snowflake.yaml b/dialects/snowflake.yaml index 4141216b..d9670878 100644 --- a/dialects/snowflake.yaml +++ b/dialects/snowflake.yaml @@ -360,3 +360,8 @@ aggregate_functions: aggregate: true supported_kernels: - bool +- name: arithmetic_decimal.bitwise_not + local_name: bitnot + required_options: + supported_kernels: + - dec