[
https://issues.apache.org/jira/browse/DRILL-6456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16496897#comment-16496897
]
ASF GitHub Bot commented on DRILL-6456:
---------------------------------------
amansinha100 commented on a change in pull request #1299: DRILL-6456: Planner
shouldn't create any exchanges on the right side …
URL: https://github.com/apache/drill/pull/1299#discussion_r192175763
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/visitor/ExcessiveExchangeIdentifier.java
##########
@@ -45,18 +49,22 @@ public static Prel removeExcessiveEchanges(Prel prel, long
targetSliceSize) {
public Prel visitExchange(ExchangePrel prel, MajorFragmentStat parent)
throws RuntimeException {
parent.add(prel);
MajorFragmentStat newFrag = new MajorFragmentStat();
+ newFrag.setRightSideOfLateral(parent.isRightSideOfLateral());
Prel newChild = ((Prel) prel.getInput()).accept(this, newFrag);
-
- if (newFrag.isSingular() && parent.isSingular() &&
- // if one of them has strict distribution or none, we can remove the
exchange
- (!newFrag.isDistributionStrict() || !parent.isDistributionStrict())
- ) {
+ if (canRemoveExchange(parent, newFrag)) {
return newChild;
} else {
return (Prel) prel.copy(prel.getTraitSet(),
Collections.singletonList((RelNode) newChild));
}
}
+ private boolean canRemoveExchange(MajorFragmentStat parentFrag,
MajorFragmentStat childFrag) {
+ return (childFrag.isSingular() && parentFrag.isSingular() &&
Review comment:
For better readability, Since the lateral check is independent of the
others, can you split it into a separate statement ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Planner shouldn't create any exchanges on the right side of Lateral Join.
> -------------------------------------------------------------------------
>
> Key: DRILL-6456
> URL: https://issues.apache.org/jira/browse/DRILL-6456
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Affects Versions: 1.14.0
> Reporter: Hanumath Rao Maduri
> Assignee: Hanumath Rao Maduri
> Priority: Major
> Fix For: 1.14.0
>
>
> Currently, there is no restriction placed on right side of the LateralJoin.
> This is causing planner to generate an Exchange when there are operators like
> (Agg, Limit, Sort etc).
> Due to this unnest operator cannot retrieve the row from lateral's left side
> to process the pipeline further. Enhance the planner to not generate
> exchanges on the right side of the LateralJoin.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)