calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject [10/10] incubator-calcite git commit: [CALCITE-650] Add metadata for average size of a tuple in SemiJoin (Jesus Camacho Rodriguez)
Date Sat, 28 Mar 2015 21:23:59 GMT
[CALCITE-650] Add metadata for average size of a tuple in SemiJoin (Jesus Camacho Rodriguez)

Close apache/incubator-calcite#67


Project: http://git-wip-us.apache.org/repos/asf/incubator-calcite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/e2833a29
Tree: http://git-wip-us.apache.org/repos/asf/incubator-calcite/tree/e2833a29
Diff: http://git-wip-us.apache.org/repos/asf/incubator-calcite/diff/e2833a29

Branch: refs/heads/master
Commit: e2833a297cf1308fe63795ebabb52a2d66e3b863
Parents: 0f824f8
Author: Jesus Camacho Rodriguez <jcamachorodriguez@hortonworks.com>
Authored: Fri Mar 27 19:16:13 2015 +0000
Committer: Julian Hyde <jhyde@apache.org>
Committed: Fri Mar 27 20:14:19 2015 -0700

----------------------------------------------------------------------
 .../org/apache/calcite/rel/metadata/RelMdSize.java     | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/e2833a29/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSize.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSize.java b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSize.java
index 1a42f01..27e8a0c 100644
--- a/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSize.java
+++ b/core/src/main/java/org/apache/calcite/rel/metadata/RelMdSize.java
@@ -26,6 +26,7 @@ import org.apache.calcite.rel.core.Intersect;
 import org.apache.calcite.rel.core.Join;
 import org.apache.calcite.rel.core.Minus;
 import org.apache.calcite.rel.core.Project;
+import org.apache.calcite.rel.core.SemiJoin;
 import org.apache.calcite.rel.core.Sort;
 import org.apache.calcite.rel.core.TableScan;
 import org.apache.calcite.rel.core.Union;
@@ -172,13 +173,21 @@ public class RelMdSize {
     return list.build();
   }
 
+  public List<Double> averageColumnSizes(SemiJoin rel) {
+    return averageJoinColumnSizes(rel, true);
+  }
+
   public List<Double> averageColumnSizes(Join rel) {
+    return averageJoinColumnSizes(rel, false);
+  }
+
+  private List<Double> averageJoinColumnSizes(Join rel, boolean semijoin) {
     final RelNode left = rel.getLeft();
     final RelNode right = rel.getRight();
     final List<Double> lefts =
         RelMetadataQuery.getAverageColumnSizes(left);
-    final List<Double> rights =
-        RelMetadataQuery.getAverageColumnSizes(right);
+    final List<Double> rights = semijoin
+        ? null : RelMetadataQuery.getAverageColumnSizes(right);
     if (lefts == null && rights == null) {
       return null;
     }


Mime
View raw message