Repository navigation
Commit 30ca39b
authored
## Which issue does this PR close?
- Closes apache#24152
## Rationale for this change
`regexp_count` and `regexp_instr` should follow the behavior of these
functions in PostgreSQL and return NULL when any of their arguments is
NULL. The previous behavior was inconsistent: `regexp_instr` returned
NULL for a NULL string or pattern, but otherwise NULLs were treated as a
default value, returned a match count of 0, or raised an error,
depending on the context.
## What changes are included in this PR?
* Make NULL handling of `regexp_count` and `regexp_instr` consistent and
match PostgreSQL
* Update SLTs or add new SLTs / unit tests as necessary
## Are these changes tested?
Yes, new tests added and/or existing tests updated when necessary.
## Are there any user-facing changes?
Yes: the behavior of these UDFs has changed when called with NULL
arguments.
1 parent fc4e43e commit 30ca39b
4 files changed
Lines changed: 457 additions & 170 deletions
File tree
- datafusion
- functions/src/regex
- sqllogictest/test_files/regexp
0 commit comments