impala-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tarmstr...@apache.org
Subject [5/7] incubator-impala git commit: IMPALA-4862: make resource profile consistent with backend behaviour
Date Wed, 12 Jul 2017 04:20:09 GMT
http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/fe/src/main/java/org/apache/impala/planner/SubplanNode.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/planner/SubplanNode.java b/fe/src/main/java/org/apache/impala/planner/SubplanNode.java
index 169abc1..c09efe5 100644
--- a/fe/src/main/java/org/apache/impala/planner/SubplanNode.java
+++ b/fe/src/main/java/org/apache/impala/planner/SubplanNode.java
@@ -93,9 +93,26 @@ public class SubplanNode extends PlanNode {
   }
 
   @Override
-  public void computeResourceProfile(TQueryOptions queryOptions) {
+  public void computeNodeResourceProfile(TQueryOptions queryOptions) {
     // TODO: add an estimate
-    resourceProfile_ = new ResourceProfile(0, 0);
+    nodeResourceProfile_ = new ResourceProfile(0, 0);
+  }
+
+  @Override
+  public ExecPhaseResourceProfiles computeTreeResourceProfiles(
+      TQueryOptions queryOptions) {
+    // All nodes in a subplan remain open at the same time across iterations of a subplan,
+    // therefore the peak resource consumption is simply the sum of all node resources.
+    ResourceProfile subplanProfile = subplanComputePeakResources(this);
+    return new ExecPhaseResourceProfiles(subplanProfile, subplanProfile);
+  }
+
+  private static ResourceProfile subplanComputePeakResources(PlanNode node) {
+    ResourceProfile result = node.nodeResourceProfile_;
+    for (PlanNode child: node.getChildren()) {
+      result = result.sum(subplanComputePeakResources(child));
+    }
+    return result;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/fe/src/main/java/org/apache/impala/planner/UnionNode.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/planner/UnionNode.java b/fe/src/main/java/org/apache/impala/planner/UnionNode.java
index 2c72c63..44e2967 100644
--- a/fe/src/main/java/org/apache/impala/planner/UnionNode.java
+++ b/fe/src/main/java/org/apache/impala/planner/UnionNode.java
@@ -129,9 +129,26 @@ public class UnionNode extends PlanNode {
   }
 
   @Override
-  public void computeResourceProfile(TQueryOptions queryOptions) {
+  public void computeNodeResourceProfile(TQueryOptions queryOptions) {
     // TODO: add an estimate
-    resourceProfile_ = new ResourceProfile(0, 0);
+    nodeResourceProfile_ = new ResourceProfile(0, 0);
+  }
+
+  @Override
+  public ExecPhaseResourceProfiles computeTreeResourceProfiles(
+      TQueryOptions queryOptions) {
+    // The union executes concurrently with Open() and GetNext() on each of it's
+    // children.
+    ResourceProfile maxProfile = ResourceProfile.invalid();
+    for (PlanNode child : children_) {
+      // Children are opened either during Open() or GetNext() of the union.
+      ExecPhaseResourceProfiles childResources =
+          child.computeTreeResourceProfiles(queryOptions);
+      maxProfile = maxProfile.max(childResources.duringOpenProfile);
+      maxProfile = maxProfile.max(childResources.postOpenProfile);
+    }
+    ResourceProfile peakResources = nodeResourceProfile_.sum(maxProfile);
+    return new ExecPhaseResourceProfiles(peakResources, peakResources);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/fe/src/main/java/org/apache/impala/planner/UnnestNode.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/planner/UnnestNode.java b/fe/src/main/java/org/apache/impala/planner/UnnestNode.java
index 5847e62..695ec24 100644
--- a/fe/src/main/java/org/apache/impala/planner/UnnestNode.java
+++ b/fe/src/main/java/org/apache/impala/planner/UnnestNode.java
@@ -74,9 +74,9 @@ public class UnnestNode extends PlanNode {
   }
 
   @Override
-  public void computeResourceProfile(TQueryOptions queryOptions) {
+  public void computeNodeResourceProfile(TQueryOptions queryOptions) {
     // TODO: add an estimate
-    resourceProfile_ = new ResourceProfile(0, 0);
+    nodeResourceProfile_ = new ResourceProfile(0, 0);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/fe/src/main/java/org/apache/impala/service/BackendConfig.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/service/BackendConfig.java b/fe/src/main/java/org/apache/impala/service/BackendConfig.java
index 80f8ace..a1566c7 100644
--- a/fe/src/main/java/org/apache/impala/service/BackendConfig.java
+++ b/fe/src/main/java/org/apache/impala/service/BackendConfig.java
@@ -61,6 +61,10 @@ public class BackendConfig {
   public int getImpalaLogLevel() { return backendCfg_.impala_log_lvl; }
   public int getNonImpalaJavaVlogLevel() { return backendCfg_.non_impala_java_vlog; }
 
+  public boolean isPartitionedHashJoinEnabled() {
+    return backendCfg_.enable_partitioned_hash_join;
+  }
+
   // Inits the auth_to_local configuration in the static KerberosName class.
   private static void initAuthToLocal() {
     // If auth_to_local is enabled, we read the configuration hadoop.security.auth_to_local

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/fe/src/main/java/org/apache/impala/service/Frontend.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/service/Frontend.java b/fe/src/main/java/org/apache/impala/service/Frontend.java
index d0a3b4d..855a076 100644
--- a/fe/src/main/java/org/apache/impala/service/Frontend.java
+++ b/fe/src/main/java/org/apache/impala/service/Frontend.java
@@ -35,10 +35,6 @@ import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hive.service.rpc.thrift.TGetColumnsReq;
-import org.apache.hive.service.rpc.thrift.TGetFunctionsReq;
-import org.apache.hive.service.rpc.thrift.TGetSchemasReq;
-import org.apache.hive.service.rpc.thrift.TGetTablesReq;
 import org.apache.impala.analysis.AnalysisContext;
 import org.apache.impala.analysis.CreateDataSrcStmt;
 import org.apache.impala.analysis.CreateDropRoleStmt;
@@ -1008,6 +1004,9 @@ public class Frontend {
       planRoots.add(planner.createPlan().get(0));
     }
 
+    // Compute resource requirements of the final plans.
+    planner.computeResourceReqs(planRoots, result);
+
     // create per-plan exec info;
     // also assemble list of names of tables with missing or corrupt stats for
     // assembling a warning message
@@ -1016,10 +1015,6 @@ public class Frontend {
           createPlanExecInfo(planRoot, planner, queryCtx, result));
     }
 
-    // Compute resource requirements after scan range locations because the cost
-    // estimates of scan nodes rely on them.
-    planner.computeResourceReqs(planRoots, result);
-
     // Optionally disable spilling in the backend. Allow spilling if there are plan hints
     // or if all tables have stats.
     boolean disableSpilling =

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/fe/src/main/java/org/apache/impala/util/BitUtil.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/util/BitUtil.java b/fe/src/main/java/org/apache/impala/util/BitUtil.java
index 51b778a..839dd6e 100644
--- a/fe/src/main/java/org/apache/impala/util/BitUtil.java
+++ b/fe/src/main/java/org/apache/impala/util/BitUtil.java
@@ -26,7 +26,7 @@ public class BitUtil {
   }
 
   // Round up 'val' to the nearest power of two. 'val' must be > 0.
-  public static int roundUpToPowerOf2(long val) {
-    return 1 << log2Ceiling(val);
+  public static long roundUpToPowerOf2(long val) {
+    return 1L << log2Ceiling(val);
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/fe/src/main/java/org/apache/impala/util/MathUtil.java
----------------------------------------------------------------------
diff --git a/fe/src/main/java/org/apache/impala/util/MathUtil.java b/fe/src/main/java/org/apache/impala/util/MathUtil.java
new file mode 100644
index 0000000..c4029fa
--- /dev/null
+++ b/fe/src/main/java/org/apache/impala/util/MathUtil.java
@@ -0,0 +1,45 @@
+// 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.impala.util;
+
+import com.google.common.math.LongMath;
+
+public class MathUtil {
+
+  // Multiply two numbers. If the multiply would overflow, return either Long.MIN_VALUE
+  // (if a xor b is negative) or Long.MAX_VALUE otherwise. The overflow path is not
+  // optimised at all and may be somewhat slow.
+  public static long saturatingMultiply(long a, long b) {
+    try {
+      return LongMath.checkedMultiply(a, b);
+    } catch (ArithmeticException e) {
+      return a < 0 != b < 0 ? Long.MIN_VALUE : Long.MAX_VALUE;
+    }
+  }
+
+  // Add two numbers. If the add would overflow, return either Long.MAX_VALUE if both are
+  // positive or Long.MIN_VALUE if both are negative. The overflow path is not optimised
+  // at all and may be somewhat slow.
+  public static long saturatingAdd(long a, long b) {
+    try {
+      return LongMath.checkedAdd(a, b);
+    } catch (ArithmeticException e) {
+      return a < 0 ? Long.MIN_VALUE : Long.MAX_VALUE;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/fe/src/test/java/org/apache/impala/util/BitUtilTest.java
----------------------------------------------------------------------
diff --git a/fe/src/test/java/org/apache/impala/util/BitUtilTest.java b/fe/src/test/java/org/apache/impala/util/BitUtilTest.java
new file mode 100644
index 0000000..a134b6a
--- /dev/null
+++ b/fe/src/test/java/org/apache/impala/util/BitUtilTest.java
@@ -0,0 +1,49 @@
+// 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.impala.util;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+/**
+ * Unit tests for BitUtil functions.
+ */
+public class BitUtilTest {
+
+  // Test the log2/PowerOf2 functions
+  @Test
+  public void testPowersOf2() {
+    assertEquals(8, BitUtil.log2Ceiling(256)); // Power-of-two
+    assertEquals(256, BitUtil.roundUpToPowerOf2(256)); // Power-of-two
+    assertEquals(4, BitUtil.log2Ceiling(10)); // Rounds up
+    assertEquals(16, BitUtil.roundUpToPowerOf2(10)); // Rounds up
+    assertEquals(33, BitUtil.log2Ceiling(8L * 1000L * 1000L * 1000L)); // > 32bit number
+    assertEquals(8L * 1024L * 1024L * 1024L,
+        BitUtil.roundUpToPowerOf2(8L * 1000L * 1000L * 1000L)); // > 32bit number
+
+    assertEquals(0, BitUtil.log2Ceiling(1)); // Minimum valid input
+    assertEquals(1, BitUtil.roundUpToPowerOf2(1)); // Minimum valid input
+    assertEquals(63, BitUtil.log2Ceiling(Long.MAX_VALUE)); // Maximum valid input
+    // Overflow to -2^62.
+    assertEquals(-0x8000000000000000L, BitUtil.roundUpToPowerOf2(Long.MAX_VALUE));
+    // Maximum non-overflow output: 2^62.
+    assertEquals(0x8000000000000000L, BitUtil.roundUpToPowerOf2(0x8000000000000000L - 1));
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/fe/src/test/java/org/apache/impala/util/MathUtilTest.java
----------------------------------------------------------------------
diff --git a/fe/src/test/java/org/apache/impala/util/MathUtilTest.java b/fe/src/test/java/org/apache/impala/util/MathUtilTest.java
new file mode 100644
index 0000000..6120067
--- /dev/null
+++ b/fe/src/test/java/org/apache/impala/util/MathUtilTest.java
@@ -0,0 +1,61 @@
+// 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.impala.util;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+/**
+ * Unit tests for MathUtil functions.
+ */
+public class MathUtilTest {
+
+  @Test
+  public void testSaturatingMultiply() {
+    // Positive * positive
+    assertEquals(10, MathUtil.saturatingMultiply(2, 5));
+    assertEquals(Long.MAX_VALUE, MathUtil.saturatingMultiply(2, Long.MAX_VALUE));
+    assertEquals(Long.MAX_VALUE, MathUtil.saturatingMultiply(3, Long.MAX_VALUE / 2));
+
+    // Positive * negative
+    assertEquals(-10, MathUtil.saturatingMultiply(2, -5));
+    assertEquals(Long.MIN_VALUE, MathUtil.saturatingMultiply(2, Long.MIN_VALUE));
+    assertEquals(Long.MIN_VALUE, MathUtil.saturatingMultiply(-3, Long.MAX_VALUE / 2));
+
+    // Negative * negative
+    assertEquals(10, MathUtil.saturatingMultiply(-2, -5));
+    assertEquals(Long.MAX_VALUE, MathUtil.saturatingMultiply(-1, Long.MIN_VALUE));
+    assertEquals(Long.MAX_VALUE, MathUtil.saturatingMultiply(Long.MIN_VALUE / 10, -100));
+  }
+
+  @Test
+  public void testSaturatingAdd() {
+    // No overflow
+    assertEquals(1234, MathUtil.saturatingAdd(1200, 34));
+    assertEquals(-1, MathUtil.saturatingAdd(Long.MAX_VALUE, Long.MIN_VALUE));
+
+    // Underflow
+    assertEquals(Long.MIN_VALUE, MathUtil.saturatingAdd(Long.MIN_VALUE, -1));
+    assertEquals(Long.MIN_VALUE, MathUtil.saturatingAdd(Long.MIN_VALUE, Long.MIN_VALUE /
2));
+
+    // Overflow
+    assertEquals(Long.MAX_VALUE, MathUtil.saturatingAdd(Long.MAX_VALUE - 10, 11));
+    assertEquals(Long.MAX_VALUE, MathUtil.saturatingAdd(Long.MAX_VALUE, Long.MAX_VALUE /
2));
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/testdata/workloads/functional-planner/queries/PlannerTest/constant-folding.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/constant-folding.test
b/testdata/workloads/functional-planner/queries/PlannerTest/constant-folding.test
index 82f5c3e..ed4f684 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/constant-folding.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/constant-folding.test
@@ -5,6 +5,7 @@ where 5 + 5 < c_custkey and o_orderkey = (2 + 2)
   and (coalesce(2, 3, 4) * 10) + l_linenumber < (0 * 1)
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=176.00MB mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -45,12 +46,12 @@ PLAN-ROOT SINK
 |     tuple-ids=1 row-size=0B cardinality=10
 |
 00:SCAN HDFS [tpch_nested_parquet.customer c]
-   partitions=1/1 files=4 size=292.36MB
+   partitions=1/1 files=4 size=292.35MB
    predicates: c_custkey > 10, !empty(c.c_orders)
    predicates on o: !empty(o.o_lineitems), o_orderkey = 4
    predicates on o_lineitems: 20 + l_linenumber < 0
    stats-rows=150000 extrapolated-rows=disabled
-   table stats: rows=150000 size=292.36MB
+   table stats: rows=150000 size=292.35MB
    columns missing stats: c_orders
    parquet statistics predicates: c_custkey > 10
    parquet dictionary predicates: c_custkey > 10
@@ -63,6 +64,7 @@ where string_col = cast(4 as string) and 2 + 3 = tinyint_col
   and id between concat('1', '0') and upper('20')
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=1.00GB mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -81,6 +83,7 @@ select * from functional.alltypes_datasource
 where tinyint_col < (pow(2, 8)) and float_col != 0 and 1 + 1 > int_col
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=1.00GB mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -99,6 +102,7 @@ having 1024 * 1024 * count(*) % 2 = 0
   and (sm between 5 and 10)
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=138.00MB mem-reservation=264.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -125,6 +129,7 @@ left outer join functional.alltypes b
 where round(1.11 + 2.22 + 3.33 + 4.44, 1) < cast(b.double_col as decimal(3, 2))
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=256.02MB mem-reservation=136.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -163,6 +168,7 @@ left outer join functional.alltypes b
 where cast(b.double_col as decimal(3, 2)) > round(1.11 + 2.22 + 3.33 + 4.44, 1)
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=256.01MB mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -197,6 +203,7 @@ group by timestamp_col = cast('2015-11-15' as timestamp) + interval 1
year
 having 1024 * 1024 * count(*) % 2 = 0
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=138.00MB mem-reservation=528.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -227,6 +234,7 @@ from functional.alltypes
 having 1024 * 1024 * count(*) % 2 = 0
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=138.00MB mem-reservation=264.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -257,6 +265,7 @@ select first_value(1 + 1 + int_col - (1 - 1)) over
 from functional.alltypes
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=144.00MB mem-reservation=64.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -287,6 +296,7 @@ select int_col from functional.alltypes
 order by id * abs((factorial(5) / power(2, 4)))
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=136.00MB mem-reservation=24.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -309,6 +319,7 @@ select id, int_col, cast(1 + 1 + 1 + year as int), cast(month - (1 - 1
- 1) as i
 from functional.alltypessmall
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=0B
 WRITE TO HDFS [functional.alltypes, OVERWRITE=false, PARTITION-KEYS=(CAST(3 + year AS INT),CAST(month
- -1 AS INT))]
 |  partitions=4
 |  mem-estimate=1.56KB mem-reservation=0B
@@ -330,6 +341,7 @@ select sum(id + c3) from
   ) v3
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=138.00MB mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/testdata/workloads/functional-planner/queries/PlannerTest/disable-codegen.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/disable-codegen.test
b/testdata/workloads/functional-planner/queries/PlannerTest/disable-codegen.test
index a707e44..e64691a 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/disable-codegen.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/disable-codegen.test
@@ -2,7 +2,7 @@
 select count(*) from functional.alltypes
 ---- DISTRIBUTEDPLAN
 Per-Host Resource Reservation: Memory=0B
-Per-Host Resource Estimates: Memory=138.00MB
+Per-Host Resource Estimates: Memory=148.00MB
 Codegen disabled by planner
 
 PLAN-ROOT SINK
@@ -22,7 +22,7 @@ PLAN-ROOT SINK
 select count(*) from functional.alltypesagg
 ---- DISTRIBUTEDPLAN
 Per-Host Resource Reservation: Memory=0B
-Per-Host Resource Estimates: Memory=90.00MB
+Per-Host Resource Estimates: Memory=100.00MB
 
 PLAN-ROOT SINK
 |
@@ -41,7 +41,7 @@ PLAN-ROOT SINK
 select count(*) from functional_parquet.alltypes
 ---- DISTRIBUTEDPLAN
 Per-Host Resource Reservation: Memory=0B
-Per-Host Resource Estimates: Memory=26.00MB
+Per-Host Resource Estimates: Memory=36.00MB
 WARNING: The following tables are missing relevant table and/or column statistics.
 functional_parquet.alltypes
 
@@ -56,7 +56,7 @@ PLAN-ROOT SINK
 |  output: sum_init_zero(functional_parquet.alltypes.parquet-stats: num_rows)
 |
 00:SCAN HDFS [functional_parquet.alltypes]
-   partitions=24/24 files=24 size=179.68KB
+   partitions=24/24 files=24 size=178.13KB
 ====
 # > 3000 rows returned to coordinator: codegen should be enabled
 select * from functional_parquet.alltypes
@@ -71,7 +71,7 @@ PLAN-ROOT SINK
 01:EXCHANGE [UNPARTITIONED]
 |
 00:SCAN HDFS [functional_parquet.alltypes]
-   partitions=24/24 files=24 size=179.68KB
+   partitions=24/24 files=24 size=178.13KB
 ====
 # Optimisation is enabled for join producing < 3000 rows
 select count(*)
@@ -79,7 +79,7 @@ from functional.alltypes t1
 join functional.alltypestiny t2 on t1.id = t2.id
 ---- DISTRIBUTEDPLAN
 Per-Host Resource Reservation: Memory=136.00MB
-Per-Host Resource Estimates: Memory=138.00MB
+Per-Host Resource Estimates: Memory=180.00MB
 Codegen disabled by planner
 
 PLAN-ROOT SINK
@@ -109,7 +109,7 @@ PLAN-ROOT SINK
 select count(*) from functional.alltypes t1, functional.alltypes t2
 ---- DISTRIBUTEDPLAN
 Per-Host Resource Reservation: Memory=0B
-Per-Host Resource Estimates: Memory=138.00MB
+Per-Host Resource Estimates: Memory=276.00MB
 
 PLAN-ROOT SINK
 |
@@ -138,7 +138,7 @@ select count(*) from (
   select * from functional.alltypestiny) v
 ---- DISTRIBUTEDPLAN
 Per-Host Resource Reservation: Memory=0B
-Per-Host Resource Estimates: Memory=170.00MB
+Per-Host Resource Estimates: Memory=148.00MB
 Codegen disabled by planner
 
 PLAN-ROOT SINK
@@ -167,7 +167,7 @@ select count(*) from (
   select * from functional.alltypes) v
 ---- DISTRIBUTEDPLAN
 Per-Host Resource Reservation: Memory=0B
-Per-Host Resource Estimates: Memory=266.00MB
+Per-Host Resource Estimates: Memory=148.00MB
 
 PLAN-ROOT SINK
 |

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection.test
b/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection.test
index c2065ed..8e8ddc0 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/fk-pk-join-detection.test
@@ -5,6 +5,7 @@ on ss_customer_sk = c_customer_sk
 where c_salutation = 'Mrs.'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=180.46MB mem-reservation=136.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -42,6 +43,7 @@ on ss_customer_sk = c_customer_sk
 where c_salutation = 'Mrs.'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=180.46MB mem-reservation=136.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -78,6 +80,7 @@ on ss_customer_sk = c_customer_sk
 where c_salutation = 'Mrs.'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=180.46MB mem-reservation=136.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -114,6 +117,7 @@ on ss_item_sk = sr_item_sk and ss_ticket_number = sr_ticket_number
 where sr_return_quantity < 10
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=210.65MB mem-reservation=136.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -149,6 +153,7 @@ tpcds.store_sales inner join tpcds.web_sales
 on ss_sold_time_sk = ws_sold_time_sk
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=396.67MB mem-reservation=136.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -183,6 +188,7 @@ on a.d_date_sk = b.d_date_sk
 where a.d_holiday = "Y"
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=107.62MB mem-reservation=136.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -223,6 +229,7 @@ where ss_item_sk = sr_item_sk and ss_ticket_number = sr_ticket_number
   and d1.d_fy_week_seq = 1000
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=352.73MB mem-reservation=544.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -304,6 +311,7 @@ tpcds.store_sales inner join tpcds.customer
 on ss_customer_sk % 10 = c_customer_sk / 100
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=202.79MB mem-reservation=136.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -338,6 +346,7 @@ tpcds.store_sales inner join tpcds_seq_snap.customer
 on ss_customer_sk = c_customer_sk
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=2.17GB mem-reservation=136.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -349,7 +358,7 @@ PLAN-ROOT SINK
 |  tuple-ids=0,1 row-size=8B cardinality=2880404
 |
 |--01:SCAN HDFS [tpcds_seq_snap.customer]
-|     partitions=1/1 files=1 size=8.59MB
+|     partitions=1/1 files=1 size=8.58MB
 |     stats-rows=unavailable extrapolated-rows=disabled
 |     table stats: rows=unavailable size=unavailable
 |     column stats: unavailable
@@ -371,6 +380,7 @@ tpcds_seq_snap.store_sales inner join tpcds.customer
 on ss_customer_sk = c_customer_sk
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=176.42MB mem-reservation=136.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -390,7 +400,7 @@ PLAN-ROOT SINK
 |     tuple-ids=1 row-size=4B cardinality=100000
 |
 00:SCAN HDFS [tpcds_seq_snap.store_sales]
-   partitions=1824/1824 files=1824 size=207.90MB
+   partitions=1824/1824 files=1824 size=207.85MB
    runtime filters: RF000 -> ss_customer_sk
    stats-rows=unavailable extrapolated-rows=disabled
    table stats: rows=unavailable size=unavailable
@@ -406,6 +416,7 @@ tpcds.store_sales inner join
 on ss_sold_time_sk = ws_sold_time_sk
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=298.00MB mem-reservation=400.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test
b/testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test
index 48e98af..02843c0 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/kudu-selectivity.test
@@ -1,6 +1,7 @@
 select * from functional_kudu.zipcode_incomes where id = '8600000US00601'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |
@@ -10,6 +11,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
      tuple-ids=0 row-size=124B cardinality=1
 ---- DISTRIBUTEDPLAN
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |
@@ -18,6 +20,7 @@ F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
      tuple-ids=0 row-size=124B cardinality=1
 
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   DATASTREAM SINK [FRAGMENT=F01, EXCHANGE=01, UNPARTITIONED]
   |  mem-estimate=0B mem-reservation=0B
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
@@ -29,6 +32,7 @@ F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
 select * from functional_kudu.zipcode_incomes where id != '1' and zip = '2'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |
@@ -39,6 +43,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
      tuple-ids=0 row-size=124B cardinality=1
 ---- DISTRIBUTEDPLAN
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |
@@ -47,6 +52,7 @@ F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
      tuple-ids=0 row-size=124B cardinality=1
 
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   DATASTREAM SINK [FRAGMENT=F01, EXCHANGE=01, UNPARTITIONED]
   |  mem-estimate=0B mem-reservation=0B
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
@@ -58,6 +64,7 @@ F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
 select * from functional_kudu.zipcode_incomes where id > '1' and zip > '2'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |
@@ -67,6 +74,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
      tuple-ids=0 row-size=124B cardinality=3317
 ---- DISTRIBUTEDPLAN
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |
@@ -75,6 +83,7 @@ F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
      tuple-ids=0 row-size=124B cardinality=3317
 
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   DATASTREAM SINK [FRAGMENT=F01, EXCHANGE=01, UNPARTITIONED]
   |  mem-estimate=0B mem-reservation=0B
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
@@ -85,6 +94,7 @@ F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
 select * from functional_kudu.zipcode_incomes where id = '1' or id = '2' or zip = '3'
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |
@@ -94,6 +104,7 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
      tuple-ids=0 row-size=124B cardinality=3
 ---- DISTRIBUTEDPLAN
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |
@@ -102,6 +113,7 @@ F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
      tuple-ids=0 row-size=124B cardinality=3
 
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   DATASTREAM SINK [FRAGMENT=F01, EXCHANGE=01, UNPARTITIONED]
   |  mem-estimate=0B mem-reservation=0B
   00:SCAN KUDU [functional_kudu.zipcode_incomes]
@@ -134,6 +146,7 @@ string_col not in ("bar") and
 id in (int_col)
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |
@@ -151,6 +164,7 @@ timestamp_col > (nanoseconds_add(cast('1987-05-19 00:00:00' as timestamp),
10))
 timestamp_col < (seconds_add(cast('9999-12-31 24:59:59' as timestamp), 10))
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |
@@ -158,13 +172,14 @@ F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
      predicates: CAST(date_string_col AS TINYINT) IS NULL, timestamp_col < NULL
      kudu predicates: smallint_col IS NULL, tinyint_col IS NOT NULL, timestamp_col > TIMESTAMP
'1987-05-19 00:00:00.000000010'
      mem-estimate=0B mem-reservation=0B
-     tuple-ids=0 row-size=126B cardinality=730
+     tuple-ids=0 row-size=97B cardinality=730
 ====
 select * from functional_kudu.alltypes where
 timestamp_col in (cast('2010-03-01 00:00:00' as timestamp),
                   cast('2010-03-01 00:01:00' as timestamp))
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |
@@ -179,6 +194,7 @@ timestamp_col in (cast('2010-03-01 00:00:00' as timestamp),
                   cast('2010-03-01 00:01:00' as timestamp))
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+Per-Host Resources: mem-estimate=0B mem-reservation=0B
   PLAN-ROOT SINK
   |  mem-estimate=0B mem-reservation=0B
   |

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
b/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
index 41b76bc..f22e359 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/mt-dop-validation.test
@@ -40,6 +40,7 @@ order by cnt, bigint_col
 limit 10
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=144.00MB mem-reservation=264.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -66,6 +67,7 @@ PLAN-ROOT SINK
    tuple-ids=0 row-size=16B cardinality=unavailable
 ---- PARALLELPLANS
 F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -76,6 +78,7 @@ PLAN-ROOT SINK
 |  tuple-ids=2 row-size=16B cardinality=10
 |
 F01:PLAN FRAGMENT [HASH(bigint_col)] hosts=3 instances=9
+Per-Host Resources: mem-estimate=384.00MB mem-reservation=792.00MB
 02:TOP-N [LIMIT=10]
 |  order by: count(int_col) ASC, bigint_col ASC
 |  mem-estimate=160B mem-reservation=0B
@@ -92,6 +95,7 @@ F01:PLAN FRAGMENT [HASH(bigint_col)] hosts=3 instances=9
 |  tuple-ids=1 row-size=16B cardinality=unavailable
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=9
+Per-Host Resources: mem-estimate=432.00MB mem-reservation=0B
 01:AGGREGATE [STREAMING]
 |  output: count(int_col)
 |  group by: bigint_col
@@ -115,6 +119,7 @@ from functional_parquet.alltypes
 where id < 10
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=40.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -143,6 +148,7 @@ PLAN-ROOT SINK
    tuple-ids=0 row-size=8B cardinality=unavailable
 ---- PARALLELPLANS
 F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -151,6 +157,7 @@ PLAN-ROOT SINK
 |  tuple-ids=4,3 row-size=16B cardinality=unavailable
 |
 F01:PLAN FRAGMENT [HASH(int_col)] hosts=3 instances=9
+Per-Host Resources: mem-estimate=0B mem-reservation=120.00MB
 02:ANALYTIC
 |  functions: row_number()
 |  partition by: int_col
@@ -169,6 +176,7 @@ F01:PLAN FRAGMENT [HASH(int_col)] hosts=3 instances=9
 |  tuple-ids=0 row-size=8B cardinality=unavailable
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=9
+Per-Host Resources: mem-estimate=48.00MB mem-reservation=0B
 00:SCAN HDFS [functional_parquet.alltypes, RANDOM]
    partitions=24/24 files=24 size=178.13KB
    predicates: id < 10
@@ -186,6 +194,7 @@ from tpch_nested_parquet.customer c, c.c_orders o, o.o_lineitems
 where c_custkey < 10 and o_orderkey < 5 and l_linenumber < 3
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=88.00MB mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -226,12 +235,12 @@ PLAN-ROOT SINK
 |     tuple-ids=1 row-size=0B cardinality=10
 |
 00:SCAN HDFS [tpch_nested_parquet.customer c]
-   partitions=1/1 files=4 size=292.36MB
+   partitions=1/1 files=4 size=292.35MB
    predicates: c_custkey < 10, !empty(c.c_orders)
    predicates on o: !empty(o.o_lineitems), o_orderkey < 5
    predicates on o_lineitems: l_linenumber < 3
    stats-rows=150000 extrapolated-rows=disabled
-   table stats: rows=150000 size=292.36MB
+   table stats: rows=150000 size=292.35MB
    columns missing stats: c_orders
    parquet statistics predicates: c_custkey < 10
    parquet dictionary predicates: c_custkey < 10
@@ -239,6 +248,7 @@ PLAN-ROOT SINK
    tuple-ids=0 row-size=254B cardinality=15000
 ---- PARALLELPLANS
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -247,6 +257,7 @@ PLAN-ROOT SINK
 |  tuple-ids=2,1,0 row-size=562B cardinality=1500000
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=9
+Per-Host Resources: mem-estimate=264.00MB mem-reservation=0B
 01:SUBPLAN
 |  mem-estimate=0B mem-reservation=0B
 |  tuple-ids=2,1,0 row-size=562B cardinality=1500000
@@ -284,12 +295,12 @@ F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=9
 |     tuple-ids=1 row-size=0B cardinality=10
 |
 00:SCAN HDFS [tpch_nested_parquet.customer c, RANDOM]
-   partitions=1/1 files=4 size=292.36MB
+   partitions=1/1 files=4 size=292.35MB
    predicates: c_custkey < 10, !empty(c.c_orders)
    predicates on o: !empty(o.o_lineitems), o_orderkey < 5
    predicates on o_lineitems: l_linenumber < 3
    stats-rows=150000 extrapolated-rows=disabled
-   table stats: rows=150000 size=292.36MB
+   table stats: rows=150000 size=292.35MB
    columns missing stats: c_orders
    parquet statistics predicates: c_custkey < 10
    parquet dictionary predicates: c_custkey < 10
@@ -302,6 +313,7 @@ from tpch_nested_parquet.customer c, c.c_orders o1, c.c_orders o2
 where o1.o_orderkey = o2.o_orderkey + 2 and o1.o_orderkey < 5
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=88.00MB mem-reservation=136.00MB
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -335,16 +347,17 @@ PLAN-ROOT SINK
 |     tuple-ids=1 row-size=0B cardinality=10
 |
 00:SCAN HDFS [tpch_nested_parquet.customer c]
-   partitions=1/1 files=4 size=292.36MB
+   partitions=1/1 files=4 size=292.35MB
    predicates: !empty(c.c_orders), !empty(c.c_orders)
    predicates on o1: o1.o_orderkey < 5
    stats-rows=150000 extrapolated-rows=disabled
-   table stats: rows=150000 size=292.36MB
+   table stats: rows=150000 size=292.35MB
    columns missing stats: c_orders, c_orders
    mem-estimate=88.00MB mem-reservation=0B
    tuple-ids=0 row-size=270B cardinality=150000
 ---- PARALLELPLANS
 F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=0B mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -353,6 +366,7 @@ PLAN-ROOT SINK
 |  tuple-ids=1,0,2 row-size=286B cardinality=1500000
 |
 F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=9
+Per-Host Resources: mem-estimate=264.00MB mem-reservation=408.00MB
 01:SUBPLAN
 |  mem-estimate=0B mem-reservation=0B
 |  tuple-ids=1,0,2 row-size=286B cardinality=1500000
@@ -383,11 +397,11 @@ F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=9
 |     tuple-ids=1 row-size=0B cardinality=10
 |
 00:SCAN HDFS [tpch_nested_parquet.customer c, RANDOM]
-   partitions=1/1 files=4 size=292.36MB
+   partitions=1/1 files=4 size=292.35MB
    predicates: !empty(c.c_orders), !empty(c.c_orders)
    predicates on o1: o1.o_orderkey < 5
    stats-rows=150000 extrapolated-rows=disabled
-   table stats: rows=150000 size=292.36MB
+   table stats: rows=150000 size=292.35MB
    columns missing stats: c_orders, c_orders
    mem-estimate=88.00MB mem-reservation=0B
    tuple-ids=0 row-size=270B cardinality=150000

http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/64fd0115/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering.test
----------------------------------------------------------------------
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering.test
b/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering.test
index f5ae46d..0de7109 100644
--- a/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering.test
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/parquet-filtering.test
@@ -8,6 +8,7 @@ where int_col > 1 and int_col * rand() > 50 and int_col is null
 and int_col > tinyint_col;
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -37,6 +38,7 @@ and timestamp_cmp(timestamp_col, '2016-11-20 00:00:00') = 1
 and year > 2000 and month < 12;
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=138.00MB mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |
@@ -67,6 +69,7 @@ and mod(int_col,50) IN (0,1)
 and id IN (int_col);
 ---- PLAN
 F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=58.00MB mem-reservation=0B
 PLAN-ROOT SINK
 |  mem-estimate=0B mem-reservation=0B
 |



Mime
View raw message