neilconway opened a new issue, #24152:
URL: https://github.com/apache/datafusion/issues/24152
### Describe the bug
How `regexp_count` handles NULL is inconsistent with PostgreSQL; it is also
not self-consistent:
| Query | DataFusion | PostgreSQL |
|---|---|---|
| `regexp_count(NULL, 'a')` | 0 | NULL |
| `regexp_count('a', NULL)` | 0 | NULL |
| `regexp_count('abc', 'b', NULL)` | error: `regexp_count() requires start
to be 1 based` | NULL |
| `regexp_count(v, 'b', s)` with rows `('abc', 1)`, `('abcb', NULL)` | `1`,
`2` — NULL start treated as 1 | `1`, `NULL` |
| `regexp_count('abc', 'b', 1, NULL)` | 1 — NULL flags treated as absent |
NULL |
### To Reproduce
_No response_
### Expected behavior
Match what Postgres does.
### Additional context
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]