You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "raminqaf (via GitHub)" <gi...@apache.org> on 2026/06/02 08:41:13 UTC
[PR] [FLINK-39821][table] Make REGEXP_REPLACE return type nullable [flink]
raminqaf opened a new pull request, #28293:
URL: https://github.com/apache/flink/pull/28293
## What is the purpose of the change
`REGEXP_REPLACE` declared its output via `nullableIfArgs`, so the planner inferred a `NOT NULL` result when all three arguments were `NOT NULL`. But the runtime returns `null` for a
non-literal regex that fails to compile: a column reference or a `CONCAT(...)` result is only validated at runtime, not at planning time. That let a `null` flow through a column the
planner believed was non-null, which is unsound.
This is a sub-task of the FLINK-39648 umbrella.
## Brief change log
- Change `BuiltInFunctionDefinitions.REGEXP_REPLACE` output type strategy from `nullableIfArgs(explicit(STRING()))` to `explicit(DataTypes.STRING().nullable())`, matching
`REGEXP_EXTRACT`, which is always-nullable for the same reason. (`REGEXP` keeps `nullableIfArgs` because it returns `false`, not `null`, on an invalid pattern.)
## Verifying this change
This change added a test and can be verified as follows:
- New `RegexpFunctionsITCase` case with `NOT NULL` arguments and a non-literal invalid regex, asserting the output type stays nullable and the value is `null`.
- Existing `RegexpFunctionsITCase`, `ScalarFunctionsTest`, `SqlExpressionTest`, `MultiJoinTest` (plan digests unchanged), and `ExpressionSerializationTest` regress the function.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
---
##### Was generative AI tooling used to co-author this PR?
- [x] Yes (please specify the tool below)
Generated-by: Opus 4.8
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39821][table] Make REGEXP_REPLACE return type nullable [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #28293:
URL: https://github.com/apache/flink/pull/28293#issuecomment-4600496661
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "2a2b3282013169546e9eeaecfcbe745754d8ce8b",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "2a2b3282013169546e9eeaecfcbe745754d8ce8b",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 2a2b3282013169546e9eeaecfcbe745754d8ce8b UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39821][table] Make REGEXP_REPLACE return type nullable [flink]
Posted by "fhueske (via GitHub)" <gi...@apache.org>.
fhueske merged PR #28293:
URL: https://github.com/apache/flink/pull/28293
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org