Skip to content

Commit

Permalink
fix: update functions definitions w/ invalid return types
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vbarua committed Feb 9, 2024
1 parent 1d11122 commit e183986
Showing 1 changed file with 34 additions and 4 deletions.
38 changes: 34 additions & 4 deletions extensions/functions_comparison.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,24 +218,54 @@ 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
variadic:
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

0 comments on commit e183986

Please sign in to comment.