Skip to content

[PoC] Alternate implementation of Parquet ColumnOrder thrift union #7930

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

Closed
wants to merge 7 commits into from

Conversation

etseidl
Copy link
Contributor

@etseidl etseidl commented Jul 15, 2025

Which issue does this PR close?

Rationale for this change

Not for merging, but as a discussion point. This PR implements the thrift union ColumnOrder as a rust struct rather than a rust enum, analogously to how the thrift rust generator handles thrift enums.

The current implementation is not very ergonomic, but gets the point across.


impl ColumnOrderDisc {
pub const TYPE_ORDER : Self = Self(1);
pub const NO_SUCH_ORDER: Self = Self(2);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a fake order to demonstrate what a union with multiple fields would look like

pub struct ColumnOrder {
pub disc: ColumnOrderDisc,
pub TYPE_ORDER: Option<TypeDefinedOrder>,
pub NO_SUCH_ORDER: Option<TypeDefinedOrder>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reused TypeDefinedOrder because I was too lazy to add another struct for the fake order.

@etseidl
Copy link
Contributor Author

etseidl commented Jul 24, 2025

closing in favor of #7995 to reduce clutter

@etseidl etseidl closed this Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant