RussellSpitzer commented on a change in pull request #3760:
URL: https://github.com/apache/iceberg/pull/3760#discussion_r788035308
##########
File path: parquet/src/main/java/org/apache/iceberg/parquet/ParquetUtil.java
##########
@@ -287,11 +287,19 @@ private static void increment(Map<Integer, Long> columns,
int fieldId, long amou
int truncateLength = truncateMode.length();
switch (type.typeId()) {
case STRING:
- upperBounds.put(id,
UnicodeUtil.truncateStringMax((Literal<CharSequence>) max, truncateLength));
+ Literal<CharSequence> truncatedMaxString =
UnicodeUtil.truncateStringMax((Literal<CharSequence>) max,
+ truncateLength);
+ if (truncatedMaxString != null) {
+ upperBounds.put(id, truncatedMaxString);
+ }
break;
case FIXED:
case BINARY:
- upperBounds.put(id,
BinaryUtil.truncateBinaryMax((Literal<ByteBuffer>) max, truncateLength));
+ Literal<ByteBuffer> truncatedMaxBinary =
BinaryUtil.truncateBinaryMax((Literal<ByteBuffer>) max,
Review comment:
Do we need a test for this? Looks like we only got the unicode test?
--
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]