[ 
https://issues.apache.org/jira/browse/DRILL-6456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16497270#comment-16497270
 ] 

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_r192256195
 
 

 ##########
 File path: 
exec/java-exec/src/test/java/org/apache/drill/exec/physical/impl/lateraljoin/TestLateralPlans.java
 ##########
 @@ -275,4 +284,153 @@ public void testUnnestColumnAlias() throws Exception {
       assert(ex.getMessage().contains("Alias table and column name are 
required for UNNEST"));
     }
   }
+
+  
/***********************************************************************************************
+   Following test cases are introduced to make sure no exchanges are present 
on right side of
+   Lateral join.
+   
**********************************************************************************************/
+
+  @Test
+  public void testNoExchangeWithAggWithoutGrpBy() throws Exception {
+    String Sql = "select d1.totalprice from dfs.`lateraljoin/multipleFiles` 
t," +
+            " lateral ( select sum(t2.ord.o_totalprice) as totalprice from 
unnest(t.c_orders) t2(ord)) d1";
+    ClusterFixtureBuilder builder = ClusterFixture.builder(dirTestWatcher)
+            .setOptionDefault(ExecConstants.ENABLE_UNNEST_LATERAL_KEY, true)
+            .setOptionDefault(ExecConstants.SLICE_TARGET, 1);
+
+    try (ClusterFixture cluster = builder.build();
+         ClientFixture client = cluster.clientFixture()) {
+      String explain = client.queryBuilder().sql(Sql).explainText();
+      String rightChild = getRightChildOfLateral(explain);
+      assert(!rightChild.contains("Exchange"));
 
 Review comment:
   Can you use the JUnit's Assert ?  

----------------------------------------------------------------
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:
us...@infra.apache.org


> 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)

Reply via email to