raminqaf opened a new pull request, #30219:
URL: https://github.com/apache/flink/pull/30219
## What is the purpose of the change
Backport of #29882 to release-2.4. Reading an element that doesn't exist,
such as `ARRAY[10,20,30][4]`, returns `-1` instead of NULL when the element
type is NOT NULL, and `IS NULL` on it returns FALSE. Merging this before 2.4.0
keeps the bug out of the release.
#29882 versions ITEM, ELEMENT and DOT, so that plans compiled before keep
returning `-1`. The versioning comes from FLINK-41530, which is only on master,
so this PR backports #30019 and #30093 as well. Without them, a plan compiled
with 2.3 would return NULL after a restore on 2.4.
## Brief change log
- Cherry-pick of 0b13973766f from #30019, applied without conflicts
- Cherry-pick of 51b8fb2dcaa from #30093, applied without conflicts
- Cherry-pick of baa408c46db from #29882, applied without conflicts, with
two changes:
- The plans and savepoints of the restore programs `calc-item-v1` and
`calc-element-v1` are generated again on this branch, after the FLINK-41530
commits and before the fix. The ones from master record Flink version 2.5. The
new plans record 2.4 and contain `$ITEM$1` and `$ELEMENT$1`.
- `DynamicTableSourceSpecSerdeTest` imports `java.util.List`, which
master got from b70989e0c0e.
## Verifying this change
879 planner tests pass on this branch. They include `RexNodeJsonSerdeTest`,
`BuiltInSqlOperatorTest` and `BuiltInSqlFunctionTest` from FLINK-41530, and
`FieldAccessFromTableITCase`, `CollectionFunctionsITCase` and
`DynamicTableSourceSpecSerdeTest` from #29882. `CalcRestoreTest` restores the
new `calc-item-v1` and `calc-element-v1` plans, and a missing element still
returns `-1`.
## 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 (only the JavaDoc of `SupportsFilterPushDown` changes,
from #30093)
- The serializers: no
- The runtime per-record code paths (performance sensitive): yes. The
generated code now checks the null flag when it writes these results, one
branch per field.
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: 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: Claude Code 2.1.333 (Claude Opus 5.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]