ryanvickr opened a new pull request, #55689:
URL: https://github.com/apache/arrow/pull/55689

   ### Rationale for this change
   
   When dictionary encoding is enabled, `WriterProperties::Builder::encoding` 
rejects dictionary encodings as fallback encodings, yet the column writer 
ignores the configured encoding and always falls back to `PLAIN` when the 
dictionary overflows or Arrow dictionary chunks differ. Incompatible 
encoding/type combinations on dictionary-enabled columns also go unnoticed 
until fallback happens at runtime.
   
   ### What changes are included in this PR?
   
   - Preserve the configured non-dictionary encoding when dictionary encoding 
is enabled and use it instead of `PLAIN` on dictionary fallback.
   - Construct non-`PLAIN` fallback encoders upfront on writer creation so 
incompatible encodings fail immediately rather than mid-write.
   - Update the `WriterProperties::Builder::encoding` docstrings to match.
   
   ### Are these changes tested?
   
   Yes, added unit tests for dictionary fallback with non-`PLAIN` encodings 
(V1/V2 pages, spaced/unspaced writes, and Arrow dictionary arrays) and for 
upfront rejection of incompatible encodings.
   
   ### Are there any user-facing changes?
   
   Yes. Columns with both dictionary encoding enabled and an explicit encoding 
set now fall back to that encoding instead of `PLAIN`, and incompatible 
fallback encodings now fail on writer creation.
   
   ### Was AI used for this PR?
   
   In accordance to the [AI generation 
guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code),
 please disclose below whether and how AI was used in this PR.
   
   Used AI to help draft unit tests and check edge cases.
   
   **PR code and description written by:**
   
   - [x] Human
   - [x] AI
   
   **Reviewed before submission by:**
   
   - [x] Human
   - [ ] AI
   - [ ] Not reviewed
   
   * GitHub Issue: #55571


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