wgtmac opened a new pull request, #2618:
URL: https://github.com/apache/orc/pull/2618

   ### What changes were proposed in this pull request?
   
   This PR adds validation for C++ union tag values before they are used as 
child indexes.
   
   The change covers:
   - UnionColumnReader::skip
   - UnionColumnReader::nextInternal
   - UnionColumnPrinter::printRow
   
   If a malformed ORC file contains a union tag that is greater than or equal 
to the number of union children, the C++ reader/printer now throws ParseError 
instead of indexing out of bounds.
   
   ### Why are the changes needed?
   
   Union tags are decoded from the ORC data stream as byte values, but the 
valid range depends on the number of union children. Malformed input can 
contain a tag outside that range. The C++ reader previously trusted the tag 
value directly when indexing per-child state.
   
   This patch makes malformed union tags fail cleanly.
   
   ### How was this patch tested?
   
   Added C++ unit tests for a two-child union with invalid tag value 200, 
covering:
   - next
   - next with nulls
   - skip
   - ColumnPrinter
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: OpenAI Codex GPT-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]

Reply via email to