edgarRd commented on a change in pull request #1339:
URL: https://github.com/apache/iceberg/pull/1339#discussion_r473495404
##########
File path: orc/src/main/java/org/apache/iceberg/orc/OrcMetrics.java
##########
@@ -203,7 +227,29 @@ private static Metrics buildOrcMetrics(final long
numOfRows, final TypeDescripti
BooleanColumnStatistics booleanStats = (BooleanColumnStatistics)
columnStats;
max = booleanStats.getTrueCount() > 0;
}
- return Optional.ofNullable(Conversions.toByteBuffer(column.type(), max));
+ return Optional.ofNullable(Conversions.toByteBuffer(type,
truncateIfNeeded(Bound.UPPER, type, max, metricsMode)));
+ }
+
+ private static Object truncateIfNeeded(Bound bound, Type type, Object value,
MetricsMode metricsMode) {
+ // ORC only stores min/max for String columns
+ if (value == null || metricsMode == MetricsModes.Full.get() ||
type.typeId() != Type.TypeID.STRING) {
Review comment:
Done.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]