Skip to content

Make LexOrdering::inner non pub, add comments, update usages#14155

Merged
comphead merged 1 commit intoapache:mainfrom
alamb:alamb/lex_ordering
Jan 17, 2025
Merged

Make LexOrdering::inner non pub, add comments, update usages#14155
comphead merged 1 commit intoapache:mainfrom
alamb:alamb/lex_ordering

Conversation

@alamb
Copy link
Contributor

@alamb alamb commented Jan 16, 2025

Which issue does this PR close?

Rationale for this change

In order to optimize the ordering calculations, we may need to change how the structures are represented internally.
Since all the inner fields are pub making such changes requires too many changes over the codebase

What changes are included in this PR?

  1. Make LexOrdering::inner non pub,
  2. add comments,
  3. update usages

Are these changes tested?

Yes, by existing CI

Are there any user-facing changes?

This is a deliberate API change that forces all LexOrdering object to be created via constructor rather than directly

@github-actions github-actions bot added physical-expr Changes to the physical-expr crates core Core DataFusion crate proto Related to proto crate labels Jan 16, 2025
#[derive(Debug, Default, Clone, PartialEq, Eq, Hash)]
pub struct LexOrdering {
pub inner: Vec<PhysicalSortExpr>,
inner: Vec<PhysicalSortExpr>,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the core change of this PR -- to make this field non pub. All the rest of the changes follow from there

@alamb alamb marked this pull request as ready for review January 16, 2025 15:15
Copy link
Contributor

@berkaysynnada berkaysynnada left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @alamb. After your work on these equivalence API's, they seem more clear and easy to use now.

@alamb
Copy link
Contributor Author

alamb commented Jan 17, 2025

LGTM, thank you @alamb. After your work on these equivalence API's, they seem more clear and easy to use now.

Thank you -- now I just need to make them faster / more efficient

It is a good intellectual / algorithmic challenge :)

@alamb alamb added the api change Changes the API exposed to users of the crate label Jan 17, 2025
@comphead comphead merged commit 0e22172 into apache:main Jan 17, 2025
25 checks passed
@alamb alamb deleted the alamb/lex_ordering branch January 18, 2025 11:39
@alamb
Copy link
Contributor Author

alamb commented Jan 18, 2025

Thank you @berkaysynnada and @comphead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api change Changes the API exposed to users of the crate core Core DataFusion crate physical-expr Changes to the physical-expr crates proto Related to proto crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants