0dunay0 commented on code in PR #10601:
URL: https://github.com/apache/paimon/pull/10601#discussion_r4379266989
##########
paimon-format/src/main/java/org/apache/parquet/filter2/predicate/ParquetFilters.java:
##########
@@ -390,17 +428,17 @@ private Comparable<?> toParquetObject(Object value,
FieldRef fieldRef) {
if (value instanceof Timestamp) {
Timestamp timestamp = (Timestamp) value;
- timestampColumn(fieldRef, fileSchema, caseSensitive);
- int precision = getTimestampPrecision(type);
- if (precision <= 3) {
- // milliseconds
- return timestamp.getMillisecond();
- } else if (precision <= 6) {
- // microseconds
- return timestamp.toMicros();
+ switch (timestampUnit(
+ fieldRef, timestampColumn(fieldRef, fileSchema,
caseSensitive))) {
+ case MILLIS:
+ return timestamp.getMillisecond();
+ case MICROS:
+ return getTimestampPrecision(type) <= 3
+ ? firstMicroOfMilli(timestamp)
Review Comment:
Fixed. `<` with a fractional literal now becomes `<= lastMicroOfMilli`, so a
stored value up to `...123999` is kept.
--
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]