Skip to content

Minor: Split equivalence code into smaller modules - #8235

Closed
alamb wants to merge 3 commits into
apache:mainfrom
alamb:alamb/extract_equivalence
Closed

Minor: Split equivalence code into smaller modules#8235
alamb wants to merge 3 commits into
apache:mainfrom
alamb:alamb/extract_equivalence

Conversation

@alamb

@alambalamb commented Nov 16, 2023

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Part of #8064

Rationale for this change

As equivalence and ordering become ever more important, I would like to break the code up into smaller modules to make it harder to handle.

At almost 3000 lines with several large classes that are overlapping. the existing equivalence.rs is hard to understand.

I would like to break it up into smaller modules.

In fact I didn't even realize there were so many equivalence tracking structures until I started looking at the code more closely.

What changes are included in this PR?

Move EquivalenceClass, EquivalenceGroup, OrderingEquivalenceClass, ProjectionMapping, EquivalenceProperties; and into their own modules, and then update some internal apis to keep the interfaces clear

Are these changes tested?

Are there any user-facing changes?

Existing tests

@github-actionsgithub-actionsBot added the physical-expr Changes to the physical-expr crates label Nov 16, 2023
@alambalamb changed the title Alamb/extract equivalenceMinor: Split equivalence classes into smaller modulesNov 16, 2023
@@ -0,0 +1,488 @@
// Licensed to the Apache Software Foundation (ASF) under one

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

This code was simply moved around, no algorithmic changes were made

@alambalamb changed the title Minor: Split equivalence classes into smaller modulesMinor: Split equivalence code into smaller modulesNov 16, 2023
@ozankabak

Copy link
Copy Markdown
Contributor

Thanks for this. I agree that it is a good idea. One minor timing issue: @mustafasrepo is currently working on a few finishing touches to this code, so doing this next week will probably (1) enable us to see the full picture before doing the re-org, (2) save us some time by avoiding merge conflicts

@alamb

Copy link
Copy Markdown
ContributorAuthor

Sounds good -- I'll leave this as a draft until @mustafasrepo 's in flight work

@alamb

Copy link
Copy Markdown
ContributorAuthor

Now that the new code has been merged, I think this is possible now. However, I don't think I can salvage this PR -- it would make more sense to start from scratch

@alamb

Copy link
Copy Markdown
ContributorAuthor

Field #8633 to track doing this

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

Labels

physical-exprChanges to the physical-expr crates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@alamb@ozankabak