arnabnandy7 opened a new pull request, #3718:
URL: https://github.com/apache/parquet-java/pull/3718

   ### Rationale for this change
   
   Dictionary-encoded data pages may contain an ID that exceeds the valid range 
of the associated dictionary. Currently, this causes an 
`ArrayIndexOutOfBoundsException` when the dictionary implementation accesses 
its backing array, obscuring the actual data corruption.
   
   ### What changes are included in this PR?
   
   - Validate decoded dictionary IDs against the dictionary's maximum ID.
   - Throw a descriptive `ParquetDecodingException` when an ID is outside the 
valid range.
   - Apply validation to typed value reads and `readValueDictionaryId()`.
   - Add a regression test covering an out-of-range dictionary ID.
   
   ### Are these changes tested?
   
   Yes. A unit test constructs a dictionary-encoded page containing an 
out-of-range ID and verifies that reading it throws a descriptive 
`ParquetDecodingException`.
   
   ```shell
   ./mvnw -pl parquet-column -Dtest=TestDictionary test
   ```
   
   ### Are there any user-facing changes?
   
   Yes. Corrupt dictionary-encoded data now produces a descriptive 
`ParquetDecodingException` instead of exposing an internal 
`ArrayIndexOutOfBoundsException`. Valid Parquet files are unaffected.
   
   Closes #3715
   


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