diff --git a/src/substrait/__init__.py b/src/substrait/__init__.py index 9536065..50a5bf4 100644 --- a/src/substrait/__init__.py +++ b/src/substrait/__init__.py @@ -3,6 +3,6 @@ except ImportError: pass -__substrait_version__ = "0.45.0" -__substrait_hash__ = "5425ba3" +__substrait_version__ = "0.46.0" +__substrait_hash__ = "1a51b3d" __minimum_substrait_version__ = "0.30.0" diff --git a/src/substrait/extensions/functions_arithmetic.yaml b/src/substrait/extensions/functions_arithmetic.yaml index fbfc1f7..cc520c5 100644 --- a/src/substrait/extensions/functions_arithmetic.yaml +++ b/src/substrait/extensions/functions_arithmetic.yaml @@ -177,9 +177,11 @@ scalar_functions: name: "divide" description: > Divide x by y. In the case of integer division, partial values are truncated (i.e. rounded towards 0). - The `on_division_by_zero` option governs behavior in cases where y is 0 and x is not 0. - `LIMIT` means positive or negative infinity (depending on the sign of x and y). - If x and y are both 0 or both +/-infinity, behavior will be governed by `on_domain_error`. + The `on_division_by_zero` option governs behavior in cases where y is 0. If the option is IEEE then + the IEEE754 standard is followed: all values except +/-infinity return NaN and +/-infinity are unchanged. + If the option is LIMIT then the result is +/-infinity in all cases. + If either x or y are NaN then behavior will be governed by `on_domain_error`. + If x and y are both +/-infinity, behavior will be governed by `on_domain_error`. impls: - args: - name: x @@ -189,6 +191,10 @@ scalar_functions: options: overflow: values: [ SILENT, SATURATE, ERROR ] + on_domain_error: + values: [ "NULL", ERROR ] + on_division_by_zero: + values: [ "NULL", ERROR ] return: i8 - args: - name: x @@ -198,6 +204,10 @@ scalar_functions: options: overflow: values: [ SILENT, SATURATE, ERROR ] + on_domain_error: + values: [ "NULL", ERROR ] + on_division_by_zero: + values: [ "NULL", ERROR ] return: i16 - args: - name: x @@ -207,6 +217,10 @@ scalar_functions: options: overflow: values: [ SILENT, SATURATE, ERROR ] + on_domain_error: + values: [ "NULL", ERROR ] + on_division_by_zero: + values: [ "NULL", ERROR ] return: i32 - args: - name: x @@ -216,6 +230,10 @@ scalar_functions: options: overflow: values: [ SILENT, SATURATE, ERROR ] + on_domain_error: + values: [ "NULL", ERROR ] + on_division_by_zero: + values: [ "NULL", ERROR ] return: i64 - args: - name: x @@ -226,9 +244,9 @@ scalar_functions: rounding: values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] on_domain_error: - values: [ NAN, ERROR ] + values: [ NAN, "NULL", ERROR ] on_division_by_zero: - values: [ LIMIT, NAN, ERROR ] + values: [ IEEE, LIMIT, "NULL", ERROR ] return: fp32 - args: - name: x @@ -239,9 +257,9 @@ scalar_functions: rounding: values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] on_domain_error: - values: [ NAN, ERROR ] + values: [ NAN, "NULL", ERROR ] on_division_by_zero: - values: [ LIMIT, NAN, ERROR ] + values: [ IEEE, LIMIT, "NULL", ERROR ] return: fp64 - name: "negate" @@ -448,7 +466,7 @@ scalar_functions: options: rounding: values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] - return: fp64 + return: fp32 - args: - name: x value: fp64 @@ -466,7 +484,7 @@ scalar_functions: options: rounding: values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] - return: fp64 + return: fp32 - args: - name: x value: fp64 @@ -484,7 +502,7 @@ scalar_functions: options: rounding: values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] - return: fp64 + return: fp32 - args: - name: x value: fp64 @@ -558,7 +576,7 @@ scalar_functions: values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] on_domain_error: values: [ NAN, ERROR ] - return: fp64 + return: fp32 - args: - name: x value: fp64 @@ -580,7 +598,7 @@ scalar_functions: values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] on_domain_error: values: [ NAN, ERROR ] - return: fp64 + return: fp32 - args: - name: x value: fp64 @@ -600,7 +618,7 @@ scalar_functions: options: rounding: values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] - return: fp64 + return: fp32 - args: - name: x value: fp64 @@ -684,7 +702,7 @@ scalar_functions: values: [ TIE_TO_EVEN, TIE_AWAY_FROM_ZERO, TRUNCATE, CEILING, FLOOR ] on_domain_error: values: [ NAN, ERROR ] - return: fp64 + return: fp32 - args: - name: x value: fp64 diff --git a/third_party/substrait b/third_party/substrait index 5425ba3..1a51b3d 160000 --- a/third_party/substrait +++ b/third_party/substrait @@ -1 +1 @@ -Subproject commit 5425ba3a4618d0c83cbef94086bd96e97a708dcc +Subproject commit 1a51b3d49ba8323134314ef94acf49c910ff520d