Skip to content

Commit

Permalink
feat: clarify behavior of is_null, is_not_null, is_nan, is_finite, an…
Browse files Browse the repository at this point in the history
…d is_infinite for nulls (#285)

 - is_null and is_not_null are now explicitly unaffected by floating point NaN or infinity
 - is_nan, is_finite, and is_infinite now return null if the input is null

BREAKING CHANGE: nullability behavior of is_nan, is_finite, and is_infinite has changed
  • Loading branch information
thisisnic authored Sep 2, 2022
1 parent 7697d39 commit cb25124
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions extensions/functions_comparison.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,53 +77,55 @@ scalar_functions:
return: BOOLEAN
-
name: "is_null"
description: Whether a value is null.
description: Whether a value is null. NaN is not null.
impls:
- args:
- value: any1
return: BOOLEAN
nullability: DECLARED_OUTPUT
-
name: "is_not_null"
description: Whether a value is not null.
description: Whether a value is not null. NaN is not null.
impls:
- args:
- value: any1
return: BOOLEAN
nullability: DECLARED_OUTPUT
-
name: "is_nan"
description: Whether a value is not a number.
description: Whether a value is not a number. If input is null, output will be null.
impls:
- args:
- value: fp32
nullability: MIRROR
return: BOOLEAN
- args:
- value: fp64
nullability: MIRROR
return: BOOLEAN
-
name: "is_finite"
description: Whether a value is finite (neither infinite nor NaN).
description: Whether a value is finite (neither infinite nor NaN). If input is null, output will be null.
impls:
- args:
- value: fp32
nullability: DECLARED_OUTPUT
nullability: MIRROR
return: BOOLEAN
- args:
- value: fp64
nullability: DECLARED_OUTPUT
nullability: MIRROR
return: BOOLEAN
-
name: "is_infinite"
description: Whether a value is infinite.
description: Whether a value is infinite. If input is null, output will be null.
impls:
- args:
- value: fp32
nullability: DECLARED_OUTPUT
nullability: MIRROR
return: BOOLEAN
- args:
- value: fp64
nullability: DECLARED_OUTPUT
nullability: MIRROR
return: BOOLEAN
-
name: "nullif"
Expand Down

0 comments on commit cb25124

Please sign in to comment.