Skip to content

Implement Parquet GH-583 INT96 timestamp ColumnOrder - #10106

Merged
etseidl merged 63 commits into
apache:mainfrom
etseidl:int96_order
Aug 4, 2026
Merged

Implement Parquet GH-583 INT96 timestamp ColumnOrder#10106
etseidl merged 63 commits into
apache:mainfrom
etseidl:int96_order

Conversation

@etseidl

@etseidl etseidl commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Spark continues to use INT96 timestamps, despite INT96 being marked as deprecated in 2018. Query engines want valid statistics to allow reliably pruning on INT96 columns. apache/parquet-format#584 adds a new ColumnOrder variant which can be used to signal compliance with the only known use of INT96 (4-byte julian day from epoch, 8-byte nanosecond).

What changes are included in this PR?

Adds support for the new enum variant, and writes the appropriate value in the FileMetaData.column_orders field.

This builds on changes introduced in #7687.

Are these changes tested?

Yes

Are there any user-facing changes?

Yes, this adds a new variant to public enums (ColumnOrder::INT96_TIMESTAMP_ORDER, SortOrder::INT96_TIMESTAMP).

@etseidl etseidl changed the title [PoC] Implement Parquet GH-583 INT96 timestamp ColumnOrder Implement Parquet GH-583 INT96 timestamp ColumnOrder Jul 28, 2026
@etseidl
etseidl marked this pull request as ready for review August 3, 2026 17:48
@alamb

alamb commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🚀 please let me know when this is ready for a review @etseidl

@etseidl

etseidl commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

🚀 please let me know when this is ready for a review @etseidl

Now would be fine 😄. Or wait until #10104 merges (this PR includes those changes). Thanks! 🙏

@alamb alamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me -- thanks @etseidl

Comment thread parquet/src/basic.rs
TOTAL_ORDER,
/// Use INT96 timestamp order (see [parquet-format/#584]).
///
/// [parquet-format/#584]: https://github.com/apache/parquet-format/pull/584

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 631526f

Comment thread parquet/src/file/writer.rs Outdated
let exp_min = stats.min_bytes_opt().expect("min stats missing");
let exp_max = stats.max_bytes_opt().expect("max stats missing");

let col_idx = reader

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a minor nit is that the mechanics to extract the INT96 stats from a column is somewhat verbose and repeated twice -- it might help readability to make a helper function or something that extracts the min/max values so there is less code duplication and thus the actual intent of the test is clearer

@etseidl etseidl Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 6b5d992 and edc8933

@etseidl
etseidl merged commit b5471c1 into apache:main Aug 4, 2026
18 checks passed
@etseidl
etseidl deleted the int96_order branch August 4, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change Changes to the arrow API next-major-release the PR has API changes and it waiting on the next major version parquet Changes to the parquet crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement PoC for Parquet GH-583: Introduce chronological ordering for INT96 timestamps

4 participants