uros-b opened a new pull request, #58228:
URL: https://github.com/apache/spark/pull/58228

   ### What changes were proposed in this pull request?
   
   Each columnar decompressor repeats the same two-line idiom to build the 
"nulls buffer" it reads null-tracking state from:
   
   ```scala
   val nullsBuffer = buffer.duplicate().order(ByteOrder.nativeOrder())
   nullsBuffer.rewind()
   ```
   
   This extracts a `protected def createNullsBuffer(buffer: ByteBuffer)` on the 
shared `Decoder` trait and routes the six call sites through it (`PassThrough`, 
`RunLengthEncoding`, `DictionaryEncoding`, `BooleanBitSet`, `IntDelta`, 
`LongDelta`). The subsequent `nullCount` / `nextNullIndex` reads stay inline, 
since the `nextNullIndex` sentinel legitimately differs (`-1`, and `capacity` 
for `PassThrough`).
   
   ### Why are the changes needed?
   
   The idiom was duplicated across all six decoders. Naming it once removes the 
duplication and gives a single home for the "duplicate, set native order, 
rewind" convention. It also normalizes the `LongDelta` site, which called 
`rewind` without parentheses.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Existing columnar compression tests. `createNullsBuffer` returns exactly the 
previously-inlined expression, so decompression behavior is unchanged.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8)
   


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