From 1d11122a45d4ff8a217dbd029af9fe92907d40d6 Mon Sep 17 00:00:00 2001 From: Victor Barua Date: Thu, 8 Feb 2024 14:00:26 -0800 Subject: [PATCH 1/2] fix: remove functions definitions w/ invalid return types T? and T|? are not valid return types T|? is equivalent to setting the nullability to MIRROR T&? is not currently expressible via nullability BREAKING CHANGE: least_skip_null and greatest_skip_null functions have been removed --- extensions/functions_comparison.yaml | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/extensions/functions_comparison.yaml b/extensions/functions_comparison.yaml index 173a6d1b3..8cf67572a 100644 --- a/extensions/functions_comparison.yaml +++ b/extensions/functions_comparison.yaml @@ -225,18 +225,8 @@ scalar_functions: - value: T variadic: min: 2 - return: T|? - - - name: "least_skip_null" - description: >- - Evaluates each argument and returns the smallest one. The function will return - null only if all arguments evaluate to null. - impls: - - args: - - value: T - variadic: - min: 2 - return: T&? + return: T + nullability: MIRROR - name: "greatest" description: >- @@ -247,15 +237,5 @@ scalar_functions: - value: T variadic: min: 2 - return: T|? - - - name: "greatest_skip_null" - description: >- - Evaluates each argument and returns the largest one. The function will return - null only if all arguments evaluate to null. - impls: - - args: - - value: T - variadic: - min: 2 - return: T&? + return: T + nullability: MIRROR From e18398658f3441cc0fd4f588ad089ad65126712c Mon Sep 17 00:00:00 2001 From: Victor Barua Date: Fri, 9 Feb 2024 15:50:45 -0800 Subject: [PATCH 2/2] fix: update functions definitions w/ invalid return types T? and T|? are not valid return types T|? is equivalent to setting the nullability to MIRROR T&? is not currently expressible via nullability BREAKING CHANGE: least_skip_null and greatest_skip_null functions have updated return types --- extensions/functions_comparison.yaml | 38 +++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/extensions/functions_comparison.yaml b/extensions/functions_comparison.yaml index 8cf67572a..3109db9d6 100644 --- a/extensions/functions_comparison.yaml +++ b/extensions/functions_comparison.yaml @@ -218,8 +218,8 @@ scalar_functions: - name: "least" description: >- - Evaluates each argument and returns the smallest one. The function will return - null if any argument evaluates to null. + Evaluates each argument and returns the smallest one. + The function will return null if any argument evaluates to null. impls: - args: - value: T @@ -227,15 +227,45 @@ scalar_functions: min: 2 return: T nullability: MIRROR + - + name: "least_skip_null" + description: >- + Evaluates each argument and returns the smallest one. + The function will return null only if all arguments evaluate to null. + impls: + - args: + - value: T + variadic: + min: 2 + return: T + # NOTE: The return type nullability as described above cannot be expressed currently + # See https://github.com/substrait-io/substrait/issues/601 + # Using MIRROR for now until it can be expressed + nullability: MIRROR - name: "greatest" description: >- - Evaluates each argument and returns the largest one. The function will return - null if any argument evaluates to null. + Evaluates each argument and returns the largest one. + The function will return null if any argument evaluates to null. + impls: + - args: + - value: T + variadic: + min: 2 + return: T + nullability: MIRROR + - + name: "greatest_skip_null" + description: >- + Evaluates each argument and returns the largest one. + The function will return null only if all arguments evaluate to null. impls: - args: - value: T variadic: min: 2 return: T + # NOTE: The return type nullability as described above cannot be expressed currently + # See https://github.com/substrait-io/substrait/issues/601 + # Using MIRROR for now until it can be expressed nullability: MIRROR