-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[parquet] Use MICROS annotation for TIMESTAMP(n<=3) columns (Iceberg v2 compatibility) #8230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
25c0f5c
7142932
f9315e0
fb82382
5bc2d62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -299,11 +299,7 @@ private static Comparable<?> toParquetObject( | |
| } else if (value instanceof Timestamp) { | ||
| Timestamp timestamp = (Timestamp) value; | ||
| int precision = getTimestampPrecision(type); | ||
| if (precision <= 3) { | ||
| // milliseconds | ||
| return timestamp.getMillisecond(); | ||
| } else if (precision <= 6) { | ||
| // microseconds | ||
| if (precision <= 6) { | ||
| return timestamp.toMicros(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] This makes Parquet predicate pushdown use epoch micros for every |
||
| } | ||
| // precision > 6 uses INT96, not supported | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] The stats extractor also needs to decode based on the Parquet file annotation, not only the Paimon field precision. Old Paimon files with
TIMESTAMP(0..3)haveTIMESTAMP_MILLISfooter stats, so reading them withfromMicrosturns their min/max into values about 1000x too small. This affects any path that re-extracts stats from existing Parquet files, such as migration/metadata rebuild workflows. Sincestats.type()carries the primitive logical annotation, can we branch on itsTimeUnithere the same way the vector reader does?