[
https://issues.apache.org/jira/browse/DRILL-6321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16475233#comment-16475233
]
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_r188150005
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/common/DrillUnnestRelBase.java
##########
@@ -0,0 +1,54 @@
+/*
+ * 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.AbstractRelNode;
+import org.apache.calcite.rel.metadata.RelMetadataQuery;
+import org.apache.calcite.rex.RexNode;
+import org.apache.drill.exec.planner.cost.DrillCostBase;
+
+public class DrillUnnestRelBase extends AbstractRelNode implements
DrillRelNode {
+
+ final protected RexNode ref;
+
+ public DrillUnnestRelBase(RelOptCluster cluster, RelTraitSet traitSet,
RexNode ref) {
+ super(cluster, traitSet);
+ this.ref = ref;
+ }
+
+ @Override
+ public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery
mq) {
+
+ double rowCount = mq.getRowCount(this);
+ // Attribute small cost for projecting simple fields. In reality
projecting simple columns in not free and
Review comment:
Technically, the unnest cost would be proportional to the size of the array
being unnested but the array size is not known at planning time. What will the
EXPLAIN plan show for the estimated row count of the UNNEST ? will it always
be 1 or does Calcite use some average array size ? Note that the downstream
operators (such as filter, aggregate, sort and the Lateral Join itself) will
use this row count to determine their own cost (e.g hash aggregate vs streaming
agg). Have you thought about how to model this ?
----------------------------------------------------------------
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]
> 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)