SEPURI-SAI-KRISHNA opened a new pull request, #29510:
URL: https://github.com/apache/flink/pull/29510
## What is the purpose of the change
`table.exec.sink.nested-constraint-enforcer` was not listed in the sink's
`@ExecNodeMetadata.consumedOptions`, so `COMPILE PLAN` never recorded it in
the plan JSON.
`ExecNodeConfig.get` falls back to the ambient session config for anything
the plan does not
pin, so `EXECUTE PLAN` used whatever the executing session happened to have.
The option is not cosmetic. `ConstraintEnforcerExecutor.create` returns
`Optional.empty()` when
there are no constraints, and `CommonExecSink.applyConstraintValidations`
then skips the
transformation entirely. So the same plan file produced two different
topologies:
```
ambient ROWS -> Sink, ConstraintEnforcer, Source
ambient IGNORE -> Sink, Source
```
Its two siblings read in the same place, `table.exec.sink.not-null-enforcer`
and
`table.exec.sink.type-length-enforcer`, were already pinned.
## Brief change log
- `StreamExecSink`: add the key to the **version 2** annotation
- `BatchExecSink`: add the key to its annotation
- `TableSinkRestoreTest` / `TableSinkBatchRestoreTest`: assert the full
`consumedOptions` set
- 35 plan golden files: one added line each
Version 1 of the stream sink is deliberately untouched. It describes the
1.15 plan format, which
predates the option, and `ExecNodeContext.newContext` always resolves
`latestAnnotation()`, so v1
is unreachable for newly compiled plans. No golden file that changed
contains a `stream-exec-sink_1`
node, which confirms this.
No ExecNode version bump: this only adds a key to the persisted config,
following the same shape
as `228de51fb23`.
## Verifying this change
Test shape follows `228de51fb23`, the existing precedent for adding a
`consumedOptions` key: a
`ExecNodeMetadataUtil.consumedOptions` assertion in the node's own restore
test, for stream and
batch.
Both new tests were confirmed to fail without the source change, naming the
missing key, while
the other 40 tests in those classes still passed.
- 16 affected suites: 227 tests, 0 failures
- All restore suites: 513 tests, 0 failures, 43 skips (all
`generateTestSetupFiles`, disabled by default)
- `spotless:check` and `checkstyle:check` clean
The whole golden diff is one line per file:
```
+ "table.exec.sink.nested-constraint-enforcer" : "IGNORE",
```
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): **no**
- The public API: **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**
Newly compiled plans gain one entry in the sink's `configuration` block.
Plans compiled by earlier
versions do not contain the key and keep falling back to the session value,
so existing jobs
restore and behave exactly as before.
## 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: Claude Code (Opus 5)
--
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]