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

ASF GitHub Bot commented on DRILL-6321:
---------------------------------------

amansinha100 commented on a change in pull request #1258: DRILL-6321:  Lateral 
Join and Unnest - initial implementation for parser and planning
URL: https://github.com/apache/drill/pull/1258#discussion_r188152596
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillCorrelateRelBase.java
 ##########
 @@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.planner.common;
+
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptCost;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.core.Correlate;
+import org.apache.calcite.rel.core.CorrelationId;
+import org.apache.calcite.rel.metadata.RelMetadataQuery;
+import org.apache.calcite.sql.SemiJoinType;
+import org.apache.calcite.util.ImmutableBitSet;
+import org.apache.drill.exec.ExecConstants;
+import org.apache.drill.exec.planner.cost.DrillCostBase;
+import org.apache.drill.exec.planner.physical.PrelUtil;
+
+
+public abstract class DrillCorrelateRelBase extends Correlate implements 
DrillRelNode {
+  public DrillCorrelateRelBase(RelOptCluster cluster, RelTraitSet traits, 
RelNode left, RelNode right,
+                               CorrelationId correlationId, ImmutableBitSet 
requiredColumns, SemiJoinType semiJoinType) {
+    super(cluster, traits, left, right, correlationId, requiredColumns, 
semiJoinType);
+  }
+
+  @Override public RelOptCost computeSelfCost(RelOptPlanner planner,
+                                              RelMetadataQuery mq) {
+    DrillCostBase.DrillCostFactory costFactory = 
(DrillCostBase.DrillCostFactory) planner.getCostFactory();
+
+    double rowCount = mq.getRowCount(this.getLeft());
 
 Review comment:
   Since correlate (lateral join) is a cross join, the actual rowCount = left 
row count x estimated right row count.  
   

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


> Lateral Join: Planning changes - enable submitting physical plan
> ----------------------------------------------------------------
>
>                 Key: DRILL-6321
>                 URL: https://issues.apache.org/jira/browse/DRILL-6321
>             Project: Apache Drill
>          Issue Type: Task
>            Reporter: Parth Chandra
>            Assignee: Chunhui Shi
>            Priority: Major
>              Labels: ready-to-commit
>             Fix For: 1.14.0
>
>
> Implement changes to enable submitting a physical plan containing lateral and 
> unnest.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to