rdblue commented on code in PR #18604:
URL: https://github.com/apache/iceberg/pull/18604#discussion_r4461921050
##########
core/src/main/java/org/apache/iceberg/StatsUtil.java:
##########
@@ -325,4 +336,194 @@ private static boolean isScalar(Schema schema,
Map<Integer, Integer> parentIndex
return true;
}
+
+ /**
+ * Lower and upper bounds for source values in a partition from an
order-preserving transform.
+ *
+ * <p>Every source value that transforms to the partition is >= lower and <=
upper. Upper is null
+ * when unbounded. Both bounds are inclusive.
+ *
+ * <p>For most transforms, lower and upper are the values in the partition.
Exceptions:
+ *
+ * <ul>
+ * <li>For string and binary truncate, upper is the next prefix when it
exists, so upper can
+ * truncate to the next partition. That still covers every value that
truncates to the
+ * partition.
+ * <li>For time transforms, lower starts one unit earlier when the
partition value is <= 1970 to
+ * handle older writers that rounded pre-1970 values toward zero.
Review Comment:
Would be nice to link to the issue or PR. I'm familiar with the problem that
was fixed and I'm not quite sure what "older writers rounded pre-1970 values
toward 0" quite means. It wasn't rounding, it was a correctness bug in the
calculation.
--
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]