Skip to content

Commit

Permalink
feat: add ignore nulls options to concat function (#605)
Browse files Browse the repository at this point in the history
This PR adds an `null_handling ` option to the concat function.

Some engines have two versions of the concat function. Where one ignores
null arguments.

example:
Postgres has the `||` operator which doesn't ignore nulls and `concat`
which does ignore nulls


https://www.postgresqltutorial.com/postgresql-string-functions/postgresql-concat-function/
  • Loading branch information
richtia authored Feb 26, 2024
1 parent 5e1948e commit 55db05b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion extensions/functions_string.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,30 @@
scalar_functions:
-
name: concat
description: Concatenate strings.
description: >-
Concatenate strings.
The `null_handling` option determines whether or not null values will be recognized by the function.
If `null_handling` is set to `IGNORE_NULLS`, null value arguments will be ignored when strings are concatenated.
If set to `ACCEPT_NULLS`, the result will be null if any argument passed to the concat function is null.
impls:
- args:
- value: "varchar<L1>"
name: "input"
variadic:
min: 1
options:
null_handling:
values: [ IGNORE_NULLS, ACCEPT_NULLS ]
return: "varchar<L1>"
- args:
- value: "string"
name: "input"
variadic:
min: 1
options:
null_handling:
values: [ IGNORE_NULLS, ACCEPT_NULLS ]
return: "string"
-
name: like
Expand Down

0 comments on commit 55db05b

Please sign in to comment.