-
Notifications
You must be signed in to change notification settings - Fork 3.8k
feat: Extend FilterSegmentPruner to prune on ClusterGroupTuples #20149
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
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 |
|---|---|---|
|
|
@@ -282,7 +282,14 @@ public VirtualColumn findEquivalent(Node otherNode) | |
| toCheckForEquivalence = otherVirtualColumn.rewriteRequiredColumns(equivalenceRewriteMap); | ||
| } | ||
|
|
||
| return equivalence.get().get(toCheckForEquivalence.getEquivalanceKey()); | ||
| VirtualColumn matched = equivalence.get().get(toCheckForEquivalence.getEquivalanceKey()); | ||
| if (matched != null && | ||
| // guardrail check for expression collision when a virtual column shadows the physical column | ||
| // e.x. otherNode v0 = dim1 and VCs dim1 = dim2 plus q = dim1, q can be treated as equivalent to v0 even though it reads physical column dim2 | ||
| getNode(matched.getOutputName()).getDependencies().size() == otherNode.getDependencies().size()) { | ||
|
Member
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 Virtual-column dependency counting misses physical-name collisions The dependency count can conflate a query virtual column with a physical column that shadows one of its dependencies. For example, with physical |
||
| return matched; | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| /** | ||
|
|
||
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.
P1 Avoid shadowed query dependencies in VC equivalence
getQueryEquivalent(domainNode) matches a segment-side virtual column without accounting for query virtual-column dependencies. For example, with segment v0 = dim1 and query VCs dim1 = dim2 plus q = dim1, q can be treated as equivalent to v0 even though it reads dim2. The pruner can then use a range for q against the wrong cluster-group value and prune segments that contain matching rows. Resolve equivalence from the query dependency graph, and add a regression test for this shadowed-dependency case.