vrjdev opened a new pull request, #58636:
URL: https://github.com/apache/spark/pull/58636
### What changes were proposed in this pull request?
Adds `ProjectingInternalRowSuite`, a new test suite for
`org.apache.spark.sql.catalyst.ProjectingInternalRow`, which previously had
no dedicated tests. Covers:
1. Every accessor (`getBoolean` through `getVariant`, plus
`getStruct`/`getArray`/`getMap`/`get`, and `isNullAt`) reading through a
non-identity `colOrdinals` permutation to the correct source column.
2. `project()` allowing one instance to be reused across different
underlying rows (including differently-shaped rows) without leaking
stale state from a previous projection.
### Why are the changes needed?
`ProjectingInternalRow` backs the DSv2 row-level write path
(`ReplaceDataProjections`/`WriteDeltaProjections`, used by
`MERGE`/`UPDATE`/`DELETE` on V2 tables) via ~18 near-identical one-line
accessor delegations - exactly the shape of code where a copy-paste slip
(wrong source ordinal, or delegating to a similarly-named sibling accessor
such as the NTZ/LTZ timestamp nanos pair) would silently return the wrong
value during a write rather than fail loudly. No existing test would catch
that.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
New unit tests only (`ProjectingInternalRowSuite`). Ran via
`build/sbt 'catalyst/testOnly
org.apache.spark.sql.catalyst.ProjectingInternalRowSuite'`:
2/2 passed.
### Was this patch authored or co-authored using generative AI tooling?
Yes. Generated-by: Claude Code (claude-sonnet-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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]