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

   ### Rationale for this change
   
   Follow-up to #50475, suggested in review there. An unsigned dictionary index 
widened on the signed thresholds because the dictionary builder reuses the 
signed AdaptiveIntBuilder, so a uint8 index only held 128 distinct values 
before widening.
   
   ### What changes are included in this PR?
   
   AdaptiveIntBuilder gets an opt-in `use_unsigned_range` mode: width detection 
and lane writes go through the existing unsigned helpers (DetectUIntWidth, 
DowncastUInts) and the reported type is unsigned. The dictionary builder passes 
its flag into the indices builder, and the MaybeUnsignedIndexType mapping from 
#50475 is removed since every path now reports the index type natively.
   
   ### Are these changes tested?
   
   Yes. 256 distinct values keep a uint8 index with the indices round-tripping 
intact, the 257th widens to uint16, and the signed thresholds are unchanged; 
the FinishDelta path is covered separately, and the python width test asserts 
the new thresholds.
   
   ### Are there any user-facing changes?
   
   An unsigned dictionary index now widens on the unsigned thresholds (a uint8 
index at 257 distinct values rather than 129).
   


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