raminqaf opened a new pull request, #29787:
URL: https://github.com/apache/flink/pull/29787
## What is the purpose of the change
Backport of #29785 to release-2.4. `v[i]` on an array VARIANT accepts a
BIGINT index, but the generated code cast it to `int` before the lookup, so an
index outside the INT range wrapped modulo 2^32 onto an existing element. With
`v = [1]` and a BIGINT column `i`:
| `i` | Before | After |
|---------------|--------|--------|
| `4294967297` | `1` | `NULL` |
| `-4294967295` | `1` | `NULL` |
## Brief change log
- Cherry-pick of e4d2b06ff33, applied without conflicts
## Verifying this change
`VariantSemanticTest` (25 tests) passes on this branch, including the new
`VARIANT_ARRAY_ACCESS_WITH_INDEX_OUTSIDE_INT_RANGE`.
## 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): yes, two
comparisons per VARIANT array access with a BIGINT index, as in #29785. Other
index types are unchanged.
- 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.318 (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]