gengliangwang commented on PR #55941:
URL: https://github.com/apache/spark/pull/55941#issuecomment-4482621740

   Addressed in 7ac5494baaf, thanks @viirya:
   
   - Renamed `elementAtIndexExact` → `resolveArrayIndex`. The action verb 
("resolve a 1-based index → 0-based position") reads more naturally than 
`Exact`, and the throws-on-bad-input contract is documented in the helper's 
javadoc.
   - Added a Scala-side comment in `collectionOperations.scala` explaining the 
two `case _: ArrayType` clauses are split by `failOnError` (order matters; 
guarded case first).
   - Restructured the ANSI-branch codegen so the unnecessary `{ … }` block 
scope disappears when `arrayElementNullable` is false. The null check now wraps 
the assignment directly:
   ```
   int idx = ElementAtUtils.resolveArrayIndex(...);
   if (arr.isNullAt(idx)) {
     isNull = true;
   } else {
     ev.value = arr.getX(idx);
   }
   ```
   or just `ev.value = arr.getX(idx);` when the element type is non-nullable.
   
   PTAL.


-- 
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]

Reply via email to