xiangfu0 commented on code in PR #19999:
URL: https://github.com/apache/pinot/pull/19999#discussion_r4343867786
##########
pinot-plugins/pinot-input-format/pinot-parquet/src/main/java/org/apache/pinot/plugin/inputformat/parquet/ParquetNativeRecordExtractor.java:
##########
@@ -139,6 +140,12 @@ private Object extractValue(Group from, int fieldIndex,
Type fieldType, int inde
// `TIME_MILLIS` (int32 millis-since-midnight) → [LocalTime], or
raw ms when configured.
return _extractRawTimeValues ? intValue :
LocalTime.ofNanoOfDay(intValue * 1_000_000L);
}
+ if (logicalTypeAnnotation instanceof
LogicalTypeAnnotation.IntLogicalTypeAnnotation intLogicalTypeAnnotation
+ && intLogicalTypeAnnotation.getBitWidth() == 32 &&
!intLogicalTypeAnnotation.isSigned()) {
+ // Unsigned 32-bit values are stored as the signed int bit
pattern; widen to `Long` so values above
+ // `Integer.MAX_VALUE` are not read as negatives.
+ return Integer.toUnsignedLong(intValue);
Review Comment:
This is correct: placing the unsigned check after the DECIMAL/DATE/TIME
branches means it only fires for a plain unsigned `int`, and
`Integer.toUnsignedLong` maps the bit pattern to the right `[0, 2^32-1]` value.
The nested list/struct test exercises this path well.
--
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]