From 7473a2d6cef9bfaa7cd6b15ff77684a4d758190c Mon Sep 17 00:00:00 2001 From: Richard Tia Date: Wed, 19 Jul 2023 16:02:45 -0700 Subject: [PATCH 1/5] feat: add remaining arithmetic functions --- cases/arithmetic/acos.yaml | 32 ++++++++++++ cases/arithmetic/acosh.yaml | 32 ++++++++++++ cases/arithmetic/asin.yaml | 39 ++++++++++++++ cases/arithmetic/asinh.yaml | 32 ++++++++++++ cases/arithmetic/atan.yaml | 39 ++++++++++++++ cases/arithmetic/atan2.yaml | 40 ++++++++++++++ cases/arithmetic/atanh.yaml | 39 ++++++++++++++ cases/arithmetic/cos.yaml | 39 ++++++++++++++ cases/arithmetic/cosh.yaml | 39 ++++++++++++++ cases/arithmetic/exp.yaml | 39 ++++++++++++++ cases/arithmetic/factorial.yaml | 42 +++++++++++++++ cases/arithmetic/modulus.yaml | 85 ++++++++++++++++++++++++++++++ cases/arithmetic/power.yaml | 51 ++++++++++++++++++ cases/arithmetic/sin.yaml | 39 ++++++++++++++ cases/arithmetic/sinh.yaml | 39 ++++++++++++++ cases/arithmetic/sqrt.yaml | 71 +++++++++++++++++++++++++ cases/arithmetic/tan.yaml | 39 ++++++++++++++ cases/arithmetic/tanh.yaml | 39 ++++++++++++++ dialects/datafusion.yaml | 33 ++++++++++++ dialects/duckdb.yaml | 39 ++++++++++++++ dialects/postgres.yaml | 43 ++++++++++++++- dialects/sqlite.yaml | 25 +++++++++ dialects/velox_presto.yaml | 92 +++++++++++++++++++++++++++++++++ 23 files changed, 1006 insertions(+), 1 deletion(-) create mode 100644 cases/arithmetic/acos.yaml create mode 100644 cases/arithmetic/acosh.yaml create mode 100644 cases/arithmetic/asin.yaml create mode 100644 cases/arithmetic/asinh.yaml create mode 100644 cases/arithmetic/atan.yaml create mode 100644 cases/arithmetic/atan2.yaml create mode 100644 cases/arithmetic/atanh.yaml create mode 100644 cases/arithmetic/cos.yaml create mode 100644 cases/arithmetic/cosh.yaml create mode 100644 cases/arithmetic/exp.yaml create mode 100644 cases/arithmetic/factorial.yaml create mode 100644 cases/arithmetic/modulus.yaml create mode 100644 cases/arithmetic/power.yaml create mode 100644 cases/arithmetic/sin.yaml create mode 100644 cases/arithmetic/sinh.yaml create mode 100644 cases/arithmetic/sqrt.yaml create mode 100644 cases/arithmetic/tan.yaml create mode 100644 cases/arithmetic/tanh.yaml diff --git a/cases/arithmetic/acos.yaml b/cases/arithmetic/acos.yaml new file mode 100644 index 00000000..baf7164d --- /dev/null +++ b/cases/arithmetic/acos.yaml @@ -0,0 +1,32 @@ +function: acos +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.00 + type: fp32 + result: + value: 1.5707963267948966 + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + result: + value: 0.0 + type: fp64 + - group: basic + args: + - value: -0.0000009 + type: fp64 + result: + value: 1.5707972267948966 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/acosh.yaml b/cases/arithmetic/acosh.yaml new file mode 100644 index 00000000..9188d739 --- /dev/null +++ b/cases/arithmetic/acosh.yaml @@ -0,0 +1,32 @@ +function: acosh +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.01 + type: fp32 + result: + value: null + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + result: + value: 0.0 + type: fp64 + - group: basic + args: + - value: 10.0005 + type: fp64 + result: + value: 2.9932730967481995 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/asin.yaml b/cases/arithmetic/asin.yaml new file mode 100644 index 00000000..842d2a15 --- /dev/null +++ b/cases/arithmetic/asin.yaml @@ -0,0 +1,39 @@ +function: asin +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.0 + type: fp32 + result: + value: 0.0 + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + result: + value: 1.5707963267948966 + type: fp64 + - group: basic + args: + - value: 0.009 + type: fp64 + result: + value: 0.009000121504428887 + type: fp64 + - group: basic + args: + - value: -0.009 + type: fp64 + result: + value: -0.009000121504428887 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/asinh.yaml b/cases/arithmetic/asinh.yaml new file mode 100644 index 00000000..88c8c7ed --- /dev/null +++ b/cases/arithmetic/asinh.yaml @@ -0,0 +1,32 @@ +function: asinh +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.01 + type: fp32 + result: + value: 0.009999833340832886 + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + result: + value: 0.881373587019543 + type: fp64 + - group: basic + args: + - value: 0.0009 + type: fp64 + result: + value: 0.0008999998785000443 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/atan.yaml b/cases/arithmetic/atan.yaml new file mode 100644 index 00000000..3a2ca066 --- /dev/null +++ b/cases/arithmetic/atan.yaml @@ -0,0 +1,39 @@ +function: atan +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.0 + type: fp32 + result: + value: 0.0 + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + result: + value: 0.7853981633974483 + type: fp64 + - group: basic + args: + - value: 7.01 + type: fp64 + result: + value: 1.4290989925795292 + type: fp64 + - group: basic + args: + - value: -7.01 + type: fp64 + result: + value: -1.4290989925795292 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/atan2.yaml b/cases/arithmetic/atan2.yaml new file mode 100644 index 00000000..368b2d2e --- /dev/null +++ b/cases/arithmetic/atan2.yaml @@ -0,0 +1,40 @@ +function: atan2 +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.0 + type: fp32 + - value: 0.0 + type: fp32 + result: + value: 0.0 + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + - value: 1.0 + type: fp64 + result: + value: 0.7853981633974483 + type: fp64 + - group: basic + args: + - value: 0.009 + type: fp64 + - value: 0.0008 + type: fp64 + result: + value: 1.482140444927459 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + - value: 0.0008 + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/atanh.yaml b/cases/arithmetic/atanh.yaml new file mode 100644 index 00000000..9af428ee --- /dev/null +++ b/cases/arithmetic/atanh.yaml @@ -0,0 +1,39 @@ +function: atanh +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.0 + type: fp32 + result: + value: 0.0 + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + result: + value: inf + type: fp64 + - group: basic + args: + - value: 0.009 + type: fp64 + result: + value: 0.009000243011810481 + type: fp64 + - group: basic + args: + - value: -0.009 + type: fp64 + result: + value: -0.009000243011810481 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/cos.yaml b/cases/arithmetic/cos.yaml new file mode 100644 index 00000000..a3979daf --- /dev/null +++ b/cases/arithmetic/cos.yaml @@ -0,0 +1,39 @@ +function: cos +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.00 + type: fp32 + result: + value: 1.0 + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + result: + value: 0.5403023058681398 + type: fp64 + - group: basic + args: + - value: 7.0000009 + type: fp64 + result: + value: 0.7539016630550606 + type: fp64 + - group: basic + args: + - value: -7.00000095 + type: fp64 + result: + value: 0.7539016302056953 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/cosh.yaml b/cases/arithmetic/cosh.yaml new file mode 100644 index 00000000..e84365cb --- /dev/null +++ b/cases/arithmetic/cosh.yaml @@ -0,0 +1,39 @@ +function: cosh +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.00 + type: fp32 + result: + value: 1.0 + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + result: + value: 1.5430806348152437 + type: fp64 + - group: basic + args: + - value: 7.0000009 + type: fp64 + result: + value: 548.3175286399451 + type: fp64 + - group: basic + args: + - value: -7.00000095 + type: fp64 + result: + value: 548.3175560557769 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/exp.yaml b/cases/arithmetic/exp.yaml new file mode 100644 index 00000000..026774c5 --- /dev/null +++ b/cases/arithmetic/exp.yaml @@ -0,0 +1,39 @@ +function: exp +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.25 + type: fp32 + result: + value: 1.2840254166877414 + type: fp32 + - group: basic + args: + - value: 0.693 + type: fp64 + result: + value: 1.9997056605411638 + type: fp64 + - group: basic + args: + - value: 2.0000007152557373046875 + type: fp64 + result: + value: 7.3890613839973085 + type: fp64 + - group: basic + args: + - value: 0.0 + type: fp64 + result: + value: 1.0 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 \ No newline at end of file diff --git a/cases/arithmetic/factorial.yaml b/cases/arithmetic/factorial.yaml new file mode 100644 index 00000000..daece4f0 --- /dev/null +++ b/cases/arithmetic/factorial.yaml @@ -0,0 +1,42 @@ +function: factorial +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0 + type: i32 + result: + value: 1 + type: i32 + - group: basic + args: + - value: 1 + type: i64 + result: + value: 1 + type: i64 + - group: basic + args: + - value: 20 + type: i64 + result: + value: 2432902008176640000 + type: i64 + - group: basic + args: + - value: null + type: i64 + result: + value: null + type: i64 + - group: + id: overflow + description: Examples demonstrating overflow behavior + args: + - value: 1000000 + type: i64 + options: + overflow: ERROR + result: + special: error diff --git a/cases/arithmetic/modulus.yaml b/cases/arithmetic/modulus.yaml new file mode 100644 index 00000000..2d4cf6d0 --- /dev/null +++ b/cases/arithmetic/modulus.yaml @@ -0,0 +1,85 @@ +function: modulus +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 9 + type: i8 + - value: 3 + type: i8 + result: + value: 0 + type: i8 + - group: basic + args: + - value: 10 + type: i8 + - value: 3 + type: i8 + result: + value: 1 + type: i8 + - group: basic + args: + - value: 10 + type: i8 + - value: -3 + type: i8 + result: + value: 1 + type: i8 + - group: basic + args: + - value: -10 + type: i8 + - value: 3 + type: i8 + result: + value: -1 + type: i8 + - group: basic + args: + - value: -10 + type: i8 + - value: -3 + type: i8 + result: + value: -1 + type: i8 + - group: basic + args: + - value: 5 + type: i8 + - value: 0 + type: i8 + result: + value: null + type: i8 + - group: basic + args: + - value: 5 + type: i8 + - value: null + type: i8 + result: + value: null + type: i8 + - group: basic + args: + - value: null + type: i8 + - value: 1 + type: i8 + result: + value: null + type: i8 + - group: basic + args: + - value: null + type: i8 + - value: null + type: i8 + result: + value: null + type: i8 \ No newline at end of file diff --git a/cases/arithmetic/power.yaml b/cases/arithmetic/power.yaml new file mode 100644 index 00000000..98e4077b --- /dev/null +++ b/cases/arithmetic/power.yaml @@ -0,0 +1,51 @@ +function: power +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 8 + type: i64 + - value: 2 + type: i64 + result: + value: 64 + type: i64 + - group: basic + args: + - value: 1 + type: fp32 + - value: -1 + type: fp32 + result: + value: 1 + type: fp32 + - group: basic + args: + - value: 2 + type: fp64 + - value: -2 + type: fp64 + result: + value: 0.25 + type: fp64 + - group: basic + args: + - value: 13 + type: i64 + - value: 10 + type: i64 + result: + value: 137858491849 + type: i64 + - group: + id: floating_exception + description: Examples demonstrating exceptional floating point cases + args: + - value: 1.5e+100 + type: fp64 + - value: 1.5e+208 + type: fp64 + result: + value: Infinity + type: fp64 diff --git a/cases/arithmetic/sin.yaml b/cases/arithmetic/sin.yaml new file mode 100644 index 00000000..4281242a --- /dev/null +++ b/cases/arithmetic/sin.yaml @@ -0,0 +1,39 @@ +function: sin +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.0 + type: fp32 + result: + value: 0.0 + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + result: + value: 0.8414709848078965 + type: fp64 + - group: basic + args: + - value: 7.0000009 + type: fp64 + result: + value: 0.6569872772305518 + type: fp64 + - group: basic + args: + - value: -7.0000009 + type: fp64 + result: + value: -0.6569872772305518 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/sinh.yaml b/cases/arithmetic/sinh.yaml new file mode 100644 index 00000000..16efa9c0 --- /dev/null +++ b/cases/arithmetic/sinh.yaml @@ -0,0 +1,39 @@ +function: sinh +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.0 + type: fp32 + result: + value: 0.0 + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + result: + value: 1.1752011936438014 + type: fp64 + - group: basic + args: + - value: 7.0000009 + type: fp64 + result: + value: 548.3166167588001 + type: fp64 + - group: basic + args: + - value: -7.0000009 + type: fp64 + result: + value: -548.3166167588001 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/sqrt.yaml b/cases/arithmetic/sqrt.yaml new file mode 100644 index 00000000..d92ce380 --- /dev/null +++ b/cases/arithmetic/sqrt.yaml @@ -0,0 +1,71 @@ +function: sqrt +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 25 + type: i64 + result: + value: 5 + type: i64 + - group: basic + args: + - value: 0 + type: i64 + result: + value: 0 + type: i64 + - group: basic + args: + - value: -9223372036854775800 + type: i64 + options: + on_domain_error: ERROR + result: + special: error + - group: basic + args: + - value: -9223372036854775800 + type: i64 + options: + on_domain_error: NONE + result: + value: null + type: i64 + - group: basic + args: + - value: -9223372036854775800 + type: i64 + options: + on_domain_error: NAN + result: + special: nan + - group: basic + args: + - value: 9223372036854775800 + type: i64 + result: + value: 3037000499.97605 + type: i64 + - group: basic + args: + - value: null + type: i64 + result: + value: null + type: i64 + - group: basic + args: + - value: 6.25 + type: fp32 + result: + value: 2.5 + type: fp32 + - group: basic + args: + - value: 2.0000007152557373046875 + type: fp64 + result: + value: 1.4142138152541635 + type: fp64 \ No newline at end of file diff --git a/cases/arithmetic/tan.yaml b/cases/arithmetic/tan.yaml new file mode 100644 index 00000000..988ec4ef --- /dev/null +++ b/cases/arithmetic/tan.yaml @@ -0,0 +1,39 @@ +function: tan +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.0 + type: fp32 + result: + value: 0.0 + type: fp32 + - group: basic + args: + - value: 0.5 + type: fp64 + result: + value: 0.5463024898437905 + type: fp64 + - group: basic + args: + - value: 7.01 + type: fp64 + result: + value: 0.8891974677731088 + type: fp64 + - group: basic + args: + - value: -7.01 + type: fp64 + result: + value: -0.8891974677731088 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/cases/arithmetic/tanh.yaml b/cases/arithmetic/tanh.yaml new file mode 100644 index 00000000..5dbb8e35 --- /dev/null +++ b/cases/arithmetic/tanh.yaml @@ -0,0 +1,39 @@ +function: tanh +cases: + - group: + id: basic + description: Basic examples without any special cases + args: + - value: 0.0 + type: fp32 + result: + value: 0.0 + type: fp32 + - group: basic + args: + - value: 1.0 + type: fp64 + result: + value: 0.7615941559557649 + type: fp64 + - group: basic + args: + - value: 7.0000009 + type: fp64 + result: + value: 0.9999983369469382 + type: fp64 + - group: basic + args: + - value: -7.0000009 + type: fp64 + result: + value: -0.9999983369469382 + type: fp64 + - group: basic + args: + - value: null + type: fp64 + result: + value: null + type: fp64 diff --git a/dialects/datafusion.yaml b/dialects/datafusion.yaml index 6caf75aa..918a146e 100644 --- a/dialects/datafusion.yaml +++ b/dialects/datafusion.yaml @@ -24,6 +24,39 @@ scalar_functions: on_division_by_zero: ERROR overflow: ERROR rounding: TIE_TO_EVEN + - name: modulus + unsupported: true + - name: power + - name: sqrt + required_options: + on_domain_error: NAN + - name: exp + unsupported_kernels: + - args: + - fp32 + result: fp32 + - name: cos + - name: sin + - name: tan + - name: cosh + - name: sinh + - name: tanh + - name: acos + unsupported_kernels: + - args: + - fp32 + result: fp32 + - name: asin + - name: atan + - name: acosh + unsupported: true + - name: asinh + unsupported: true + - name: atanh + unsupported: true + - name: atan2 + - name: factorial + unsupported: True - name: abs unsupported: true required_options: diff --git a/dialects/duckdb.yaml b/dialects/duckdb.yaml index 033201db..cf46083a 100644 --- a/dialects/duckdb.yaml +++ b/dialects/duckdb.yaml @@ -26,6 +26,45 @@ scalar_functions: on_division_by_zero: NAN overflow: ERROR rounding: TIE_TO_EVEN + - name: modulus + local_name: "%" + infix: True + required_options: + overflow: ERROR + rounding: TIE_TO_EVEN + - name: power + required_options: + overflow: ERROR + rounding: TIE_TO_EVEN + - name: sqrt + required_options: + on_domain_error: ERROR + rounding: TIE_TO_EVEN + - name: exp + required_options: + overflow: ERROR + rounding: TIE_TO_EVEN + - name: cos + - name: sin + - name: tan + - name: cosh + unsupported: true + - name: sinh + unsupported: true + - name: tanh + unsupported: true + - name: acos + - name: asin + - name: atan + - name: acosh + unsupported: true + - name: asinh + unsupported: true + - name: atanh + unsupported: true + - name: atan2 + - name: factorial + unsupported: true - name: abs required_options: overflow: ERROR diff --git a/dialects/postgres.yaml b/dialects/postgres.yaml index 2cf8fd1c..fa8df519 100644 --- a/dialects/postgres.yaml +++ b/dialects/postgres.yaml @@ -64,9 +64,50 @@ scalar_functions: - fp32 - fp32 result: fp32 - - name: abs + - name: modulus + local_name: "%" + infix: True required_options: overflow: ERROR + unsupported_kernels: + - args: + - i8 + - i8 + result: i8 + - args: + - fp32 + - fp32 + result: fp32 + - name: power + - name: sqrt + required_options: + on_domain_error: ERROR + - name: exp + - name: cos + - name: sin + - name: tan + - name: cosh + - name: sinh + - name: tanh + - name: acos + - name: asin + - name: atan + - name: acosh + unsupported_kernels: + - args: + - fp32 + result: fp32 + - name: asinh + unsupported_kernels: + - args: + - fp32 + result: fp32 + - name: atanh + - name: atan2 + - name: factorial + - name: abs + required_options: + on_domain_error: ERROR rounding: TIE_TO_EVEN unsupported_kernels: - args: diff --git a/dialects/sqlite.yaml b/dialects/sqlite.yaml index 9d35ca73..c879b5ed 100644 --- a/dialects/sqlite.yaml +++ b/dialects/sqlite.yaml @@ -34,6 +34,31 @@ scalar_functions: required_options: on_division_by_zero: NAN overflow: SILENT + - name: modulus + local_name: "%" + infix: True + required_options: + overflow: SILENT + - name: power + - name: sqrt + required_options: + on_domain_error: NONE + - name: exp + - name: cos + - name: sin + - name: tan + - name: cosh + - name: sinh + - name: tanh + - name: acos + - name: asin + - name: atan + - name: acosh + - name: asinh + - name: atanh + - name: atan2 + - name: factorial + unsupported: True - name: abs required_options: overflow: SILENT diff --git a/dialects/velox_presto.yaml b/dialects/velox_presto.yaml index a790c86e..f9a8aed1 100644 --- a/dialects/velox_presto.yaml +++ b/dialects/velox_presto.yaml @@ -96,6 +96,98 @@ scalar_functions: - fp32 - fp32 result: fp32 + - name: modulus + local_name: mod + required_options: + overflow: ERROR + unsupported_kernels: + - args: + - i8 + - i8 + result: i8 + - args: + - i16 + - i16 + result: i16 + - args: + - i32 + - i32 + result: i32 + - args: + - fp32 + - fp32 + result: fp32 + - name: power + unsupported_kernels: + - args: + - fp32 + - fp32 + result: fp32 + - name: sqrt + required_options: + on_domain_error: ERROR + unsupported_kernels: + - args: + - i64 + result: i64 + - args: + - fp32 + result: fp32 + - name: exp + unsupported_kernels: + - args: + - fp32 + result: fp32 + - name: cos + unsupported_kernels: + - args: + - fp32 + result: fp32 + - name: sin + unsupported_kernels: + - args: + - fp32 + result: fp32 + - name: tan + unsupported_kernels: + - args: + - fp32 + result: fp32 + - name: acos + unsupported_kernels: + - args: + - fp32 + result: fp32 + - name: asin + unsupported_kernels: + - args: + - fp32 + result: fp32 + - name: atan + unsupported_kernels: + - args: + - fp32 + result: fp32 + - name: cosh + unsupported: true + - name: sinh + unsupported: true + - name: tanh + unsupported: true + - name: acosh + unsupported: true + - name: asinh + unsupported: true + - name: atanh + unsupported: true + - name: atan2 + unsupported_kernels: + - args: + - fp32 + - fp32 + result: fp32 + - name: factorial + unsupported: True - name: abs required_options: overflow: ERROR From 497a9be9828217b9795faa9211e9a4c0d5a53649 Mon Sep 17 00:00:00 2001 From: Richard Tia Date: Thu, 10 Aug 2023 11:23:18 -0700 Subject: [PATCH 2/5] fix: missing EOL --- cases/arithmetic/exp.yaml | 2 +- cases/arithmetic/sqrt.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cases/arithmetic/exp.yaml b/cases/arithmetic/exp.yaml index 026774c5..028734e5 100644 --- a/cases/arithmetic/exp.yaml +++ b/cases/arithmetic/exp.yaml @@ -36,4 +36,4 @@ cases: type: fp64 result: value: null - type: fp64 \ No newline at end of file + type: fp64 diff --git a/cases/arithmetic/sqrt.yaml b/cases/arithmetic/sqrt.yaml index d92ce380..e4332b7c 100644 --- a/cases/arithmetic/sqrt.yaml +++ b/cases/arithmetic/sqrt.yaml @@ -68,4 +68,4 @@ cases: type: fp64 result: value: 1.4142138152541635 - type: fp64 \ No newline at end of file + type: fp64 From b4dbd2bca31c4b88e53a06abfdf426b29cd0e08e Mon Sep 17 00:00:00 2001 From: Richard Tia Date: Thu, 10 Aug 2023 15:19:15 -0700 Subject: [PATCH 3/5] fix: add i64 support to velox sqrt --- dialects/velox_presto.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/dialects/velox_presto.yaml b/dialects/velox_presto.yaml index f9a8aed1..9d7ca6ea 100644 --- a/dialects/velox_presto.yaml +++ b/dialects/velox_presto.yaml @@ -127,9 +127,6 @@ scalar_functions: required_options: on_domain_error: ERROR unsupported_kernels: - - args: - - i64 - result: i64 - args: - fp32 result: fp32 From ad0f5550931e225b3e6afee9f434a3de6535f719 Mon Sep 17 00:00:00 2001 From: Richard Tia Date: Thu, 10 Aug 2023 15:38:31 -0700 Subject: [PATCH 4/5] fix: update sqrt for velox --- dialects/velox_presto.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dialects/velox_presto.yaml b/dialects/velox_presto.yaml index 9d7ca6ea..68a079cd 100644 --- a/dialects/velox_presto.yaml +++ b/dialects/velox_presto.yaml @@ -124,9 +124,10 @@ scalar_functions: - fp32 result: fp32 - name: sqrt - required_options: - on_domain_error: ERROR unsupported_kernels: + - args: + - i64 + result: i64 - args: - fp32 result: fp32 From e145abcaa8675fa1fe9cf01ef8c99660ba875949 Mon Sep 17 00:00:00 2001 From: Richard Tia Date: Fri, 11 Aug 2023 10:42:33 -0700 Subject: [PATCH 5/5] fix: add tests for other types in modulus --- cases/arithmetic/modulus.yaml | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/cases/arithmetic/modulus.yaml b/cases/arithmetic/modulus.yaml index 2d4cf6d0..44bbdaf9 100644 --- a/cases/arithmetic/modulus.yaml +++ b/cases/arithmetic/modulus.yaml @@ -15,38 +15,38 @@ cases: args: - value: 10 type: i8 - - value: 3 + - value: -3 type: i8 result: value: 1 type: i8 - group: basic args: - - value: 10 - type: i8 - - value: -3 - type: i8 + - value: 32767 + type: i16 + - value: 1000 + type: i16 result: - value: 1 - type: i8 + value: 767 + type: i16 - group: basic args: - - value: -10 - type: i8 - - value: 3 - type: i8 + - value: -2147483647 + type: i32 + - value: 300000000 + type: i32 result: - value: -1 - type: i8 + value: -47483647 + type: i32 - group: basic args: - - value: -10 - type: i8 - - value: -3 - type: i8 + - value: -9223372036854775800 + type: i64 + - value: -80000000000000 + type: i64 result: - value: -1 - type: i8 + value: -12036854775800 + type: i64 - group: basic args: - value: 5 @@ -68,18 +68,18 @@ cases: - group: basic args: - value: null - type: i8 + type: i64 - value: 1 - type: i8 + type: i64 result: value: null - type: i8 + type: i64 - group: basic args: - value: null - type: i8 + type: i64 - value: null - type: i8 + type: i64 result: value: null - type: i8 \ No newline at end of file + type: i64