IMPALA-10095: Include query plan tests for all of TPC-DS

Added TpcdsPlannerTest to include each TPC-DS query as a separate plan
test file. Removed the previous tpcds-all test file.

This means when running only PlannerTest no TPC-DS plans are checked,
however as part of a full frontend test run the TpcdsPlannerTest will be
included.

Runs with cardinality and resource checks, as well as using parquet
tables to include predicate pushdowns.

Change-Id: Ibaf40d8b783be1dc7b62ba3269feb034cb8047da
Reviewed-on: http://gerrit.cloudera.org:8080/16345
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
diff --git a/fe/src/test/java/org/apache/impala/planner/PlannerTest.java b/fe/src/test/java/org/apache/impala/planner/PlannerTest.java
index 1d03e98..f30a49f 100644
--- a/fe/src/test/java/org/apache/impala/planner/PlannerTest.java
+++ b/fe/src/test/java/org/apache/impala/planner/PlannerTest.java
@@ -550,16 +550,6 @@
   }
 
   @Test
-  public void testTpcds() {
-    // Uses ss_sold_date_sk as the partition key of store_sales to allow static partition
-    // pruning. The original predicates were rephrased in terms of the ss_sold_date_sk
-    // partition key, with the query semantics identical to the original queries.
-    runPlannerTestFile("tpcds-all", "tpcds",
-        ImmutableSet.of(PlannerTestOption.INCLUDE_RESOURCE_HEADER,
-            PlannerTestOption.VALIDATE_RESOURCES));
-  }
-
-  @Test
   public void testSmallQueryOptimization() {
     TQueryOptions options = new TQueryOptions();
     options.setExec_single_node_rows_threshold(8);
diff --git a/fe/src/test/java/org/apache/impala/planner/PlannerTestBase.java b/fe/src/test/java/org/apache/impala/planner/PlannerTestBase.java
index afcfa11..bb53d06 100644
--- a/fe/src/test/java/org/apache/impala/planner/PlannerTestBase.java
+++ b/fe/src/test/java/org/apache/impala/planner/PlannerTestBase.java
@@ -89,7 +89,7 @@
   private final static boolean GENERATE_OUTPUT_FILE = true;
   private final java.nio.file.Path testDir_ = Paths.get("functional-planner", "queries",
       "PlannerTest");
-  private static java.nio.file.Path outDir_;
+  protected static java.nio.file.Path outDir_;
   private static KuduClient kuduClient_;
 
   // Map from plan ID (TPlanNodeId) to the plan node with that ID.
diff --git a/fe/src/test/java/org/apache/impala/planner/TpcdsPlannerTest.java b/fe/src/test/java/org/apache/impala/planner/TpcdsPlannerTest.java
new file mode 100644
index 0000000..4c94941
--- /dev/null
+++ b/fe/src/test/java/org/apache/impala/planner/TpcdsPlannerTest.java
@@ -0,0 +1,572 @@
+// 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.planner;
+
+import java.nio.file.Paths;
+import java.util.Set;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Plans from the TPC-DS qualification queries at scale factor 1. Single node,
+ * Distributed and Parallel plans are all included. Cardinality and resource checks are
+ * also preformed.
+ */
+public class TpcdsPlannerTest extends PlannerTestBase {
+
+  private static Set<PlannerTestOption> testOptions =
+      ImmutableSet.of(PlannerTestOption.EXTENDED_EXPLAIN,
+          PlannerTestOption.INCLUDE_RESOURCE_HEADER, PlannerTestOption.VALIDATE_RESOURCES,
+          PlannerTestOption.VALIDATE_CARDINALITY);
+
+  @BeforeClass
+  public static void setUp() throws Exception {
+    PlannerTestBase.setUp();
+    Paths.get(outDir_.toString(), "tpcds").toFile().mkdirs();
+  }
+
+  @Test
+  public void testQ1() {
+    runPlannerTestFile("tpcds/tpcds-q01", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ2() {
+    runPlannerTestFile("tpcds/tpcds-q02", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ3() {
+    runPlannerTestFile("tpcds/tpcds-q03", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ4() {
+    runPlannerTestFile("tpcds/tpcds-q04", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ5() {
+    runPlannerTestFile("tpcds/tpcds-q05", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ6() {
+    runPlannerTestFile("tpcds/tpcds-q06", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ7() {
+    runPlannerTestFile("tpcds/tpcds-q07", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ8() {
+    runPlannerTestFile("tpcds/tpcds-q08", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ9() {
+    runPlannerTestFile("tpcds/tpcds-q09", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ10() {
+    // This is an official variant of q10 that uses a rewrite for lack of support for
+    // multiple subqueries in disjunctive predicates.
+    runPlannerTestFile("tpcds/tpcds-q10a", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ11() {
+    runPlannerTestFile("tpcds/tpcds-q11", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ12() {
+    runPlannerTestFile("tpcds/tpcds-q12", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ13() {
+    runPlannerTestFile("tpcds/tpcds-q13", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ14a() {
+    // First of the two query statements from the official q14.
+    runPlannerTestFile("tpcds/tpcds-q14a", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ14b() {
+    // Second of the two query statements from the official q14.
+    runPlannerTestFile("tpcds/tpcds-q14b", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ15() {
+    runPlannerTestFile("tpcds/tpcds-q15", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ16() {
+    runPlannerTestFile("tpcds/tpcds-q16", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ17() {
+    runPlannerTestFile("tpcds/tpcds-q17", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ18() {
+    runPlannerTestFile("tpcds/tpcds-q18", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ19() {
+    runPlannerTestFile("tpcds/tpcds-q19", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ20() {
+    runPlannerTestFile("tpcds/tpcds-q20", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ21() {
+    runPlannerTestFile("tpcds/tpcds-q21", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ22() {
+    runPlannerTestFile("tpcds/tpcds-q22", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ23a() {
+    // First of the two query statements from the official q23.
+    runPlannerTestFile("tpcds/tpcds-q23a", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ23b() {
+    // Second of the two query statements from the official q23.
+    runPlannerTestFile("tpcds/tpcds-q23b", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ24a() {
+    // First of the two query statements from the official q24.
+    runPlannerTestFile("tpcds/tpcds-q24a", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ24b() {
+    // Second of the two query statements from the official q24.
+    runPlannerTestFile("tpcds/tpcds-q24b", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ25() {
+    runPlannerTestFile("tpcds/tpcds-q25", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ26() {
+    runPlannerTestFile("tpcds/tpcds-q26", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ27() {
+    runPlannerTestFile("tpcds/tpcds-q27", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ28() {
+    runPlannerTestFile("tpcds/tpcds-q28", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ29() {
+    runPlannerTestFile("tpcds/tpcds-q29", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ30() {
+    runPlannerTestFile("tpcds/tpcds-q30", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ31() {
+    runPlannerTestFile("tpcds/tpcds-q31", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ32() {
+    runPlannerTestFile("tpcds/tpcds-q32", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ33() {
+    runPlannerTestFile("tpcds/tpcds-q33", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ34() {
+    runPlannerTestFile("tpcds/tpcds-q34", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ35() {
+    // This is an official variant of q35 that uses a rewrite for lack of support for
+    // multiple subqueries in disjunctive predicates.
+    runPlannerTestFile("tpcds/tpcds-q35a", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ36() {
+    runPlannerTestFile("tpcds/tpcds-q36", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ37() {
+    runPlannerTestFile("tpcds/tpcds-q37", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ38() {
+    runPlannerTestFile("tpcds/tpcds-q38", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ39a() {
+    // First of the two query statements from the official q39.
+    runPlannerTestFile("tpcds/tpcds-q39a", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ39b() {
+    // Second of the two query statements from the official q39.
+    runPlannerTestFile("tpcds/tpcds-q39b", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ40() {
+    runPlannerTestFile("tpcds/tpcds-q40", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ41() {
+    runPlannerTestFile("tpcds/tpcds-q41", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ42() {
+    runPlannerTestFile("tpcds/tpcds-q42", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ43() {
+    runPlannerTestFile("tpcds/tpcds-q43", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ44() {
+    runPlannerTestFile("tpcds/tpcds-q44", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ45() {
+    runPlannerTestFile("tpcds/tpcds-q45", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ46() {
+    runPlannerTestFile("tpcds/tpcds-q46", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ47() {
+    runPlannerTestFile("tpcds/tpcds-q47", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ48() {
+    runPlannerTestFile("tpcds/tpcds-q48", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ49() {
+    runPlannerTestFile("tpcds/tpcds-q49", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ50() {
+    runPlannerTestFile("tpcds/tpcds-q50", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ51() {
+    runPlannerTestFile("tpcds/tpcds-q51", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ52() {
+    runPlannerTestFile("tpcds/tpcds-q52", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ53() {
+    runPlannerTestFile("tpcds/tpcds-q53", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ54() {
+    runPlannerTestFile("tpcds/tpcds-q54", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ55() {
+    runPlannerTestFile("tpcds/tpcds-q55", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ56() {
+    runPlannerTestFile("tpcds/tpcds-q56", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ57() {
+    runPlannerTestFile("tpcds/tpcds-q57", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ58() {
+    runPlannerTestFile("tpcds/tpcds-q58", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ59() {
+    runPlannerTestFile("tpcds/tpcds-q59", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ60() {
+    runPlannerTestFile("tpcds/tpcds-q60", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ61() {
+    runPlannerTestFile("tpcds/tpcds-q61", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ62() {
+    runPlannerTestFile("tpcds/tpcds-q62", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ63() {
+    runPlannerTestFile("tpcds/tpcds-q63", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ64() {
+    runPlannerTestFile("tpcds/tpcds-q64", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ65() {
+    runPlannerTestFile("tpcds/tpcds-q65", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ66() {
+    runPlannerTestFile("tpcds/tpcds-q66", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ67() {
+    runPlannerTestFile("tpcds/tpcds-q67", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ68() {
+    runPlannerTestFile("tpcds/tpcds-q68", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ69() {
+    runPlannerTestFile("tpcds/tpcds-q69", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ70() {
+    runPlannerTestFile("tpcds/tpcds-q70", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ71() {
+    runPlannerTestFile("tpcds/tpcds-q71", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ72() {
+    runPlannerTestFile("tpcds/tpcds-q72", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ73() {
+    runPlannerTestFile("tpcds/tpcds-q73", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ74() {
+    runPlannerTestFile("tpcds/tpcds-q74", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ75() {
+    runPlannerTestFile("tpcds/tpcds-q75", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ76() {
+    runPlannerTestFile("tpcds/tpcds-q76", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ77() {
+    runPlannerTestFile("tpcds/tpcds-q77", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ78() {
+    runPlannerTestFile("tpcds/tpcds-q78", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ79() {
+    runPlannerTestFile("tpcds/tpcds-q79", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ80() {
+    runPlannerTestFile("tpcds/tpcds-q80", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ81() {
+    runPlannerTestFile("tpcds/tpcds-q81", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ82() {
+    runPlannerTestFile("tpcds/tpcds-q82", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ83() {
+    runPlannerTestFile("tpcds/tpcds-q83", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ84() {
+    runPlannerTestFile("tpcds/tpcds-q84", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ85() {
+    runPlannerTestFile("tpcds/tpcds-q85", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ86() {
+    runPlannerTestFile("tpcds/tpcds-q86", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ87() {
+    runPlannerTestFile("tpcds/tpcds-q87", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ88() {
+    runPlannerTestFile("tpcds/tpcds-q88", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ89() {
+    runPlannerTestFile("tpcds/tpcds-q89", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ90() {
+    runPlannerTestFile("tpcds/tpcds-q90", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ91() {
+    runPlannerTestFile("tpcds/tpcds-q91", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ92() {
+    runPlannerTestFile("tpcds/tpcds-q92", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ93() {
+    runPlannerTestFile("tpcds/tpcds-q93", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ94() {
+    runPlannerTestFile("tpcds/tpcds-q94", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ95() {
+    runPlannerTestFile("tpcds/tpcds-q95", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ96() {
+    runPlannerTestFile("tpcds/tpcds-q96", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ97() {
+    runPlannerTestFile("tpcds/tpcds-q97", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ98() {
+    runPlannerTestFile("tpcds/tpcds-q98", "tpcds_parquet", testOptions);
+  }
+
+  @Test
+  public void testQ99() {
+    runPlannerTestFile("tpcds/tpcds-q99", "tpcds_parquet", testOptions);
+  }
+}
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds-all.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds-all.test
deleted file mode 100644
index b5d9a20..0000000
--- a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds-all.test
+++ /dev/null
@@ -1,16020 +0,0 @@
-# TPCDS-Q3
-select
-  dt.d_year,
-  item.i_brand_id brand_id,
-  item.i_brand brand,
-  sum(ss_ext_sales_price) sum_agg
-from
-  date_dim dt,
-  store_sales,
-  item
-where
-  dt.d_date_sk = store_sales.ss_sold_date_sk
-  and store_sales.ss_item_sk = item.i_item_sk
-  and item.i_manufact_id = 436
-  and dt.d_moy = 12
-group by
-  dt.d_year,
-  item.i_brand,
-  item.i_brand_id
-order by
-  dt.d_year,
-  sum_agg desc,
-  brand_id
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=29.88MB Threads=4
-Per-Host Resource Estimates: Memory=214MB
-PLAN-ROOT SINK
-|
-06:TOP-N [LIMIT=100]
-|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
-|  row-size=52B cardinality=100
-|
-05:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_brand, item.i_brand_id
-|  row-size=52B cardinality=3.04K
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
-|  runtime filters: RF000 <- dt.d_date_sk
-|  row-size=72B cardinality=3.04K
-|
-|--00:SCAN HDFS [tpcds.date_dim dt]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_moy = 12
-|     row-size=12B cardinality=6.09K
-|
-03:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
-|  runtime filters: RF002 <- item.i_item_sk
-|  row-size=60B cardinality=3.04K
-|
-|--02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: item.i_manufact_id = 436
-|     row-size=44B cardinality=19
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> store_sales.ss_sold_date_sk, RF002 -> store_sales.ss_item_sk
-   row-size=16B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=34.81MB Threads=9
-Per-Host Resource Estimates: Memory=235MB
-PLAN-ROOT SINK
-|
-12:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
-|  limit: 100
-|
-06:TOP-N [LIMIT=100]
-|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
-|  row-size=52B cardinality=100
-|
-11:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_brand, item.i_brand_id
-|  row-size=52B cardinality=3.04K
-|
-10:EXCHANGE [HASH(dt.d_year,item.i_brand,item.i_brand_id)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_brand, item.i_brand_id
-|  row-size=52B cardinality=3.04K
-|
-04:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
-|  runtime filters: RF000 <- dt.d_date_sk
-|  row-size=72B cardinality=3.04K
-|
-|--09:EXCHANGE [HASH(dt.d_date_sk)]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim dt]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_moy = 12
-|     row-size=12B cardinality=6.09K
-|
-08:EXCHANGE [HASH(store_sales.ss_sold_date_sk)]
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
-|  runtime filters: RF002 <- item.i_item_sk
-|  row-size=60B cardinality=3.04K
-|
-|--07:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: item.i_manufact_id = 436
-|     row-size=44B cardinality=19
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> store_sales.ss_sold_date_sk, RF002 -> store_sales.ss_item_sk
-   row-size=16B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=52.62MB Threads=12
-Per-Host Resource Estimates: Memory=127MB
-PLAN-ROOT SINK
-|
-12:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
-|  limit: 100
-|
-06:TOP-N [LIMIT=100]
-|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
-|  row-size=52B cardinality=100
-|
-11:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_brand, item.i_brand_id
-|  row-size=52B cardinality=3.04K
-|
-10:EXCHANGE [HASH(dt.d_year,item.i_brand,item.i_brand_id)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_brand, item.i_brand_id
-|  row-size=52B cardinality=3.04K
-|
-04:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
-|  row-size=72B cardinality=3.04K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: dt.d_date_sk
-|  |  runtime filters: RF000 <- dt.d_date_sk
-|  |
-|  09:EXCHANGE [HASH(dt.d_date_sk)]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim dt]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_moy = 12
-|     row-size=12B cardinality=6.09K
-|
-08:EXCHANGE [HASH(store_sales.ss_sold_date_sk)]
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
-|  row-size=60B cardinality=3.04K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: item.i_item_sk
-|  |  runtime filters: RF002 <- item.i_item_sk
-|  |
-|  07:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: item.i_manufact_id = 436
-|     row-size=44B cardinality=19
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> store_sales.ss_sold_date_sk, RF002 -> store_sales.ss_item_sk
-   row-size=16B cardinality=2.88M
-====
-# TPCDS-Q7
-select
-  i_item_id,
-  avg(ss_quantity) agg1,
-  avg(ss_list_price) agg2,
-  avg(ss_coupon_amt) agg3,
-  avg(ss_sales_price) agg4
-from
-  store_sales,
-  customer_demographics,
-  date_dim,
-  item,
-  promotion
-where
-  ss_sold_date_sk = d_date_sk
-  and ss_item_sk = i_item_sk
-  and ss_cdemo_sk = cd_demo_sk
-  and ss_promo_sk = p_promo_sk
-  and cd_gender = 'F'
-  and cd_marital_status = 'W'
-  and cd_education_status = 'Primary'
-  and (p_channel_email = 'N'
-    or p_channel_event = 'N')
-  and d_year = 1998
-group by
-  i_item_id
-order by
-  i_item_id
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=50.38MB Threads=6
-Per-Host Resource Estimates: Memory=434MB
-PLAN-ROOT SINK
-|
-10:TOP-N [LIMIT=100]
-|  order by: i_item_id ASC
-|  row-size=60B cardinality=100
-|
-09:AGGREGATE [FINALIZE]
-|  output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|  group by: i_item_id
-|  row-size=60B cardinality=8.85K
-|
-08:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=162B cardinality=261.60K
-|
-|--03:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-07:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_promo_sk = p_promo_sk
-|  runtime filters: RF002 <- p_promo_sk
-|  row-size=126B cardinality=261.60K
-|
-|--04:SCAN HDFS [tpcds.promotion]
-|     HDFS partitions=1/1 files=1 size=36.36KB
-|     predicates: (p_channel_email = 'N' OR p_channel_event = 'N')
-|     row-size=30B cardinality=300
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_cdemo_sk = cd_demo_sk
-|  runtime filters: RF004 <- cd_demo_sk
-|  row-size=96B cardinality=263.34K
-|
-|--01:SCAN HDFS [tpcds.customer_demographics]
-|     HDFS partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
-|     row-size=52B cardinality=97.40K
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=44B cardinality=589.03K
-|
-|--02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998
-|     row-size=8B cardinality=373
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_item_sk, RF002 -> ss_promo_sk, RF004 -> ss_cdemo_sk, RF006 -> ss_sold_date_sk
-   row-size=36B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=54.31MB Threads=12
-Per-Host Resource Estimates: Memory=460MB
-PLAN-ROOT SINK
-|
-17:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: i_item_id ASC
-|  limit: 100
-|
-10:TOP-N [LIMIT=100]
-|  order by: i_item_id ASC
-|  row-size=60B cardinality=100
-|
-16:AGGREGATE [FINALIZE]
-|  output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
-|  group by: i_item_id
-|  row-size=60B cardinality=8.85K
-|
-15:EXCHANGE [HASH(i_item_id)]
-|
-09:AGGREGATE [STREAMING]
-|  output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|  group by: i_item_id
-|  row-size=60B cardinality=8.85K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=162B cardinality=261.60K
-|
-|--14:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_promo_sk = p_promo_sk
-|  runtime filters: RF002 <- p_promo_sk
-|  row-size=126B cardinality=261.60K
-|
-|--13:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.promotion]
-|     HDFS partitions=1/1 files=1 size=36.36KB
-|     predicates: (p_channel_email = 'N' OR p_channel_event = 'N')
-|     row-size=30B cardinality=300
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_cdemo_sk = cd_demo_sk
-|  runtime filters: RF004 <- cd_demo_sk
-|  row-size=96B cardinality=263.34K
-|
-|--12:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.customer_demographics]
-|     HDFS partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
-|     row-size=52B cardinality=97.40K
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=44B cardinality=589.03K
-|
-|--11:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998
-|     row-size=8B cardinality=373
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_item_sk, RF002 -> ss_promo_sk, RF004 -> ss_cdemo_sk, RF006 -> ss_sold_date_sk
-   row-size=36B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=84.56MB Threads=13
-Per-Host Resource Estimates: Memory=259MB
-PLAN-ROOT SINK
-|
-17:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: i_item_id ASC
-|  limit: 100
-|
-10:TOP-N [LIMIT=100]
-|  order by: i_item_id ASC
-|  row-size=60B cardinality=100
-|
-16:AGGREGATE [FINALIZE]
-|  output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
-|  group by: i_item_id
-|  row-size=60B cardinality=8.85K
-|
-15:EXCHANGE [HASH(i_item_id)]
-|
-09:AGGREGATE [STREAMING]
-|  output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|  group by: i_item_id
-|  row-size=60B cardinality=8.85K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=162B cardinality=261.60K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: i_item_sk
-|  |  runtime filters: RF000 <- i_item_sk
-|  |
-|  14:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_promo_sk = p_promo_sk
-|  row-size=126B cardinality=261.60K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: p_promo_sk
-|  |  runtime filters: RF002 <- p_promo_sk
-|  |
-|  13:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.promotion]
-|     HDFS partitions=1/1 files=1 size=36.36KB
-|     predicates: (p_channel_email = 'N' OR p_channel_event = 'N')
-|     row-size=30B cardinality=300
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_cdemo_sk = cd_demo_sk
-|  row-size=96B cardinality=263.34K
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: cd_demo_sk
-|  |  runtime filters: RF004 <- cd_demo_sk
-|  |
-|  12:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.customer_demographics]
-|     HDFS partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
-|     row-size=52B cardinality=97.40K
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=44B cardinality=589.03K
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |
-|  11:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998
-|     row-size=8B cardinality=373
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_item_sk, RF002 -> ss_promo_sk, RF004 -> ss_cdemo_sk, RF006 -> ss_sold_date_sk
-   row-size=36B cardinality=2.88M
-====
-# TPCDS-Q8
-select
-  s_store_name,
-  sum(ss_net_profit)
-from
-  store_sales
-  join store on (store_sales.ss_store_sk = store.s_store_sk)
-  join
-  (select
-    a.ca_zip
-  from
-    (select
-      substr(ca_zip, 1, 5) ca_zip,
-      count( *) cnt
-    from
-      customer_address
-      join  customer on (customer_address.ca_address_sk = customer.c_current_addr_sk)
-    where
-      c_preferred_cust_flag = 'Y'
-    group by
-      ca_zip
-    having
-      count(*) > 10
-    ) a
-    left semi join
-    (select
-      substr(ca_zip, 1, 5) ca_zip
-    from
-      customer_address
-    where
-      substr(ca_zip, 1, 5) in ('89436', '30868', '65085', '22977', '83927', '77557', '58429', '40697', '80614', '10502', '32779',
-      '91137', '61265', '98294', '17921', '18427', '21203', '59362', '87291', '84093', '21505', '17184', '10866', '67898', '25797',
-      '28055', '18377', '80332', '74535', '21757', '29742', '90885', '29898', '17819', '40811', '25990', '47513', '89531', '91068',
-      '10391', '18846', '99223', '82637', '41368', '83658', '86199', '81625', '26696', '89338', '88425', '32200', '81427', '19053',
-      '77471', '36610', '99823', '43276', '41249', '48584', '83550', '82276', '18842', '78890', '14090', '38123', '40936', '34425',
-      '19850', '43286', '80072', '79188', '54191', '11395', '50497', '84861', '90733', '21068', '57666', '37119', '25004', '57835',
-      '70067', '62878', '95806', '19303', '18840', '19124', '29785', '16737', '16022', '49613', '89977', '68310', '60069', '98360',
-      '48649', '39050', '41793', '25002', '27413', '39736', '47208', '16515', '94808', '57648', '15009', '80015', '42961', '63982',
-      '21744', '71853', '81087', '67468', '34175', '64008', '20261', '11201', '51799', '48043', '45645', '61163', '48375', '36447',
-      '57042', '21218', '41100', '89951', '22745', '35851', '83326', '61125', '78298', '80752', '49858', '52940', '96976', '63792',
-      '11376', '53582', '18717', '90226', '50530', '94203', '99447', '27670', '96577', '57856', '56372', '16165', '23427', '54561',
-      '28806', '44439', '22926', '30123', '61451', '92397', '56979', '92309', '70873', '13355', '21801', '46346', '37562', '56458',
-      '28286', '47306', '99555', '69399', '26234', '47546', '49661', '88601', '35943', '39936', '25632', '24611', '44166', '56648',
-      '30379', '59785', '11110', '14329', '93815', '52226', '71381', '13842', '25612', '63294', '14664', '21077', '82626', '18799',
-      '60915', '81020', '56447', '76619', '11433', '13414', '42548', '92713', '70467', '30884', '47484', '16072', '38936', '13036',
-      '88376', '45539', '35901', '19506', '65690', '73957', '71850', '49231', '14276', '20005', '18384', '76615', '11635', '38177',
-      '55607', '41369', '95447', '58581', '58149', '91946', '33790', '76232', '75692', '95464', '22246', '51061', '56692', '53121',
-      '77209', '15482', '10688', '14868', '45907', '73520', '72666', '25734', '17959', '24677', '66446', '94627', '53535', '15560',
-      '41967', '69297', '11929', '59403', '33283', '52232', '57350', '43933', '40921', '36635', '10827', '71286', '19736', '80619',
-      '25251', '95042', '15526', '36496', '55854', '49124', '81980', '35375', '49157', '63512', '28944', '14946', '36503', '54010',
-      '18767', '23969', '43905', '66979', '33113', '21286', '58471', '59080', '13395', '79144', '70373', '67031', '38360', '26705',
-      '50906', '52406', '26066', '73146', '15884', '31897', '30045', '61068', '45550', '92454', '13376', '14354', '19770', '22928',
-      '97790', '50723', '46081', '30202', '14410', '20223', '88500', '67298', '13261', '14172', '81410', '93578', '83583', '46047',
-      '94167', '82564', '21156', '15799', '86709', '37931', '74703', '83103', '23054', '70470', '72008', '49247', '91911', '69998',
-      '20961', '70070', '63197', '54853', '88191', '91830', '49521', '19454', '81450', '89091', '62378', '25683', '61869', '51744',
-      '36580', '85778', '36871', '48121', '28810', '83712', '45486', '67393', '26935', '42393', '20132', '55349', '86057', '21309',
-      '80218', '10094', '11357', '48819', '39734', '40758', '30432', '21204', '29467', '30214', '61024', '55307', '74621', '11622',
-      '68908', '33032', '52868', '99194', '99900', '84936', '69036', '99149', '45013', '32895', '59004', '32322', '14933', '32936',
-      '33562', '72550', '27385', '58049', '58200', '16808', '21360', '32961', '18586', '79307', '15492')
-    ) b
-  on (a.ca_zip = b.ca_zip)
-  ) v1 on (substr(store.s_zip, 1, 2) = substr(v1.ca_zip, 1, 2))
-where
-  ss_sold_date_sk between 2452276 and 2452366
-group by
-  s_store_name
-order by
-  s_store_name
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=32.38MB Threads=6
-Per-Host Resource Estimates: Memory=280MB
-PLAN-ROOT SINK
-|
-11:TOP-N [LIMIT=100]
-|  order by: s_store_name ASC
-|  row-size=32B cardinality=8
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum(ss_net_profit)
-|  group by: s_store_name
-|  row-size=32B cardinality=8
-|
-09:HASH JOIN [INNER JOIN]
-|  hash predicates: substr(store.s_zip, 1, 2) = substr(substr(ca_zip, 1, 5), 1, 2)
-|  runtime filters: RF000 <- substr(substr(ca_zip, 1, 5), 1, 2)
-|  row-size=65B cardinality=84.40K
-|
-|--07:HASH JOIN [RIGHT SEMI JOIN]
-|  |  hash predicates: substr(ca_zip, 1, 5) = substr(ca_zip, 1, 5)
-|  |  runtime filters: RF004 <- substr(ca_zip, 1, 5)
-|  |  row-size=20B cardinality=396
-|  |
-|  |--05:AGGREGATE [FINALIZE]
-|  |  |  output: count(*)
-|  |  |  group by: substr(ca_zip, 1, 5)
-|  |  |  having: count(*) > 10
-|  |  |  row-size=20B cardinality=396
-|  |  |
-|  |  04:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: customer_address.ca_address_sk = customer.c_current_addr_sk
-|  |  |  runtime filters: RF006 <- customer.c_current_addr_sk
-|  |  |  row-size=38B cardinality=51.30K
-|  |  |
-|  |  |--03:SCAN HDFS [tpcds.customer]
-|  |  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |  |     predicates: c_preferred_cust_flag = 'Y'
-|  |  |     row-size=17B cardinality=50.00K
-|  |  |
-|  |  02:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     runtime filters: RF006 -> customer_address.ca_address_sk
-|  |     row-size=21B cardinality=50.00K
-|  |
-|  06:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     predicates: substr(ca_zip, 1, 5) IN ('89436', '30868', '65085', '22977', '83927', '77557', '58429', '40697', '80614', '10502', '32779', '91137', '61265', '98294', '17921', '18427', '21203', '59362', '87291', '84093', '21505', '17184', '10866', '67898', '25797', '28055', '18377', '80332', '74535', '21757', '29742', '90885', '29898', '17819', '40811', '25990', '47513', '89531', '91068', '10391', '18846', '99223', '82637', '41368', '83658', '86199', '81625', '26696', '89338', '88425', '32200', '81427', '19053', '77471', '36610', '99823', '43276', '41249', '48584', '83550', '82276', '18842', '78890', '14090', '38123', '40936', '34425', '19850', '43286', '80072', '79188', '54191', '11395', '50497', '84861', '90733', '21068', '57666', '37119', '25004', '57835', '70067', '62878', '95806', '19303', '18840', '19124', '29785', '16737', '16022', '49613', '89977', '68310', '60069', '98360', '48649', '39050', '41793', '25002', '27413', '39736', '47208', '16515', '94808', '57648', '15009', '80015', '42961', '63982', '21744', '71853', '81087', '67468', '34175', '64008', '20261', '11201', '51799', '48043', '45645', '61163', '48375', '36447', '57042', '21218', '41100', '89951', '22745', '35851', '83326', '61125', '78298', '80752', '49858', '52940', '96976', '63792', '11376', '53582', '18717', '90226', '50530', '94203', '99447', '27670', '96577', '57856', '56372', '16165', '23427', '54561', '28806', '44439', '22926', '30123', '61451', '92397', '56979', '92309', '70873', '13355', '21801', '46346', '37562', '56458', '28286', '47306', '99555', '69399', '26234', '47546', '49661', '88601', '35943', '39936', '25632', '24611', '44166', '56648', '30379', '59785', '11110', '14329', '93815', '52226', '71381', '13842', '25612', '63294', '14664', '21077', '82626', '18799', '60915', '81020', '56447', '76619', '11433', '13414', '42548', '92713', '70467', '30884', '47484', '16072', '38936', '13036', '88376', '45539', '35901', '19506', '65690', '73957', '71850', '49231', '14276', '20005', '18384', '76615', '11635', '38177', '55607', '41369', '95447', '58581', '58149', '91946', '33790', '76232', '75692', '95464', '22246', '51061', '56692', '53121', '77209', '15482', '10688', '14868', '45907', '73520', '72666', '25734', '17959', '24677', '66446', '94627', '53535', '15560', '41967', '69297', '11929', '59403', '33283', '52232', '57350', '43933', '40921', '36635', '10827', '71286', '19736', '80619', '25251', '95042', '15526', '36496', '55854', '49124', '81980', '35375', '49157', '63512', '28944', '14946', '36503', '54010', '18767', '23969', '43905', '66979', '33113', '21286', '58471', '59080', '13395', '79144', '70373', '67031', '38360', '26705', '50906', '52406', '26066', '73146', '15884', '31897', '30045', '61068', '45550', '92454', '13376', '14354', '19770', '22928', '97790', '50723', '46081', '30202', '14410', '20223', '88500', '67298', '13261', '14172', '81410', '93578', '83583', '46047', '94167', '82564', '21156', '15799', '86709', '37931', '74703', '83103', '23054', '70470', '72008', '49247', '91911', '69998', '20961', '70070', '63197', '54853', '88191', '91830', '49521', '19454', '81450', '89091', '62378', '25683', '61869', '51744', '36580', '85778', '36871', '48121', '28810', '83712', '45486', '67393', '26935', '42393', '20132', '55349', '86057', '21309', '80218', '10094', '11357', '48819', '39734', '40758', '30432', '21204', '29467', '30214', '61024', '55307', '74621', '11622', '68908', '33032', '52868', '99194', '99900', '84936', '69036', '99149', '45013', '32895', '59004', '32322', '14933', '32936', '33562', '72550', '27385', '58049', '58200', '16808', '21360', '32961', '18586', '79307', '15492')
-|     runtime filters: RF004 -> substr(ca_zip, 1, 5)
-|     row-size=17B cardinality=5.00K
-|
-08:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  runtime filters: RF002 <- store.s_store_sk
-|  row-size=45B cardinality=84.40K
-|
-|--01:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF000 -> substr(store.s_zip, 1, 2)
-|     row-size=37B cardinality=12
-|
-00:SCAN HDFS [tpcds.store_sales]
-   partition predicates: ss_sold_date_sk >= 2452276, ss_sold_date_sk <= 2452366
-   HDFS partitions=90/1824 files=90 size=10.32MB
-   runtime filters: RF002 -> store_sales.ss_store_sk
-   row-size=8B cardinality=84.40K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=46.13MB Threads=13
-Per-Host Resource Estimates: Memory=327MB
-PLAN-ROOT SINK
-|
-20:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: s_store_name ASC
-|  limit: 100
-|
-11:TOP-N [LIMIT=100]
-|  order by: s_store_name ASC
-|  row-size=32B cardinality=8
-|
-19:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_net_profit)
-|  group by: s_store_name
-|  row-size=32B cardinality=8
-|
-18:EXCHANGE [HASH(s_store_name)]
-|
-10:AGGREGATE [STREAMING]
-|  output: sum(ss_net_profit)
-|  group by: s_store_name
-|  row-size=32B cardinality=8
-|
-09:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: substr(store.s_zip, 1, 2) = substr(substr(ca_zip, 1, 5), 1, 2)
-|  runtime filters: RF000 <- substr(substr(ca_zip, 1, 5), 1, 2)
-|  row-size=65B cardinality=84.40K
-|
-|--17:EXCHANGE [BROADCAST]
-|  |
-|  07:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
-|  |  hash predicates: substr(ca_zip, 1, 5) = substr(ca_zip, 1, 5)
-|  |  runtime filters: RF004 <- substr(ca_zip, 1, 5)
-|  |  row-size=20B cardinality=396
-|  |
-|  |--15:AGGREGATE [FINALIZE]
-|  |  |  output: count:merge(*)
-|  |  |  group by: substr(ca_zip, 1, 5)
-|  |  |  having: count(*) > 10
-|  |  |  row-size=20B cardinality=396
-|  |  |
-|  |  14:EXCHANGE [HASH(substr(ca_zip, 1, 5))]
-|  |  |
-|  |  05:AGGREGATE [STREAMING]
-|  |  |  output: count(*)
-|  |  |  group by: substr(ca_zip, 1, 5)
-|  |  |  row-size=20B cardinality=3.96K
-|  |  |
-|  |  04:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: customer_address.ca_address_sk = customer.c_current_addr_sk
-|  |  |  runtime filters: RF006 <- customer.c_current_addr_sk
-|  |  |  row-size=38B cardinality=51.30K
-|  |  |
-|  |  |--13:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  03:SCAN HDFS [tpcds.customer]
-|  |  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |  |     predicates: c_preferred_cust_flag = 'Y'
-|  |  |     row-size=17B cardinality=50.00K
-|  |  |
-|  |  02:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     runtime filters: RF006 -> customer_address.ca_address_sk
-|  |     row-size=21B cardinality=50.00K
-|  |
-|  16:EXCHANGE [HASH(substr(ca_zip, 1, 5))]
-|  |
-|  06:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     predicates: substr(ca_zip, 1, 5) IN ('89436', '30868', '65085', '22977', '83927', '77557', '58429', '40697', '80614', '10502', '32779', '91137', '61265', '98294', '17921', '18427', '21203', '59362', '87291', '84093', '21505', '17184', '10866', '67898', '25797', '28055', '18377', '80332', '74535', '21757', '29742', '90885', '29898', '17819', '40811', '25990', '47513', '89531', '91068', '10391', '18846', '99223', '82637', '41368', '83658', '86199', '81625', '26696', '89338', '88425', '32200', '81427', '19053', '77471', '36610', '99823', '43276', '41249', '48584', '83550', '82276', '18842', '78890', '14090', '38123', '40936', '34425', '19850', '43286', '80072', '79188', '54191', '11395', '50497', '84861', '90733', '21068', '57666', '37119', '25004', '57835', '70067', '62878', '95806', '19303', '18840', '19124', '29785', '16737', '16022', '49613', '89977', '68310', '60069', '98360', '48649', '39050', '41793', '25002', '27413', '39736', '47208', '16515', '94808', '57648', '15009', '80015', '42961', '63982', '21744', '71853', '81087', '67468', '34175', '64008', '20261', '11201', '51799', '48043', '45645', '61163', '48375', '36447', '57042', '21218', '41100', '89951', '22745', '35851', '83326', '61125', '78298', '80752', '49858', '52940', '96976', '63792', '11376', '53582', '18717', '90226', '50530', '94203', '99447', '27670', '96577', '57856', '56372', '16165', '23427', '54561', '28806', '44439', '22926', '30123', '61451', '92397', '56979', '92309', '70873', '13355', '21801', '46346', '37562', '56458', '28286', '47306', '99555', '69399', '26234', '47546', '49661', '88601', '35943', '39936', '25632', '24611', '44166', '56648', '30379', '59785', '11110', '14329', '93815', '52226', '71381', '13842', '25612', '63294', '14664', '21077', '82626', '18799', '60915', '81020', '56447', '76619', '11433', '13414', '42548', '92713', '70467', '30884', '47484', '16072', '38936', '13036', '88376', '45539', '35901', '19506', '65690', '73957', '71850', '49231', '14276', '20005', '18384', '76615', '11635', '38177', '55607', '41369', '95447', '58581', '58149', '91946', '33790', '76232', '75692', '95464', '22246', '51061', '56692', '53121', '77209', '15482', '10688', '14868', '45907', '73520', '72666', '25734', '17959', '24677', '66446', '94627', '53535', '15560', '41967', '69297', '11929', '59403', '33283', '52232', '57350', '43933', '40921', '36635', '10827', '71286', '19736', '80619', '25251', '95042', '15526', '36496', '55854', '49124', '81980', '35375', '49157', '63512', '28944', '14946', '36503', '54010', '18767', '23969', '43905', '66979', '33113', '21286', '58471', '59080', '13395', '79144', '70373', '67031', '38360', '26705', '50906', '52406', '26066', '73146', '15884', '31897', '30045', '61068', '45550', '92454', '13376', '14354', '19770', '22928', '97790', '50723', '46081', '30202', '14410', '20223', '88500', '67298', '13261', '14172', '81410', '93578', '83583', '46047', '94167', '82564', '21156', '15799', '86709', '37931', '74703', '83103', '23054', '70470', '72008', '49247', '91911', '69998', '20961', '70070', '63197', '54853', '88191', '91830', '49521', '19454', '81450', '89091', '62378', '25683', '61869', '51744', '36580', '85778', '36871', '48121', '28810', '83712', '45486', '67393', '26935', '42393', '20132', '55349', '86057', '21309', '80218', '10094', '11357', '48819', '39734', '40758', '30432', '21204', '29467', '30214', '61024', '55307', '74621', '11622', '68908', '33032', '52868', '99194', '99900', '84936', '69036', '99149', '45013', '32895', '59004', '32322', '14933', '32936', '33562', '72550', '27385', '58049', '58200', '16808', '21360', '32961', '18586', '79307', '15492')
-|     runtime filters: RF004 -> substr(ca_zip, 1, 5)
-|     row-size=17B cardinality=5.00K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  runtime filters: RF002 <- store.s_store_sk
-|  row-size=45B cardinality=84.40K
-|
-|--12:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF000 -> substr(store.s_zip, 1, 2)
-|     row-size=37B cardinality=12
-|
-00:SCAN HDFS [tpcds.store_sales]
-   partition predicates: ss_sold_date_sk >= 2452276, ss_sold_date_sk <= 2452366
-   HDFS partitions=90/1824 files=90 size=10.32MB
-   runtime filters: RF002 -> store_sales.ss_store_sk
-   row-size=8B cardinality=84.40K
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=58.38MB Threads=14
-Per-Host Resource Estimates: Memory=187MB
-PLAN-ROOT SINK
-|
-20:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: s_store_name ASC
-|  limit: 100
-|
-11:TOP-N [LIMIT=100]
-|  order by: s_store_name ASC
-|  row-size=32B cardinality=8
-|
-19:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_net_profit)
-|  group by: s_store_name
-|  row-size=32B cardinality=8
-|
-18:EXCHANGE [HASH(s_store_name)]
-|
-10:AGGREGATE [STREAMING]
-|  output: sum(ss_net_profit)
-|  group by: s_store_name
-|  row-size=32B cardinality=8
-|
-09:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: substr(store.s_zip, 1, 2) = substr(substr(ca_zip, 1, 5), 1, 2)
-|  row-size=65B cardinality=84.40K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: substr(substr(ca_zip, 1, 5), 1, 2)
-|  |  runtime filters: RF000 <- substr(substr(ca_zip, 1, 5), 1, 2)
-|  |
-|  17:EXCHANGE [BROADCAST]
-|  |
-|  07:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
-|  |  hash predicates: substr(ca_zip, 1, 5) = substr(ca_zip, 1, 5)
-|  |  row-size=20B cardinality=396
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=01 plan-id=02 cohort-id=02
-|  |  |  build expressions: substr(ca_zip, 1, 5)
-|  |  |  runtime filters: RF004 <- substr(ca_zip, 1, 5)
-|  |  |
-|  |  15:AGGREGATE [FINALIZE]
-|  |  |  output: count:merge(*)
-|  |  |  group by: substr(ca_zip, 1, 5)
-|  |  |  having: count(*) > 10
-|  |  |  row-size=20B cardinality=396
-|  |  |
-|  |  14:EXCHANGE [HASH(substr(ca_zip, 1, 5))]
-|  |  |
-|  |  05:AGGREGATE [STREAMING]
-|  |  |  output: count(*)
-|  |  |  group by: substr(ca_zip, 1, 5)
-|  |  |  row-size=20B cardinality=3.96K
-|  |  |
-|  |  04:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: customer_address.ca_address_sk = customer.c_current_addr_sk
-|  |  |  row-size=38B cardinality=51.30K
-|  |  |
-|  |  |--JOIN BUILD
-|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
-|  |  |  |  build expressions: customer.c_current_addr_sk
-|  |  |  |  runtime filters: RF006 <- customer.c_current_addr_sk
-|  |  |  |
-|  |  |  13:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  03:SCAN HDFS [tpcds.customer]
-|  |  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |  |     predicates: c_preferred_cust_flag = 'Y'
-|  |  |     row-size=17B cardinality=50.00K
-|  |  |
-|  |  02:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     runtime filters: RF006 -> customer_address.ca_address_sk
-|  |     row-size=21B cardinality=50.00K
-|  |
-|  16:EXCHANGE [HASH(substr(ca_zip, 1, 5))]
-|  |
-|  06:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     predicates: substr(ca_zip, 1, 5) IN ('89436', '30868', '65085', '22977', '83927', '77557', '58429', '40697', '80614', '10502', '32779', '91137', '61265', '98294', '17921', '18427', '21203', '59362', '87291', '84093', '21505', '17184', '10866', '67898', '25797', '28055', '18377', '80332', '74535', '21757', '29742', '90885', '29898', '17819', '40811', '25990', '47513', '89531', '91068', '10391', '18846', '99223', '82637', '41368', '83658', '86199', '81625', '26696', '89338', '88425', '32200', '81427', '19053', '77471', '36610', '99823', '43276', '41249', '48584', '83550', '82276', '18842', '78890', '14090', '38123', '40936', '34425', '19850', '43286', '80072', '79188', '54191', '11395', '50497', '84861', '90733', '21068', '57666', '37119', '25004', '57835', '70067', '62878', '95806', '19303', '18840', '19124', '29785', '16737', '16022', '49613', '89977', '68310', '60069', '98360', '48649', '39050', '41793', '25002', '27413', '39736', '47208', '16515', '94808', '57648', '15009', '80015', '42961', '63982', '21744', '71853', '81087', '67468', '34175', '64008', '20261', '11201', '51799', '48043', '45645', '61163', '48375', '36447', '57042', '21218', '41100', '89951', '22745', '35851', '83326', '61125', '78298', '80752', '49858', '52940', '96976', '63792', '11376', '53582', '18717', '90226', '50530', '94203', '99447', '27670', '96577', '57856', '56372', '16165', '23427', '54561', '28806', '44439', '22926', '30123', '61451', '92397', '56979', '92309', '70873', '13355', '21801', '46346', '37562', '56458', '28286', '47306', '99555', '69399', '26234', '47546', '49661', '88601', '35943', '39936', '25632', '24611', '44166', '56648', '30379', '59785', '11110', '14329', '93815', '52226', '71381', '13842', '25612', '63294', '14664', '21077', '82626', '18799', '60915', '81020', '56447', '76619', '11433', '13414', '42548', '92713', '70467', '30884', '47484', '16072', '38936', '13036', '88376', '45539', '35901', '19506', '65690', '73957', '71850', '49231', '14276', '20005', '18384', '76615', '11635', '38177', '55607', '41369', '95447', '58581', '58149', '91946', '33790', '76232', '75692', '95464', '22246', '51061', '56692', '53121', '77209', '15482', '10688', '14868', '45907', '73520', '72666', '25734', '17959', '24677', '66446', '94627', '53535', '15560', '41967', '69297', '11929', '59403', '33283', '52232', '57350', '43933', '40921', '36635', '10827', '71286', '19736', '80619', '25251', '95042', '15526', '36496', '55854', '49124', '81980', '35375', '49157', '63512', '28944', '14946', '36503', '54010', '18767', '23969', '43905', '66979', '33113', '21286', '58471', '59080', '13395', '79144', '70373', '67031', '38360', '26705', '50906', '52406', '26066', '73146', '15884', '31897', '30045', '61068', '45550', '92454', '13376', '14354', '19770', '22928', '97790', '50723', '46081', '30202', '14410', '20223', '88500', '67298', '13261', '14172', '81410', '93578', '83583', '46047', '94167', '82564', '21156', '15799', '86709', '37931', '74703', '83103', '23054', '70470', '72008', '49247', '91911', '69998', '20961', '70070', '63197', '54853', '88191', '91830', '49521', '19454', '81450', '89091', '62378', '25683', '61869', '51744', '36580', '85778', '36871', '48121', '28810', '83712', '45486', '67393', '26935', '42393', '20132', '55349', '86057', '21309', '80218', '10094', '11357', '48819', '39734', '40758', '30432', '21204', '29467', '30214', '61024', '55307', '74621', '11622', '68908', '33032', '52868', '99194', '99900', '84936', '69036', '99149', '45013', '32895', '59004', '32322', '14933', '32936', '33562', '72550', '27385', '58049', '58200', '16808', '21360', '32961', '18586', '79307', '15492')
-|     runtime filters: RF004 -> substr(ca_zip, 1, 5)
-|     row-size=17B cardinality=5.00K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  row-size=45B cardinality=84.40K
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |  build expressions: store.s_store_sk
-|  |  runtime filters: RF002 <- store.s_store_sk
-|  |
-|  12:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF000 -> substr(store.s_zip, 1, 2)
-|     row-size=37B cardinality=12
-|
-00:SCAN HDFS [tpcds.store_sales]
-   partition predicates: ss_sold_date_sk >= 2452276, ss_sold_date_sk <= 2452366
-   HDFS partitions=90/1824 files=90 size=10.32MB
-   runtime filters: RF002 -> store_sales.ss_store_sk
-   row-size=8B cardinality=84.40K
-====
-# TPCDS-Q13
-select avg(ss_quantity)
-       ,avg(ss_ext_sales_price)
-       ,avg(ss_ext_wholesale_cost)
-       ,sum(ss_ext_wholesale_cost)
- from store_sales
-     ,store
-     ,customer_demographics
-     ,household_demographics
-     ,customer_address
-     ,date_dim
- where s_store_sk = ss_store_sk
- and  ss_sold_date_sk = d_date_sk and d_year = 2001
- and((ss_hdemo_sk=hd_demo_sk
-  and cd_demo_sk = ss_cdemo_sk
-  and cd_marital_status = 'M'
-  and cd_education_status = 'Advanced Degree'
-  and ss_sales_price between 100.00 and 150.00
-  and hd_dep_count = 3
-     )or
-     (ss_hdemo_sk=hd_demo_sk
-  and cd_demo_sk = ss_cdemo_sk
-  and cd_marital_status = 'S'
-  and cd_education_status = 'College'
-  and ss_sales_price between 50.00 and 100.00
-  and hd_dep_count = 1
-     ) or
-     (ss_hdemo_sk=hd_demo_sk
-  and cd_demo_sk = ss_cdemo_sk
-  and cd_marital_status = 'W'
-  and cd_education_status = '2 yr Degree'
-  and ss_sales_price between 150.00 and 200.00
-  and hd_dep_count = 1
-     ))
- and((ss_addr_sk = ca_address_sk
-  and ca_country = 'United States'
-  and ca_state in ('TX', 'OH', 'TX')
-  and ss_net_profit between 100 and 200
-     ) or
-     (ss_addr_sk = ca_address_sk
-  and ca_country = 'United States'
-  and ca_state in ('OR', 'NM', 'KY')
-  and ss_net_profit between 150 and 300
-     ) or
-     (ss_addr_sk = ca_address_sk
-  and ca_country = 'United States'
-  and ca_state in ('VA', 'TX', 'MS')
-  and ss_net_profit between 50 and 250
-     ))
----- PLAN
-Max Per-Host Resource Reservation: Memory=45.01MB Threads=7
-Per-Host Resource Estimates: Memory=461MB
-PLAN-ROOT SINK
-|
-11:AGGREGATE [FINALIZE]
-|  output: avg(ss_quantity), avg(ss_ext_sales_price), avg(ss_ext_wholesale_cost), sum(ss_ext_wholesale_cost)
-|  row-size=40B cardinality=1
-|
-10:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=142B cardinality=2.55K
-|
-|--01:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=4B cardinality=12
-|
-09:HASH JOIN [INNER JOIN]
-|  hash predicates: cd_demo_sk = ss_cdemo_sk
-|  other predicates: cd_education_status = 'Advanced Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR hd_dep_count = 1, cd_marital_status = 'M' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR hd_dep_count = 1, hd_dep_count = 3 OR cd_education_status = 'College' OR hd_dep_count = 1, cd_education_status = 'Advanced Degree' OR hd_dep_count = 1 OR hd_dep_count = 1, hd_dep_count IN (3, 1) OR cd_education_status = '2 yr Degree', hd_dep_count = 3 OR cd_education_status = 'College' OR cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR hd_dep_count = 1 OR cd_education_status = '2 yr Degree', cd_marital_status = 'M' OR hd_dep_count = 1 OR hd_dep_count = 1, hd_dep_count = 3 OR cd_marital_status = 'S' OR hd_dep_count = 1, hd_dep_count IN (3, 1) OR cd_marital_status = 'W', hd_dep_count = 3 OR cd_education_status = 'College' OR cd_marital_status = 'W', cd_marital_status = 'M' OR hd_dep_count = 1 OR cd_education_status = '2 yr Degree', hd_dep_count = 3 OR cd_marital_status = 'S' OR cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR hd_dep_count = 1 OR cd_marital_status = 'W', cd_marital_status = 'M' OR hd_dep_count = 1 OR cd_marital_status = 'W', hd_dep_count = 3 OR cd_marital_status = 'S' OR cd_marital_status = 'W', cd_marital_status = 'M' OR hd_dep_count = 1 OR ss_sales_price <= 200.00, cd_marital_status = 'M' OR hd_dep_count = 1 OR ss_sales_price >= 150.00, cd_marital_status = 'M' OR ss_sales_price <= 100.00 OR hd_dep_count = 1, cd_marital_status = 'M' OR ss_sales_price <= 100.00 OR ss_sales_price <= 200.00, cd_marital_status = 'M' OR ss_sales_price <= 100.00 OR ss_sales_price >= 150.00, cd_marital_status = 'M' OR ss_sales_price >= 50.00 OR hd_dep_count = 1, cd_marital_status = 'M' OR ss_sales_price >= 50.00 OR ss_sales_price <= 200.00, cd_marital_status = 'M' OR ss_sales_price >= 50.00 OR ss_sales_price >= 150.00, hd_dep_count = 3 OR cd_marital_status = 'S' OR ss_sales_price <= 200.00, hd_dep_count = 3 OR cd_marital_status = 'S' OR ss_sales_price >= 150.00, hd_dep_count = 3 OR ss_sales_price <= 100.00 OR cd_marital_status = 'W', hd_dep_count = 3 OR ss_sales_price >= 50.00 OR cd_marital_status = 'W', ss_sales_price <= 150.00 OR cd_marital_status = 'S' OR hd_dep_count = 1, ss_sales_price <= 150.00 OR cd_marital_status = 'S' OR ss_sales_price <= 200.00, ss_sales_price <= 150.00 OR cd_marital_status = 'S' OR ss_sales_price >= 150.00, ss_sales_price <= 150.00 OR hd_dep_count = 1 OR cd_marital_status = 'W', ss_sales_price <= 150.00 OR ss_sales_price <= 100.00 OR cd_marital_status = 'W', ss_sales_price <= 150.00 OR ss_sales_price >= 50.00 OR cd_marital_status = 'W', ss_sales_price >= 100.00 OR cd_marital_status = 'S' OR hd_dep_count = 1, ss_sales_price >= 100.00 OR cd_marital_status = 'S' OR ss_sales_price <= 200.00, ss_sales_price >= 100.00 OR cd_marital_status = 'S' OR ss_sales_price >= 150.00, ss_sales_price >= 100.00 OR hd_dep_count = 1 OR cd_marital_status = 'W', ss_sales_price >= 100.00 OR ss_sales_price <= 100.00 OR cd_marital_status = 'W', ss_sales_price >= 100.00 OR ss_sales_price >= 50.00 OR cd_marital_status = 'W', cd_marital_status = 'M' OR ss_sales_price <= 100.00 OR cd_marital_status = 'W', cd_marital_status = 'M' OR ss_sales_price >= 50.00 OR cd_marital_status = 'W', ss_sales_price <= 150.00 OR cd_marital_status = 'S' OR cd_marital_status = 'W', ss_sales_price >= 100.00 OR cd_marital_status = 'S' OR cd_marital_status = 'W', hd_dep_count = 3 OR cd_education_status = 'College' OR ss_sales_price <= 200.00, hd_dep_count = 3 OR cd_education_status = 'College' OR ss_sales_price >= 150.00, ss_sales_price <= 150.00 OR cd_education_status = 'College' OR hd_dep_count = 1, ss_sales_price <= 150.00 OR cd_education_status = 'College' OR ss_sales_price <= 200.00, ss_sales_price <= 150.00 OR cd_education_status = 'College' OR ss_sales_price >= 150.00, ss_sales_price >= 100.00 OR cd_education_status = 'College' OR hd_dep_count = 1, ss_sales_price >= 100.00 OR cd_education_status = 'College' OR ss_sales_price <= 200.00, ss_sales_price >= 100.00 OR cd_education_status = 'College' OR ss_sales_price >= 150.00, ss_sales_price <= 150.00 OR cd_education_status = 'College' OR cd_marital_status = 'W', ss_sales_price >= 100.00 OR cd_education_status = 'College' OR cd_marital_status = 'W', hd_dep_count = 3 OR ss_sales_price <= 100.00 OR cd_education_status = '2 yr Degree', hd_dep_count = 3 OR ss_sales_price >= 50.00 OR cd_education_status = '2 yr Degree', ss_sales_price <= 150.00 OR hd_dep_count = 1 OR cd_education_status = '2 yr Degree', ss_sales_price <= 150.00 OR ss_sales_price <= 100.00 OR cd_education_status = '2 yr Degree', ss_sales_price <= 150.00 OR ss_sales_price >= 50.00 OR cd_education_status = '2 yr Degree', ss_sales_price >= 100.00 OR hd_dep_count = 1 OR cd_education_status = '2 yr Degree', ss_sales_price >= 100.00 OR ss_sales_price <= 100.00 OR cd_education_status = '2 yr Degree', ss_sales_price >= 100.00 OR ss_sales_price >= 50.00 OR cd_education_status = '2 yr Degree', cd_marital_status = 'M' OR ss_sales_price <= 100.00 OR cd_education_status = '2 yr Degree', cd_marital_status = 'M' OR ss_sales_price >= 50.00 OR cd_education_status = '2 yr Degree', ss_sales_price <= 150.00 OR cd_marital_status = 'S' OR cd_education_status = '2 yr Degree', ss_sales_price >= 100.00 OR cd_marital_status = 'S' OR cd_education_status = '2 yr Degree', cd_marital_status = 'M' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR ss_sales_price <= 200.00, cd_marital_status = 'M' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR ss_sales_price >= 150.00, cd_education_status = 'Advanced Degree' OR hd_dep_count = 1 OR ss_sales_price <= 200.00, cd_education_status = 'Advanced Degree' OR hd_dep_count = 1 OR ss_sales_price >= 150.00, cd_education_status = 'Advanced Degree' OR ss_sales_price <= 100.00 OR hd_dep_count = 1, cd_education_status = 'Advanced Degree' OR ss_sales_price <= 100.00 OR ss_sales_price <= 200.00, cd_education_status = 'Advanced Degree' OR ss_sales_price <= 100.00 OR ss_sales_price >= 150.00, cd_education_status = 'Advanced Degree' OR ss_sales_price >= 50.00 OR hd_dep_count = 1, cd_education_status = 'Advanced Degree' OR ss_sales_price >= 50.00 OR ss_sales_price <= 200.00, cd_education_status = 'Advanced Degree' OR ss_sales_price >= 50.00 OR ss_sales_price >= 150.00, cd_education_status = 'Advanced Degree' OR ss_sales_price <= 100.00 OR cd_marital_status = 'W', cd_education_status = 'Advanced Degree' OR ss_sales_price >= 50.00 OR cd_marital_status = 'W', ss_sales_price <= 150.00 OR cd_education_status = 'College' OR cd_education_status = '2 yr Degree', ss_sales_price >= 100.00 OR cd_education_status = 'College' OR cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR ss_sales_price <= 100.00 OR cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR ss_sales_price >= 50.00 OR cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR ss_sales_price <= 200.00, cd_education_status = 'Advanced Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR ss_sales_price >= 150.00
-|  runtime filters: RF002 <- ss_cdemo_sk
-|  row-size=138B cardinality=2.55K
-|
-|--08:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_hdemo_sk = hd_demo_sk
-|  |  other predicates: hd_dep_count IN (3, 1) OR ss_sales_price <= 200.00, hd_dep_count IN (3, 1) OR ss_sales_price >= 150.00, hd_dep_count = 3 OR ss_sales_price <= 100.00 OR hd_dep_count = 1, hd_dep_count = 3 OR ss_sales_price <= 100.00 OR ss_sales_price <= 200.00, hd_dep_count = 3 OR ss_sales_price <= 100.00 OR ss_sales_price >= 150.00, hd_dep_count = 3 OR ss_sales_price >= 50.00 OR hd_dep_count = 1, hd_dep_count = 3 OR ss_sales_price >= 50.00 OR ss_sales_price <= 200.00, hd_dep_count = 3 OR ss_sales_price >= 50.00 OR ss_sales_price >= 150.00, ss_sales_price <= 150.00 OR hd_dep_count = 1 OR hd_dep_count = 1, ss_sales_price <= 150.00 OR hd_dep_count = 1 OR ss_sales_price <= 200.00, ss_sales_price <= 150.00 OR hd_dep_count = 1 OR ss_sales_price >= 150.00, ss_sales_price <= 150.00 OR ss_sales_price <= 100.00 OR hd_dep_count = 1, ss_sales_price <= 150.00 OR ss_sales_price >= 50.00 OR hd_dep_count = 1, ss_sales_price >= 100.00 OR hd_dep_count = 1 OR hd_dep_count = 1, ss_sales_price >= 100.00 OR hd_dep_count = 1 OR ss_sales_price <= 200.00, ss_sales_price >= 100.00 OR hd_dep_count = 1 OR ss_sales_price >= 150.00, ss_sales_price >= 100.00 OR ss_sales_price <= 100.00 OR hd_dep_count = 1, ss_sales_price >= 100.00 OR ss_sales_price >= 50.00 OR hd_dep_count = 1
-|  |  runtime filters: RF004 <- hd_demo_sk
-|  |  row-size=99B cardinality=3.05K
-|  |
-|  |--03:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: hd_dep_count IN (3, 1, 1)
-|  |     row-size=8B cardinality=2.16K
-|  |
-|  07:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |  row-size=91B cardinality=10.43K
-|  |
-|  |--05:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 2001
-|  |     row-size=8B cardinality=373
-|  |
-|  06:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_addr_sk = ca_address_sk
-|  |  other predicates: ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit <= 300 OR ss_net_profit <= 250, ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit <= 300 OR ss_net_profit >= 50, ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit >= 150 OR ss_net_profit <= 250, ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit >= 150 OR ss_net_profit >= 50, ss_net_profit <= 200 OR ca_state IN ('OR', 'NM', 'KY') OR ss_net_profit <= 250, ss_net_profit <= 200 OR ca_state IN ('OR', 'NM', 'KY') OR ss_net_profit >= 50, ss_net_profit <= 200 OR ss_net_profit <= 300 OR ca_state IN ('VA', 'TX', 'MS'), ss_net_profit <= 200 OR ss_net_profit >= 150 OR ca_state IN ('VA', 'TX', 'MS'), ss_net_profit >= 100 OR ca_state IN ('OR', 'NM', 'KY') OR ss_net_profit <= 250, ss_net_profit >= 100 OR ca_state IN ('OR', 'NM', 'KY') OR ss_net_profit >= 50, ss_net_profit >= 100 OR ss_net_profit <= 300 OR ca_state IN ('VA', 'TX', 'MS'), ss_net_profit >= 100 OR ss_net_profit >= 150 OR ca_state IN ('VA', 'TX', 'MS'), ca_state IN ('TX', 'OH', 'TX', 'OR', 'NM', 'KY') OR ss_net_profit <= 250, ca_state IN ('TX', 'OH', 'TX', 'OR', 'NM', 'KY') OR ss_net_profit >= 50, ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit <= 300 OR ca_state IN ('VA', 'TX', 'MS'), ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit >= 150 OR ca_state IN ('VA', 'TX', 'MS'), ss_net_profit <= 200 OR ca_state IN ('OR', 'NM', 'KY') OR ca_state IN ('VA', 'TX', 'MS'), ss_net_profit >= 100 OR ca_state IN ('OR', 'NM', 'KY') OR ca_state IN ('VA', 'TX', 'MS')
-|  |  runtime filters: RF008 <- ca_address_sk
-|  |  row-size=83B cardinality=50.98K
-|  |
-|  |--04:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     predicates: ca_state IN ('TX', 'OH', 'TX', 'OR', 'NM', 'KY', 'VA', 'TX', 'MS'), ca_country = 'United States'
-|  |     row-size=43B cardinality=8.82K
-|  |
-|  00:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_net_profit <= 200 OR ss_net_profit <= 300 OR ss_net_profit <= 250, ss_net_profit <= 200 OR ss_net_profit <= 300 OR ss_net_profit >= 50, ss_net_profit <= 200 OR ss_net_profit >= 150 OR ss_net_profit <= 250, ss_net_profit <= 200 OR ss_net_profit >= 150 OR ss_net_profit >= 50, ss_net_profit >= 100 OR ss_net_profit <= 300 OR ss_net_profit <= 250, ss_net_profit >= 100 OR ss_net_profit <= 300 OR ss_net_profit >= 50, ss_net_profit >= 100 OR ss_net_profit >= 150 OR ss_net_profit <= 250, ss_net_profit >= 100 OR ss_net_profit >= 150 OR ss_net_profit >= 50, ss_sales_price <= 150.00 OR ss_sales_price <= 100.00 OR ss_sales_price <= 200.00, ss_sales_price <= 150.00 OR ss_sales_price <= 100.00 OR ss_sales_price >= 150.00, ss_sales_price <= 150.00 OR ss_sales_price >= 50.00 OR ss_sales_price <= 200.00, ss_sales_price <= 150.00 OR ss_sales_price >= 50.00 OR ss_sales_price >= 150.00, ss_sales_price >= 100.00 OR ss_sales_price <= 100.00 OR ss_sales_price <= 200.00, ss_sales_price >= 100.00 OR ss_sales_price <= 100.00 OR ss_sales_price >= 150.00, ss_sales_price >= 100.00 OR ss_sales_price >= 50.00 OR ss_sales_price <= 200.00, ss_sales_price >= 100.00 OR ss_sales_price >= 50.00 OR ss_sales_price >= 150.00
-|     runtime filters: RF000 -> ss_store_sk, RF004 -> ss_hdemo_sk, RF006 -> ss_sold_date_sk, RF008 -> ss_addr_sk
-|     row-size=40B cardinality=288.04K
-|
-02:SCAN HDFS [tpcds.customer_demographics]
-   HDFS partitions=1/1 files=1 size=76.92MB
-   predicates: cd_marital_status = 'M' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR cd_marital_status = 'W' AND cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR cd_marital_status = 'W' AND cd_education_status = '2 yr Degree'
-   runtime filters: RF002 -> cd_demo_sk
-   row-size=39B cardinality=181.75K
-====
-# TPCDS-Q19
-select
-  i_brand_id brand_id,
-  i_brand brand,
-  i_manufact_id,
-  i_manufact,
-  sum(ss_ext_sales_price) ext_price
-from
-  date_dim,
-  store_sales,
-  item,
-  customer,
-  customer_address,
-  store
-where
-  d_date_sk = ss_sold_date_sk
-  and ss_item_sk = i_item_sk
-  and i_manager_id = 7
-  and d_moy = 11
-  and d_year = 1999
-  and ss_customer_sk = c_customer_sk
-  and c_current_addr_sk = ca_address_sk
-  and substr(ca_zip, 1, 5) <> substr(s_zip, 1, 5)
-  and ss_store_sk = s_store_sk
-  and ss_sold_date_sk between 2451484 and 2451513
-group by
-  i_brand,
-  i_brand_id,
-  i_manufact_id,
-  i_manufact
-order by
-  ext_price desc,
-  i_brand,
-  i_brand_id,
-  i_manufact_id,
-  i_manufact
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=43.32MB Threads=7
-Per-Host Resource Estimates: Memory=331MB
-PLAN-ROOT SINK
-|
-12:TOP-N [LIMIT=100]
-|  order by: sum(ss_ext_sales_price) DESC, i_brand ASC, i_brand_id ASC, i_manufact_id ASC, i_manufact ASC
-|  row-size=76B cardinality=24
-|
-11:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_brand, i_brand_id, i_manufact_id, i_manufact
-|  row-size=76B cardinality=24
-|
-10:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  other predicates: substr(ca_zip, 1, 5) != substr(s_zip, 1, 5)
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=158B cardinality=24
-|
-|--05:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=21B cardinality=12
-|
-09:HASH JOIN [INNER JOIN]
-|  hash predicates: ca_address_sk = c_current_addr_sk
-|  runtime filters: RF002 <- c_current_addr_sk
-|  row-size=137B cardinality=24
-|
-|--08:HASH JOIN [INNER JOIN]
-|  |  hash predicates: c_customer_sk = ss_customer_sk
-|  |  runtime filters: RF004 <- ss_customer_sk
-|  |  row-size=116B cardinality=24
-|  |
-|  |--07:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  |  runtime filters: RF006 <- d_date_sk
-|  |  |  row-size=108B cardinality=24
-|  |  |
-|  |  |--00:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_year = 1999, d_moy = 11, tpcds.date_dim.d_date_sk <= 2451513, tpcds.date_dim.d_date_sk >= 2451484
-|  |  |     row-size=12B cardinality=50
-|  |  |
-|  |  06:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ss_item_sk = i_item_sk
-|  |  |  runtime filters: RF008 <- i_item_sk
-|  |  |  row-size=96B cardinality=873
-|  |  |
-|  |  |--02:SCAN HDFS [tpcds.item]
-|  |  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |  |     predicates: i_manager_id = 7
-|  |  |     row-size=72B cardinality=182
-|  |  |
-|  |  01:SCAN HDFS [tpcds.store_sales]
-|  |     partition predicates: ss_sold_date_sk >= 2451484, ss_sold_date_sk <= 2451513
-|  |     HDFS partitions=30/1824 files=30 size=10.55MB
-|  |     runtime filters: RF000 -> ss_store_sk, RF006 -> ss_sold_date_sk, RF008 -> ss_item_sk
-|  |     row-size=24B cardinality=86.28K
-|  |
-|  03:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF004 -> c_customer_sk
-|     row-size=8B cardinality=100.00K
-|
-04:SCAN HDFS [tpcds.customer_address]
-   HDFS partitions=1/1 files=1 size=5.25MB
-   runtime filters: RF002 -> ca_address_sk
-   row-size=21B cardinality=50.00K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=54.13MB Threads=16
-Per-Host Resource Estimates: Memory=360MB
-PLAN-ROOT SINK
-|
-22:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum(ss_ext_sales_price) DESC, i_brand ASC, i_brand_id ASC, i_manufact_id ASC, i_manufact ASC
-|  limit: 100
-|
-12:TOP-N [LIMIT=100]
-|  order by: sum(ss_ext_sales_price) DESC, i_brand ASC, i_brand_id ASC, i_manufact_id ASC, i_manufact ASC
-|  row-size=76B cardinality=24
-|
-21:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: i_brand, i_brand_id, i_manufact_id, i_manufact
-|  row-size=76B cardinality=24
-|
-20:EXCHANGE [HASH(i_brand,i_brand_id,i_manufact_id,i_manufact)]
-|
-11:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_brand, i_brand_id, i_manufact_id, i_manufact
-|  row-size=76B cardinality=24
-|
-10:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  other predicates: substr(ca_zip, 1, 5) != substr(s_zip, 1, 5)
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=158B cardinality=24
-|
-|--19:EXCHANGE [BROADCAST]
-|  |
-|  05:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=21B cardinality=12
-|
-09:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: c_current_addr_sk = ca_address_sk
-|  runtime filters: RF002 <- ca_address_sk
-|  row-size=137B cardinality=24
-|
-|--18:EXCHANGE [HASH(ca_address_sk)]
-|  |
-|  04:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=21B cardinality=50.00K
-|
-17:EXCHANGE [HASH(c_current_addr_sk)]
-|
-08:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF004 <- c_customer_sk
-|  row-size=116B cardinality=24
-|
-|--16:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  03:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF002 -> c_current_addr_sk
-|     row-size=8B cardinality=100.00K
-|
-15:EXCHANGE [HASH(ss_customer_sk)]
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=108B cardinality=24
-|
-|--14:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1999, d_moy = 11, tpcds.date_dim.d_date_sk <= 2451513, tpcds.date_dim.d_date_sk >= 2451484
-|     row-size=12B cardinality=50
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF008 <- i_item_sk
-|  row-size=96B cardinality=873
-|
-|--13:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_manager_id = 7
-|     row-size=72B cardinality=182
-|
-01:SCAN HDFS [tpcds.store_sales]
-   partition predicates: ss_sold_date_sk >= 2451484, ss_sold_date_sk <= 2451513
-   HDFS partitions=30/1824 files=30 size=10.55MB
-   runtime filters: RF000 -> ss_store_sk, RF004 -> ss_customer_sk, RF006 -> ss_sold_date_sk, RF008 -> ss_item_sk
-   row-size=24B cardinality=86.28K
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=72.26MB Threads=21
-Per-Host Resource Estimates: Memory=203MB
-PLAN-ROOT SINK
-|
-22:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum(ss_ext_sales_price) DESC, i_brand ASC, i_brand_id ASC, i_manufact_id ASC, i_manufact ASC
-|  limit: 100
-|
-12:TOP-N [LIMIT=100]
-|  order by: sum(ss_ext_sales_price) DESC, i_brand ASC, i_brand_id ASC, i_manufact_id ASC, i_manufact ASC
-|  row-size=76B cardinality=24
-|
-21:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: i_brand, i_brand_id, i_manufact_id, i_manufact
-|  row-size=76B cardinality=24
-|
-20:EXCHANGE [HASH(i_brand,i_brand_id,i_manufact_id,i_manufact)]
-|
-11:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_brand, i_brand_id, i_manufact_id, i_manufact
-|  row-size=76B cardinality=24
-|
-10:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  other predicates: substr(ca_zip, 1, 5) != substr(s_zip, 1, 5)
-|  row-size=158B cardinality=24
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: s_store_sk
-|  |  runtime filters: RF000 <- s_store_sk
-|  |
-|  19:EXCHANGE [BROADCAST]
-|  |
-|  05:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=21B cardinality=12
-|
-09:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: c_current_addr_sk = ca_address_sk
-|  row-size=137B cardinality=24
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: ca_address_sk
-|  |  runtime filters: RF002 <- ca_address_sk
-|  |
-|  18:EXCHANGE [HASH(ca_address_sk)]
-|  |
-|  04:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=21B cardinality=50.00K
-|
-17:EXCHANGE [HASH(c_current_addr_sk)]
-|
-08:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  row-size=116B cardinality=24
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: c_customer_sk
-|  |  runtime filters: RF004 <- c_customer_sk
-|  |
-|  16:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  03:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF002 -> c_current_addr_sk
-|     row-size=8B cardinality=100.00K
-|
-15:EXCHANGE [HASH(ss_customer_sk)]
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=108B cardinality=24
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |
-|  14:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1999, d_moy = 11, tpcds.date_dim.d_date_sk <= 2451513, tpcds.date_dim.d_date_sk >= 2451484
-|     row-size=12B cardinality=50
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=96B cardinality=873
-|
-|--JOIN BUILD
-|  |  join-table-id=04 plan-id=05 cohort-id=01
-|  |  build expressions: i_item_sk
-|  |  runtime filters: RF008 <- i_item_sk
-|  |
-|  13:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_manager_id = 7
-|     row-size=72B cardinality=182
-|
-01:SCAN HDFS [tpcds.store_sales]
-   partition predicates: ss_sold_date_sk >= 2451484, ss_sold_date_sk <= 2451513
-   HDFS partitions=30/1824 files=30 size=10.55MB
-   runtime filters: RF000 -> ss_store_sk, RF004 -> ss_customer_sk, RF006 -> ss_sold_date_sk, RF008 -> ss_item_sk
-   row-size=24B cardinality=86.28K
-====
-# TPCDS-Q27
-select
-  i_item_id,
-  s_state,
-  avg(ss_quantity) agg1,
-  avg(ss_list_price) agg2,
-  avg(ss_coupon_amt) agg3,
-  avg(ss_sales_price) agg4
-from
-  store_sales,
-  customer_demographics,
-  date_dim,
-  store,
-  item
-where
-  ss_sold_date_sk = d_date_sk
-  and ss_item_sk = i_item_sk
-  and ss_store_sk = s_store_sk
-  and ss_cdemo_sk = cd_demo_sk
-  and cd_gender = 'F'
-  and cd_marital_status = 'W'
-  and cd_education_status = 'Primary'
-  and d_year = 1998
-  and s_state in ('WI', 'CA', 'TX', 'FL', 'WA', 'TN')
-group by
-  i_item_id,
-  s_state
-order by
-  i_item_id,
-  s_state
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=50.32MB Threads=6
-Per-Host Resource Estimates: Memory=434MB
-PLAN-ROOT SINK
-|
-10:TOP-N [LIMIT=100]
-|  order by: i_item_id ASC, s_state ASC
-|  row-size=74B cardinality=100
-|
-09:AGGREGATE [FINALIZE]
-|  output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|  group by: i_item_id, s_state
-|  row-size=74B cardinality=8.85K
-|
-08:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=150B cardinality=263.34K
-|
-|--04:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-07:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF002 <- s_store_sk
-|  row-size=114B cardinality=263.34K
-|
-|--03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_state IN ('WI', 'CA', 'TX', 'FL', 'WA', 'TN')
-|     row-size=18B cardinality=12
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_cdemo_sk = cd_demo_sk
-|  runtime filters: RF004 <- cd_demo_sk
-|  row-size=96B cardinality=263.34K
-|
-|--01:SCAN HDFS [tpcds.customer_demographics]
-|     HDFS partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
-|     row-size=52B cardinality=97.40K
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=44B cardinality=589.03K
-|
-|--02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998
-|     row-size=8B cardinality=373
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_item_sk, RF002 -> ss_store_sk, RF004 -> ss_cdemo_sk, RF006 -> ss_sold_date_sk
-   row-size=36B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=54.26MB Threads=12
-Per-Host Resource Estimates: Memory=460MB
-PLAN-ROOT SINK
-|
-17:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: i_item_id ASC, s_state ASC
-|  limit: 100
-|
-10:TOP-N [LIMIT=100]
-|  order by: i_item_id ASC, s_state ASC
-|  row-size=74B cardinality=100
-|
-16:AGGREGATE [FINALIZE]
-|  output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
-|  group by: i_item_id, s_state
-|  row-size=74B cardinality=8.85K
-|
-15:EXCHANGE [HASH(i_item_id,s_state)]
-|
-09:AGGREGATE [STREAMING]
-|  output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|  group by: i_item_id, s_state
-|  row-size=74B cardinality=8.85K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=150B cardinality=263.34K
-|
-|--14:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF002 <- s_store_sk
-|  row-size=114B cardinality=263.34K
-|
-|--13:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_state IN ('WI', 'CA', 'TX', 'FL', 'WA', 'TN')
-|     row-size=18B cardinality=12
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_cdemo_sk = cd_demo_sk
-|  runtime filters: RF004 <- cd_demo_sk
-|  row-size=96B cardinality=263.34K
-|
-|--12:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.customer_demographics]
-|     HDFS partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
-|     row-size=52B cardinality=97.40K
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=44B cardinality=589.03K
-|
-|--11:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998
-|     row-size=8B cardinality=373
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_item_sk, RF002 -> ss_store_sk, RF004 -> ss_cdemo_sk, RF006 -> ss_sold_date_sk
-   row-size=36B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=84.51MB Threads=13
-Per-Host Resource Estimates: Memory=260MB
-PLAN-ROOT SINK
-|
-17:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: i_item_id ASC, s_state ASC
-|  limit: 100
-|
-10:TOP-N [LIMIT=100]
-|  order by: i_item_id ASC, s_state ASC
-|  row-size=74B cardinality=100
-|
-16:AGGREGATE [FINALIZE]
-|  output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
-|  group by: i_item_id, s_state
-|  row-size=74B cardinality=8.85K
-|
-15:EXCHANGE [HASH(i_item_id,s_state)]
-|
-09:AGGREGATE [STREAMING]
-|  output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|  group by: i_item_id, s_state
-|  row-size=74B cardinality=8.85K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=150B cardinality=263.34K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: i_item_sk
-|  |  runtime filters: RF000 <- i_item_sk
-|  |
-|  14:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=114B cardinality=263.34K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: s_store_sk
-|  |  runtime filters: RF002 <- s_store_sk
-|  |
-|  13:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_state IN ('WI', 'CA', 'TX', 'FL', 'WA', 'TN')
-|     row-size=18B cardinality=12
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_cdemo_sk = cd_demo_sk
-|  row-size=96B cardinality=263.34K
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: cd_demo_sk
-|  |  runtime filters: RF004 <- cd_demo_sk
-|  |
-|  12:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.customer_demographics]
-|     HDFS partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
-|     row-size=52B cardinality=97.40K
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=44B cardinality=589.03K
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |
-|  11:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998
-|     row-size=8B cardinality=373
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_item_sk, RF002 -> ss_store_sk, RF004 -> ss_cdemo_sk, RF006 -> ss_sold_date_sk
-   row-size=36B cardinality=2.88M
-====
-# TPCDS-Q34
-select
-  c_last_name,
-  c_first_name,
-  c_salutation,
-  c_preferred_cust_flag,
-  ss_ticket_number,
-  cnt
-from
-  (select
-    ss_ticket_number,
-    ss_customer_sk,
-    count(*) cnt
-  from
-    store_sales,
-    date_dim,
-    store,
-    household_demographics
-  where
-    store_sales.ss_sold_date_sk = date_dim.d_date_sk
-    and store_sales.ss_store_sk = store.s_store_sk
-    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-    and (date_dim.d_dom between 1 and 3
-      or date_dim.d_dom between 25 and 28)
-    and (household_demographics.hd_buy_potential = '>10000'
-      or household_demographics.hd_buy_potential = 'unknown')
-    and household_demographics.hd_vehicle_count > 0
-    and (case when household_demographics.hd_vehicle_count > 0 then household_demographics.hd_dep_count / household_demographics.hd_vehicle_count else null end) > 1.2
-    and date_dim.d_year in (1998, 1998 + 1, 1998 + 2)
-    and store.s_county in ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
-  group by
-    ss_ticket_number,
-    ss_customer_sk
-  ) dn,
-  customer
-where
-  ss_customer_sk = c_customer_sk
-  and cnt between 15 and 20
-order by
-  c_last_name,
-  c_first_name,
-  c_salutation,
-  c_preferred_cust_flag desc
-limit 100000
----- PLAN
-Max Per-Host Resource Reservation: Memory=34.07MB Threads=6
-Per-Host Resource Estimates: Memory=298MB
-PLAN-ROOT SINK
-|
-10:TOP-N [LIMIT=100000]
-|  order by: c_last_name ASC, c_first_name ASC, c_salutation ASC, c_preferred_cust_flag DESC
-|  row-size=80B cardinality=3.15K
-|
-09:HASH JOIN [INNER JOIN]
-|  hash predicates: c_customer_sk = ss_customer_sk
-|  runtime filters: RF000 <- ss_customer_sk
-|  row-size=88B cardinality=3.15K
-|
-|--07:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  group by: ss_ticket_number, ss_customer_sk
-|  |  having: count(*) <= 20, count(*) >= 15
-|  |  row-size=20B cardinality=3.15K
-|  |
-|  06:HASH JOIN [INNER JOIN]
-|  |  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  |  runtime filters: RF002 <- store.s_store_sk
-|  |  row-size=101B cardinality=31.53K
-|  |
-|  |--02:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
-|  |     row-size=33B cardinality=12
-|  |
-|  05:HASH JOIN [INNER JOIN]
-|  |  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  |  runtime filters: RF004 <- date_dim.d_date_sk
-|  |  row-size=68B cardinality=31.53K
-|  |
-|  |--01:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: date_dim.d_year IN (1998, 1999, 2000), (date_dim.d_dom >= 1 AND date_dim.d_dom <= 3 OR date_dim.d_dom >= 25 AND date_dim.d_dom <= 28)
-|  |     row-size=12B cardinality=354
-|  |
-|  04:HASH JOIN [INNER JOIN]
-|  |  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  runtime filters: RF006 <- household_demographics.hd_demo_sk
-|  |  row-size=56B cardinality=162.45K
-|  |
-|  |--03:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: household_demographics.hd_vehicle_count > 0, household_demographics.hd_buy_potential IN ('>10000', 'unknown'), (CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END) > 1.2
-|  |     row-size=32B cardinality=416
-|  |
-|  00:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF002 -> store_sales.ss_store_sk, RF004 -> store_sales.ss_sold_date_sk, RF006 -> store_sales.ss_hdemo_sk
-|     row-size=24B cardinality=2.88M
-|
-08:SCAN HDFS [tpcds.customer]
-   HDFS partitions=1/1 files=1 size=12.60MB
-   runtime filters: RF000 -> c_customer_sk
-   row-size=68B cardinality=100.00K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=47.51MB Threads=13
-Per-Host Resource Estimates: Memory=335MB
-PLAN-ROOT SINK
-|
-18:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: c_last_name ASC, c_first_name ASC, c_salutation ASC, c_preferred_cust_flag DESC
-|  limit: 100000
-|
-10:TOP-N [LIMIT=100000]
-|  order by: c_last_name ASC, c_first_name ASC, c_salutation ASC, c_preferred_cust_flag DESC
-|  row-size=80B cardinality=3.15K
-|
-09:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF000 <- c_customer_sk
-|  row-size=88B cardinality=3.15K
-|
-|--17:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  08:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     row-size=68B cardinality=100.00K
-|
-16:EXCHANGE [HASH(ss_customer_sk)]
-|
-15:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  group by: ss_ticket_number, ss_customer_sk
-|  having: count(*) <= 20, count(*) >= 15
-|  row-size=20B cardinality=3.15K
-|
-14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk)]
-|
-07:AGGREGATE [STREAMING]
-|  output: count(*)
-|  group by: ss_ticket_number, ss_customer_sk
-|  row-size=20B cardinality=31.53K
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  runtime filters: RF002 <- store.s_store_sk
-|  row-size=101B cardinality=31.53K
-|
-|--13:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
-|     row-size=33B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  runtime filters: RF004 <- date_dim.d_date_sk
-|  row-size=68B cardinality=31.53K
-|
-|--12:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: date_dim.d_year IN (1998, 1999, 2000), (date_dim.d_dom >= 1 AND date_dim.d_dom <= 3 OR date_dim.d_dom >= 25 AND date_dim.d_dom <= 28)
-|     row-size=12B cardinality=354
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  runtime filters: RF006 <- household_demographics.hd_demo_sk
-|  row-size=56B cardinality=162.45K
-|
-|--11:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: household_demographics.hd_vehicle_count > 0, household_demographics.hd_buy_potential IN ('>10000', 'unknown'), (CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END) > 1.2
-|     row-size=32B cardinality=416
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_customer_sk, RF002 -> store_sales.ss_store_sk, RF004 -> store_sales.ss_sold_date_sk, RF006 -> store_sales.ss_hdemo_sk
-   row-size=24B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=68.26MB Threads=14
-Per-Host Resource Estimates: Memory=188MB
-PLAN-ROOT SINK
-|
-18:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: c_last_name ASC, c_first_name ASC, c_salutation ASC, c_preferred_cust_flag DESC
-|  limit: 100000
-|
-10:TOP-N [LIMIT=100000]
-|  order by: c_last_name ASC, c_first_name ASC, c_salutation ASC, c_preferred_cust_flag DESC
-|  row-size=80B cardinality=3.15K
-|
-09:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  row-size=88B cardinality=3.15K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: c_customer_sk
-|  |  runtime filters: RF000 <- c_customer_sk
-|  |
-|  17:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  08:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     row-size=68B cardinality=100.00K
-|
-16:EXCHANGE [HASH(ss_customer_sk)]
-|
-15:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  group by: ss_ticket_number, ss_customer_sk
-|  having: count(*) <= 20, count(*) >= 15
-|  row-size=20B cardinality=3.15K
-|
-14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk)]
-|
-07:AGGREGATE [STREAMING]
-|  output: count(*)
-|  group by: ss_ticket_number, ss_customer_sk
-|  row-size=20B cardinality=31.53K
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  row-size=101B cardinality=31.53K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: store.s_store_sk
-|  |  runtime filters: RF002 <- store.s_store_sk
-|  |
-|  13:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
-|     row-size=33B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  row-size=68B cardinality=31.53K
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: date_dim.d_date_sk
-|  |  runtime filters: RF004 <- date_dim.d_date_sk
-|  |
-|  12:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: date_dim.d_year IN (1998, 1999, 2000), (date_dim.d_dom >= 1 AND date_dim.d_dom <= 3 OR date_dim.d_dom >= 25 AND date_dim.d_dom <= 28)
-|     row-size=12B cardinality=354
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  row-size=56B cardinality=162.45K
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |  build expressions: household_demographics.hd_demo_sk
-|  |  runtime filters: RF006 <- household_demographics.hd_demo_sk
-|  |
-|  11:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: household_demographics.hd_vehicle_count > 0, household_demographics.hd_buy_potential IN ('>10000', 'unknown'), (CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END) > 1.2
-|     row-size=32B cardinality=416
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_customer_sk, RF002 -> store_sales.ss_store_sk, RF004 -> store_sales.ss_sold_date_sk, RF006 -> store_sales.ss_hdemo_sk
-   row-size=24B cardinality=2.88M
-====
-# TPCDS-Q42
-select
-  dt.d_year,
-  item.i_category_id,
-  item.i_category,
-  sum(ss_ext_sales_price)
-from
-  date_dim dt,
-  store_sales,
-  item
-where
-  dt.d_date_sk = store_sales.ss_sold_date_sk
-  and store_sales.ss_item_sk = item.i_item_sk
-  and item.i_manager_id = 1
-  and dt.d_moy = 12
-  and dt.d_year = 1998
-group by
-  dt.d_year,
-  item.i_category_id,
-  item.i_category
-order by
-  sum(ss_ext_sales_price) desc,
-  dt.d_year,
-  item.i_category_id,
-  item.i_category
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=29.88MB Threads=4
-Per-Host Resource Estimates: Memory=214MB
-PLAN-ROOT SINK
-|
-06:TOP-N [LIMIT=100]
-|  order by: sum(ss_ext_sales_price) DESC, dt.d_year ASC, item.i_category_id ASC, item.i_category ASC
-|  row-size=42B cardinality=100
-|
-05:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_category_id, item.i_category
-|  row-size=42B cardinality=1.73K
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
-|  runtime filters: RF000 <- dt.d_date_sk
-|  row-size=62B cardinality=1.73K
-|
-|--00:SCAN HDFS [tpcds.date_dim dt]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_year = 1998, dt.d_moy = 12
-|     row-size=12B cardinality=108
-|
-03:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
-|  runtime filters: RF002 <- item.i_item_sk
-|  row-size=50B cardinality=29.12K
-|
-|--02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: item.i_manager_id = 1
-|     row-size=34B cardinality=182
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> store_sales.ss_sold_date_sk, RF002 -> store_sales.ss_item_sk
-   row-size=16B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=33.81MB Threads=8
-Per-Host Resource Estimates: Memory=234MB
-PLAN-ROOT SINK
-|
-11:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum(ss_ext_sales_price) DESC, dt.d_year ASC, item.i_category_id ASC, item.i_category ASC
-|  limit: 100
-|
-06:TOP-N [LIMIT=100]
-|  order by: sum(ss_ext_sales_price) DESC, dt.d_year ASC, item.i_category_id ASC, item.i_category ASC
-|  row-size=42B cardinality=100
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_category_id, item.i_category
-|  row-size=42B cardinality=1.73K
-|
-09:EXCHANGE [HASH(dt.d_year,item.i_category_id,item.i_category)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_category_id, item.i_category
-|  row-size=42B cardinality=1.73K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
-|  runtime filters: RF000 <- dt.d_date_sk
-|  row-size=62B cardinality=1.73K
-|
-|--08:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim dt]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_year = 1998, dt.d_moy = 12
-|     row-size=12B cardinality=108
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
-|  runtime filters: RF002 <- item.i_item_sk
-|  row-size=50B cardinality=29.12K
-|
-|--07:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: item.i_manager_id = 1
-|     row-size=34B cardinality=182
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> store_sales.ss_sold_date_sk, RF002 -> store_sales.ss_item_sk
-   row-size=16B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=51.62MB Threads=9
-Per-Host Resource Estimates: Memory=124MB
-PLAN-ROOT SINK
-|
-11:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum(ss_ext_sales_price) DESC, dt.d_year ASC, item.i_category_id ASC, item.i_category ASC
-|  limit: 100
-|
-06:TOP-N [LIMIT=100]
-|  order by: sum(ss_ext_sales_price) DESC, dt.d_year ASC, item.i_category_id ASC, item.i_category ASC
-|  row-size=42B cardinality=100
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_category_id, item.i_category
-|  row-size=42B cardinality=1.73K
-|
-09:EXCHANGE [HASH(dt.d_year,item.i_category_id,item.i_category)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_category_id, item.i_category
-|  row-size=42B cardinality=1.73K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
-|  row-size=62B cardinality=1.73K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: dt.d_date_sk
-|  |  runtime filters: RF000 <- dt.d_date_sk
-|  |
-|  08:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim dt]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_year = 1998, dt.d_moy = 12
-|     row-size=12B cardinality=108
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
-|  row-size=50B cardinality=29.12K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: item.i_item_sk
-|  |  runtime filters: RF002 <- item.i_item_sk
-|  |
-|  07:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: item.i_manager_id = 1
-|     row-size=34B cardinality=182
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> store_sales.ss_sold_date_sk, RF002 -> store_sales.ss_item_sk
-   row-size=16B cardinality=2.88M
-====
-# TPCDS-Q43
-select
-  s_store_name,
-  s_store_id,
-  sum(case when (d_day_name = 'Sunday') then ss_sales_price else null end) sun_sales,
-  sum(case when (d_day_name = 'Monday') then ss_sales_price else null end) mon_sales,
-  sum(case when (d_day_name = 'Tuesday') then ss_sales_price else null end) tue_sales,
-  sum(case when (d_day_name = 'Wednesday') then ss_sales_price else null end) wed_sales,
-  sum(case when (d_day_name = 'Thursday') then ss_sales_price else null end) thu_sales,
-  sum(case when (d_day_name = 'Friday') then ss_sales_price else null end) fri_sales,
-  sum(case when (d_day_name = 'Saturday') then ss_sales_price else null end) sat_sales
-from
-  date_dim,
-  store_sales,
-  store
-where
-  d_date_sk = ss_sold_date_sk
-  and s_store_sk = ss_store_sk
-  and s_gmt_offset = -5
-  and d_year = 1998
-group by
-  s_store_name,
-  s_store_id
-order by
-  s_store_name,
-  s_store_id,
-  sun_sales,
-  mon_sales,
-  tue_sales,
-  wed_sales,
-  thu_sales,
-  fri_sales,
-  sat_sales
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=21.88MB Threads=4
-Per-Host Resource Estimates: Memory=214MB
-PLAN-ROOT SINK
-|
-06:TOP-N [LIMIT=100]
-|  order by: s_store_name ASC, s_store_id ASC, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END) ASC
-|  row-size=156B cardinality=48
-|
-05:AGGREGATE [FINALIZE]
-|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  group by: s_store_name, s_store_id
-|  row-size=156B cardinality=48
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=91B cardinality=589.03K
-|
-|--02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_gmt_offset = -5
-|     row-size=52B cardinality=12
-|
-03:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=39B cardinality=589.03K
-|
-|--00:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998
-|     row-size=27B cardinality=373
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk
-   row-size=12B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=25.82MB Threads=8
-Per-Host Resource Estimates: Memory=234MB
-PLAN-ROOT SINK
-|
-11:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: s_store_name ASC, s_store_id ASC, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END) ASC
-|  limit: 100
-|
-06:TOP-N [LIMIT=100]
-|  order by: s_store_name ASC, s_store_id ASC, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END) ASC
-|  row-size=156B cardinality=48
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  group by: s_store_name, s_store_id
-|  row-size=156B cardinality=48
-|
-09:EXCHANGE [HASH(s_store_name,s_store_id)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  group by: s_store_name, s_store_id
-|  row-size=156B cardinality=48
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=91B cardinality=589.03K
-|
-|--08:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_gmt_offset = -5
-|     row-size=52B cardinality=12
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=39B cardinality=589.03K
-|
-|--07:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998
-|     row-size=27B cardinality=373
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk
-   row-size=12B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=43.63MB Threads=9
-Per-Host Resource Estimates: Memory=124MB
-PLAN-ROOT SINK
-|
-11:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: s_store_name ASC, s_store_id ASC, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END) ASC
-|  limit: 100
-|
-06:TOP-N [LIMIT=100]
-|  order by: s_store_name ASC, s_store_id ASC, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END) ASC
-|  row-size=156B cardinality=48
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  group by: s_store_name, s_store_id
-|  row-size=156B cardinality=48
-|
-09:EXCHANGE [HASH(s_store_name,s_store_id)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  group by: s_store_name, s_store_id
-|  row-size=156B cardinality=48
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=91B cardinality=589.03K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: s_store_sk
-|  |  runtime filters: RF000 <- s_store_sk
-|  |
-|  08:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_gmt_offset = -5
-|     row-size=52B cardinality=12
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=39B cardinality=589.03K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF002 <- d_date_sk
-|  |
-|  07:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998
-|     row-size=27B cardinality=373
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk
-   row-size=12B cardinality=2.88M
-====
-# TPCDS-Q46
-select
-  c_last_name,
-  c_first_name,
-  ca_city,
-  bought_city,
-  ss_ticket_number,
-  amt,
-  profit
-from
-  (select
-    ss_ticket_number,
-    ss_customer_sk,
-    ca_city bought_city,
-    sum(ss_coupon_amt) amt,
-    sum(ss_net_profit) profit
-  from
-    store_sales,
-    date_dim,
-    store,
-    household_demographics,
-    customer_address
-  where
-    store_sales.ss_sold_date_sk = date_dim.d_date_sk
-    and store_sales.ss_store_sk = store.s_store_sk
-    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-    and store_sales.ss_addr_sk = customer_address.ca_address_sk
-    and (household_demographics.hd_dep_count = 5
-      or household_demographics.hd_vehicle_count = 3)
-    and date_dim.d_dow in (6, 0)
-    and date_dim.d_year in (1999, 1999 + 1, 1999 + 2)
-    and store.s_city in ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
-  group by
-    ss_ticket_number,
-    ss_customer_sk,
-    ss_addr_sk,
-    ca_city
-  ) dn,
-  customer,
-  customer_address current_addr
-where
-  ss_customer_sk = c_customer_sk
-  and customer.c_current_addr_sk = current_addr.ca_address_sk
-  and current_addr.ca_city <> bought_city
-order by
-  c_last_name,
-  c_first_name,
-  ca_city,
-  bought_city,
-  ss_ticket_number
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=67.06MB Threads=8
-Per-Host Resource Estimates: Memory=378MB
-PLAN-ROOT SINK
-|
-14:TOP-N [LIMIT=100]
-|  order by: c_last_name ASC, c_first_name ASC, ca_city ASC, bought_city ASC, ss_ticket_number ASC
-|  row-size=118B cardinality=100
-|
-13:HASH JOIN [INNER JOIN]
-|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
-|  other predicates: current_addr.ca_city != ca_city
-|  runtime filters: RF000 <- current_addr.ca_address_sk
-|  row-size=138B cardinality=230.45K
-|
-|--11:SCAN HDFS [tpcds.customer_address current_addr]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-12:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF002 <- c_customer_sk
-|  row-size=113B cardinality=230.45K
-|
-|--10:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> customer.c_current_addr_sk
-|     row-size=44B cardinality=100.00K
-|
-09:AGGREGATE [FINALIZE]
-|  output: sum(ss_coupon_amt), sum(ss_net_profit)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
-|  row-size=69B cardinality=230.45K
-|
-08:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
-|  runtime filters: RF004 <- customer_address.ca_address_sk
-|  row-size=107B cardinality=230.45K
-|
-|--04:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-07:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  runtime filters: RF006 <- store.s_store_sk
-|  row-size=83B cardinality=230.45K
-|
-|--02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
-|     row-size=23B cardinality=12
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  runtime filters: RF008 <- date_dim.d_date_sk
-|  row-size=60B cardinality=230.45K
-|
-|--01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: date_dim.d_dow IN (6, 0), date_dim.d_year IN (1999, 2000, 2001)
-|     row-size=12B cardinality=598
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  runtime filters: RF010 <- household_demographics.hd_demo_sk
-|  row-size=48B cardinality=702.92K
-|
-|--03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: (household_demographics.hd_dep_count = 5 OR household_demographics.hd_vehicle_count = 3)
-|     row-size=12B cardinality=1.80K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF002 -> tpcds.store_sales.ss_customer_sk, RF004 -> store_sales.ss_addr_sk, RF006 -> store_sales.ss_store_sk, RF008 -> store_sales.ss_sold_date_sk, RF010 -> store_sales.ss_hdemo_sk
-   row-size=36B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=80.20MB Threads=17
-Per-Host Resource Estimates: Memory=412MB
-PLAN-ROOT SINK
-|
-24:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: c_last_name ASC, c_first_name ASC, ca_city ASC, bought_city ASC, ss_ticket_number ASC
-|  limit: 100
-|
-14:TOP-N [LIMIT=100]
-|  order by: c_last_name ASC, c_first_name ASC, ca_city ASC, bought_city ASC, ss_ticket_number ASC
-|  row-size=118B cardinality=100
-|
-13:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
-|  other predicates: current_addr.ca_city != ca_city
-|  runtime filters: RF000 <- current_addr.ca_address_sk
-|  row-size=138B cardinality=230.45K
-|
-|--23:EXCHANGE [BROADCAST]
-|  |
-|  11:SCAN HDFS [tpcds.customer_address current_addr]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-12:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF002 <- c_customer_sk
-|  row-size=113B cardinality=230.45K
-|
-|--22:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  10:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> customer.c_current_addr_sk
-|     row-size=44B cardinality=100.00K
-|
-21:EXCHANGE [HASH(ss_customer_sk)]
-|
-20:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_coupon_amt), sum:merge(ss_net_profit)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
-|  row-size=69B cardinality=230.45K
-|
-19:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)]
-|
-09:AGGREGATE [STREAMING]
-|  output: sum(ss_coupon_amt), sum(ss_net_profit)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
-|  row-size=69B cardinality=230.45K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
-|  runtime filters: RF004 <- customer_address.ca_address_sk
-|  row-size=107B cardinality=230.45K
-|
-|--18:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  runtime filters: RF006 <- store.s_store_sk
-|  row-size=83B cardinality=230.45K
-|
-|--17:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
-|     row-size=23B cardinality=12
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  runtime filters: RF008 <- date_dim.d_date_sk
-|  row-size=60B cardinality=230.45K
-|
-|--16:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: date_dim.d_dow IN (6, 0), date_dim.d_year IN (1999, 2000, 2001)
-|     row-size=12B cardinality=598
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  runtime filters: RF010 <- household_demographics.hd_demo_sk
-|  row-size=48B cardinality=702.92K
-|
-|--15:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: (household_demographics.hd_dep_count = 5 OR household_demographics.hd_vehicle_count = 3)
-|     row-size=12B cardinality=1.80K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF002 -> tpcds.store_sales.ss_customer_sk, RF004 -> store_sales.ss_addr_sk, RF006 -> store_sales.ss_store_sk, RF008 -> store_sales.ss_sold_date_sk, RF010 -> store_sales.ss_hdemo_sk
-   row-size=36B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=107.76MB Threads=20
-Per-Host Resource Estimates: Memory=257MB
-PLAN-ROOT SINK
-|
-24:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: c_last_name ASC, c_first_name ASC, ca_city ASC, bought_city ASC, ss_ticket_number ASC
-|  limit: 100
-|
-14:TOP-N [LIMIT=100]
-|  order by: c_last_name ASC, c_first_name ASC, ca_city ASC, bought_city ASC, ss_ticket_number ASC
-|  row-size=118B cardinality=100
-|
-13:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
-|  other predicates: current_addr.ca_city != ca_city
-|  row-size=138B cardinality=230.45K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: current_addr.ca_address_sk
-|  |  runtime filters: RF000 <- current_addr.ca_address_sk
-|  |
-|  23:EXCHANGE [BROADCAST]
-|  |
-|  11:SCAN HDFS [tpcds.customer_address current_addr]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-12:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  row-size=113B cardinality=230.45K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: c_customer_sk
-|  |  runtime filters: RF002 <- c_customer_sk
-|  |
-|  22:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  10:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> customer.c_current_addr_sk
-|     row-size=44B cardinality=100.00K
-|
-21:EXCHANGE [HASH(ss_customer_sk)]
-|
-20:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_coupon_amt), sum:merge(ss_net_profit)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
-|  row-size=69B cardinality=230.45K
-|
-19:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)]
-|
-09:AGGREGATE [STREAMING]
-|  output: sum(ss_coupon_amt), sum(ss_net_profit)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
-|  row-size=69B cardinality=230.45K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
-|  row-size=107B cardinality=230.45K
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: customer_address.ca_address_sk
-|  |  runtime filters: RF004 <- customer_address.ca_address_sk
-|  |
-|  18:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  row-size=83B cardinality=230.45K
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |  build expressions: store.s_store_sk
-|  |  runtime filters: RF006 <- store.s_store_sk
-|  |
-|  17:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
-|     row-size=23B cardinality=12
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  row-size=60B cardinality=230.45K
-|
-|--JOIN BUILD
-|  |  join-table-id=04 plan-id=05 cohort-id=01
-|  |  build expressions: date_dim.d_date_sk
-|  |  runtime filters: RF008 <- date_dim.d_date_sk
-|  |
-|  16:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: date_dim.d_dow IN (6, 0), date_dim.d_year IN (1999, 2000, 2001)
-|     row-size=12B cardinality=598
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  row-size=48B cardinality=702.92K
-|
-|--JOIN BUILD
-|  |  join-table-id=05 plan-id=06 cohort-id=01
-|  |  build expressions: household_demographics.hd_demo_sk
-|  |  runtime filters: RF010 <- household_demographics.hd_demo_sk
-|  |
-|  15:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: (household_demographics.hd_dep_count = 5 OR household_demographics.hd_vehicle_count = 3)
-|     row-size=12B cardinality=1.80K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF002 -> tpcds.store_sales.ss_customer_sk, RF004 -> store_sales.ss_addr_sk, RF006 -> store_sales.ss_store_sk, RF008 -> store_sales.ss_sold_date_sk, RF010 -> store_sales.ss_hdemo_sk
-   row-size=36B cardinality=2.88M
-====
-# TPCDS-Q52
-select
-  dt.d_year,
-  item.i_brand_id brand_id,
-  item.i_brand brand,
-  sum(ss_ext_sales_price) ext_price
-from
-  date_dim dt,
-  store_sales,
-  item
-where
-  dt.d_date_sk = store_sales.ss_sold_date_sk
-  and store_sales.ss_item_sk = item.i_item_sk
-  and item.i_manager_id = 1
-  and dt.d_moy = 12
-  and dt.d_year = 1998
-group by
-  dt.d_year,
-  item.i_brand,
-  item.i_brand_id
-order by
-  dt.d_year,
-  ext_price desc,
-  brand_id
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=29.88MB Threads=4
-Per-Host Resource Estimates: Memory=214MB
-PLAN-ROOT SINK
-|
-06:TOP-N [LIMIT=100]
-|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
-|  row-size=52B cardinality=100
-|
-05:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_brand, item.i_brand_id
-|  row-size=52B cardinality=1.73K
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
-|  runtime filters: RF000 <- dt.d_date_sk
-|  row-size=72B cardinality=1.73K
-|
-|--00:SCAN HDFS [tpcds.date_dim dt]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_year = 1998, dt.d_moy = 12
-|     row-size=12B cardinality=108
-|
-03:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
-|  runtime filters: RF002 <- item.i_item_sk
-|  row-size=60B cardinality=29.12K
-|
-|--02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: item.i_manager_id = 1
-|     row-size=44B cardinality=182
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> store_sales.ss_sold_date_sk, RF002 -> store_sales.ss_item_sk
-   row-size=16B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=33.81MB Threads=8
-Per-Host Resource Estimates: Memory=234MB
-PLAN-ROOT SINK
-|
-11:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
-|  limit: 100
-|
-06:TOP-N [LIMIT=100]
-|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
-|  row-size=52B cardinality=100
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_brand, item.i_brand_id
-|  row-size=52B cardinality=1.73K
-|
-09:EXCHANGE [HASH(dt.d_year,item.i_brand,item.i_brand_id)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_brand, item.i_brand_id
-|  row-size=52B cardinality=1.73K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
-|  runtime filters: RF000 <- dt.d_date_sk
-|  row-size=72B cardinality=1.73K
-|
-|--08:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim dt]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_year = 1998, dt.d_moy = 12
-|     row-size=12B cardinality=108
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
-|  runtime filters: RF002 <- item.i_item_sk
-|  row-size=60B cardinality=29.12K
-|
-|--07:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: item.i_manager_id = 1
-|     row-size=44B cardinality=182
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> store_sales.ss_sold_date_sk, RF002 -> store_sales.ss_item_sk
-   row-size=16B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=51.62MB Threads=9
-Per-Host Resource Estimates: Memory=125MB
-PLAN-ROOT SINK
-|
-11:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
-|  limit: 100
-|
-06:TOP-N [LIMIT=100]
-|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
-|  row-size=52B cardinality=100
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_brand, item.i_brand_id
-|  row-size=52B cardinality=1.73K
-|
-09:EXCHANGE [HASH(dt.d_year,item.i_brand,item.i_brand_id)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: dt.d_year, item.i_brand, item.i_brand_id
-|  row-size=52B cardinality=1.73K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
-|  row-size=72B cardinality=1.73K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: dt.d_date_sk
-|  |  runtime filters: RF000 <- dt.d_date_sk
-|  |
-|  08:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim dt]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: dt.d_year = 1998, dt.d_moy = 12
-|     row-size=12B cardinality=108
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
-|  row-size=60B cardinality=29.12K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: item.i_item_sk
-|  |  runtime filters: RF002 <- item.i_item_sk
-|  |
-|  07:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: item.i_manager_id = 1
-|     row-size=44B cardinality=182
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> store_sales.ss_sold_date_sk, RF002 -> store_sales.ss_item_sk
-   row-size=16B cardinality=2.88M
-====
-# TPCDS-Q53
-select
-  *
-from
-  (select
-    i_manufact_id,
-    sum(ss_sales_price) sum_sales
-  from
-    item,
-    store_sales,
-    date_dim,
-    store
-  where
-    ss_item_sk = i_item_sk
-    and ss_sold_date_sk = d_date_sk
-    and ss_store_sk = s_store_sk
-    and d_month_seq in (1212, 1212 + 1, 1212 + 2, 1212 + 3, 1212 + 4, 1212 + 5, 1212 + 6, 1212 + 7, 1212 + 8, 1212 + 9, 1212 + 10, 1212 + 11)
-    and ((i_category in ('Books', 'Children', 'Electronics')
-      and i_class in ('personal', 'portable', 'reference', 'self-help')
-      and i_brand in ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9'))
-    or (i_category in ('Women', 'Music', 'Men')
-      and i_class in ('accessories', 'classical', 'fragrances', 'pants')
-      and i_brand in ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
-  group by
-    i_manufact_id,
-    d_qoy
-  ) tmp1
-order by
-  sum_sales,
-  i_manufact_id
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=32.82MB Threads=5
-Per-Host Resource Estimates: Memory=249MB
-PLAN-ROOT SINK
-|
-08:TOP-N [LIMIT=100]
-|  order by: sum_sales ASC, i_manufact_id ASC
-|  row-size=20B cardinality=96
-|
-07:AGGREGATE [FINALIZE]
-|  output: sum(ss_sales_price)
-|  group by: i_manufact_id, d_qoy
-|  row-size=24B cardinality=96
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=114B cardinality=96
-|
-|--03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=4B cardinality=12
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=110B cardinality=96
-|
-|--02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq IN (1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223)
-|     row-size=12B cardinality=362
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF004 <- i_item_sk
-|  row-size=98B cardinality=481
-|
-|--00:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
-|     row-size=78B cardinality=3
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk, RF004 -> ss_item_sk
-   row-size=20B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=36.76MB Threads=10
-Per-Host Resource Estimates: Memory=269MB
-PLAN-ROOT SINK
-|
-14:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum_sales ASC, i_manufact_id ASC
-|  limit: 100
-|
-08:TOP-N [LIMIT=100]
-|  order by: sum_sales ASC, i_manufact_id ASC
-|  row-size=20B cardinality=96
-|
-13:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_sales_price)
-|  group by: i_manufact_id, d_qoy
-|  row-size=24B cardinality=96
-|
-12:EXCHANGE [HASH(i_manufact_id,d_qoy)]
-|
-07:AGGREGATE [STREAMING]
-|  output: sum(ss_sales_price)
-|  group by: i_manufact_id, d_qoy
-|  row-size=24B cardinality=96
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=114B cardinality=96
-|
-|--11:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=4B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=110B cardinality=96
-|
-|--10:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq IN (1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223)
-|     row-size=12B cardinality=362
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF004 <- i_item_sk
-|  row-size=98B cardinality=481
-|
-|--09:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
-|     row-size=78B cardinality=3
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk, RF004 -> ss_item_sk
-   row-size=20B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=57.51MB Threads=11
-Per-Host Resource Estimates: Memory=146MB
-PLAN-ROOT SINK
-|
-14:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum_sales ASC, i_manufact_id ASC
-|  limit: 100
-|
-08:TOP-N [LIMIT=100]
-|  order by: sum_sales ASC, i_manufact_id ASC
-|  row-size=20B cardinality=96
-|
-13:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_sales_price)
-|  group by: i_manufact_id, d_qoy
-|  row-size=24B cardinality=96
-|
-12:EXCHANGE [HASH(i_manufact_id,d_qoy)]
-|
-07:AGGREGATE [STREAMING]
-|  output: sum(ss_sales_price)
-|  group by: i_manufact_id, d_qoy
-|  row-size=24B cardinality=96
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=114B cardinality=96
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: s_store_sk
-|  |  runtime filters: RF000 <- s_store_sk
-|  |
-|  11:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=4B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=110B cardinality=96
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF002 <- d_date_sk
-|  |
-|  10:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq IN (1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223)
-|     row-size=12B cardinality=362
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=98B cardinality=481
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: i_item_sk
-|  |  runtime filters: RF004 <- i_item_sk
-|  |
-|  09:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
-|     row-size=78B cardinality=3
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk, RF004 -> ss_item_sk
-   row-size=20B cardinality=2.88M
-====
-# TPCDS-Q55
-select
-  i_brand_id brand_id,
-  i_brand brand,
-  sum(ss_ext_sales_price) ext_price
-from
-  date_dim,
-  store_sales,
-  item
-where
-  d_date_sk = ss_sold_date_sk
-  and ss_item_sk = i_item_sk
-  and i_manager_id = 36
-  and d_moy = 12
-  and d_year = 2001
-group by
-  i_brand,
-  i_brand_id
-order by
-  ext_price desc,
-  i_brand_id
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=29.88MB Threads=4
-Per-Host Resource Estimates: Memory=214MB
-PLAN-ROOT SINK
-|
-06:TOP-N [LIMIT=100]
-|  order by: sum(ss_ext_sales_price) DESC, i_brand_id ASC
-|  row-size=48B cardinality=100
-|
-05:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_brand, i_brand_id
-|  row-size=48B cardinality=1.73K
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF000 <- d_date_sk
-|  row-size=72B cardinality=1.73K
-|
-|--00:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 2001, d_moy = 12
-|     row-size=12B cardinality=108
-|
-03:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=60B cardinality=29.12K
-|
-|--02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_manager_id = 36
-|     row-size=44B cardinality=182
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_sold_date_sk, RF002 -> ss_item_sk
-   row-size=16B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=33.81MB Threads=8
-Per-Host Resource Estimates: Memory=234MB
-PLAN-ROOT SINK
-|
-11:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum(ss_ext_sales_price) DESC, i_brand_id ASC
-|  limit: 100
-|
-06:TOP-N [LIMIT=100]
-|  order by: sum(ss_ext_sales_price) DESC, i_brand_id ASC
-|  row-size=48B cardinality=100
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: i_brand, i_brand_id
-|  row-size=48B cardinality=1.73K
-|
-09:EXCHANGE [HASH(i_brand,i_brand_id)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_brand, i_brand_id
-|  row-size=48B cardinality=1.73K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF000 <- d_date_sk
-|  row-size=72B cardinality=1.73K
-|
-|--08:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 2001, d_moy = 12
-|     row-size=12B cardinality=108
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=60B cardinality=29.12K
-|
-|--07:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_manager_id = 36
-|     row-size=44B cardinality=182
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_sold_date_sk, RF002 -> ss_item_sk
-   row-size=16B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=51.62MB Threads=9
-Per-Host Resource Estimates: Memory=124MB
-PLAN-ROOT SINK
-|
-11:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum(ss_ext_sales_price) DESC, i_brand_id ASC
-|  limit: 100
-|
-06:TOP-N [LIMIT=100]
-|  order by: sum(ss_ext_sales_price) DESC, i_brand_id ASC
-|  row-size=48B cardinality=100
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: i_brand, i_brand_id
-|  row-size=48B cardinality=1.73K
-|
-09:EXCHANGE [HASH(i_brand,i_brand_id)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_brand, i_brand_id
-|  row-size=48B cardinality=1.73K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=72B cardinality=1.73K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF000 <- d_date_sk
-|  |
-|  08:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 2001, d_moy = 12
-|     row-size=12B cardinality=108
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=60B cardinality=29.12K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: i_item_sk
-|  |  runtime filters: RF002 <- i_item_sk
-|  |
-|  07:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_manager_id = 36
-|     row-size=44B cardinality=182
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_sold_date_sk, RF002 -> ss_item_sk
-   row-size=16B cardinality=2.88M
-====
-# TPCDS-Q59
-with
-  wss as
-  (select
-    d_week_seq,
-    ss_store_sk,
-    sum(case when (d_day_name = 'Sunday') then ss_sales_price else null end) sun_sales,
-    sum(case when (d_day_name = 'Monday') then ss_sales_price else null end) mon_sales,
-    sum(case when (d_day_name = 'Tuesday') then ss_sales_price else null end) tue_sales,
-    sum(case when (d_day_name = 'Wednesday') then ss_sales_price else null end) wed_sales,
-    sum(case when (d_day_name = 'Thursday') then ss_sales_price else null end) thu_sales,
-    sum(case when (d_day_name = 'Friday') then ss_sales_price else null end) fri_sales,
-    sum(case when (d_day_name = 'Saturday') then ss_sales_price else null end) sat_sales
-  from
-    store_sales,
-    date_dim
-  where
-    d_date_sk = ss_sold_date_sk
-  group by
-    d_week_seq,
-    ss_store_sk
-  )
-select
-  s_store_name1,
-  s_store_id1,
-  d_week_seq1,
-  sun_sales1 / sun_sales2,
-  mon_sales1 / mon_sales2,
-  tue_sales1 / tue_sales2,
-  wed_sales1 / wed_sales2,
-  thu_sales1 / thu_sales2,
-  fri_sales1 / fri_sales2,
-  sat_sales1 / sat_sales2
-from
-  (select
-    s_store_name s_store_name1,
-    wss.d_week_seq d_week_seq1,
-    s_store_id s_store_id1,
-    sun_sales sun_sales1,
-    mon_sales mon_sales1,
-    tue_sales tue_sales1,
-    wed_sales wed_sales1,
-    thu_sales thu_sales1,
-    fri_sales fri_sales1,
-    sat_sales sat_sales1
-  from
-    wss,
-    store,
-    date_dim d
-  where
-    d.d_week_seq = wss.d_week_seq
-    and ss_store_sk = s_store_sk
-    and d_month_seq between 1185 and 1185 + 11
-  ) y,
-  (select
-    s_store_name s_store_name2,
-    wss.d_week_seq d_week_seq2,
-    s_store_id s_store_id2,
-    sun_sales sun_sales2,
-    mon_sales mon_sales2,
-    tue_sales tue_sales2,
-    wed_sales wed_sales2,
-    thu_sales thu_sales2,
-    fri_sales fri_sales2,
-    sat_sales sat_sales2
-  from
-    wss,
-    store,
-    date_dim d
-  where
-    d.d_week_seq = wss.d_week_seq
-    and ss_store_sk = s_store_sk
-    and d_month_seq between 1185 + 12 and 1185 + 23
-  ) x
-where
-  s_store_id1 = s_store_id2
-  and d_week_seq1 = d_week_seq2 - 52
-order by
-  s_store_name1,
-  s_store_id1,
-  d_week_seq1
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=70.52MB Threads=9
-Per-Host Resource Estimates: Memory=534MB
-PLAN-ROOT SINK
-|
-17:TOP-N [LIMIT=100]
-|  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
-|  row-size=272B cardinality=100
-|
-16:HASH JOIN [INNER JOIN]
-|  hash predicates: d_week_seq = d_week_seq - 52, s_store_id = s_store_id
-|  runtime filters: RF000 <- d_week_seq - 52, RF001 <- s_store_id
-|  row-size=336B cardinality=419.05M
-|
-|--15:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  runtime filters: RF010 <- s_store_sk
-|  |  row-size=160B cardinality=50.14K
-|  |
-|  |--12:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=32B cardinality=12
-|  |
-|  14:HASH JOIN [INNER JOIN]
-|  |  hash predicates: d_week_seq = d.d_week_seq
-|  |  runtime filters: RF012 <- d.d_week_seq
-|  |  row-size=128B cardinality=50.14K
-|  |
-|  |--13:SCAN HDFS [tpcds.date_dim d]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1208, d_month_seq >= 1197
-|  |     row-size=8B cardinality=7.30K
-|  |
-|  11:AGGREGATE [FINALIZE]
-|  |  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  |  group by: d_week_seq, ss_store_sk
-|  |  row-size=120B cardinality=63.85K
-|  |
-|  10:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF014 <- d_date_sk
-|  |  row-size=39B cardinality=2.88M
-|  |
-|  |--09:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     runtime filters: RF012 -> tpcds.date_dim.d_week_seq
-|  |     row-size=27B cardinality=73.05K
-|  |
-|  08:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF010 -> tpcds.store_sales.ss_store_sk, RF014 -> ss_sold_date_sk
-|     row-size=12B cardinality=2.88M
-|
-07:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF004 <- s_store_sk
-|  row-size=176B cardinality=50.14K
-|
-|--04:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF001 -> s_store_id
-|     row-size=48B cardinality=12
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: d_week_seq = d.d_week_seq
-|  runtime filters: RF006 <- d.d_week_seq
-|  row-size=128B cardinality=50.14K
-|
-|--05:SCAN HDFS [tpcds.date_dim d]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1196, d_month_seq >= 1185
-|     runtime filters: RF000 -> d.d_week_seq
-|     row-size=8B cardinality=7.30K
-|
-03:AGGREGATE [FINALIZE]
-|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  group by: d_week_seq, ss_store_sk
-|  row-size=120B cardinality=63.85K
-|
-02:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF008 <- d_date_sk
-|  row-size=39B cardinality=2.88M
-|
-|--01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     runtime filters: RF000 -> tpcds.date_dim.d_week_seq, RF006 -> tpcds.date_dim.d_week_seq
-|     row-size=27B cardinality=73.05K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF004 -> tpcds.store_sales.ss_store_sk, RF008 -> ss_sold_date_sk
-   row-size=12B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=103.14MB Threads=20
-Per-Host Resource Estimates: Memory=601MB
-PLAN-ROOT SINK
-|
-30:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
-|  limit: 100
-|
-17:TOP-N [LIMIT=100]
-|  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
-|  row-size=272B cardinality=100
-|
-16:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: d_week_seq = d_week_seq - 52, s_store_id = s_store_id
-|  runtime filters: RF000 <- d_week_seq - 52, RF001 <- s_store_id
-|  row-size=336B cardinality=419.05M
-|
-|--29:EXCHANGE [HASH(d_week_seq - 52,s_store_id)]
-|  |
-|  15:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  runtime filters: RF010 <- s_store_sk
-|  |  row-size=160B cardinality=50.14K
-|  |
-|  |--27:EXCHANGE [BROADCAST]
-|  |  |
-|  |  12:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=32B cardinality=12
-|  |
-|  14:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: d_week_seq = d.d_week_seq
-|  |  runtime filters: RF012 <- d.d_week_seq
-|  |  row-size=128B cardinality=50.14K
-|  |
-|  |--26:EXCHANGE [BROADCAST]
-|  |  |
-|  |  13:SCAN HDFS [tpcds.date_dim d]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1208, d_month_seq >= 1197
-|  |     row-size=8B cardinality=7.30K
-|  |
-|  25:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  |  group by: d_week_seq, ss_store_sk
-|  |  row-size=120B cardinality=63.85K
-|  |
-|  24:EXCHANGE [HASH(d_week_seq,ss_store_sk)]
-|  |
-|  11:AGGREGATE [STREAMING]
-|  |  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  |  group by: d_week_seq, ss_store_sk
-|  |  row-size=120B cardinality=63.85K
-|  |
-|  10:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF014 <- d_date_sk
-|  |  row-size=39B cardinality=2.88M
-|  |
-|  |--23:EXCHANGE [BROADCAST]
-|  |  |
-|  |  09:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     runtime filters: RF012 -> tpcds.date_dim.d_week_seq
-|  |     row-size=27B cardinality=73.05K
-|  |
-|  08:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF010 -> tpcds.store_sales.ss_store_sk, RF014 -> ss_sold_date_sk
-|     row-size=12B cardinality=2.88M
-|
-28:EXCHANGE [HASH(d_week_seq,s_store_id)]
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF004 <- s_store_sk
-|  row-size=176B cardinality=50.14K
-|
-|--22:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF001 -> s_store_id
-|     row-size=48B cardinality=12
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: d_week_seq = d.d_week_seq
-|  runtime filters: RF006 <- d.d_week_seq
-|  row-size=128B cardinality=50.14K
-|
-|--21:EXCHANGE [BROADCAST]
-|  |
-|  05:SCAN HDFS [tpcds.date_dim d]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1196, d_month_seq >= 1185
-|     runtime filters: RF000 -> d.d_week_seq
-|     row-size=8B cardinality=7.30K
-|
-20:AGGREGATE [FINALIZE]
-|  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  group by: d_week_seq, ss_store_sk
-|  row-size=120B cardinality=63.85K
-|
-19:EXCHANGE [HASH(d_week_seq,ss_store_sk)]
-|
-03:AGGREGATE [STREAMING]
-|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  group by: d_week_seq, ss_store_sk
-|  row-size=120B cardinality=63.85K
-|
-02:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF008 <- d_date_sk
-|  row-size=39B cardinality=2.88M
-|
-|--18:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     runtime filters: RF000 -> tpcds.date_dim.d_week_seq, RF006 -> tpcds.date_dim.d_week_seq
-|     row-size=27B cardinality=73.05K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF004 -> tpcds.store_sales.ss_store_sk, RF008 -> ss_sold_date_sk
-   row-size=12B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=159.52MB Threads=25
-Per-Host Resource Estimates: Memory=356MB
-PLAN-ROOT SINK
-|
-30:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
-|  limit: 100
-|
-17:TOP-N [LIMIT=100]
-|  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
-|  row-size=272B cardinality=100
-|
-16:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: d_week_seq = d_week_seq - 52, s_store_id = s_store_id
-|  row-size=336B cardinality=419.05M
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: d_week_seq - 52, s_store_id
-|  |  runtime filters: RF000 <- d_week_seq - 52, RF001 <- s_store_id
-|  |
-|  29:EXCHANGE [HASH(d_week_seq - 52,s_store_id)]
-|  |
-|  15:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=160B cardinality=50.14K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=01 plan-id=02 cohort-id=02
-|  |  |  build expressions: s_store_sk
-|  |  |  runtime filters: RF010 <- s_store_sk
-|  |  |
-|  |  27:EXCHANGE [BROADCAST]
-|  |  |
-|  |  12:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=32B cardinality=12
-|  |
-|  14:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: d_week_seq = d.d_week_seq
-|  |  row-size=128B cardinality=50.14K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=02 plan-id=03 cohort-id=02
-|  |  |  build expressions: d.d_week_seq
-|  |  |  runtime filters: RF012 <- d.d_week_seq
-|  |  |
-|  |  26:EXCHANGE [BROADCAST]
-|  |  |
-|  |  13:SCAN HDFS [tpcds.date_dim d]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1208, d_month_seq >= 1197
-|  |     row-size=8B cardinality=7.30K
-|  |
-|  25:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  |  group by: d_week_seq, ss_store_sk
-|  |  row-size=120B cardinality=63.85K
-|  |
-|  24:EXCHANGE [HASH(d_week_seq,ss_store_sk)]
-|  |
-|  11:AGGREGATE [STREAMING]
-|  |  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  |  group by: d_week_seq, ss_store_sk
-|  |  row-size=120B cardinality=63.85K
-|  |
-|  10:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  row-size=39B cardinality=2.88M
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=03 plan-id=04 cohort-id=02
-|  |  |  build expressions: d_date_sk
-|  |  |  runtime filters: RF014 <- d_date_sk
-|  |  |
-|  |  23:EXCHANGE [BROADCAST]
-|  |  |
-|  |  09:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     runtime filters: RF012 -> tpcds.date_dim.d_week_seq
-|  |     row-size=27B cardinality=73.05K
-|  |
-|  08:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF010 -> tpcds.store_sales.ss_store_sk, RF014 -> ss_sold_date_sk
-|     row-size=12B cardinality=2.88M
-|
-28:EXCHANGE [HASH(d_week_seq,s_store_id)]
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=176B cardinality=50.14K
-|
-|--JOIN BUILD
-|  |  join-table-id=04 plan-id=05 cohort-id=01
-|  |  build expressions: s_store_sk
-|  |  runtime filters: RF004 <- s_store_sk
-|  |
-|  22:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF001 -> s_store_id
-|     row-size=48B cardinality=12
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: d_week_seq = d.d_week_seq
-|  row-size=128B cardinality=50.14K
-|
-|--JOIN BUILD
-|  |  join-table-id=05 plan-id=06 cohort-id=01
-|  |  build expressions: d.d_week_seq
-|  |  runtime filters: RF006 <- d.d_week_seq
-|  |
-|  21:EXCHANGE [BROADCAST]
-|  |
-|  05:SCAN HDFS [tpcds.date_dim d]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1196, d_month_seq >= 1185
-|     runtime filters: RF000 -> d.d_week_seq
-|     row-size=8B cardinality=7.30K
-|
-20:AGGREGATE [FINALIZE]
-|  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  group by: d_week_seq, ss_store_sk
-|  row-size=120B cardinality=63.85K
-|
-19:EXCHANGE [HASH(d_week_seq,ss_store_sk)]
-|
-03:AGGREGATE [STREAMING]
-|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
-|  group by: d_week_seq, ss_store_sk
-|  row-size=120B cardinality=63.85K
-|
-02:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=39B cardinality=2.88M
-|
-|--JOIN BUILD
-|  |  join-table-id=06 plan-id=07 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF008 <- d_date_sk
-|  |
-|  18:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     runtime filters: RF000 -> tpcds.date_dim.d_week_seq, RF006 -> tpcds.date_dim.d_week_seq
-|     row-size=27B cardinality=73.05K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF004 -> tpcds.store_sales.ss_store_sk, RF008 -> ss_sold_date_sk
-   row-size=12B cardinality=2.88M
-====
-# TPCDS-Q63
-select
-  *
-from
-  (select
-    i_manager_id,
-    sum(ss_sales_price) sum_sales,
-    avg(sum(ss_sales_price)) over (partition by i_manager_id) avg_monthly_sales
-  from
-    item,
-    store_sales,
-    date_dim,
-    store
-  where
-    ss_item_sk = i_item_sk
-    and ss_sold_date_sk = d_date_sk
-    and ss_store_sk = s_store_sk
-    and d_month_seq in (1212, 1212 + 1, 1212 + 2, 1212 + 3, 1212 + 4, 1212 + 5, 1212 + 6, 1212 + 7, 1212 + 8, 1212 + 9, 1212 + 10, 1212 + 11)
-    and ((i_category in ('Books', 'Children', 'Electronics')
-      and i_class in ('personal', 'portable', 'refernece', 'self-help')
-      and i_brand in ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9'))
-    or (i_category in ('Women', 'Music', 'Men')
-      and i_class in ('accessories', 'classical', 'fragrances', 'pants')
-      and i_brand in ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
-    and ss_sold_date_sk between 2451911 and 2452275  -- partition key filter
-  group by
-    i_manager_id,
-    d_moy
-  ) tmp1
-where
-case when avg_monthly_sales > 0 then abs (sum_sales - avg_monthly_sales) / avg_monthly_sales else null end > 0.1
-order by
-  i_manager_id,
-  avg_monthly_sales,
-  sum_sales
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=29.32MB Threads=5
-Per-Host Resource Estimates: Memory=253MB
-PLAN-ROOT SINK
-|
-11:TOP-N [LIMIT=100]
-|  order by: i_manager_id ASC, avg_monthly_sales ASC, sum_sales ASC
-|  row-size=36B cardinality=1
-|
-10:SELECT
-|  predicates: CASE WHEN avg(sum(ss_sales_price)) > 0 THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > 0.1
-|  row-size=40B cardinality=1
-|
-09:ANALYTIC
-|  functions: avg(sum(ss_sales_price))
-|  partition by: i_manager_id
-|  row-size=40B cardinality=6
-|
-08:SORT
-|  order by: i_manager_id ASC NULLS LAST
-|  row-size=24B cardinality=6
-|
-07:AGGREGATE [FINALIZE]
-|  output: sum(ss_sales_price)
-|  group by: i_manager_id, d_moy
-|  row-size=24B cardinality=6
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=114B cardinality=6
-|
-|--03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=4B cardinality=12
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=110B cardinality=6
-|
-|--02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: tpcds.date_dim.d_date_sk <= 2452275, tpcds.date_dim.d_date_sk >= 2451911, d_month_seq IN (1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223)
-|     row-size=12B cardinality=114
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF004 <- i_item_sk
-|  row-size=98B cardinality=92
-|
-|--00:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'refernece', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
-|     row-size=78B cardinality=3
-|
-01:SCAN HDFS [tpcds.store_sales]
-   partition predicates: ss_sold_date_sk >= 2451911, ss_sold_date_sk <= 2452275
-   HDFS partitions=364/1824 files=364 size=66.85MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk, RF004 -> ss_item_sk
-   row-size=20B cardinality=546.31K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=39.26MB Threads=10
-Per-Host Resource Estimates: Memory=279MB
-PLAN-ROOT SINK
-|
-17:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: i_manager_id ASC, avg_monthly_sales ASC, sum_sales ASC
-|  limit: 100
-|
-11:TOP-N [LIMIT=100]
-|  order by: i_manager_id ASC, avg_monthly_sales ASC, sum_sales ASC
-|  row-size=36B cardinality=1
-|
-10:SELECT
-|  predicates: CASE WHEN avg(sum(ss_sales_price)) > 0 THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > 0.1
-|  row-size=40B cardinality=1
-|
-09:ANALYTIC
-|  functions: avg(sum(ss_sales_price))
-|  partition by: i_manager_id
-|  row-size=40B cardinality=6
-|
-08:SORT
-|  order by: i_manager_id ASC NULLS LAST
-|  row-size=24B cardinality=6
-|
-16:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_sales_price)
-|  group by: i_manager_id, d_moy
-|  row-size=24B cardinality=6
-|
-15:EXCHANGE [HASH(i_manager_id)]
-|
-07:AGGREGATE [STREAMING]
-|  output: sum(ss_sales_price)
-|  group by: i_manager_id, d_moy
-|  row-size=24B cardinality=6
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=114B cardinality=6
-|
-|--14:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=4B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=110B cardinality=6
-|
-|--13:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: tpcds.date_dim.d_date_sk <= 2452275, tpcds.date_dim.d_date_sk >= 2451911, d_month_seq IN (1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223)
-|     row-size=12B cardinality=114
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF004 <- i_item_sk
-|  row-size=98B cardinality=92
-|
-|--12:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'refernece', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
-|     row-size=78B cardinality=3
-|
-01:SCAN HDFS [tpcds.store_sales]
-   partition predicates: ss_sold_date_sk >= 2451911, ss_sold_date_sk <= 2452275
-   HDFS partitions=364/1824 files=364 size=66.85MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk, RF004 -> ss_item_sk
-   row-size=20B cardinality=546.31K
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=62.51MB Threads=11
-Per-Host Resource Estimates: Memory=166MB
-PLAN-ROOT SINK
-|
-17:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: i_manager_id ASC, avg_monthly_sales ASC, sum_sales ASC
-|  limit: 100
-|
-11:TOP-N [LIMIT=100]
-|  order by: i_manager_id ASC, avg_monthly_sales ASC, sum_sales ASC
-|  row-size=36B cardinality=1
-|
-10:SELECT
-|  predicates: CASE WHEN avg(sum(ss_sales_price)) > 0 THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > 0.1
-|  row-size=40B cardinality=1
-|
-09:ANALYTIC
-|  functions: avg(sum(ss_sales_price))
-|  partition by: i_manager_id
-|  row-size=40B cardinality=6
-|
-08:SORT
-|  order by: i_manager_id ASC NULLS LAST
-|  row-size=24B cardinality=6
-|
-16:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_sales_price)
-|  group by: i_manager_id, d_moy
-|  row-size=24B cardinality=6
-|
-15:EXCHANGE [HASH(i_manager_id)]
-|
-07:AGGREGATE [STREAMING]
-|  output: sum(ss_sales_price)
-|  group by: i_manager_id, d_moy
-|  row-size=24B cardinality=6
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=114B cardinality=6
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: s_store_sk
-|  |  runtime filters: RF000 <- s_store_sk
-|  |
-|  14:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=4B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=110B cardinality=6
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF002 <- d_date_sk
-|  |
-|  13:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: tpcds.date_dim.d_date_sk <= 2452275, tpcds.date_dim.d_date_sk >= 2451911, d_month_seq IN (1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223)
-|     row-size=12B cardinality=114
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=98B cardinality=92
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: i_item_sk
-|  |  runtime filters: RF004 <- i_item_sk
-|  |
-|  12:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'refernece', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
-|     row-size=78B cardinality=3
-|
-01:SCAN HDFS [tpcds.store_sales]
-   partition predicates: ss_sold_date_sk >= 2451911, ss_sold_date_sk <= 2452275
-   HDFS partitions=364/1824 files=364 size=66.85MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk, RF004 -> ss_item_sk
-   row-size=20B cardinality=546.31K
-====
-# TPCDS-Q65
-select
-  s_store_name,
-  i_item_desc,
-  sc.revenue,
-  i_current_price,
-  i_wholesale_cost,
-  i_brand
-from
-  store,
-  item,
-  (select
-    ss_store_sk,
-    avg(revenue) as ave
-  from
-    (select
-      ss_store_sk,
-      ss_item_sk,
-      sum(ss_sales_price) as revenue
-    from
-      store_sales,
-      date_dim
-    where
-      ss_sold_date_sk = d_date_sk
-      and d_month_seq between 1212 and 1212 + 11
-    group by
-      ss_store_sk,
-      ss_item_sk
-    ) sa
-  group by
-    ss_store_sk
-  ) sb,
-  (select
-    ss_store_sk,
-    ss_item_sk,
-    sum(ss_sales_price) as revenue
-  from
-    store_sales,
-    date_dim
-  where
-    ss_sold_date_sk = d_date_sk
-    and d_month_seq between 1212 and 1212 + 11
-  group by
-    ss_store_sk,
-    ss_item_sk
-  ) sc
-where
-  sb.ss_store_sk = sc.ss_store_sk
-  and sc.revenue <= 0.1 * sb.ave
-  and s_store_sk = sc.ss_store_sk
-  and i_item_sk = sc.ss_item_sk
-order by
-  s_store_name,
-  i_item_desc
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=55.57MB Threads=7
-Per-Host Resource Estimates: Memory=432MB
-PLAN-ROOT SINK
-|
-14:TOP-N [LIMIT=100]
-|  order by: s_store_name ASC, i_item_desc ASC
-|  row-size=181B cardinality=100
-|
-13:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = ss_store_sk
-|  other predicates: sum(ss_sales_price) <= 0.1 * avg(revenue)
-|  runtime filters: RF000 <- ss_store_sk
-|  row-size=225B cardinality=647.10K
-|
-|--06:AGGREGATE [FINALIZE]
-|  |  output: avg(sum(ss_sales_price))
-|  |  group by: ss_store_sk
-|  |  row-size=20B cardinality=6
-|  |
-|  05:AGGREGATE [FINALIZE]
-|  |  output: sum(ss_sales_price)
-|  |  group by: ss_store_sk, ss_item_sk
-|  |  row-size=28B cardinality=107.85K
-|  |
-|  04:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF008 <- d_date_sk
-|  |  row-size=28B cardinality=2.88M
-|  |
-|  |--03:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|  |     row-size=8B cardinality=7.30K
-|  |
-|  02:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF008 -> ss_sold_date_sk
-|     row-size=20B cardinality=2.88M
-|
-12:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=205B cardinality=107.85K
-|
-|--01:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=157B cardinality=18.00K
-|
-11:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF004 <- s_store_sk
-|  row-size=48B cardinality=107.85K
-|
-|--00:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF000 -> tpcds.store.s_store_sk
-|     row-size=20B cardinality=12
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum(ss_sales_price)
-|  group by: ss_store_sk, ss_item_sk
-|  row-size=28B cardinality=107.85K
-|
-09:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=28B cardinality=2.88M
-|
-|--08:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|     row-size=8B cardinality=7.30K
-|
-07:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_store_sk, RF002 -> tpcds.store_sales.ss_item_sk, RF004 -> tpcds.store_sales.ss_store_sk, RF006 -> ss_sold_date_sk
-   row-size=20B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=76.51MB Threads=17
-Per-Host Resource Estimates: Memory=502MB
-PLAN-ROOT SINK
-|
-27:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: s_store_name ASC, i_item_desc ASC
-|  limit: 100
-|
-14:TOP-N [LIMIT=100]
-|  order by: s_store_name ASC, i_item_desc ASC
-|  row-size=181B cardinality=100
-|
-13:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = ss_store_sk
-|  other predicates: sum(ss_sales_price) <= 0.1 * avg(revenue)
-|  runtime filters: RF000 <- ss_store_sk
-|  row-size=225B cardinality=647.10K
-|
-|--26:EXCHANGE [BROADCAST]
-|  |
-|  25:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(revenue)
-|  |  group by: ss_store_sk
-|  |  row-size=20B cardinality=6
-|  |
-|  24:EXCHANGE [HASH(ss_store_sk)]
-|  |
-|  06:AGGREGATE [STREAMING]
-|  |  output: avg(sum(ss_sales_price))
-|  |  group by: ss_store_sk
-|  |  row-size=20B cardinality=6
-|  |
-|  23:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ss_sales_price)
-|  |  group by: ss_store_sk, ss_item_sk
-|  |  row-size=28B cardinality=107.85K
-|  |
-|  22:EXCHANGE [HASH(ss_store_sk,ss_item_sk)]
-|  |
-|  05:AGGREGATE [STREAMING]
-|  |  output: sum(ss_sales_price)
-|  |  group by: ss_store_sk, ss_item_sk
-|  |  row-size=28B cardinality=107.85K
-|  |
-|  04:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF008 <- d_date_sk
-|  |  row-size=28B cardinality=2.88M
-|  |
-|  |--21:EXCHANGE [BROADCAST]
-|  |  |
-|  |  03:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|  |     row-size=8B cardinality=7.30K
-|  |
-|  02:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF008 -> ss_sold_date_sk
-|     row-size=20B cardinality=2.88M
-|
-12:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=205B cardinality=107.85K
-|
-|--20:EXCHANGE [HASH(i_item_sk)]
-|  |
-|  01:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=157B cardinality=18.00K
-|
-19:EXCHANGE [HASH(ss_item_sk)]
-|
-11:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF004 <- s_store_sk
-|  row-size=48B cardinality=107.85K
-|
-|--18:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF000 -> tpcds.store.s_store_sk
-|     row-size=20B cardinality=12
-|
-17:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_sales_price)
-|  group by: ss_store_sk, ss_item_sk
-|  row-size=28B cardinality=107.85K
-|
-16:EXCHANGE [HASH(ss_store_sk,ss_item_sk)]
-|
-10:AGGREGATE [STREAMING]
-|  output: sum(ss_sales_price)
-|  group by: ss_store_sk, ss_item_sk
-|  row-size=28B cardinality=107.85K
-|
-09:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=28B cardinality=2.88M
-|
-|--15:EXCHANGE [BROADCAST]
-|  |
-|  08:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|     row-size=8B cardinality=7.30K
-|
-07:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_store_sk, RF002 -> tpcds.store_sales.ss_item_sk, RF004 -> tpcds.store_sales.ss_store_sk, RF006 -> ss_sold_date_sk
-   row-size=20B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=123.01MB Threads=23
-Per-Host Resource Estimates: Memory=310MB
-PLAN-ROOT SINK
-|
-27:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: s_store_name ASC, i_item_desc ASC
-|  limit: 100
-|
-14:TOP-N [LIMIT=100]
-|  order by: s_store_name ASC, i_item_desc ASC
-|  row-size=181B cardinality=100
-|
-13:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = ss_store_sk
-|  other predicates: sum(ss_sales_price) <= 0.1 * avg(revenue)
-|  row-size=225B cardinality=647.10K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: ss_store_sk
-|  |  runtime filters: RF000 <- ss_store_sk
-|  |
-|  26:EXCHANGE [BROADCAST]
-|  |
-|  25:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(revenue)
-|  |  group by: ss_store_sk
-|  |  row-size=20B cardinality=6
-|  |
-|  24:EXCHANGE [HASH(ss_store_sk)]
-|  |
-|  06:AGGREGATE [STREAMING]
-|  |  output: avg(sum(ss_sales_price))
-|  |  group by: ss_store_sk
-|  |  row-size=20B cardinality=6
-|  |
-|  23:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ss_sales_price)
-|  |  group by: ss_store_sk, ss_item_sk
-|  |  row-size=28B cardinality=107.85K
-|  |
-|  22:EXCHANGE [HASH(ss_store_sk,ss_item_sk)]
-|  |
-|  05:AGGREGATE [STREAMING]
-|  |  output: sum(ss_sales_price)
-|  |  group by: ss_store_sk, ss_item_sk
-|  |  row-size=28B cardinality=107.85K
-|  |
-|  04:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  row-size=28B cardinality=2.88M
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=01 plan-id=02 cohort-id=02
-|  |  |  build expressions: d_date_sk
-|  |  |  runtime filters: RF008 <- d_date_sk
-|  |  |
-|  |  21:EXCHANGE [BROADCAST]
-|  |  |
-|  |  03:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|  |     row-size=8B cardinality=7.30K
-|  |
-|  02:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF008 -> ss_sold_date_sk
-|     row-size=20B cardinality=2.88M
-|
-12:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=205B cardinality=107.85K
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: i_item_sk
-|  |  runtime filters: RF002 <- i_item_sk
-|  |
-|  20:EXCHANGE [HASH(i_item_sk)]
-|  |
-|  01:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=157B cardinality=18.00K
-|
-19:EXCHANGE [HASH(ss_item_sk)]
-|
-11:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=48B cardinality=107.85K
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |  build expressions: s_store_sk
-|  |  runtime filters: RF004 <- s_store_sk
-|  |
-|  18:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF000 -> tpcds.store.s_store_sk
-|     row-size=20B cardinality=12
-|
-17:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_sales_price)
-|  group by: ss_store_sk, ss_item_sk
-|  row-size=28B cardinality=107.85K
-|
-16:EXCHANGE [HASH(ss_store_sk,ss_item_sk)]
-|
-10:AGGREGATE [STREAMING]
-|  output: sum(ss_sales_price)
-|  group by: ss_store_sk, ss_item_sk
-|  row-size=28B cardinality=107.85K
-|
-09:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=28B cardinality=2.88M
-|
-|--JOIN BUILD
-|  |  join-table-id=04 plan-id=05 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |
-|  15:EXCHANGE [BROADCAST]
-|  |
-|  08:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|     row-size=8B cardinality=7.30K
-|
-07:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_store_sk, RF002 -> tpcds.store_sales.ss_item_sk, RF004 -> tpcds.store_sales.ss_store_sk, RF006 -> ss_sold_date_sk
-   row-size=20B cardinality=2.88M
-====
-# TPCDS-Q68
-select
-  c_last_name,
-  c_first_name,
-  ca_city,
-  bought_city,
-  ss_ticket_number,
-  extended_price,
-  extended_tax,
-  list_price
-from
-  (select
-    ss_ticket_number,
-    ss_customer_sk,
-    ca_city bought_city,
-    sum(ss_ext_sales_price) extended_price,
-    sum(ss_ext_list_price) list_price,
-    sum(ss_ext_tax) extended_tax
-  from
-    store_sales,
-    date_dim,
-    store,
-    household_demographics,
-    customer_address
-  where
-    store_sales.ss_sold_date_sk = date_dim.d_date_sk
-    and store_sales.ss_store_sk = store.s_store_sk
-    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-    and store_sales.ss_addr_sk = customer_address.ca_address_sk
-    and (household_demographics.hd_dep_count = 5
-      or household_demographics.hd_vehicle_count = 3)
-    and store.s_city in ('Midway', 'Fairview')
-    and d_date between '1999-01-01' and '1999-03-31'
-  group by
-    ss_ticket_number,
-    ss_customer_sk,
-    ss_addr_sk,
-    ca_city
-  ) dn,
-  customer,
-  customer_address current_addr
-where
-  ss_customer_sk = c_customer_sk
-  and customer.c_current_addr_sk = current_addr.ca_address_sk
-  and current_addr.ca_city <> bought_city
-order by
-  c_last_name,
-  ss_ticket_number
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=84.06MB Threads=8
-Per-Host Resource Estimates: Memory=378MB
-PLAN-ROOT SINK
-|
-14:TOP-N [LIMIT=100]
-|  order by: c_last_name ASC, ss_ticket_number ASC
-|  row-size=134B cardinality=100
-|
-13:HASH JOIN [INNER JOIN]
-|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
-|  other predicates: current_addr.ca_city != ca_city
-|  runtime filters: RF000 <- current_addr.ca_address_sk
-|  row-size=154B cardinality=702.92K
-|
-|--11:SCAN HDFS [tpcds.customer_address current_addr]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-12:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF002 <- c_customer_sk
-|  row-size=129B cardinality=702.92K
-|
-|--10:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> customer.c_current_addr_sk
-|     row-size=44B cardinality=100.00K
-|
-09:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price), sum(ss_ext_list_price), sum(ss_ext_tax)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
-|  row-size=85B cardinality=702.92K
-|
-08:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
-|  runtime filters: RF004 <- customer_address.ca_address_sk
-|  row-size=125B cardinality=702.92K
-|
-|--04:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-07:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  runtime filters: RF006 <- store.s_store_sk
-|  row-size=101B cardinality=702.92K
-|
-|--02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_city IN ('Midway', 'Fairview')
-|     row-size=23B cardinality=12
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  runtime filters: RF008 <- date_dim.d_date_sk
-|  row-size=78B cardinality=702.92K
-|
-|--01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
-|     row-size=26B cardinality=7.30K
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  runtime filters: RF010 <- household_demographics.hd_demo_sk
-|  row-size=52B cardinality=702.92K
-|
-|--03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: (household_demographics.hd_dep_count = 5 OR household_demographics.hd_vehicle_count = 3)
-|     row-size=12B cardinality=1.80K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF002 -> tpcds.store_sales.ss_customer_sk, RF004 -> store_sales.ss_addr_sk, RF006 -> store_sales.ss_store_sk, RF008 -> store_sales.ss_sold_date_sk, RF010 -> store_sales.ss_hdemo_sk
-   row-size=40B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=136.32MB Threads=16
-Per-Host Resource Estimates: Memory=465MB
-PLAN-ROOT SINK
-|
-23:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: c_last_name ASC, ss_ticket_number ASC
-|  limit: 100
-|
-14:TOP-N [LIMIT=100]
-|  order by: c_last_name ASC, ss_ticket_number ASC
-|  row-size=134B cardinality=100
-|
-13:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
-|  other predicates: current_addr.ca_city != ca_city
-|  runtime filters: RF000 <- current_addr.ca_address_sk
-|  row-size=154B cardinality=702.92K
-|
-|--22:EXCHANGE [BROADCAST]
-|  |
-|  11:SCAN HDFS [tpcds.customer_address current_addr]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-12:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF002 <- c_customer_sk
-|  row-size=129B cardinality=702.92K
-|
-|--21:EXCHANGE [BROADCAST]
-|  |
-|  10:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> customer.c_current_addr_sk
-|     row-size=44B cardinality=100.00K
-|
-20:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price), sum:merge(ss_ext_list_price), sum:merge(ss_ext_tax)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
-|  row-size=85B cardinality=702.92K
-|
-19:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)]
-|
-09:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price), sum(ss_ext_list_price), sum(ss_ext_tax)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
-|  row-size=85B cardinality=702.92K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
-|  runtime filters: RF004 <- customer_address.ca_address_sk
-|  row-size=125B cardinality=702.92K
-|
-|--18:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  runtime filters: RF006 <- store.s_store_sk
-|  row-size=101B cardinality=702.92K
-|
-|--17:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_city IN ('Midway', 'Fairview')
-|     row-size=23B cardinality=12
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  runtime filters: RF008 <- date_dim.d_date_sk
-|  row-size=78B cardinality=702.92K
-|
-|--16:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
-|     row-size=26B cardinality=7.30K
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  runtime filters: RF010 <- household_demographics.hd_demo_sk
-|  row-size=52B cardinality=702.92K
-|
-|--15:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: (household_demographics.hd_dep_count = 5 OR household_demographics.hd_vehicle_count = 3)
-|     row-size=12B cardinality=1.80K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF002 -> tpcds.store_sales.ss_customer_sk, RF004 -> store_sales.ss_addr_sk, RF006 -> store_sales.ss_store_sk, RF008 -> store_sales.ss_sold_date_sk, RF010 -> store_sales.ss_hdemo_sk
-   row-size=40B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=168.38MB Threads=17
-Per-Host Resource Estimates: Memory=292MB
-PLAN-ROOT SINK
-|
-23:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: c_last_name ASC, ss_ticket_number ASC
-|  limit: 100
-|
-14:TOP-N [LIMIT=100]
-|  order by: c_last_name ASC, ss_ticket_number ASC
-|  row-size=134B cardinality=100
-|
-13:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
-|  other predicates: current_addr.ca_city != ca_city
-|  row-size=154B cardinality=702.92K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: current_addr.ca_address_sk
-|  |  runtime filters: RF000 <- current_addr.ca_address_sk
-|  |
-|  22:EXCHANGE [BROADCAST]
-|  |
-|  11:SCAN HDFS [tpcds.customer_address current_addr]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-12:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  row-size=129B cardinality=702.92K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: c_customer_sk
-|  |  runtime filters: RF002 <- c_customer_sk
-|  |
-|  21:EXCHANGE [BROADCAST]
-|  |
-|  10:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> customer.c_current_addr_sk
-|     row-size=44B cardinality=100.00K
-|
-20:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price), sum:merge(ss_ext_list_price), sum:merge(ss_ext_tax)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
-|  row-size=85B cardinality=702.92K
-|
-19:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)]
-|
-09:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price), sum(ss_ext_list_price), sum(ss_ext_tax)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
-|  row-size=85B cardinality=702.92K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
-|  row-size=125B cardinality=702.92K
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: customer_address.ca_address_sk
-|  |  runtime filters: RF004 <- customer_address.ca_address_sk
-|  |
-|  18:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=25B cardinality=50.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  row-size=101B cardinality=702.92K
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |  build expressions: store.s_store_sk
-|  |  runtime filters: RF006 <- store.s_store_sk
-|  |
-|  17:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_city IN ('Midway', 'Fairview')
-|     row-size=23B cardinality=12
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  row-size=78B cardinality=702.92K
-|
-|--JOIN BUILD
-|  |  join-table-id=04 plan-id=05 cohort-id=01
-|  |  build expressions: date_dim.d_date_sk
-|  |  runtime filters: RF008 <- date_dim.d_date_sk
-|  |
-|  16:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
-|     row-size=26B cardinality=7.30K
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  row-size=52B cardinality=702.92K
-|
-|--JOIN BUILD
-|  |  join-table-id=05 plan-id=06 cohort-id=01
-|  |  build expressions: household_demographics.hd_demo_sk
-|  |  runtime filters: RF010 <- household_demographics.hd_demo_sk
-|  |
-|  15:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: (household_demographics.hd_dep_count = 5 OR household_demographics.hd_vehicle_count = 3)
-|     row-size=12B cardinality=1.80K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF002 -> tpcds.store_sales.ss_customer_sk, RF004 -> store_sales.ss_addr_sk, RF006 -> store_sales.ss_store_sk, RF008 -> store_sales.ss_sold_date_sk, RF010 -> store_sales.ss_hdemo_sk
-   row-size=40B cardinality=2.88M
-====
-# TPCDS-Q73
-select
-  c_last_name,
-  c_first_name,
-  c_salutation,
-  c_preferred_cust_flag,
-  ss_ticket_number,
-  cnt
-from
-  (select
-    ss_ticket_number,
-    ss_customer_sk,
-    count(*) cnt
-  from
-    store_sales,
-    date_dim,
-    store,
-    household_demographics
-  where
-    store_sales.ss_sold_date_sk = date_dim.d_date_sk
-    and store_sales.ss_store_sk = store.s_store_sk
-    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-    and (household_demographics.hd_buy_potential = '>10000'
-      or household_demographics.hd_buy_potential = 'unknown')
-    and household_demographics.hd_vehicle_count > 0
-    and case when household_demographics.hd_vehicle_count > 0 then household_demographics.hd_dep_count / household_demographics.hd_vehicle_count else null end > 1
-    and store.s_county in ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
-  group by
-    ss_ticket_number,
-    ss_customer_sk
-  ) dj,
-  customer
-where
-  ss_customer_sk = c_customer_sk
-  and cnt between 1 and 5
-order by
-  cnt desc
-limit 1000
----- PLAN
-Max Per-Host Resource Reservation: Memory=34.07MB Threads=6
-Per-Host Resource Estimates: Memory=298MB
-PLAN-ROOT SINK
-|
-10:TOP-N [LIMIT=1000]
-|  order by: cnt DESC
-|  row-size=80B cardinality=1.00K
-|
-09:HASH JOIN [INNER JOIN]
-|  hash predicates: c_customer_sk = ss_customer_sk
-|  runtime filters: RF000 <- ss_customer_sk
-|  row-size=88B cardinality=16.25K
-|
-|--07:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  group by: ss_ticket_number, ss_customer_sk
-|  |  having: count(*) <= 5, count(*) >= 1
-|  |  row-size=20B cardinality=16.25K
-|  |
-|  06:HASH JOIN [INNER JOIN]
-|  |  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  |  runtime filters: RF002 <- store.s_store_sk
-|  |  row-size=93B cardinality=162.45K
-|  |
-|  |--02:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
-|  |     row-size=33B cardinality=12
-|  |
-|  05:HASH JOIN [INNER JOIN]
-|  |  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  |  runtime filters: RF004 <- date_dim.d_date_sk
-|  |  row-size=60B cardinality=162.45K
-|  |
-|  |--01:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     row-size=4B cardinality=73.05K
-|  |
-|  04:HASH JOIN [INNER JOIN]
-|  |  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  runtime filters: RF006 <- household_demographics.hd_demo_sk
-|  |  row-size=56B cardinality=162.45K
-|  |
-|  |--03:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: household_demographics.hd_vehicle_count > 0, household_demographics.hd_buy_potential IN ('>10000', 'unknown'), CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END > 1
-|  |     row-size=32B cardinality=416
-|  |
-|  00:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF002 -> store_sales.ss_store_sk, RF004 -> store_sales.ss_sold_date_sk, RF006 -> store_sales.ss_hdemo_sk
-|     row-size=24B cardinality=2.88M
-|
-08:SCAN HDFS [tpcds.customer]
-   HDFS partitions=1/1 files=1 size=12.60MB
-   runtime filters: RF000 -> c_customer_sk
-   row-size=68B cardinality=100.00K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=49.45MB Threads=13
-Per-Host Resource Estimates: Memory=336MB
-PLAN-ROOT SINK
-|
-18:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: cnt DESC
-|  limit: 1000
-|
-10:TOP-N [LIMIT=1000]
-|  order by: cnt DESC
-|  row-size=80B cardinality=1.00K
-|
-09:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF000 <- c_customer_sk
-|  row-size=88B cardinality=16.25K
-|
-|--17:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  08:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     row-size=68B cardinality=100.00K
-|
-16:EXCHANGE [HASH(ss_customer_sk)]
-|
-15:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  group by: ss_ticket_number, ss_customer_sk
-|  having: count(*) <= 5, count(*) >= 1
-|  row-size=20B cardinality=16.25K
-|
-14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk)]
-|
-07:AGGREGATE [STREAMING]
-|  output: count(*)
-|  group by: ss_ticket_number, ss_customer_sk
-|  row-size=20B cardinality=162.45K
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  runtime filters: RF002 <- store.s_store_sk
-|  row-size=93B cardinality=162.45K
-|
-|--13:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
-|     row-size=33B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  runtime filters: RF004 <- date_dim.d_date_sk
-|  row-size=60B cardinality=162.45K
-|
-|--12:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     row-size=4B cardinality=73.05K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  runtime filters: RF006 <- household_demographics.hd_demo_sk
-|  row-size=56B cardinality=162.45K
-|
-|--11:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: household_demographics.hd_vehicle_count > 0, household_demographics.hd_buy_potential IN ('>10000', 'unknown'), CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END > 1
-|     row-size=32B cardinality=416
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_customer_sk, RF002 -> store_sales.ss_store_sk, RF004 -> store_sales.ss_sold_date_sk, RF006 -> store_sales.ss_hdemo_sk
-   row-size=24B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=68.26MB Threads=14
-Per-Host Resource Estimates: Memory=190MB
-PLAN-ROOT SINK
-|
-18:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: cnt DESC
-|  limit: 1000
-|
-10:TOP-N [LIMIT=1000]
-|  order by: cnt DESC
-|  row-size=80B cardinality=1.00K
-|
-09:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  row-size=88B cardinality=16.25K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: c_customer_sk
-|  |  runtime filters: RF000 <- c_customer_sk
-|  |
-|  17:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  08:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     row-size=68B cardinality=100.00K
-|
-16:EXCHANGE [HASH(ss_customer_sk)]
-|
-15:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  group by: ss_ticket_number, ss_customer_sk
-|  having: count(*) <= 5, count(*) >= 1
-|  row-size=20B cardinality=16.25K
-|
-14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk)]
-|
-07:AGGREGATE [STREAMING]
-|  output: count(*)
-|  group by: ss_ticket_number, ss_customer_sk
-|  row-size=20B cardinality=162.45K
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  row-size=93B cardinality=162.45K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: store.s_store_sk
-|  |  runtime filters: RF002 <- store.s_store_sk
-|  |
-|  13:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
-|     row-size=33B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  row-size=60B cardinality=162.45K
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: date_dim.d_date_sk
-|  |  runtime filters: RF004 <- date_dim.d_date_sk
-|  |
-|  12:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     row-size=4B cardinality=73.05K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  row-size=56B cardinality=162.45K
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |  build expressions: household_demographics.hd_demo_sk
-|  |  runtime filters: RF006 <- household_demographics.hd_demo_sk
-|  |
-|  11:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: household_demographics.hd_vehicle_count > 0, household_demographics.hd_buy_potential IN ('>10000', 'unknown'), CASE WHEN household_demographics.hd_vehicle_count > 0 THEN household_demographics.hd_dep_count / household_demographics.hd_vehicle_count ELSE NULL END > 1
-|     row-size=32B cardinality=416
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_customer_sk, RF002 -> store_sales.ss_store_sk, RF004 -> store_sales.ss_sold_date_sk, RF006 -> store_sales.ss_hdemo_sk
-   row-size=24B cardinality=2.88M
-====
-# TPCDS-Q79
-select
-  c_last_name,
-  c_first_name,
-  substr(s_city, 1, 30),
-  ss_ticket_number,
-  amt,
-  profit
-from
-  (select
-    ss_ticket_number,
-    ss_customer_sk,
-    store.s_city,
-    sum(ss_coupon_amt) amt,
-    sum(ss_net_profit) profit
-  from
-    store_sales,
-    date_dim,
-    store,
-    household_demographics
-  where
-    store_sales.ss_sold_date_sk = date_dim.d_date_sk
-    and store_sales.ss_store_sk = store.s_store_sk
-    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-    and (household_demographics.hd_dep_count = 8
-      or household_demographics.hd_vehicle_count > 0)
-    and store.s_number_employees between 200 and 295
-    and d_date between '1999-01-01' and '1999-03-31'
-  group by
-    ss_ticket_number,
-    ss_customer_sk,
-    ss_addr_sk,
-    store.s_city
-  ) ms,
-  customer
-where
-  ss_customer_sk = c_customer_sk
-order by
-  c_last_name,
-  c_first_name,
-  substr(s_city, 1, 30),
-  profit
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=34.07MB Threads=6
-Per-Host Resource Estimates: Memory=298MB
-PLAN-ROOT SINK
-|
-10:TOP-N [LIMIT=100]
-|  order by: c_last_name ASC, c_first_name ASC, substr(s_city, 1, 30) ASC, profit ASC
-|  row-size=88B cardinality=100
-|
-09:HASH JOIN [INNER JOIN]
-|  hash predicates: c_customer_sk = ss_customer_sk
-|  runtime filters: RF000 <- ss_customer_sk
-|  row-size=106B cardinality=46.86K
-|
-|--07:AGGREGATE [FINALIZE]
-|  |  output: sum(ss_coupon_amt), sum(ss_net_profit)
-|  |  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, store.s_city
-|  |  row-size=67B cardinality=46.86K
-|  |
-|  06:HASH JOIN [INNER JOIN]
-|  |  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  |  runtime filters: RF002 <- date_dim.d_date_sk
-|  |  row-size=101B cardinality=46.86K
-|  |
-|  |--01:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  05:HASH JOIN [INNER JOIN]
-|  |  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  |  runtime filters: RF004 <- store.s_store_sk
-|  |  row-size=75B cardinality=46.86K
-|  |
-|  |--02:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_number_employees <= 295, store.s_number_employees >= 200
-|  |     row-size=27B cardinality=1
-|  |
-|  04:HASH JOIN [INNER JOIN]
-|  |  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  runtime filters: RF006 <- household_demographics.hd_demo_sk
-|  |  row-size=48B cardinality=281.17K
-|  |
-|  |--03:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: (household_demographics.hd_dep_count = 8 OR household_demographics.hd_vehicle_count > 0)
-|  |     row-size=12B cardinality=720
-|  |
-|  00:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF002 -> store_sales.ss_sold_date_sk, RF004 -> store_sales.ss_store_sk, RF006 -> store_sales.ss_hdemo_sk
-|     row-size=36B cardinality=2.88M
-|
-08:SCAN HDFS [tpcds.customer]
-   HDFS partitions=1/1 files=1 size=12.60MB
-   runtime filters: RF000 -> c_customer_sk
-   row-size=40B cardinality=100.00K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=45.70MB Threads=13
-Per-Host Resource Estimates: Memory=330MB
-PLAN-ROOT SINK
-|
-18:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: c_last_name ASC, c_first_name ASC, substr(s_city, 1, 30) ASC, profit ASC
-|  limit: 100
-|
-10:TOP-N [LIMIT=100]
-|  order by: c_last_name ASC, c_first_name ASC, substr(s_city, 1, 30) ASC, profit ASC
-|  row-size=88B cardinality=100
-|
-09:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF000 <- c_customer_sk
-|  row-size=106B cardinality=46.86K
-|
-|--17:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  08:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     row-size=40B cardinality=100.00K
-|
-16:EXCHANGE [HASH(ss_customer_sk)]
-|
-15:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_coupon_amt), sum:merge(ss_net_profit)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, store.s_city
-|  row-size=67B cardinality=46.86K
-|
-14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,store.s_city)]
-|
-07:AGGREGATE [STREAMING]
-|  output: sum(ss_coupon_amt), sum(ss_net_profit)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, store.s_city
-|  row-size=67B cardinality=46.86K
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  runtime filters: RF002 <- date_dim.d_date_sk
-|  row-size=101B cardinality=46.86K
-|
-|--13:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
-|     row-size=26B cardinality=7.30K
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  runtime filters: RF004 <- store.s_store_sk
-|  row-size=75B cardinality=46.86K
-|
-|--12:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_number_employees <= 295, store.s_number_employees >= 200
-|     row-size=27B cardinality=1
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  runtime filters: RF006 <- household_demographics.hd_demo_sk
-|  row-size=48B cardinality=281.17K
-|
-|--11:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: (household_demographics.hd_dep_count = 8 OR household_demographics.hd_vehicle_count > 0)
-|     row-size=12B cardinality=720
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_customer_sk, RF002 -> store_sales.ss_sold_date_sk, RF004 -> store_sales.ss_store_sk, RF006 -> store_sales.ss_hdemo_sk
-   row-size=36B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=64.51MB Threads=14
-Per-Host Resource Estimates: Memory=185MB
-PLAN-ROOT SINK
-|
-18:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: c_last_name ASC, c_first_name ASC, substr(s_city, 1, 30) ASC, profit ASC
-|  limit: 100
-|
-10:TOP-N [LIMIT=100]
-|  order by: c_last_name ASC, c_first_name ASC, substr(s_city, 1, 30) ASC, profit ASC
-|  row-size=88B cardinality=100
-|
-09:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  row-size=106B cardinality=46.86K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: c_customer_sk
-|  |  runtime filters: RF000 <- c_customer_sk
-|  |
-|  17:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  08:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     row-size=40B cardinality=100.00K
-|
-16:EXCHANGE [HASH(ss_customer_sk)]
-|
-15:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_coupon_amt), sum:merge(ss_net_profit)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, store.s_city
-|  row-size=67B cardinality=46.86K
-|
-14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,store.s_city)]
-|
-07:AGGREGATE [STREAMING]
-|  output: sum(ss_coupon_amt), sum(ss_net_profit)
-|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, store.s_city
-|  row-size=67B cardinality=46.86K
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  row-size=101B cardinality=46.86K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: date_dim.d_date_sk
-|  |  runtime filters: RF002 <- date_dim.d_date_sk
-|  |
-|  13:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
-|     row-size=26B cardinality=7.30K
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
-|  row-size=75B cardinality=46.86K
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: store.s_store_sk
-|  |  runtime filters: RF004 <- store.s_store_sk
-|  |
-|  12:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_number_employees <= 295, store.s_number_employees >= 200
-|     row-size=27B cardinality=1
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
-|  row-size=48B cardinality=281.17K
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |  build expressions: household_demographics.hd_demo_sk
-|  |  runtime filters: RF006 <- household_demographics.hd_demo_sk
-|  |
-|  11:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: (household_demographics.hd_dep_count = 8 OR household_demographics.hd_vehicle_count > 0)
-|     row-size=12B cardinality=720
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_customer_sk, RF002 -> store_sales.ss_sold_date_sk, RF004 -> store_sales.ss_store_sk, RF006 -> store_sales.ss_hdemo_sk
-   row-size=36B cardinality=2.88M
-====
-# TPCDS-Q89
-select * from (select  *
-from (
-select i_category, i_class, i_brand,
-       s_store_name, s_company_name,
-       d_moy,
-       sum(ss_sales_price) sum_sales,
-       avg(sum(ss_sales_price)) over
-         (partition by i_category, i_brand, s_store_name, s_company_name)
-         avg_monthly_sales
-from item, store_sales, date_dim, store
-where ss_item_sk = i_item_sk and
-      ss_sold_date_sk = d_date_sk and
-      ss_store_sk = s_store_sk and
-      d_year in (2000) and
-        ((i_category in ('Children','Music','Home') and
-          i_class in ('toddlers','pop','lighting')
-         )
-      or (i_category in ('Jewelry','Books','Sports') and
-          i_class in ('costume','travel','football')
-        ))
-group by i_category, i_class, i_brand,
-         s_store_name, s_company_name, d_moy) tmp1
-where case when (avg_monthly_sales <> 0) then (abs(sum_sales - avg_monthly_sales) / avg_monthly_sales) else null end > 0.1
-order by sum_sales - avg_monthly_sales, s_store_name
-limit 100) tmp2
----- PLAN
-Max Per-Host Resource Reservation: Memory=36.82MB Threads=5
-Per-Host Resource Estimates: Memory=253MB
-PLAN-ROOT SINK
-|
-11:TOP-N [LIMIT=100]
-|  order by: sum_sales - avg_monthly_sales ASC, s_store_name ASC
-|  row-size=137B cardinality=100
-|
-10:SELECT
-|  predicates: CASE WHEN (avg(sum(ss_sales_price)) != 0) THEN (abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price))) ELSE NULL END > 0.1
-|  row-size=137B cardinality=1.07K
-|
-09:ANALYTIC
-|  functions: avg(sum(ss_sales_price))
-|  partition by: i_category, i_brand, s_store_name, s_company_name
-|  row-size=137B cardinality=10.67K
-|
-08:SORT
-|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST
-|  row-size=121B cardinality=10.67K
-|
-07:AGGREGATE [FINALIZE]
-|  output: sum(ss_sales_price)
-|  group by: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy
-|  row-size=121B cardinality=10.67K
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=145B cardinality=10.67K
-|
-|--03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=39B cardinality=12
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=106B cardinality=10.67K
-|
-|--02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year IN (2000)
-|     row-size=12B cardinality=373
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF004 <- i_item_sk
-|  row-size=94B cardinality=52.17K
-|
-|--00:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: ((i_category IN ('Children', 'Music', 'Home') AND i_class IN ('toddlers', 'pop', 'lighting')) OR (i_category IN ('Jewelry', 'Books', 'Sports') AND i_class IN ('costume', 'travel', 'football')))
-|     row-size=74B cardinality=326
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk, RF004 -> ss_item_sk
-   row-size=20B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=52.76MB Threads=10
-Per-Host Resource Estimates: Memory=285MB
-PLAN-ROOT SINK
-|
-17:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum_sales - avg_monthly_sales ASC, s_store_name ASC
-|  limit: 100
-|
-11:TOP-N [LIMIT=100]
-|  order by: sum_sales - avg_monthly_sales ASC, s_store_name ASC
-|  row-size=137B cardinality=100
-|
-10:SELECT
-|  predicates: CASE WHEN (avg(sum(ss_sales_price)) != 0) THEN (abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price))) ELSE NULL END > 0.1
-|  row-size=137B cardinality=1.07K
-|
-09:ANALYTIC
-|  functions: avg(sum(ss_sales_price))
-|  partition by: i_category, i_brand, s_store_name, s_company_name
-|  row-size=137B cardinality=10.67K
-|
-08:SORT
-|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST
-|  row-size=121B cardinality=10.67K
-|
-16:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_sales_price)
-|  group by: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy
-|  row-size=121B cardinality=10.67K
-|
-15:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
-|
-07:AGGREGATE [STREAMING]
-|  output: sum(ss_sales_price)
-|  group by: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy
-|  row-size=121B cardinality=10.67K
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=145B cardinality=10.67K
-|
-|--14:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=39B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=106B cardinality=10.67K
-|
-|--13:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year IN (2000)
-|     row-size=12B cardinality=373
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF004 <- i_item_sk
-|  row-size=94B cardinality=52.17K
-|
-|--12:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: ((i_category IN ('Children', 'Music', 'Home') AND i_class IN ('toddlers', 'pop', 'lighting')) OR (i_category IN ('Jewelry', 'Books', 'Sports') AND i_class IN ('costume', 'travel', 'football')))
-|     row-size=74B cardinality=326
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk, RF004 -> ss_item_sk
-   row-size=20B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=89.51MB Threads=11
-Per-Host Resource Estimates: Memory=178MB
-PLAN-ROOT SINK
-|
-17:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum_sales - avg_monthly_sales ASC, s_store_name ASC
-|  limit: 100
-|
-11:TOP-N [LIMIT=100]
-|  order by: sum_sales - avg_monthly_sales ASC, s_store_name ASC
-|  row-size=137B cardinality=100
-|
-10:SELECT
-|  predicates: CASE WHEN (avg(sum(ss_sales_price)) != 0) THEN (abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price))) ELSE NULL END > 0.1
-|  row-size=137B cardinality=1.07K
-|
-09:ANALYTIC
-|  functions: avg(sum(ss_sales_price))
-|  partition by: i_category, i_brand, s_store_name, s_company_name
-|  row-size=137B cardinality=10.67K
-|
-08:SORT
-|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST
-|  row-size=121B cardinality=10.67K
-|
-16:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_sales_price)
-|  group by: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy
-|  row-size=121B cardinality=10.67K
-|
-15:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
-|
-07:AGGREGATE [STREAMING]
-|  output: sum(ss_sales_price)
-|  group by: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy
-|  row-size=121B cardinality=10.67K
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=145B cardinality=10.67K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: s_store_sk
-|  |  runtime filters: RF000 <- s_store_sk
-|  |
-|  14:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=39B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=106B cardinality=10.67K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF002 <- d_date_sk
-|  |
-|  13:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year IN (2000)
-|     row-size=12B cardinality=373
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=94B cardinality=52.17K
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: i_item_sk
-|  |  runtime filters: RF004 <- i_item_sk
-|  |
-|  12:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: ((i_category IN ('Children', 'Music', 'Home') AND i_class IN ('toddlers', 'pop', 'lighting')) OR (i_category IN ('Jewelry', 'Books', 'Sports') AND i_class IN ('costume', 'travel', 'football')))
-|     row-size=74B cardinality=326
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk, RF004 -> ss_item_sk
-   row-size=20B cardinality=2.88M
-====
-# TPCDS-Q96
-SELECT
-  COUNT(*) AS total
-FROM store_sales ss
-JOIN time_dim td
-  ON (ss.ss_sold_time_sk = td.t_time_sk)
-JOIN household_demographics hd
-  ON (ss.ss_hdemo_sk = hd.hd_demo_sk)
-JOIN store s
-  ON (ss.ss_store_sk = s.s_store_sk)
-WHERE
-  td.t_hour = 8
-  AND td.t_minute >= 30
-  AND hd.hd_dep_count = 5
-  AND s.s_store_name = 'ese'
----- PLAN
-Max Per-Host Resource Reservation: Memory=25.07MB Threads=5
-Per-Host Resource Estimates: Memory=233MB
-PLAN-ROOT SINK
-|
-07:AGGREGATE [FINALIZE]
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss.ss_store_sk = s.s_store_sk
-|  runtime filters: RF000 <- s.s_store_sk
-|  row-size=52B cardinality=2.27K
-|
-|--03:SCAN HDFS [tpcds.store s]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s.s_store_name = 'ese'
-|     row-size=20B cardinality=2
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: ss.ss_hdemo_sk = hd.hd_demo_sk
-|  runtime filters: RF002 <- hd.hd_demo_sk
-|  row-size=32B cardinality=6.82K
-|
-|--02:SCAN HDFS [tpcds.household_demographics hd]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: hd.hd_dep_count = 5
-|     row-size=8B cardinality=720
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ss.ss_sold_time_sk = td.t_time_sk
-|  runtime filters: RF004 <- td.t_time_sk
-|  row-size=24B cardinality=69.82K
-|
-|--01:SCAN HDFS [tpcds.time_dim td]
-|     HDFS partitions=1/1 files=1 size=4.87MB
-|     predicates: td.t_hour = 8, td.t_minute >= 30
-|     row-size=12B cardinality=1.14K
-|
-00:SCAN HDFS [tpcds.store_sales ss]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss.ss_store_sk, RF002 -> ss.ss_hdemo_sk, RF004 -> ss.ss_sold_time_sk
-   row-size=12B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=25.07MB Threads=9
-Per-Host Resource Estimates: Memory=253MB
-PLAN-ROOT SINK
-|
-12:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  row-size=8B cardinality=1
-|
-11:EXCHANGE [UNPARTITIONED]
-|
-07:AGGREGATE
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss.ss_store_sk = s.s_store_sk
-|  runtime filters: RF000 <- s.s_store_sk
-|  row-size=52B cardinality=2.27K
-|
-|--10:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store s]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s.s_store_name = 'ese'
-|     row-size=20B cardinality=2
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss.ss_hdemo_sk = hd.hd_demo_sk
-|  runtime filters: RF002 <- hd.hd_demo_sk
-|  row-size=32B cardinality=6.82K
-|
-|--09:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.household_demographics hd]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: hd.hd_dep_count = 5
-|     row-size=8B cardinality=720
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss.ss_sold_time_sk = td.t_time_sk
-|  runtime filters: RF004 <- td.t_time_sk
-|  row-size=24B cardinality=69.82K
-|
-|--08:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.time_dim td]
-|     HDFS partitions=1/1 files=1 size=4.87MB
-|     predicates: td.t_hour = 8, td.t_minute >= 30
-|     row-size=12B cardinality=1.14K
-|
-00:SCAN HDFS [tpcds.store_sales ss]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss.ss_store_sk, RF002 -> ss.ss_hdemo_sk, RF004 -> ss.ss_sold_time_sk
-   row-size=12B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=41.88MB Threads=9
-Per-Host Resource Estimates: Memory=128MB
-PLAN-ROOT SINK
-|
-12:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  row-size=8B cardinality=1
-|
-11:EXCHANGE [UNPARTITIONED]
-|
-07:AGGREGATE
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss.ss_store_sk = s.s_store_sk
-|  row-size=52B cardinality=2.27K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: s.s_store_sk
-|  |  runtime filters: RF000 <- s.s_store_sk
-|  |
-|  10:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store s]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s.s_store_name = 'ese'
-|     row-size=20B cardinality=2
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss.ss_hdemo_sk = hd.hd_demo_sk
-|  row-size=32B cardinality=6.82K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: hd.hd_demo_sk
-|  |  runtime filters: RF002 <- hd.hd_demo_sk
-|  |
-|  09:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.household_demographics hd]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: hd.hd_dep_count = 5
-|     row-size=8B cardinality=720
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss.ss_sold_time_sk = td.t_time_sk
-|  row-size=24B cardinality=69.82K
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: td.t_time_sk
-|  |  runtime filters: RF004 <- td.t_time_sk
-|  |
-|  08:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.time_dim td]
-|     HDFS partitions=1/1 files=1 size=4.87MB
-|     predicates: td.t_hour = 8, td.t_minute >= 30
-|     row-size=12B cardinality=1.14K
-|
-00:SCAN HDFS [tpcds.store_sales ss]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss.ss_store_sk, RF002 -> ss.ss_hdemo_sk, RF004 -> ss.ss_sold_time_sk
-   row-size=12B cardinality=2.88M
-====
-# TPCDS-Q98
-select
-  i_item_desc,
-  i_category,
-  i_class,
-  i_current_price,
-  sum(ss_ext_sales_price) as itemrevenue,
-  sum(ss_ext_sales_price)*100/sum(sum(ss_ext_sales_price)) over (partition by i_class) as revenueratio
-from
-  store_sales,
-  item,
-  date_dim
-where
-  ss_item_sk = i_item_sk
-  and i_category in ('Jewelry', 'Sports', 'Books')
-  and ss_sold_date_sk = d_date_sk
-  and ss_sold_date_sk between 2451911 and 2451941
-  and d_date between '2001-01-01' and '2001-01-31' -- original uses interval and the
-group by
-  i_item_id,
-  i_item_desc,
-  i_category,
-  i_class,
-  i_current_price
-order by
-  i_category,
-  i_class,
-  i_item_id,
-  i_item_desc,
-  revenueratio
-limit 1000
----- PLAN
-Max Per-Host Resource Reservation: Memory=26.50MB Threads=4
-Per-Host Resource Estimates: Memory=218MB
-PLAN-ROOT SINK
-|
-08:TOP-N [LIMIT=1000]
-|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ss_ext_sales_price) * 100 / sum(sum(ss_ext_sales_price)) ASC
-|  row-size=214B cardinality=1.00K
-|
-07:ANALYTIC
-|  functions: sum(sum(ss_ext_sales_price))
-|  partition by: i_class
-|  row-size=214B cardinality=29.80K
-|
-06:SORT
-|  order by: i_class ASC NULLS LAST
-|  row-size=198B cardinality=29.80K
-|
-05:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
-|  row-size=198B cardinality=29.80K
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF000 <- d_date_sk
-|  row-size=232B cardinality=29.80K
-|
-|--02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: tpcds.date_dim.d_date_sk <= 2451941, tpcds.date_dim.d_date_sk >= 2451911, d_date <= '2001-01-31', d_date >= '2001-01-01'
-|     row-size=26B cardinality=7.30K
-|
-03:HASH JOIN [INNER JOIN]
-|  hash predicates: i_item_sk = ss_item_sk
-|  runtime filters: RF002 <- ss_item_sk
-|  row-size=206B cardinality=29.80K
-|
-|--00:SCAN HDFS [tpcds.store_sales]
-|     partition predicates: ss_sold_date_sk >= 2451911, ss_sold_date_sk <= 2451941
-|     HDFS partitions=31/1824 files=31 size=3.64MB
-|     runtime filters: RF000 -> ss_sold_date_sk
-|     row-size=16B cardinality=29.76K
-|
-01:SCAN HDFS [tpcds.item]
-   HDFS partitions=1/1 files=1 size=4.82MB
-   predicates: i_category IN ('Jewelry', 'Sports', 'Books')
-   runtime filters: RF002 -> i_item_sk
-   row-size=190B cardinality=5.40K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=57.88MB Threads=9
-Per-Host Resource Estimates: Memory=254MB
-PLAN-ROOT SINK
-|
-14:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ss_ext_sales_price) * 100 / sum(sum(ss_ext_sales_price)) ASC
-|  limit: 1000
-|
-08:TOP-N [LIMIT=1000]
-|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ss_ext_sales_price) * 100 / sum(sum(ss_ext_sales_price)) ASC
-|  row-size=214B cardinality=1.00K
-|
-07:ANALYTIC
-|  functions: sum(sum(ss_ext_sales_price))
-|  partition by: i_class
-|  row-size=214B cardinality=29.80K
-|
-06:SORT
-|  order by: i_class ASC NULLS LAST
-|  row-size=198B cardinality=29.80K
-|
-13:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
-|  row-size=198B cardinality=29.80K
-|
-12:EXCHANGE [HASH(i_class)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
-|  row-size=198B cardinality=29.80K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF000 <- d_date_sk
-|  row-size=232B cardinality=29.80K
-|
-|--11:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: tpcds.date_dim.d_date_sk <= 2451941, tpcds.date_dim.d_date_sk >= 2451911, d_date <= '2001-01-31', d_date >= '2001-01-01'
-|     row-size=26B cardinality=7.30K
-|
-03:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=206B cardinality=29.80K
-|
-|--10:EXCHANGE [HASH(i_item_sk)]
-|  |
-|  01:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_category IN ('Jewelry', 'Sports', 'Books')
-|     row-size=190B cardinality=5.40K
-|
-09:EXCHANGE [HASH(ss_item_sk)]
-|
-00:SCAN HDFS [tpcds.store_sales]
-   partition predicates: ss_sold_date_sk >= 2451911, ss_sold_date_sk <= 2451941
-   HDFS partitions=31/1824 files=31 size=3.64MB
-   runtime filters: RF000 -> ss_sold_date_sk, RF002 -> ss_item_sk
-   row-size=16B cardinality=29.76K
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=60.31MB Threads=9
-Per-Host Resource Estimates: Memory=120MB
-PLAN-ROOT SINK
-|
-14:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ss_ext_sales_price) * 100 / sum(sum(ss_ext_sales_price)) ASC
-|  limit: 1000
-|
-08:TOP-N [LIMIT=1000]
-|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ss_ext_sales_price) * 100 / sum(sum(ss_ext_sales_price)) ASC
-|  row-size=214B cardinality=1.00K
-|
-07:ANALYTIC
-|  functions: sum(sum(ss_ext_sales_price))
-|  partition by: i_class
-|  row-size=214B cardinality=29.80K
-|
-06:SORT
-|  order by: i_class ASC NULLS LAST
-|  row-size=198B cardinality=29.80K
-|
-13:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
-|  row-size=198B cardinality=29.80K
-|
-12:EXCHANGE [HASH(i_class)]
-|
-05:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
-|  row-size=198B cardinality=29.80K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=232B cardinality=29.80K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF000 <- d_date_sk
-|  |
-|  11:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: tpcds.date_dim.d_date_sk <= 2451941, tpcds.date_dim.d_date_sk >= 2451911, d_date <= '2001-01-31', d_date >= '2001-01-01'
-|     row-size=26B cardinality=7.30K
-|
-03:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=206B cardinality=29.80K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: i_item_sk
-|  |  runtime filters: RF002 <- i_item_sk
-|  |
-|  10:EXCHANGE [HASH(i_item_sk)]
-|  |
-|  01:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_category IN ('Jewelry', 'Sports', 'Books')
-|     row-size=190B cardinality=5.40K
-|
-09:EXCHANGE [HASH(ss_item_sk)]
-|
-00:SCAN HDFS [tpcds.store_sales]
-   partition predicates: ss_sold_date_sk >= 2451911, ss_sold_date_sk <= 2451941
-   HDFS partitions=31/1824 files=31 size=3.64MB
-   runtime filters: RF000 -> ss_sold_date_sk, RF002 -> ss_item_sk
-   row-size=16B cardinality=29.76K
-====
-# TPCD-Q6
-select * from (
- select  a.ca_state state, count(*) cnt
- from customer_address a
-     ,customer c
-     ,store_sales s
-     ,date_dim d
-     ,item i
- where
-        a.ca_address_sk = c.c_current_addr_sk
-        and c.c_customer_sk = s.ss_customer_sk
-        and s.ss_sold_date_sk = d.d_date_sk
-        and s.ss_item_sk = i.i_item_sk
-        and d.d_month_seq =
-             (select distinct (d_month_seq)
-              from date_dim
-               where d_year = 1999
-                and d_moy = 1
-               limit 1)
-        and i.i_current_price > 1.2 *
-             (select avg(j.i_current_price)
-             from item j
-             where j.i_category = i.i_category)
- group by a.ca_state
- having count(*) >= 10
- order by cnt limit 100) as t
----- PLAN
-Max Per-Host Resource Reservation: Memory=73.62MB Threads=8
-Per-Host Resource Estimates: Memory=402MB
-PLAN-ROOT SINK
-|
-16:TOP-N [LIMIT=100]
-|  order by: count(*) ASC
-|  row-size=22B cardinality=5
-|
-15:AGGREGATE [FINALIZE]
-|  output: count(*)
-|  group by: a.ca_state
-|  having: count(*) >= 10
-|  row-size=22B cardinality=5
-|
-14:HASH JOIN [LEFT SEMI JOIN]
-|  hash predicates: i.i_category = j.i_category
-|  other join predicates: i.i_current_price > 1.2 * avg(j.i_current_price)
-|  runtime filters: RF000 <- j.i_category
-|  row-size=80B cardinality=1.19K
-|
-|--08:AGGREGATE [FINALIZE]
-|  |  output: avg(j.i_current_price)
-|  |  group by: j.i_category
-|  |  row-size=26B cardinality=10
-|  |
-|  07:SCAN HDFS [tpcds.item j]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=22B cardinality=18.00K
-|
-13:HASH JOIN [LEFT SEMI JOIN]
-|  hash predicates: d.d_month_seq = (d_month_seq)
-|  runtime filters: RF002 <- (d_month_seq)
-|  row-size=80B cardinality=1.19K
-|
-|--06:AGGREGATE [FINALIZE]
-|  |  group by: (d_month_seq)
-|  |  limit: 1
-|  |  row-size=4B cardinality=1
-|  |
-|  05:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1999, d_moy = 1
-|     row-size=12B cardinality=108
-|
-12:HASH JOIN [INNER JOIN]
-|  hash predicates: s.ss_item_sk = i.i_item_sk
-|  runtime filters: RF004 <- i.i_item_sk
-|  row-size=80B cardinality=2.88M
-|
-|--04:SCAN HDFS [tpcds.item i]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     runtime filters: RF000 -> i.i_category
-|     row-size=30B cardinality=18.00K
-|
-11:HASH JOIN [INNER JOIN]
-|  hash predicates: s.ss_sold_date_sk = d.d_date_sk
-|  runtime filters: RF006 <- d.d_date_sk
-|  row-size=50B cardinality=2.88M
-|
-|--03:SCAN HDFS [tpcds.date_dim d]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     runtime filters: RF002 -> d.d_month_seq
-|     row-size=8B cardinality=73.05K
-|
-10:HASH JOIN [INNER JOIN]
-|  hash predicates: c.c_current_addr_sk = a.ca_address_sk
-|  runtime filters: RF008 <- a.ca_address_sk
-|  row-size=42B cardinality=2.88M
-|
-|--00:SCAN HDFS [tpcds.customer_address a]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=18B cardinality=50.00K
-|
-09:HASH JOIN [INNER JOIN]
-|  hash predicates: s.ss_customer_sk = c.c_customer_sk
-|  runtime filters: RF010 <- c.c_customer_sk
-|  row-size=24B cardinality=2.88M
-|
-|--01:SCAN HDFS [tpcds.customer c]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF008 -> c.c_current_addr_sk
-|     row-size=8B cardinality=100.00K
-|
-02:SCAN HDFS [tpcds.store_sales s]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF004 -> s.ss_item_sk, RF006 -> s.ss_sold_date_sk, RF010 -> s.ss_customer_sk
-   row-size=16B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=88.44MB Threads=19
-Per-Host Resource Estimates: Memory=452MB
-PLAN-ROOT SINK
-|
-30:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: count(*) ASC
-|  limit: 100
-|
-16:TOP-N [LIMIT=100]
-|  order by: count(*) ASC
-|  row-size=22B cardinality=5
-|
-29:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  group by: a.ca_state
-|  having: count(*) >= 10
-|  row-size=22B cardinality=5
-|
-28:EXCHANGE [HASH(a.ca_state)]
-|
-15:AGGREGATE [STREAMING]
-|  output: count(*)
-|  group by: a.ca_state
-|  row-size=22B cardinality=51
-|
-14:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  hash predicates: i.i_category = j.i_category
-|  other join predicates: i.i_current_price > 1.2 * avg(j.i_current_price)
-|  runtime filters: RF000 <- j.i_category
-|  row-size=80B cardinality=1.19K
-|
-|--27:EXCHANGE [BROADCAST]
-|  |
-|  26:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(j.i_current_price)
-|  |  group by: j.i_category
-|  |  row-size=26B cardinality=10
-|  |
-|  25:EXCHANGE [HASH(j.i_category)]
-|  |
-|  08:AGGREGATE [STREAMING]
-|  |  output: avg(j.i_current_price)
-|  |  group by: j.i_category
-|  |  row-size=26B cardinality=10
-|  |
-|  07:SCAN HDFS [tpcds.item j]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=22B cardinality=18.00K
-|
-13:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  hash predicates: d.d_month_seq = (d_month_seq)
-|  runtime filters: RF002 <- (d_month_seq)
-|  row-size=80B cardinality=1.19K
-|
-|--24:EXCHANGE [BROADCAST]
-|  |
-|  23:EXCHANGE [UNPARTITIONED]
-|  |  limit: 1
-|  |
-|  22:AGGREGATE [FINALIZE]
-|  |  group by: (d_month_seq)
-|  |  limit: 1
-|  |  row-size=4B cardinality=1
-|  |
-|  21:EXCHANGE [HASH((d_month_seq))]
-|  |
-|  06:AGGREGATE [STREAMING]
-|  |  group by: (d_month_seq)
-|  |  row-size=4B cardinality=108
-|  |
-|  05:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1999, d_moy = 1
-|     row-size=12B cardinality=108
-|
-12:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: s.ss_item_sk = i.i_item_sk
-|  runtime filters: RF004 <- i.i_item_sk
-|  row-size=80B cardinality=2.88M
-|
-|--20:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.item i]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     runtime filters: RF000 -> i.i_category
-|     row-size=30B cardinality=18.00K
-|
-11:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: s.ss_sold_date_sk = d.d_date_sk
-|  runtime filters: RF006 <- d.d_date_sk
-|  row-size=50B cardinality=2.88M
-|
-|--19:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.date_dim d]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     runtime filters: RF002 -> d.d_month_seq
-|     row-size=8B cardinality=73.05K
-|
-10:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: c.c_current_addr_sk = a.ca_address_sk
-|  runtime filters: RF008 <- a.ca_address_sk
-|  row-size=42B cardinality=2.88M
-|
-|--18:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.customer_address a]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=18B cardinality=50.00K
-|
-09:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: s.ss_customer_sk = c.c_customer_sk
-|  runtime filters: RF010 <- c.c_customer_sk
-|  row-size=24B cardinality=2.88M
-|
-|--17:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.customer c]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF008 -> c.c_current_addr_sk
-|     row-size=8B cardinality=100.00K
-|
-02:SCAN HDFS [tpcds.store_sales s]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF004 -> s.ss_item_sk, RF006 -> s.ss_sold_date_sk, RF010 -> s.ss_customer_sk
-   row-size=16B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=115.00MB Threads=20
-Per-Host Resource Estimates: Memory=270MB
-PLAN-ROOT SINK
-|
-30:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: count(*) ASC
-|  limit: 100
-|
-16:TOP-N [LIMIT=100]
-|  order by: count(*) ASC
-|  row-size=22B cardinality=5
-|
-29:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  group by: a.ca_state
-|  having: count(*) >= 10
-|  row-size=22B cardinality=5
-|
-28:EXCHANGE [HASH(a.ca_state)]
-|
-15:AGGREGATE [STREAMING]
-|  output: count(*)
-|  group by: a.ca_state
-|  row-size=22B cardinality=51
-|
-14:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  hash predicates: i.i_category = j.i_category
-|  other join predicates: i.i_current_price > 1.2 * avg(j.i_current_price)
-|  row-size=80B cardinality=1.19K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: j.i_category
-|  |  runtime filters: RF000 <- j.i_category
-|  |
-|  27:EXCHANGE [BROADCAST]
-|  |
-|  26:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(j.i_current_price)
-|  |  group by: j.i_category
-|  |  row-size=26B cardinality=10
-|  |
-|  25:EXCHANGE [HASH(j.i_category)]
-|  |
-|  08:AGGREGATE [STREAMING]
-|  |  output: avg(j.i_current_price)
-|  |  group by: j.i_category
-|  |  row-size=26B cardinality=10
-|  |
-|  07:SCAN HDFS [tpcds.item j]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=22B cardinality=18.00K
-|
-13:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  hash predicates: d.d_month_seq = (d_month_seq)
-|  row-size=80B cardinality=1.19K
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |  build expressions: (d_month_seq)
-|  |  runtime filters: RF002 <- (d_month_seq)
-|  |
-|  24:EXCHANGE [BROADCAST]
-|  |
-|  23:EXCHANGE [UNPARTITIONED]
-|  |  limit: 1
-|  |
-|  22:AGGREGATE [FINALIZE]
-|  |  group by: (d_month_seq)
-|  |  limit: 1
-|  |  row-size=4B cardinality=1
-|  |
-|  21:EXCHANGE [HASH((d_month_seq))]
-|  |
-|  06:AGGREGATE [STREAMING]
-|  |  group by: (d_month_seq)
-|  |  row-size=4B cardinality=108
-|  |
-|  05:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1999, d_moy = 1
-|     row-size=12B cardinality=108
-|
-12:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: s.ss_item_sk = i.i_item_sk
-|  row-size=80B cardinality=2.88M
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |  build expressions: i.i_item_sk
-|  |  runtime filters: RF004 <- i.i_item_sk
-|  |
-|  20:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.item i]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     runtime filters: RF000 -> i.i_category
-|     row-size=30B cardinality=18.00K
-|
-11:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: s.ss_sold_date_sk = d.d_date_sk
-|  row-size=50B cardinality=2.88M
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |  build expressions: d.d_date_sk
-|  |  runtime filters: RF006 <- d.d_date_sk
-|  |
-|  19:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.date_dim d]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     runtime filters: RF002 -> d.d_month_seq
-|     row-size=8B cardinality=73.05K
-|
-10:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: c.c_current_addr_sk = a.ca_address_sk
-|  row-size=42B cardinality=2.88M
-|
-|--JOIN BUILD
-|  |  join-table-id=04 plan-id=05 cohort-id=01
-|  |  build expressions: a.ca_address_sk
-|  |  runtime filters: RF008 <- a.ca_address_sk
-|  |
-|  18:EXCHANGE [BROADCAST]
-|  |
-|  00:SCAN HDFS [tpcds.customer_address a]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=18B cardinality=50.00K
-|
-09:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: s.ss_customer_sk = c.c_customer_sk
-|  row-size=24B cardinality=2.88M
-|
-|--JOIN BUILD
-|  |  join-table-id=05 plan-id=06 cohort-id=01
-|  |  build expressions: c.c_customer_sk
-|  |  runtime filters: RF010 <- c.c_customer_sk
-|  |
-|  17:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.customer c]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF008 -> c.c_current_addr_sk
-|     row-size=8B cardinality=100.00K
-|
-02:SCAN HDFS [tpcds.store_sales s]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF004 -> s.ss_item_sk, RF006 -> s.ss_sold_date_sk, RF010 -> s.ss_customer_sk
-   row-size=16B cardinality=2.88M
-====
-# TPCDS-Q47
-with v1 as (
- select i_category, i_brand,
-        s_store_name, s_company_name,
-        d_year, d_moy,
-        sum(ss_sales_price) sum_sales,
-        avg(sum(ss_sales_price)) over
-          (partition by i_category, i_brand,
-                     s_store_name, s_company_name, d_year)
-          avg_monthly_sales,
-        rank() over
-          (partition by i_category, i_brand,
-                     s_store_name, s_company_name
-           order by d_year, d_moy) rn
- from item, store_sales, date_dim, store
- where ss_item_sk = i_item_sk and
-       ss_sold_date_sk = d_date_sk and
-       ss_store_sk = s_store_sk and
-       (
-         d_year = 2000 or
-         ( d_year = 2000-1 and d_moy =12) or
-         ( d_year = 2000+1 and d_moy =1)
-       )
- group by i_category, i_brand,
-          s_store_name, s_company_name,
-          d_year, d_moy),
- v2 as(
- select v1.i_category, v1.i_brand
-        ,v1.d_year
-        ,v1.avg_monthly_sales
-        ,v1.sum_sales, v1_lag.sum_sales psum, v1_lead.sum_sales nsum
- from v1, v1 v1_lag, v1 v1_lead
- where v1.i_category = v1_lag.i_category and
-       v1.i_category = v1_lead.i_category and
-       v1.i_brand = v1_lag.i_brand and
-       v1.i_brand = v1_lead.i_brand and
-       v1.s_store_name = v1_lag.s_store_name and
-       v1.s_store_name = v1_lead.s_store_name and
-       v1.s_company_name = v1_lag.s_company_name and
-       v1.s_company_name = v1_lead.s_company_name and
-       v1.rn = v1_lag.rn + 1 and
-       v1.rn = v1_lead.rn - 1)
- select * from ( select  *
- from v2
- where  d_year = 2000 and
-        avg_monthly_sales > 0 and
-        case when avg_monthly_sales > 0 then abs(sum_sales - avg_monthly_sales) / avg_monthly_sales else null end > 0.1
- order by sum_sales - avg_monthly_sales, d_year
- limit 100
- ) as v3
----- PLAN
-Max Per-Host Resource Reservation: Memory=168.44MB Threads=13
-Per-Host Resource Estimates: Memory=762MB
-PLAN-ROOT SINK
-|
-35:TOP-N [LIMIT=100]
-|  order by: sum_sales - avg_monthly_sales ASC, d_year ASC
-|  row-size=114B cardinality=100
-|
-34:HASH JOIN [INNER JOIN]
-|  hash predicates: rank() = rank() - 1, s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
-|  row-size=356B cardinality=1.09G
-|
-|--32:ANALYTIC
-|  |  functions: rank()
-|  |  partition by: i_category, i_brand, s_store_name, s_company_name
-|  |  order by: d_year ASC, d_moy ASC
-|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  row-size=113B cardinality=685.36K
-|  |
-|  31:SORT
-|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  30:AGGREGATE [FINALIZE]
-|  |  output: sum(ss_sales_price)
-|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  29:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  runtime filters: RF012 <- s_store_sk
-|  |  row-size=125B cardinality=685.36K
-|  |
-|  |--26:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=39B cardinality=12
-|  |
-|  28:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_item_sk = i_item_sk
-|  |  runtime filters: RF014 <- i_item_sk
-|  |  row-size=86B cardinality=685.36K
-|  |
-|  |--23:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     row-size=54B cardinality=18.00K
-|  |
-|  27:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF016 <- d_date_sk
-|  |  row-size=32B cardinality=685.36K
-|  |
-|  |--25:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: (d_year = 2000 OR (d_year = 1999 AND d_moy = 12) OR (d_year = 2001 AND d_moy = 1))
-|  |     row-size=12B cardinality=434
-|  |
-|  24:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF012 -> ss_store_sk, RF014 -> ss_item_sk, RF016 -> ss_sold_date_sk
-|     row-size=20B cardinality=2.88M
-|
-33:HASH JOIN [INNER JOIN]
-|  hash predicates: rank() + 1 = rank(), s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
-|  row-size=243B cardinality=1.10M
-|
-|--12:SELECT
-|  |  predicates: d_year = 2000, avg(sum(ss_sales_price)) > 0, CASE WHEN avg(sum(ss_sales_price)) > 0 THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > 0.1
-|  |  row-size=129B cardinality=1.11K
-|  |
-|  11:ANALYTIC
-|  |  functions: avg(sum(ss_sales_price))
-|  |  partition by: i_category, i_brand, s_store_name, s_company_name, d_year
-|  |  row-size=129B cardinality=685.36K
-|  |
-|  10:SORT
-|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC NULLS LAST
-|  |  row-size=113B cardinality=685.36K
-|  |
-|  09:ANALYTIC
-|  |  functions: rank()
-|  |  partition by: i_category, i_brand, s_store_name, s_company_name
-|  |  order by: d_year ASC, d_moy ASC
-|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  row-size=113B cardinality=685.36K
-|  |
-|  08:SORT
-|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  07:AGGREGATE [FINALIZE]
-|  |  output: sum(ss_sales_price)
-|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  06:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  runtime filters: RF006 <- s_store_sk
-|  |  row-size=125B cardinality=685.36K
-|  |
-|  |--03:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=39B cardinality=12
-|  |
-|  05:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_item_sk = i_item_sk
-|  |  runtime filters: RF008 <- i_item_sk
-|  |  row-size=86B cardinality=685.36K
-|  |
-|  |--00:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     row-size=54B cardinality=18.00K
-|  |
-|  04:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF010 <- d_date_sk
-|  |  row-size=32B cardinality=685.36K
-|  |
-|  |--02:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: (d_year = 2000 OR (d_year = 1999 AND d_moy = 12) OR (d_year = 2001 AND d_moy = 1))
-|  |     row-size=12B cardinality=434
-|  |
-|  01:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF006 -> ss_store_sk, RF008 -> ss_item_sk, RF010 -> ss_sold_date_sk
-|     row-size=20B cardinality=2.88M
-|
-22:ANALYTIC
-|  functions: rank()
-|  partition by: i_category, i_brand, s_store_name, s_company_name
-|  order by: d_year ASC, d_moy ASC
-|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  row-size=113B cardinality=685.36K
-|
-21:SORT
-|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
-|  row-size=105B cardinality=685.36K
-|
-20:AGGREGATE [FINALIZE]
-|  output: sum(ss_sales_price)
-|  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  row-size=105B cardinality=685.36K
-|
-19:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=125B cardinality=685.36K
-|
-|--16:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=39B cardinality=12
-|
-18:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=86B cardinality=685.36K
-|
-|--13:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=54B cardinality=18.00K
-|
-17:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF004 <- d_date_sk
-|  row-size=32B cardinality=685.36K
-|
-|--15:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: (d_year = 2000 OR (d_year = 1999 AND d_moy = 12) OR (d_year = 2001 AND d_moy = 1))
-|     row-size=12B cardinality=434
-|
-14:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_item_sk, RF004 -> ss_sold_date_sk
-   row-size=20B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=390.40MB Threads=29
-Per-Host Resource Estimates: Memory=1.06GB
-PLAN-ROOT SINK
-|
-54:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum_sales - avg_monthly_sales ASC, d_year ASC
-|  limit: 100
-|
-35:TOP-N [LIMIT=100]
-|  order by: sum_sales - avg_monthly_sales ASC, d_year ASC
-|  row-size=114B cardinality=100
-|
-34:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: rank() = rank() - 1, s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
-|  row-size=356B cardinality=1.09G
-|
-|--53:EXCHANGE [HASH(rank() - 1,s_store_name,i_category,s_company_name,i_brand)]
-|  |
-|  32:ANALYTIC
-|  |  functions: rank()
-|  |  partition by: i_category, i_brand, s_store_name, s_company_name
-|  |  order by: d_year ASC, d_moy ASC
-|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  row-size=113B cardinality=685.36K
-|  |
-|  31:SORT
-|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  51:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ss_sales_price)
-|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  50:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
-|  |
-|  30:AGGREGATE [STREAMING]
-|  |  output: sum(ss_sales_price)
-|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  29:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  runtime filters: RF012 <- s_store_sk
-|  |  row-size=125B cardinality=685.36K
-|  |
-|  |--49:EXCHANGE [BROADCAST]
-|  |  |
-|  |  26:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=39B cardinality=12
-|  |
-|  28:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_item_sk = i_item_sk
-|  |  runtime filters: RF014 <- i_item_sk
-|  |  row-size=86B cardinality=685.36K
-|  |
-|  |--48:EXCHANGE [BROADCAST]
-|  |  |
-|  |  23:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     row-size=54B cardinality=18.00K
-|  |
-|  27:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF016 <- d_date_sk
-|  |  row-size=32B cardinality=685.36K
-|  |
-|  |--47:EXCHANGE [BROADCAST]
-|  |  |
-|  |  25:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: (d_year = 2000 OR (d_year = 1999 AND d_moy = 12) OR (d_year = 2001 AND d_moy = 1))
-|  |     row-size=12B cardinality=434
-|  |
-|  24:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF012 -> ss_store_sk, RF014 -> ss_item_sk, RF016 -> ss_sold_date_sk
-|     row-size=20B cardinality=2.88M
-|
-52:EXCHANGE [HASH(rank(),s_store_name,i_category,s_company_name,i_brand)]
-|
-33:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: rank() + 1 = rank(), s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
-|  row-size=243B cardinality=1.10M
-|
-|--46:EXCHANGE [BROADCAST]
-|  |
-|  12:SELECT
-|  |  predicates: d_year = 2000, avg(sum(ss_sales_price)) > 0, CASE WHEN avg(sum(ss_sales_price)) > 0 THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > 0.1
-|  |  row-size=129B cardinality=1.11K
-|  |
-|  11:ANALYTIC
-|  |  functions: avg(sum(ss_sales_price))
-|  |  partition by: i_category, i_brand, s_store_name, s_company_name, d_year
-|  |  row-size=129B cardinality=685.36K
-|  |
-|  10:SORT
-|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC NULLS LAST
-|  |  row-size=113B cardinality=685.36K
-|  |
-|  09:ANALYTIC
-|  |  functions: rank()
-|  |  partition by: i_category, i_brand, s_store_name, s_company_name
-|  |  order by: d_year ASC, d_moy ASC
-|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  row-size=113B cardinality=685.36K
-|  |
-|  08:SORT
-|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  45:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ss_sales_price)
-|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  44:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
-|  |
-|  07:AGGREGATE [STREAMING]
-|  |  output: sum(ss_sales_price)
-|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  06:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  runtime filters: RF006 <- s_store_sk
-|  |  row-size=125B cardinality=685.36K
-|  |
-|  |--43:EXCHANGE [BROADCAST]
-|  |  |
-|  |  03:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=39B cardinality=12
-|  |
-|  05:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_item_sk = i_item_sk
-|  |  runtime filters: RF008 <- i_item_sk
-|  |  row-size=86B cardinality=685.36K
-|  |
-|  |--42:EXCHANGE [BROADCAST]
-|  |  |
-|  |  00:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     row-size=54B cardinality=18.00K
-|  |
-|  04:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF010 <- d_date_sk
-|  |  row-size=32B cardinality=685.36K
-|  |
-|  |--41:EXCHANGE [BROADCAST]
-|  |  |
-|  |  02:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: (d_year = 2000 OR (d_year = 1999 AND d_moy = 12) OR (d_year = 2001 AND d_moy = 1))
-|  |     row-size=12B cardinality=434
-|  |
-|  01:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF006 -> ss_store_sk, RF008 -> ss_item_sk, RF010 -> ss_sold_date_sk
-|     row-size=20B cardinality=2.88M
-|
-22:ANALYTIC
-|  functions: rank()
-|  partition by: i_category, i_brand, s_store_name, s_company_name
-|  order by: d_year ASC, d_moy ASC
-|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  row-size=113B cardinality=685.36K
-|
-21:SORT
-|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
-|  row-size=105B cardinality=685.36K
-|
-40:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_sales_price)
-|  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  row-size=105B cardinality=685.36K
-|
-39:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
-|
-20:AGGREGATE [STREAMING]
-|  output: sum(ss_sales_price)
-|  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  row-size=105B cardinality=685.36K
-|
-19:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=125B cardinality=685.36K
-|
-|--38:EXCHANGE [BROADCAST]
-|  |
-|  16:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=39B cardinality=12
-|
-18:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=86B cardinality=685.36K
-|
-|--37:EXCHANGE [BROADCAST]
-|  |
-|  13:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=54B cardinality=18.00K
-|
-17:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF004 <- d_date_sk
-|  row-size=32B cardinality=685.36K
-|
-|--36:EXCHANGE [BROADCAST]
-|  |
-|  15:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: (d_year = 2000 OR (d_year = 1999 AND d_moy = 12) OR (d_year = 2001 AND d_moy = 1))
-|     row-size=12B cardinality=434
-|
-14:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_item_sk, RF004 -> ss_sold_date_sk
-   row-size=20B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=698.77MB Threads=36
-Per-Host Resource Estimates: Memory=915MB
-PLAN-ROOT SINK
-|
-54:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum_sales - avg_monthly_sales ASC, d_year ASC
-|  limit: 100
-|
-35:TOP-N [LIMIT=100]
-|  order by: sum_sales - avg_monthly_sales ASC, d_year ASC
-|  row-size=114B cardinality=100
-|
-34:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: rank() = rank() - 1, s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
-|  row-size=356B cardinality=1.09G
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: rank() - 1, s_store_name, i_category, s_company_name, i_brand
-|  |
-|  53:EXCHANGE [HASH(rank() - 1,s_store_name,i_category,s_company_name,i_brand)]
-|  |
-|  32:ANALYTIC
-|  |  functions: rank()
-|  |  partition by: i_category, i_brand, s_store_name, s_company_name
-|  |  order by: d_year ASC, d_moy ASC
-|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  row-size=113B cardinality=685.36K
-|  |
-|  31:SORT
-|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  51:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ss_sales_price)
-|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  50:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
-|  |
-|  30:AGGREGATE [STREAMING]
-|  |  output: sum(ss_sales_price)
-|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  29:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=125B cardinality=685.36K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=01 plan-id=02 cohort-id=02
-|  |  |  build expressions: s_store_sk
-|  |  |  runtime filters: RF012 <- s_store_sk
-|  |  |
-|  |  49:EXCHANGE [BROADCAST]
-|  |  |
-|  |  26:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=39B cardinality=12
-|  |
-|  28:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_item_sk = i_item_sk
-|  |  row-size=86B cardinality=685.36K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=02 plan-id=03 cohort-id=02
-|  |  |  build expressions: i_item_sk
-|  |  |  runtime filters: RF014 <- i_item_sk
-|  |  |
-|  |  48:EXCHANGE [BROADCAST]
-|  |  |
-|  |  23:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     row-size=54B cardinality=18.00K
-|  |
-|  27:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  row-size=32B cardinality=685.36K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=03 plan-id=04 cohort-id=02
-|  |  |  build expressions: d_date_sk
-|  |  |  runtime filters: RF016 <- d_date_sk
-|  |  |
-|  |  47:EXCHANGE [BROADCAST]
-|  |  |
-|  |  25:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: (d_year = 2000 OR (d_year = 1999 AND d_moy = 12) OR (d_year = 2001 AND d_moy = 1))
-|  |     row-size=12B cardinality=434
-|  |
-|  24:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF012 -> ss_store_sk, RF014 -> ss_item_sk, RF016 -> ss_sold_date_sk
-|     row-size=20B cardinality=2.88M
-|
-52:EXCHANGE [HASH(rank(),s_store_name,i_category,s_company_name,i_brand)]
-|
-33:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: rank() + 1 = rank(), s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
-|  row-size=243B cardinality=1.10M
-|
-|--JOIN BUILD
-|  |  join-table-id=04 plan-id=05 cohort-id=01
-|  |  build expressions: rank(), s_store_name, i_category, s_company_name, i_brand
-|  |
-|  46:EXCHANGE [BROADCAST]
-|  |
-|  12:SELECT
-|  |  predicates: d_year = 2000, avg(sum(ss_sales_price)) > 0, CASE WHEN avg(sum(ss_sales_price)) > 0 THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > 0.1
-|  |  row-size=129B cardinality=1.11K
-|  |
-|  11:ANALYTIC
-|  |  functions: avg(sum(ss_sales_price))
-|  |  partition by: i_category, i_brand, s_store_name, s_company_name, d_year
-|  |  row-size=129B cardinality=685.36K
-|  |
-|  10:SORT
-|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC NULLS LAST
-|  |  row-size=113B cardinality=685.36K
-|  |
-|  09:ANALYTIC
-|  |  functions: rank()
-|  |  partition by: i_category, i_brand, s_store_name, s_company_name
-|  |  order by: d_year ASC, d_moy ASC
-|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  row-size=113B cardinality=685.36K
-|  |
-|  08:SORT
-|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  45:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ss_sales_price)
-|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  44:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
-|  |
-|  07:AGGREGATE [STREAMING]
-|  |  output: sum(ss_sales_price)
-|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  |  row-size=105B cardinality=685.36K
-|  |
-|  06:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=125B cardinality=685.36K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=05 plan-id=06 cohort-id=03
-|  |  |  build expressions: s_store_sk
-|  |  |  runtime filters: RF006 <- s_store_sk
-|  |  |
-|  |  43:EXCHANGE [BROADCAST]
-|  |  |
-|  |  03:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=39B cardinality=12
-|  |
-|  05:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_item_sk = i_item_sk
-|  |  row-size=86B cardinality=685.36K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=06 plan-id=07 cohort-id=03
-|  |  |  build expressions: i_item_sk
-|  |  |  runtime filters: RF008 <- i_item_sk
-|  |  |
-|  |  42:EXCHANGE [BROADCAST]
-|  |  |
-|  |  00:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     row-size=54B cardinality=18.00K
-|  |
-|  04:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  row-size=32B cardinality=685.36K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=07 plan-id=08 cohort-id=03
-|  |  |  build expressions: d_date_sk
-|  |  |  runtime filters: RF010 <- d_date_sk
-|  |  |
-|  |  41:EXCHANGE [BROADCAST]
-|  |  |
-|  |  02:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: (d_year = 2000 OR (d_year = 1999 AND d_moy = 12) OR (d_year = 2001 AND d_moy = 1))
-|  |     row-size=12B cardinality=434
-|  |
-|  01:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF006 -> ss_store_sk, RF008 -> ss_item_sk, RF010 -> ss_sold_date_sk
-|     row-size=20B cardinality=2.88M
-|
-22:ANALYTIC
-|  functions: rank()
-|  partition by: i_category, i_brand, s_store_name, s_company_name
-|  order by: d_year ASC, d_moy ASC
-|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  row-size=113B cardinality=685.36K
-|
-21:SORT
-|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
-|  row-size=105B cardinality=685.36K
-|
-40:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_sales_price)
-|  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  row-size=105B cardinality=685.36K
-|
-39:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
-|
-20:AGGREGATE [STREAMING]
-|  output: sum(ss_sales_price)
-|  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
-|  row-size=105B cardinality=685.36K
-|
-19:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=125B cardinality=685.36K
-|
-|--JOIN BUILD
-|  |  join-table-id=08 plan-id=09 cohort-id=01
-|  |  build expressions: s_store_sk
-|  |  runtime filters: RF000 <- s_store_sk
-|  |
-|  38:EXCHANGE [BROADCAST]
-|  |
-|  16:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=39B cardinality=12
-|
-18:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=86B cardinality=685.36K
-|
-|--JOIN BUILD
-|  |  join-table-id=09 plan-id=10 cohort-id=01
-|  |  build expressions: i_item_sk
-|  |  runtime filters: RF002 <- i_item_sk
-|  |
-|  37:EXCHANGE [BROADCAST]
-|  |
-|  13:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=54B cardinality=18.00K
-|
-17:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=32B cardinality=685.36K
-|
-|--JOIN BUILD
-|  |  join-table-id=10 plan-id=11 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF004 <- d_date_sk
-|  |
-|  36:EXCHANGE [BROADCAST]
-|  |
-|  15:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: (d_year = 2000 OR (d_year = 1999 AND d_moy = 12) OR (d_year = 2001 AND d_moy = 1))
-|     row-size=12B cardinality=434
-|
-14:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_item_sk, RF004 -> ss_sold_date_sk
-   row-size=20B cardinality=2.88M
-====
-# TPCDS-Q66
-select promotions,total,cast(promotions as decimal(15,4))/cast(total as decimal(15,4))*100
-from
-  (select sum(ss_ext_sales_price) promotions
-   from  store_sales
-        ,store
-        ,promotion
-        ,date_dim
-        ,customer
-        ,customer_address
-        ,item
-   where ss_sold_date_sk = d_date_sk
-   and   ss_store_sk = s_store_sk
-   and   ss_promo_sk = p_promo_sk
-   and   ss_customer_sk= c_customer_sk
-   and   ca_address_sk = c_current_addr_sk
-   and   ss_item_sk = i_item_sk
-   and   ca_gmt_offset = -5
-   and   i_category = 'Books'
-   and   (p_channel_dmail = 'Y' or p_channel_email = 'Y' or p_channel_tv = 'Y')
-   and   s_gmt_offset = -5
-   and   d_year = 2000
-   and   d_moy  = 11) promotional_sales,
-  (select sum(ss_ext_sales_price) total
-   from  store_sales
-        ,store
-        ,date_dim
-        ,customer
-        ,customer_address
-        ,item
-   where ss_sold_date_sk = d_date_sk
-   and   ss_store_sk = s_store_sk
-   and   ss_customer_sk= c_customer_sk
-   and   ca_address_sk = c_current_addr_sk
-   and   ss_item_sk = i_item_sk
-   and   ca_gmt_offset = -5
-   and   i_category = 'Books'
-   and   s_gmt_offset = -5
-   and   d_year = 2000
-   and   d_moy  = 11) all_sales
-order by promotions, total
----- PLAN
-Max Per-Host Resource Reservation: Memory=111.39MB Threads=14
-Per-Host Resource Estimates: Memory=703MB
-PLAN-ROOT SINK
-|
-27:SORT
-|  order by: promotions ASC, total ASC
-|  row-size=32B cardinality=1
-|
-26:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=32B cardinality=1
-|
-|--25:AGGREGATE [FINALIZE]
-|  |  output: sum(ss_ext_sales_price)
-|  |  row-size=16B cardinality=1
-|  |
-|  24:HASH JOIN [INNER JOIN]
-|  |  hash predicates: c_current_addr_sk = ca_address_sk
-|  |  runtime filters: RF012 <- ca_address_sk
-|  |  row-size=86B cardinality=3.30K
-|  |
-|  |--18:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     predicates: ca_gmt_offset = -5
-|  |     row-size=8B cardinality=8.33K
-|  |
-|  23:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_customer_sk = c_customer_sk
-|  |  runtime filters: RF014 <- c_customer_sk
-|  |  row-size=78B cardinality=17.06K
-|  |
-|  |--17:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     runtime filters: RF012 -> c_current_addr_sk
-|  |     row-size=8B cardinality=100.00K
-|  |
-|  22:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=70B cardinality=17.06K
-|  |
-|  |--15:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: s_gmt_offset = -5
-|  |     row-size=8B cardinality=12
-|  |
-|  21:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_item_sk = i_item_sk
-|  |  runtime filters: RF018 <- i_item_sk
-|  |  row-size=62B cardinality=17.06K
-|  |
-|  |--19:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_category = 'Books'
-|  |     row-size=26B cardinality=1.80K
-|  |
-|  20:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF020 <- d_date_sk
-|  |  row-size=36B cardinality=170.55K
-|  |
-|  |--16:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 2000, d_moy = 11
-|  |     row-size=12B cardinality=108
-|  |
-|  14:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF020 -> ss_sold_date_sk, RF018 -> ss_item_sk, RF014 -> ss_customer_sk
-|     row-size=24B cardinality=2.88M
-|
-13:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price)
-|  row-size=16B cardinality=1
-|
-12:HASH JOIN [INNER JOIN]
-|  hash predicates: c_current_addr_sk = ca_address_sk
-|  runtime filters: RF000 <- ca_address_sk
-|  row-size=133B cardinality=3.28K
-|
-|--05:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     predicates: ca_gmt_offset = -5
-|     row-size=8B cardinality=8.33K
-|
-11:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF002 <- c_customer_sk
-|  row-size=125B cardinality=16.94K
-|
-|--04:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> c_current_addr_sk
-|     row-size=8B cardinality=100.00K
-|
-10:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF004 <- s_store_sk
-|  row-size=117B cardinality=16.94K
-|
-|--01:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_gmt_offset = -5
-|     row-size=8B cardinality=12
-|
-09:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_promo_sk = p_promo_sk
-|  runtime filters: RF006 <- p_promo_sk
-|  row-size=109B cardinality=16.94K
-|
-|--02:SCAN HDFS [tpcds.promotion]
-|     HDFS partitions=1/1 files=1 size=36.36KB
-|     predicates: (p_channel_dmail = 'Y' OR p_channel_email = 'Y' OR p_channel_tv = 'Y')
-|     row-size=43B cardinality=300
-|
-08:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF008 <- i_item_sk
-|  row-size=66B cardinality=17.06K
-|
-|--06:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_category = 'Books'
-|     row-size=26B cardinality=1.80K
-|
-07:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF010 <- d_date_sk
-|  row-size=40B cardinality=170.55K
-|
-|--03:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 2000, d_moy = 11
-|     row-size=12B cardinality=108
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF010 -> ss_sold_date_sk, RF008 -> ss_item_sk, RF006 -> ss_promo_sk, RF002 -> ss_customer_sk, RF004 -> ss_store_sk
-   row-size=28B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=121.39MB Threads=30
-Per-Host Resource Estimates: Memory=755MB
-PLAN-ROOT SINK
-|
-27:SORT
-|  order by: promotions ASC, total ASC
-|  row-size=32B cardinality=1
-|
-26:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=32B cardinality=1
-|
-|--45:EXCHANGE [UNPARTITIONED]
-|  |
-|  44:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ss_ext_sales_price)
-|  |  row-size=16B cardinality=1
-|  |
-|  43:EXCHANGE [UNPARTITIONED]
-|  |
-|  25:AGGREGATE
-|  |  output: sum(ss_ext_sales_price)
-|  |  row-size=16B cardinality=1
-|  |
-|  24:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: c_current_addr_sk = ca_address_sk
-|  |  runtime filters: RF012 <- ca_address_sk
-|  |  row-size=86B cardinality=3.30K
-|  |
-|  |--42:EXCHANGE [BROADCAST]
-|  |  |
-|  |  18:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     predicates: ca_gmt_offset = -5
-|  |     row-size=8B cardinality=8.33K
-|  |
-|  23:HASH JOIN [INNER JOIN, PARTITIONED]
-|  |  hash predicates: ss_customer_sk = c_customer_sk
-|  |  runtime filters: RF014 <- c_customer_sk
-|  |  row-size=78B cardinality=17.06K
-|  |
-|  |--41:EXCHANGE [HASH(c_customer_sk)]
-|  |  |
-|  |  17:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     runtime filters: RF012 -> c_current_addr_sk
-|  |     row-size=8B cardinality=100.00K
-|  |
-|  40:EXCHANGE [HASH(ss_customer_sk)]
-|  |
-|  22:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=70B cardinality=17.06K
-|  |
-|  |--39:EXCHANGE [BROADCAST]
-|  |  |
-|  |  15:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: s_gmt_offset = -5
-|  |     row-size=8B cardinality=12
-|  |
-|  21:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_item_sk = i_item_sk
-|  |  runtime filters: RF018 <- i_item_sk
-|  |  row-size=62B cardinality=17.06K
-|  |
-|  |--38:EXCHANGE [BROADCAST]
-|  |  |
-|  |  19:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_category = 'Books'
-|  |     row-size=26B cardinality=1.80K
-|  |
-|  20:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF020 <- d_date_sk
-|  |  row-size=36B cardinality=170.55K
-|  |
-|  |--37:EXCHANGE [BROADCAST]
-|  |  |
-|  |  16:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 2000, d_moy = 11
-|  |     row-size=12B cardinality=108
-|  |
-|  14:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF020 -> ss_sold_date_sk, RF018 -> ss_item_sk, RF014 -> ss_customer_sk
-|     row-size=24B cardinality=2.88M
-|
-36:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  row-size=16B cardinality=1
-|
-35:EXCHANGE [UNPARTITIONED]
-|
-13:AGGREGATE
-|  output: sum(ss_ext_sales_price)
-|  row-size=16B cardinality=1
-|
-12:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: c_current_addr_sk = ca_address_sk
-|  runtime filters: RF000 <- ca_address_sk
-|  row-size=133B cardinality=3.28K
-|
-|--34:EXCHANGE [BROADCAST]
-|  |
-|  05:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     predicates: ca_gmt_offset = -5
-|     row-size=8B cardinality=8.33K
-|
-11:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF002 <- c_customer_sk
-|  row-size=125B cardinality=16.94K
-|
-|--33:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  04:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> c_current_addr_sk
-|     row-size=8B cardinality=100.00K
-|
-32:EXCHANGE [HASH(ss_customer_sk)]
-|
-10:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF004 <- s_store_sk
-|  row-size=117B cardinality=16.94K
-|
-|--31:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_gmt_offset = -5
-|     row-size=8B cardinality=12
-|
-09:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_promo_sk = p_promo_sk
-|  runtime filters: RF006 <- p_promo_sk
-|  row-size=109B cardinality=16.94K
-|
-|--30:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.promotion]
-|     HDFS partitions=1/1 files=1 size=36.36KB
-|     predicates: (p_channel_dmail = 'Y' OR p_channel_email = 'Y' OR p_channel_tv = 'Y')
-|     row-size=43B cardinality=300
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF008 <- i_item_sk
-|  row-size=66B cardinality=17.06K
-|
-|--29:EXCHANGE [BROADCAST]
-|  |
-|  06:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_category = 'Books'
-|     row-size=26B cardinality=1.80K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF010 <- d_date_sk
-|  row-size=40B cardinality=170.55K
-|
-|--28:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 2000, d_moy = 11
-|     row-size=12B cardinality=108
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF010 -> ss_sold_date_sk, RF008 -> ss_item_sk, RF006 -> ss_promo_sk, RF002 -> ss_customer_sk, RF004 -> ss_store_sk
-   row-size=28B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=166.70MB Threads=35
-Per-Host Resource Estimates: Memory=411MB
-PLAN-ROOT SINK
-|
-27:SORT
-|  order by: promotions ASC, total ASC
-|  row-size=32B cardinality=1
-|
-26:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 00
-|  row-size=32B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |
-|  45:EXCHANGE [UNPARTITIONED]
-|  |
-|  44:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ss_ext_sales_price)
-|  |  row-size=16B cardinality=1
-|  |
-|  43:EXCHANGE [UNPARTITIONED]
-|  |
-|  25:AGGREGATE
-|  |  output: sum(ss_ext_sales_price)
-|  |  row-size=16B cardinality=1
-|  |
-|  24:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: c_current_addr_sk = ca_address_sk
-|  |  row-size=86B cardinality=3.30K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=01 plan-id=02 cohort-id=02
-|  |  |  build expressions: ca_address_sk
-|  |  |  runtime filters: RF012 <- ca_address_sk
-|  |  |
-|  |  42:EXCHANGE [BROADCAST]
-|  |  |
-|  |  18:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     predicates: ca_gmt_offset = -5
-|  |     row-size=8B cardinality=8.33K
-|  |
-|  23:HASH JOIN [INNER JOIN, PARTITIONED]
-|  |  hash predicates: ss_customer_sk = c_customer_sk
-|  |  row-size=78B cardinality=17.06K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=02 plan-id=03 cohort-id=02
-|  |  |  build expressions: c_customer_sk
-|  |  |  runtime filters: RF014 <- c_customer_sk
-|  |  |
-|  |  41:EXCHANGE [HASH(c_customer_sk)]
-|  |  |
-|  |  17:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     runtime filters: RF012 -> c_current_addr_sk
-|  |     row-size=8B cardinality=100.00K
-|  |
-|  40:EXCHANGE [HASH(ss_customer_sk)]
-|  |
-|  22:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=70B cardinality=17.06K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=03 plan-id=04 cohort-id=02
-|  |  |  build expressions: s_store_sk
-|  |  |
-|  |  39:EXCHANGE [BROADCAST]
-|  |  |
-|  |  15:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: s_gmt_offset = -5
-|  |     row-size=8B cardinality=12
-|  |
-|  21:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_item_sk = i_item_sk
-|  |  row-size=62B cardinality=17.06K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=04 plan-id=05 cohort-id=02
-|  |  |  build expressions: i_item_sk
-|  |  |  runtime filters: RF018 <- i_item_sk
-|  |  |
-|  |  38:EXCHANGE [BROADCAST]
-|  |  |
-|  |  19:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_category = 'Books'
-|  |     row-size=26B cardinality=1.80K
-|  |
-|  20:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  row-size=36B cardinality=170.55K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=05 plan-id=06 cohort-id=02
-|  |  |  build expressions: d_date_sk
-|  |  |  runtime filters: RF020 <- d_date_sk
-|  |  |
-|  |  37:EXCHANGE [BROADCAST]
-|  |  |
-|  |  16:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 2000, d_moy = 11
-|  |     row-size=12B cardinality=108
-|  |
-|  14:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF020 -> ss_sold_date_sk, RF018 -> ss_item_sk, RF014 -> ss_customer_sk
-|     row-size=24B cardinality=2.88M
-|
-36:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  row-size=16B cardinality=1
-|
-35:EXCHANGE [UNPARTITIONED]
-|
-13:AGGREGATE
-|  output: sum(ss_ext_sales_price)
-|  row-size=16B cardinality=1
-|
-12:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: c_current_addr_sk = ca_address_sk
-|  row-size=133B cardinality=3.28K
-|
-|--JOIN BUILD
-|  |  join-table-id=06 plan-id=07 cohort-id=01
-|  |  build expressions: ca_address_sk
-|  |  runtime filters: RF000 <- ca_address_sk
-|  |
-|  34:EXCHANGE [BROADCAST]
-|  |
-|  05:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     predicates: ca_gmt_offset = -5
-|     row-size=8B cardinality=8.33K
-|
-11:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  row-size=125B cardinality=16.94K
-|
-|--JOIN BUILD
-|  |  join-table-id=07 plan-id=08 cohort-id=01
-|  |  build expressions: c_customer_sk
-|  |  runtime filters: RF002 <- c_customer_sk
-|  |
-|  33:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  04:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> c_current_addr_sk
-|     row-size=8B cardinality=100.00K
-|
-32:EXCHANGE [HASH(ss_customer_sk)]
-|
-10:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=117B cardinality=16.94K
-|
-|--JOIN BUILD
-|  |  join-table-id=08 plan-id=09 cohort-id=01
-|  |  build expressions: s_store_sk
-|  |  runtime filters: RF004 <- s_store_sk
-|  |
-|  31:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_gmt_offset = -5
-|     row-size=8B cardinality=12
-|
-09:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_promo_sk = p_promo_sk
-|  row-size=109B cardinality=16.94K
-|
-|--JOIN BUILD
-|  |  join-table-id=09 plan-id=10 cohort-id=01
-|  |  build expressions: p_promo_sk
-|  |  runtime filters: RF006 <- p_promo_sk
-|  |
-|  30:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.promotion]
-|     HDFS partitions=1/1 files=1 size=36.36KB
-|     predicates: (p_channel_dmail = 'Y' OR p_channel_email = 'Y' OR p_channel_tv = 'Y')
-|     row-size=43B cardinality=300
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=66B cardinality=17.06K
-|
-|--JOIN BUILD
-|  |  join-table-id=10 plan-id=11 cohort-id=01
-|  |  build expressions: i_item_sk
-|  |  runtime filters: RF008 <- i_item_sk
-|  |
-|  29:EXCHANGE [BROADCAST]
-|  |
-|  06:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_category = 'Books'
-|     row-size=26B cardinality=1.80K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  row-size=40B cardinality=170.55K
-|
-|--JOIN BUILD
-|  |  join-table-id=11 plan-id=12 cohort-id=01
-|  |  build expressions: d_date_sk
-|  |  runtime filters: RF010 <- d_date_sk
-|  |
-|  28:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 2000, d_moy = 11
-|     row-size=12B cardinality=108
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF010 -> ss_sold_date_sk, RF008 -> ss_item_sk, RF006 -> ss_promo_sk, RF002 -> ss_customer_sk, RF004 -> ss_store_sk
-   row-size=28B cardinality=2.88M
-====
-# TPCDS-Q88
-select  *
-from
- (select count(*) h8_30_to_9
- from store_sales, household_demographics , time_dim, store
- where ss_sold_time_sk = time_dim.t_time_sk
-     and ss_hdemo_sk = household_demographics.hd_demo_sk
-     and ss_store_sk = s_store_sk
-     and time_dim.t_hour = 8
-     and time_dim.t_minute >= 30
-     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
-          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
-          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
-     and store.s_store_name = 'ese') s1,
- (select count(*) h9_to_9_30
- from store_sales, household_demographics , time_dim, store
- where ss_sold_time_sk = time_dim.t_time_sk
-     and ss_hdemo_sk = household_demographics.hd_demo_sk
-     and ss_store_sk = s_store_sk
-     and time_dim.t_hour = 9
-     and time_dim.t_minute < 30
-     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
-          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
-          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
-     and store.s_store_name = 'ese') s2,
- (select count(*) h9_30_to_10
- from store_sales, household_demographics , time_dim, store
- where ss_sold_time_sk = time_dim.t_time_sk
-     and ss_hdemo_sk = household_demographics.hd_demo_sk
-     and ss_store_sk = s_store_sk
-     and time_dim.t_hour = 9
-     and time_dim.t_minute >= 30
-     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
-          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
-          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
-     and store.s_store_name = 'ese') s3,
- (select count(*) h10_to_10_30
- from store_sales, household_demographics , time_dim, store
- where ss_sold_time_sk = time_dim.t_time_sk
-     and ss_hdemo_sk = household_demographics.hd_demo_sk
-     and ss_store_sk = s_store_sk
-     and time_dim.t_hour = 10
-     and time_dim.t_minute < 30
-     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
-          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
-          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
-     and store.s_store_name = 'ese') s4,
- (select count(*) h10_30_to_11
- from store_sales, household_demographics , time_dim, store
- where ss_sold_time_sk = time_dim.t_time_sk
-     and ss_hdemo_sk = household_demographics.hd_demo_sk
-     and ss_store_sk = s_store_sk
-     and time_dim.t_hour = 10
-     and time_dim.t_minute >= 30
-     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
-          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
-          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
-     and store.s_store_name = 'ese') s5,
- (select count(*) h11_to_11_30
- from store_sales, household_demographics , time_dim, store
- where ss_sold_time_sk = time_dim.t_time_sk
-     and ss_hdemo_sk = household_demographics.hd_demo_sk
-     and ss_store_sk = s_store_sk
-     and time_dim.t_hour = 11
-     and time_dim.t_minute < 30
-     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
-          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
-          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
-     and store.s_store_name = 'ese') s6,
- (select count(*) h11_30_to_12
- from store_sales, household_demographics , time_dim, store
- where ss_sold_time_sk = time_dim.t_time_sk
-     and ss_hdemo_sk = household_demographics.hd_demo_sk
-     and ss_store_sk = s_store_sk
-     and time_dim.t_hour = 11
-     and time_dim.t_minute >= 30
-     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
-          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
-          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
-     and store.s_store_name = 'ese') s7,
- (select count(*) h12_to_12_30
- from store_sales, household_demographics , time_dim, store
- where ss_sold_time_sk = time_dim.t_time_sk
-     and ss_hdemo_sk = household_demographics.hd_demo_sk
-     and ss_store_sk = s_store_sk
-     and time_dim.t_hour = 12
-     and time_dim.t_minute < 30
-     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
-          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
-          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
-     and store.s_store_name = 'ese') s8
----- PLAN
-Max Per-Host Resource Reservation: Memory=186.56MB Threads=33
-Per-Host Resource Estimates: Memory=1.81GB
-PLAN-ROOT SINK
-|
-70:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=64B cardinality=1
-|
-|--63:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  62:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--59:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  61:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--57:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  60:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF046 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--58:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 12, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  56:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF046 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-69:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=56B cardinality=1
-|
-|--55:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  54:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--51:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  53:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--49:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  52:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF040 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--50:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 11, time_dim.t_minute >= 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  48:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF040 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-68:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=48B cardinality=1
-|
-|--47:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  46:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--43:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  45:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--41:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  44:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF034 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--42:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 11, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  40:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF034 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-67:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=40B cardinality=1
-|
-|--39:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  38:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--35:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  37:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--33:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  36:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF028 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--34:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 10, time_dim.t_minute >= 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  32:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF028 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-66:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=32B cardinality=1
-|
-|--31:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  30:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--27:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  29:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--25:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  28:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF022 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--26:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 10, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  24:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF022 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-65:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=24B cardinality=1
-|
-|--23:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  22:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--19:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  21:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--17:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  20:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF016 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--18:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 9, time_dim.t_minute >= 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  16:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF016 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-64:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=16B cardinality=1
-|
-|--15:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  14:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--11:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  13:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  runtime filters: RF008 <- household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--09:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  12:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF010 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--10:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 9, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  08:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF010 -> ss_sold_time_sk, RF008 -> ss_hdemo_sk
-|     row-size=12B cardinality=2.88M
-|
-07:AGGREGATE [FINALIZE]
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=56B cardinality=2.27K
-|
-|--03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_store_name = 'ese'
-|     row-size=20B cardinality=2
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  runtime filters: RF002 <- household_demographics.hd_demo_sk
-|  row-size=36B cardinality=6.82K
-|
-|--01:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|     row-size=12B cardinality=720
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  runtime filters: RF004 <- time_dim.t_time_sk
-|  row-size=24B cardinality=69.82K
-|
-|--02:SCAN HDFS [tpcds.time_dim]
-|     HDFS partitions=1/1 files=1 size=4.87MB
-|     predicates: time_dim.t_hour = 8, time_dim.t_minute >= 30
-|     row-size=12B cardinality=1.14K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF004 -> ss_sold_time_sk, RF002 -> ss_hdemo_sk
-   row-size=12B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=186.56MB Threads=72
-Per-Host Resource Estimates: Memory=1.96GB
-PLAN-ROOT SINK
-|
-70:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=64B cardinality=1
-|
-|--117:EXCHANGE [UNPARTITIONED]
-|  |
-|  116:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  115:EXCHANGE [UNPARTITIONED]
-|  |
-|  63:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  62:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--114:EXCHANGE [BROADCAST]
-|  |  |
-|  |  59:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  61:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--113:EXCHANGE [BROADCAST]
-|  |  |
-|  |  57:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  60:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF046 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--112:EXCHANGE [BROADCAST]
-|  |  |
-|  |  58:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 12, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  56:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF046 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-69:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=56B cardinality=1
-|
-|--111:EXCHANGE [UNPARTITIONED]
-|  |
-|  110:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  109:EXCHANGE [UNPARTITIONED]
-|  |
-|  55:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  54:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--108:EXCHANGE [BROADCAST]
-|  |  |
-|  |  51:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  53:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--107:EXCHANGE [BROADCAST]
-|  |  |
-|  |  49:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  52:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF040 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--106:EXCHANGE [BROADCAST]
-|  |  |
-|  |  50:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 11, time_dim.t_minute >= 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  48:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF040 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-68:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=48B cardinality=1
-|
-|--105:EXCHANGE [UNPARTITIONED]
-|  |
-|  104:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  103:EXCHANGE [UNPARTITIONED]
-|  |
-|  47:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  46:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--102:EXCHANGE [BROADCAST]
-|  |  |
-|  |  43:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  45:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--101:EXCHANGE [BROADCAST]
-|  |  |
-|  |  41:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  44:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF034 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--100:EXCHANGE [BROADCAST]
-|  |  |
-|  |  42:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 11, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  40:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF034 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-67:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=40B cardinality=1
-|
-|--99:EXCHANGE [UNPARTITIONED]
-|  |
-|  98:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  97:EXCHANGE [UNPARTITIONED]
-|  |
-|  39:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  38:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--96:EXCHANGE [BROADCAST]
-|  |  |
-|  |  35:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  37:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--95:EXCHANGE [BROADCAST]
-|  |  |
-|  |  33:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  36:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF028 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--94:EXCHANGE [BROADCAST]
-|  |  |
-|  |  34:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 10, time_dim.t_minute >= 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  32:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF028 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-66:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=32B cardinality=1
-|
-|--93:EXCHANGE [UNPARTITIONED]
-|  |
-|  92:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  91:EXCHANGE [UNPARTITIONED]
-|  |
-|  31:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  30:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--90:EXCHANGE [BROADCAST]
-|  |  |
-|  |  27:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  29:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--89:EXCHANGE [BROADCAST]
-|  |  |
-|  |  25:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  28:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF022 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--88:EXCHANGE [BROADCAST]
-|  |  |
-|  |  26:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 10, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  24:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF022 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-65:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=24B cardinality=1
-|
-|--87:EXCHANGE [UNPARTITIONED]
-|  |
-|  86:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  85:EXCHANGE [UNPARTITIONED]
-|  |
-|  23:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  22:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--84:EXCHANGE [BROADCAST]
-|  |  |
-|  |  19:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  21:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--83:EXCHANGE [BROADCAST]
-|  |  |
-|  |  17:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  20:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF016 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--82:EXCHANGE [BROADCAST]
-|  |  |
-|  |  18:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 9, time_dim.t_minute >= 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  16:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF016 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-64:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=16B cardinality=1
-|
-|--81:EXCHANGE [UNPARTITIONED]
-|  |
-|  80:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  79:EXCHANGE [UNPARTITIONED]
-|  |
-|  15:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  14:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--78:EXCHANGE [BROADCAST]
-|  |  |
-|  |  11:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  13:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  runtime filters: RF008 <- household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--77:EXCHANGE [BROADCAST]
-|  |  |
-|  |  09:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  12:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  runtime filters: RF010 <- time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--76:EXCHANGE [BROADCAST]
-|  |  |
-|  |  10:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 9, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  08:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF010 -> ss_sold_time_sk, RF008 -> ss_hdemo_sk
-|     row-size=12B cardinality=2.88M
-|
-75:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  row-size=8B cardinality=1
-|
-74:EXCHANGE [UNPARTITIONED]
-|
-07:AGGREGATE
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=56B cardinality=2.27K
-|
-|--73:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_store_name = 'ese'
-|     row-size=20B cardinality=2
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  runtime filters: RF002 <- household_demographics.hd_demo_sk
-|  row-size=36B cardinality=6.82K
-|
-|--72:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|     row-size=12B cardinality=720
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  runtime filters: RF004 <- time_dim.t_time_sk
-|  row-size=24B cardinality=69.82K
-|
-|--71:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.time_dim]
-|     HDFS partitions=1/1 files=1 size=4.87MB
-|     predicates: time_dim.t_hour = 8, time_dim.t_minute >= 30
-|     row-size=12B cardinality=1.14K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF004 -> ss_sold_time_sk, RF002 -> ss_hdemo_sk
-   row-size=12B cardinality=2.88M
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=307.06MB Threads=79
-Per-Host Resource Estimates: Memory=994MB
-PLAN-ROOT SINK
-|
-70:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 00
-|  row-size=64B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |
-|  117:EXCHANGE [UNPARTITIONED]
-|  |
-|  116:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  115:EXCHANGE [UNPARTITIONED]
-|  |
-|  63:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  62:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=01 plan-id=02 cohort-id=02
-|  |  |  build expressions: s_store_sk
-|  |  |
-|  |  114:EXCHANGE [BROADCAST]
-|  |  |
-|  |  59:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  61:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=02 plan-id=03 cohort-id=02
-|  |  |  build expressions: household_demographics.hd_demo_sk
-|  |  |
-|  |  113:EXCHANGE [BROADCAST]
-|  |  |
-|  |  57:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  60:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=03 plan-id=04 cohort-id=02
-|  |  |  build expressions: time_dim.t_time_sk
-|  |  |  runtime filters: RF046 <- time_dim.t_time_sk
-|  |  |
-|  |  112:EXCHANGE [BROADCAST]
-|  |  |
-|  |  58:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 12, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  56:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF046 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-69:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 04
-|  row-size=56B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=04 plan-id=05 cohort-id=01
-|  |
-|  111:EXCHANGE [UNPARTITIONED]
-|  |
-|  110:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  109:EXCHANGE [UNPARTITIONED]
-|  |
-|  55:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  54:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=05 plan-id=06 cohort-id=03
-|  |  |  build expressions: s_store_sk
-|  |  |
-|  |  108:EXCHANGE [BROADCAST]
-|  |  |
-|  |  51:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  53:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=06 plan-id=07 cohort-id=03
-|  |  |  build expressions: household_demographics.hd_demo_sk
-|  |  |
-|  |  107:EXCHANGE [BROADCAST]
-|  |  |
-|  |  49:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  52:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=07 plan-id=08 cohort-id=03
-|  |  |  build expressions: time_dim.t_time_sk
-|  |  |  runtime filters: RF040 <- time_dim.t_time_sk
-|  |  |
-|  |  106:EXCHANGE [BROADCAST]
-|  |  |
-|  |  50:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 11, time_dim.t_minute >= 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  48:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF040 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-68:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 08
-|  row-size=48B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=08 plan-id=09 cohort-id=01
-|  |
-|  105:EXCHANGE [UNPARTITIONED]
-|  |
-|  104:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  103:EXCHANGE [UNPARTITIONED]
-|  |
-|  47:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  46:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=09 plan-id=10 cohort-id=04
-|  |  |  build expressions: s_store_sk
-|  |  |
-|  |  102:EXCHANGE [BROADCAST]
-|  |  |
-|  |  43:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  45:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=10 plan-id=11 cohort-id=04
-|  |  |  build expressions: household_demographics.hd_demo_sk
-|  |  |
-|  |  101:EXCHANGE [BROADCAST]
-|  |  |
-|  |  41:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  44:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=11 plan-id=12 cohort-id=04
-|  |  |  build expressions: time_dim.t_time_sk
-|  |  |  runtime filters: RF034 <- time_dim.t_time_sk
-|  |  |
-|  |  100:EXCHANGE [BROADCAST]
-|  |  |
-|  |  42:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 11, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  40:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF034 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-67:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 12
-|  row-size=40B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=12 plan-id=13 cohort-id=01
-|  |
-|  99:EXCHANGE [UNPARTITIONED]
-|  |
-|  98:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  97:EXCHANGE [UNPARTITIONED]
-|  |
-|  39:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  38:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=13 plan-id=14 cohort-id=05
-|  |  |  build expressions: s_store_sk
-|  |  |
-|  |  96:EXCHANGE [BROADCAST]
-|  |  |
-|  |  35:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  37:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=14 plan-id=15 cohort-id=05
-|  |  |  build expressions: household_demographics.hd_demo_sk
-|  |  |
-|  |  95:EXCHANGE [BROADCAST]
-|  |  |
-|  |  33:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  36:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=15 plan-id=16 cohort-id=05
-|  |  |  build expressions: time_dim.t_time_sk
-|  |  |  runtime filters: RF028 <- time_dim.t_time_sk
-|  |  |
-|  |  94:EXCHANGE [BROADCAST]
-|  |  |
-|  |  34:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 10, time_dim.t_minute >= 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  32:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF028 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-66:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 16
-|  row-size=32B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=16 plan-id=17 cohort-id=01
-|  |
-|  93:EXCHANGE [UNPARTITIONED]
-|  |
-|  92:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  91:EXCHANGE [UNPARTITIONED]
-|  |
-|  31:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  30:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=17 plan-id=18 cohort-id=06
-|  |  |  build expressions: s_store_sk
-|  |  |
-|  |  90:EXCHANGE [BROADCAST]
-|  |  |
-|  |  27:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  29:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=18 plan-id=19 cohort-id=06
-|  |  |  build expressions: household_demographics.hd_demo_sk
-|  |  |
-|  |  89:EXCHANGE [BROADCAST]
-|  |  |
-|  |  25:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  28:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=19 plan-id=20 cohort-id=06
-|  |  |  build expressions: time_dim.t_time_sk
-|  |  |  runtime filters: RF022 <- time_dim.t_time_sk
-|  |  |
-|  |  88:EXCHANGE [BROADCAST]
-|  |  |
-|  |  26:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 10, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  24:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF022 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-65:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 20
-|  row-size=24B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=20 plan-id=21 cohort-id=01
-|  |
-|  87:EXCHANGE [UNPARTITIONED]
-|  |
-|  86:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  85:EXCHANGE [UNPARTITIONED]
-|  |
-|  23:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  22:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=21 plan-id=22 cohort-id=07
-|  |  |  build expressions: s_store_sk
-|  |  |
-|  |  84:EXCHANGE [BROADCAST]
-|  |  |
-|  |  19:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  21:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=22 plan-id=23 cohort-id=07
-|  |  |  build expressions: household_demographics.hd_demo_sk
-|  |  |
-|  |  83:EXCHANGE [BROADCAST]
-|  |  |
-|  |  17:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  20:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=23 plan-id=24 cohort-id=07
-|  |  |  build expressions: time_dim.t_time_sk
-|  |  |  runtime filters: RF016 <- time_dim.t_time_sk
-|  |  |
-|  |  82:EXCHANGE [BROADCAST]
-|  |  |
-|  |  18:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 9, time_dim.t_minute >= 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  16:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF016 -> ss_sold_time_sk
-|     row-size=12B cardinality=2.88M
-|
-64:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 24
-|  row-size=16B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=24 plan-id=25 cohort-id=01
-|  |
-|  81:EXCHANGE [UNPARTITIONED]
-|  |
-|  80:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  79:EXCHANGE [UNPARTITIONED]
-|  |
-|  15:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  14:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  row-size=56B cardinality=2.27K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=25 plan-id=26 cohort-id=08
-|  |  |  build expressions: s_store_sk
-|  |  |
-|  |  78:EXCHANGE [BROADCAST]
-|  |  |
-|  |  11:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     predicates: store.s_store_name = 'ese'
-|  |     row-size=20B cardinality=2
-|  |
-|  13:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  |  row-size=36B cardinality=6.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=26 plan-id=27 cohort-id=08
-|  |  |  build expressions: household_demographics.hd_demo_sk
-|  |  |  runtime filters: RF008 <- household_demographics.hd_demo_sk
-|  |  |
-|  |  77:EXCHANGE [BROADCAST]
-|  |  |
-|  |  09:SCAN HDFS [tpcds.household_demographics]
-|  |     HDFS partitions=1/1 files=1 size=148.10KB
-|  |     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|  |     row-size=12B cardinality=720
-|  |
-|  12:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  |  row-size=24B cardinality=69.82K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=27 plan-id=28 cohort-id=08
-|  |  |  build expressions: time_dim.t_time_sk
-|  |  |  runtime filters: RF010 <- time_dim.t_time_sk
-|  |  |
-|  |  76:EXCHANGE [BROADCAST]
-|  |  |
-|  |  10:SCAN HDFS [tpcds.time_dim]
-|  |     HDFS partitions=1/1 files=1 size=4.87MB
-|  |     predicates: time_dim.t_hour = 9, time_dim.t_minute < 30
-|  |     row-size=12B cardinality=1.14K
-|  |
-|  08:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF010 -> ss_sold_time_sk, RF008 -> ss_hdemo_sk
-|     row-size=12B cardinality=2.88M
-|
-75:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  row-size=8B cardinality=1
-|
-74:EXCHANGE [UNPARTITIONED]
-|
-07:AGGREGATE
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  row-size=56B cardinality=2.27K
-|
-|--JOIN BUILD
-|  |  join-table-id=28 plan-id=29 cohort-id=01
-|  |  build expressions: s_store_sk
-|  |
-|  73:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: store.s_store_name = 'ese'
-|     row-size=20B cardinality=2
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
-|  row-size=36B cardinality=6.82K
-|
-|--JOIN BUILD
-|  |  join-table-id=29 plan-id=30 cohort-id=01
-|  |  build expressions: household_demographics.hd_demo_sk
-|  |  runtime filters: RF002 <- household_demographics.hd_demo_sk
-|  |
-|  72:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.household_demographics]
-|     HDFS partitions=1/1 files=1 size=148.10KB
-|     predicates: ((household_demographics.hd_dep_count = 1 AND household_demographics.hd_vehicle_count <= 3) OR (household_demographics.hd_dep_count = 0 AND household_demographics.hd_vehicle_count <= 2) OR (household_demographics.hd_dep_count = 2 AND household_demographics.hd_vehicle_count <= 4))
-|     row-size=12B cardinality=720
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
-|  row-size=24B cardinality=69.82K
-|
-|--JOIN BUILD
-|  |  join-table-id=30 plan-id=31 cohort-id=01
-|  |  build expressions: time_dim.t_time_sk
-|  |  runtime filters: RF004 <- time_dim.t_time_sk
-|  |
-|  71:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.time_dim]
-|     HDFS partitions=1/1 files=1 size=4.87MB
-|     predicates: time_dim.t_hour = 8, time_dim.t_minute >= 30
-|     row-size=12B cardinality=1.14K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF004 -> ss_sold_time_sk, RF002 -> ss_hdemo_sk
-   row-size=12B cardinality=2.88M
-====
-# TPCDS-Q9
-select case when (select count(*)
-                  from store_sales
-                  where ss_quantity between 1 and 20) > 74129
-            then (select avg(ss_ext_discount_amt)
-                  from store_sales
-                  where ss_quantity between 1 and 20)
-            else (select avg(ss_net_profit)
-                  from store_sales
-                  where ss_quantity between 1 and 20) end bucket1,
-       case when (select count(*)
-                  from store_sales
-                  where ss_quantity between 21 and 40) > 122840
-            then (select avg(ss_ext_discount_amt)
-                  from store_sales
-                  where ss_quantity between 21 and 40)
-            else (select avg(ss_net_profit)
-                  from store_sales
-                  where ss_quantity between 21 and 40) end bucket2,
-       case when (select count(*)
-                  from store_sales
-                  where ss_quantity between 41 and 60) > 56580
-            then (select avg(ss_ext_discount_amt)
-                  from store_sales
-                  where ss_quantity between 41 and 60)
-            else (select avg(ss_net_profit)
-                  from store_sales
-                  where ss_quantity between 41 and 60) end bucket3,
-       case when (select count(*)
-                  from store_sales
-                  where ss_quantity between 61 and 80) > 10097
-            then (select avg(ss_ext_discount_amt)
-                  from store_sales
-                  where ss_quantity between 61 and 80)
-            else (select avg(ss_net_profit)
-                  from store_sales
-                  where ss_quantity between 61 and 80) end bucket4,
-       case when (select count(*)
-                  from store_sales
-                  where ss_quantity between 81 and 100) > 165306
-            then (select avg(ss_ext_discount_amt)
-                  from store_sales
-                  where ss_quantity between 81 and 100)
-            else (select avg(ss_net_profit)
-                  from store_sales
-                  where ss_quantity between 81 and 100) end bucket5
-from reason
-where r_reason_sk = 1
----- PLAN
-Max Per-Host Resource Reservation: Memory=120.01MB Threads=17
-Per-Host Resource Estimates: Memory=2.05GB
-PLAN-ROOT SINK
-|
-45:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=124B cardinality=1
-|
-|--30:AGGREGATE [FINALIZE]
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  29:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 100, ss_quantity >= 81
-|     row-size=8B cardinality=288.04K
-|
-44:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=116B cardinality=1
-|
-|--28:AGGREGATE [FINALIZE]
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  27:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 100, ss_quantity >= 81
-|     row-size=8B cardinality=288.04K
-|
-43:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=108B cardinality=1
-|
-|--26:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  25:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 100, ss_quantity >= 81
-|     row-size=4B cardinality=288.04K
-|
-42:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=100B cardinality=1
-|
-|--24:AGGREGATE [FINALIZE]
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  23:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 80, ss_quantity >= 61
-|     row-size=8B cardinality=288.04K
-|
-41:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=92B cardinality=1
-|
-|--22:AGGREGATE [FINALIZE]
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  21:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 80, ss_quantity >= 61
-|     row-size=8B cardinality=288.04K
-|
-40:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=84B cardinality=1
-|
-|--20:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  19:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 80, ss_quantity >= 61
-|     row-size=4B cardinality=288.04K
-|
-39:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=76B cardinality=1
-|
-|--18:AGGREGATE [FINALIZE]
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  17:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 60, ss_quantity >= 41
-|     row-size=8B cardinality=288.04K
-|
-38:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=68B cardinality=1
-|
-|--16:AGGREGATE [FINALIZE]
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  15:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 60, ss_quantity >= 41
-|     row-size=8B cardinality=288.04K
-|
-37:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=60B cardinality=1
-|
-|--14:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  13:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 60, ss_quantity >= 41
-|     row-size=4B cardinality=288.04K
-|
-36:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=52B cardinality=1
-|
-|--12:AGGREGATE [FINALIZE]
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  11:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 40, ss_quantity >= 21
-|     row-size=8B cardinality=288.04K
-|
-35:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=44B cardinality=1
-|
-|--10:AGGREGATE [FINALIZE]
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  09:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 40, ss_quantity >= 21
-|     row-size=8B cardinality=288.04K
-|
-34:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=36B cardinality=1
-|
-|--08:AGGREGATE [FINALIZE]
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  07:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 40, ss_quantity >= 21
-|     row-size=4B cardinality=288.04K
-|
-33:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=28B cardinality=1
-|
-|--06:AGGREGATE [FINALIZE]
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  05:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 20, ss_quantity >= 1
-|     row-size=8B cardinality=288.04K
-|
-32:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=20B cardinality=1
-|
-|--04:AGGREGATE [FINALIZE]
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  03:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 20, ss_quantity >= 1
-|     row-size=8B cardinality=288.04K
-|
-31:NESTED LOOP JOIN [CROSS JOIN]
-|  row-size=12B cardinality=1
-|
-|--00:SCAN HDFS [tpcds.reason]
-|     HDFS partitions=1/1 files=1 size=1.31KB
-|     predicates: r_reason_sk = 1
-|     row-size=4B cardinality=1
-|
-02:AGGREGATE [FINALIZE]
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   predicates: ss_quantity <= 20, ss_quantity >= 1
-   row-size=4B cardinality=288.04K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=120.01MB Threads=47
-Per-Host Resource Estimates: Memory=2.20GB
-PLAN-ROOT SINK
-|
-45:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=124B cardinality=1
-|
-|--90:EXCHANGE [UNPARTITIONED]
-|  |
-|  89:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  88:EXCHANGE [UNPARTITIONED]
-|  |
-|  30:AGGREGATE
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  29:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 100, ss_quantity >= 81
-|     row-size=8B cardinality=288.04K
-|
-44:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=116B cardinality=1
-|
-|--87:EXCHANGE [UNPARTITIONED]
-|  |
-|  86:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  85:EXCHANGE [UNPARTITIONED]
-|  |
-|  28:AGGREGATE
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  27:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 100, ss_quantity >= 81
-|     row-size=8B cardinality=288.04K
-|
-43:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=108B cardinality=1
-|
-|--84:EXCHANGE [UNPARTITIONED]
-|  |
-|  83:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  82:EXCHANGE [UNPARTITIONED]
-|  |
-|  26:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  25:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 100, ss_quantity >= 81
-|     row-size=4B cardinality=288.04K
-|
-42:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=100B cardinality=1
-|
-|--81:EXCHANGE [UNPARTITIONED]
-|  |
-|  80:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  79:EXCHANGE [UNPARTITIONED]
-|  |
-|  24:AGGREGATE
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  23:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 80, ss_quantity >= 61
-|     row-size=8B cardinality=288.04K
-|
-41:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=92B cardinality=1
-|
-|--78:EXCHANGE [UNPARTITIONED]
-|  |
-|  77:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  76:EXCHANGE [UNPARTITIONED]
-|  |
-|  22:AGGREGATE
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  21:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 80, ss_quantity >= 61
-|     row-size=8B cardinality=288.04K
-|
-40:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=84B cardinality=1
-|
-|--75:EXCHANGE [UNPARTITIONED]
-|  |
-|  74:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  73:EXCHANGE [UNPARTITIONED]
-|  |
-|  20:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  19:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 80, ss_quantity >= 61
-|     row-size=4B cardinality=288.04K
-|
-39:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=76B cardinality=1
-|
-|--72:EXCHANGE [UNPARTITIONED]
-|  |
-|  71:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  70:EXCHANGE [UNPARTITIONED]
-|  |
-|  18:AGGREGATE
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  17:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 60, ss_quantity >= 41
-|     row-size=8B cardinality=288.04K
-|
-38:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=68B cardinality=1
-|
-|--69:EXCHANGE [UNPARTITIONED]
-|  |
-|  68:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  67:EXCHANGE [UNPARTITIONED]
-|  |
-|  16:AGGREGATE
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  15:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 60, ss_quantity >= 41
-|     row-size=8B cardinality=288.04K
-|
-37:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=60B cardinality=1
-|
-|--66:EXCHANGE [UNPARTITIONED]
-|  |
-|  65:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  64:EXCHANGE [UNPARTITIONED]
-|  |
-|  14:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  13:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 60, ss_quantity >= 41
-|     row-size=4B cardinality=288.04K
-|
-36:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=52B cardinality=1
-|
-|--63:EXCHANGE [UNPARTITIONED]
-|  |
-|  62:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  61:EXCHANGE [UNPARTITIONED]
-|  |
-|  12:AGGREGATE
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  11:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 40, ss_quantity >= 21
-|     row-size=8B cardinality=288.04K
-|
-35:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=44B cardinality=1
-|
-|--60:EXCHANGE [UNPARTITIONED]
-|  |
-|  59:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  58:EXCHANGE [UNPARTITIONED]
-|  |
-|  10:AGGREGATE
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  09:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 40, ss_quantity >= 21
-|     row-size=8B cardinality=288.04K
-|
-34:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=36B cardinality=1
-|
-|--57:EXCHANGE [UNPARTITIONED]
-|  |
-|  56:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  55:EXCHANGE [UNPARTITIONED]
-|  |
-|  08:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  07:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 40, ss_quantity >= 21
-|     row-size=4B cardinality=288.04K
-|
-33:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=28B cardinality=1
-|
-|--54:EXCHANGE [UNPARTITIONED]
-|  |
-|  53:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  52:EXCHANGE [UNPARTITIONED]
-|  |
-|  06:AGGREGATE
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  05:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 20, ss_quantity >= 1
-|     row-size=8B cardinality=288.04K
-|
-32:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=20B cardinality=1
-|
-|--51:EXCHANGE [UNPARTITIONED]
-|  |
-|  50:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  49:EXCHANGE [UNPARTITIONED]
-|  |
-|  04:AGGREGATE
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  03:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 20, ss_quantity >= 1
-|     row-size=8B cardinality=288.04K
-|
-31:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  row-size=12B cardinality=1
-|
-|--48:EXCHANGE [UNPARTITIONED]
-|  |
-|  00:SCAN HDFS [tpcds.reason]
-|     HDFS partitions=1/1 files=1 size=1.31KB
-|     predicates: r_reason_sk = 1
-|     row-size=4B cardinality=1
-|
-47:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  row-size=8B cardinality=1
-|
-46:EXCHANGE [UNPARTITIONED]
-|
-02:AGGREGATE
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   predicates: ss_quantity <= 20, ss_quantity >= 1
-   row-size=4B cardinality=288.04K
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=240.01MB Threads=61
-Per-Host Resource Estimates: Memory=946MB
-PLAN-ROOT SINK
-|
-45:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 00
-|  row-size=124B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |
-|  90:EXCHANGE [UNPARTITIONED]
-|  |
-|  89:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  88:EXCHANGE [UNPARTITIONED]
-|  |
-|  30:AGGREGATE
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  29:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 100, ss_quantity >= 81
-|     row-size=8B cardinality=288.04K
-|
-44:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 01
-|  row-size=116B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=01 plan-id=02 cohort-id=01
-|  |
-|  87:EXCHANGE [UNPARTITIONED]
-|  |
-|  86:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  85:EXCHANGE [UNPARTITIONED]
-|  |
-|  28:AGGREGATE
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  27:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 100, ss_quantity >= 81
-|     row-size=8B cardinality=288.04K
-|
-43:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 02
-|  row-size=108B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=02 plan-id=03 cohort-id=01
-|  |
-|  84:EXCHANGE [UNPARTITIONED]
-|  |
-|  83:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  82:EXCHANGE [UNPARTITIONED]
-|  |
-|  26:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  25:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 100, ss_quantity >= 81
-|     row-size=4B cardinality=288.04K
-|
-42:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 03
-|  row-size=100B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=03 plan-id=04 cohort-id=01
-|  |
-|  81:EXCHANGE [UNPARTITIONED]
-|  |
-|  80:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  79:EXCHANGE [UNPARTITIONED]
-|  |
-|  24:AGGREGATE
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  23:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 80, ss_quantity >= 61
-|     row-size=8B cardinality=288.04K
-|
-41:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 04
-|  row-size=92B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=04 plan-id=05 cohort-id=01
-|  |
-|  78:EXCHANGE [UNPARTITIONED]
-|  |
-|  77:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  76:EXCHANGE [UNPARTITIONED]
-|  |
-|  22:AGGREGATE
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  21:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 80, ss_quantity >= 61
-|     row-size=8B cardinality=288.04K
-|
-40:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 05
-|  row-size=84B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=05 plan-id=06 cohort-id=01
-|  |
-|  75:EXCHANGE [UNPARTITIONED]
-|  |
-|  74:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  73:EXCHANGE [UNPARTITIONED]
-|  |
-|  20:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  19:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 80, ss_quantity >= 61
-|     row-size=4B cardinality=288.04K
-|
-39:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 06
-|  row-size=76B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=06 plan-id=07 cohort-id=01
-|  |
-|  72:EXCHANGE [UNPARTITIONED]
-|  |
-|  71:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  70:EXCHANGE [UNPARTITIONED]
-|  |
-|  18:AGGREGATE
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  17:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 60, ss_quantity >= 41
-|     row-size=8B cardinality=288.04K
-|
-38:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 07
-|  row-size=68B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=07 plan-id=08 cohort-id=01
-|  |
-|  69:EXCHANGE [UNPARTITIONED]
-|  |
-|  68:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  67:EXCHANGE [UNPARTITIONED]
-|  |
-|  16:AGGREGATE
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  15:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 60, ss_quantity >= 41
-|     row-size=8B cardinality=288.04K
-|
-37:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 08
-|  row-size=60B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=08 plan-id=09 cohort-id=01
-|  |
-|  66:EXCHANGE [UNPARTITIONED]
-|  |
-|  65:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  64:EXCHANGE [UNPARTITIONED]
-|  |
-|  14:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  13:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 60, ss_quantity >= 41
-|     row-size=4B cardinality=288.04K
-|
-36:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 09
-|  row-size=52B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=09 plan-id=10 cohort-id=01
-|  |
-|  63:EXCHANGE [UNPARTITIONED]
-|  |
-|  62:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  61:EXCHANGE [UNPARTITIONED]
-|  |
-|  12:AGGREGATE
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  11:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 40, ss_quantity >= 21
-|     row-size=8B cardinality=288.04K
-|
-35:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 10
-|  row-size=44B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=10 plan-id=11 cohort-id=01
-|  |
-|  60:EXCHANGE [UNPARTITIONED]
-|  |
-|  59:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  58:EXCHANGE [UNPARTITIONED]
-|  |
-|  10:AGGREGATE
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  09:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 40, ss_quantity >= 21
-|     row-size=8B cardinality=288.04K
-|
-34:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 11
-|  row-size=36B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=11 plan-id=12 cohort-id=01
-|  |
-|  57:EXCHANGE [UNPARTITIONED]
-|  |
-|  56:AGGREGATE [FINALIZE]
-|  |  output: count:merge(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  55:EXCHANGE [UNPARTITIONED]
-|  |
-|  08:AGGREGATE
-|  |  output: count(*)
-|  |  row-size=8B cardinality=1
-|  |
-|  07:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 40, ss_quantity >= 21
-|     row-size=4B cardinality=288.04K
-|
-33:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 12
-|  row-size=28B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=12 plan-id=13 cohort-id=01
-|  |
-|  54:EXCHANGE [UNPARTITIONED]
-|  |
-|  53:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  52:EXCHANGE [UNPARTITIONED]
-|  |
-|  06:AGGREGATE
-|  |  output: avg(ss_net_profit)
-|  |  row-size=8B cardinality=1
-|  |
-|  05:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 20, ss_quantity >= 1
-|     row-size=8B cardinality=288.04K
-|
-32:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 13
-|  row-size=20B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=13 plan-id=14 cohort-id=01
-|  |
-|  51:EXCHANGE [UNPARTITIONED]
-|  |
-|  50:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  49:EXCHANGE [UNPARTITIONED]
-|  |
-|  04:AGGREGATE
-|  |  output: avg(ss_ext_discount_amt)
-|  |  row-size=8B cardinality=1
-|  |
-|  03:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_quantity <= 20, ss_quantity >= 1
-|     row-size=8B cardinality=288.04K
-|
-31:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  join table id: 14
-|  row-size=12B cardinality=1
-|
-|--JOIN BUILD
-|  |  join-table-id=14 plan-id=15 cohort-id=01
-|  |
-|  48:EXCHANGE [UNPARTITIONED]
-|  |
-|  00:SCAN HDFS [tpcds.reason]
-|     HDFS partitions=1/1 files=1 size=1.31KB
-|     predicates: r_reason_sk = 1
-|     row-size=4B cardinality=1
-|
-47:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  row-size=8B cardinality=1
-|
-46:EXCHANGE [UNPARTITIONED]
-|
-02:AGGREGATE
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   predicates: ss_quantity <= 20, ss_quantity >= 1
-   row-size=4B cardinality=288.04K
-====
-# TPCDS-Q44
-SELECT asceding.rnk,
-       i1.i_product_name best_performing,
-       i2.i_product_name worst_performing
-FROM
-  (SELECT *
-   FROM
-     (SELECT item_sk,
-             rank() OVER (
-                          ORDER BY rank_col ASC) rnk
-      FROM
-        (SELECT ss_item_sk item_sk,
-                avg(ss_net_profit) rank_col
-         FROM store_sales ss1
-         WHERE ss_store_sk = 4
-         GROUP BY ss_item_sk
-         HAVING avg(ss_net_profit) > 0.9*
-           (SELECT avg(ss_net_profit) rank_col
-            FROM store_sales
-            WHERE ss_store_sk = 4
-              AND ss_addr_sk IS NULL
-            GROUP BY ss_store_sk))V1)V11
-   WHERE rnk < 11) asceding,
-  (SELECT *
-   FROM
-     (SELECT item_sk,
-             rank() OVER (
-                          ORDER BY rank_col DESC) rnk
-      FROM
-        (SELECT ss_item_sk item_sk,
-                avg(ss_net_profit) rank_col
-         FROM store_sales ss1
-         WHERE ss_store_sk = 4
-         GROUP BY ss_item_sk
-         HAVING avg(ss_net_profit) > 0.9*
-           (SELECT avg(ss_net_profit) rank_col
-            FROM store_sales
-            WHERE ss_store_sk = 4
-              AND ss_addr_sk IS NULL
-            GROUP BY ss_store_sk))V2)V21
-   WHERE rnk < 11) descending,
-     item i1,
-     item i2
-WHERE asceding.rnk = descending.rnk
-  AND i1.i_item_sk=asceding.item_sk
-  AND i2.i_item_sk=descending.item_sk
-ORDER BY asceding.rnk
-LIMIT 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=65.75MB Threads=7
-Per-Host Resource Estimates: Memory=626MB
-PLAN-ROOT SINK
-|
-23:TOP-N [LIMIT=100]
-|  order by: rnk ASC
-|  row-size=68B cardinality=100
-|
-22:HASH JOIN [INNER JOIN]
-|  hash predicates: i2.i_item_sk = ss_item_sk
-|  runtime filters: RF000 <- ss_item_sk
-|  row-size=148B cardinality=1.80K
-|
-|--21:HASH JOIN [INNER JOIN]
-|  |  hash predicates: rank() = rank()
-|  |  row-size=110B cardinality=1.80K
-|  |
-|  |--17:SELECT
-|  |  |  predicates: rank() < 11
-|  |  |  row-size=36B cardinality=1.80K
-|  |  |
-|  |  16:ANALYTIC
-|  |  |  functions: rank()
-|  |  |  order by: avg(ss_net_profit) DESC
-|  |  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  |  row-size=36B cardinality=17.98K
-|  |  |
-|  |  15:SORT
-|  |  |  order by: avg(ss_net_profit) DESC
-|  |  |  row-size=28B cardinality=17.98K
-|  |  |
-|  |  14:NESTED LOOP JOIN [INNER JOIN]
-|  |  |  predicates: avg(ss_net_profit) > 0.9 * avg(ss_net_profit)
-|  |  |  row-size=28B cardinality=17.98K
-|  |  |
-|  |  |--13:CARDINALITY CHECK
-|  |  |  |  limit: 1
-|  |  |  |  row-size=12B cardinality=1
-|  |  |  |
-|  |  |  12:AGGREGATE [FINALIZE]
-|  |  |  |  output: avg(ss_net_profit)
-|  |  |  |  group by: ss_store_sk
-|  |  |  |  limit: 2
-|  |  |  |  row-size=12B cardinality=2
-|  |  |  |
-|  |  |  11:SCAN HDFS [tpcds.store_sales]
-|  |  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |  |     predicates: ss_addr_sk IS NULL, ss_store_sk = 4
-|  |  |     row-size=12B cardinality=53.06K
-|  |  |
-|  |  10:AGGREGATE [FINALIZE]
-|  |  |  output: avg(ss_net_profit)
-|  |  |  group by: ss_item_sk
-|  |  |  row-size=16B cardinality=17.98K
-|  |  |
-|  |  09:SCAN HDFS [tpcds.store_sales ss1]
-|  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |     predicates: ss_store_sk = 4
-|  |     row-size=16B cardinality=480.07K
-|  |
-|  20:HASH JOIN [INNER JOIN]
-|  |  hash predicates: i1.i_item_sk = ss_item_sk
-|  |  runtime filters: RF002 <- ss_item_sk
-|  |  row-size=74B cardinality=1.80K
-|  |
-|  |--08:SELECT
-|  |  |  predicates: rank() < 11
-|  |  |  row-size=36B cardinality=1.80K
-|  |  |
-|  |  07:ANALYTIC
-|  |  |  functions: rank()
-|  |  |  order by: avg(ss_net_profit) ASC
-|  |  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  |  row-size=36B cardinality=17.98K
-|  |  |
-|  |  06:SORT
-|  |  |  order by: avg(ss_net_profit) ASC
-|  |  |  row-size=28B cardinality=17.98K
-|  |  |
-|  |  05:NESTED LOOP JOIN [INNER JOIN]
-|  |  |  predicates: avg(ss_net_profit) > 0.9 * avg(ss_net_profit)
-|  |  |  row-size=28B cardinality=17.98K
-|  |  |
-|  |  |--04:CARDINALITY CHECK
-|  |  |  |  limit: 1
-|  |  |  |  row-size=12B cardinality=1
-|  |  |  |
-|  |  |  03:AGGREGATE [FINALIZE]
-|  |  |  |  output: avg(ss_net_profit)
-|  |  |  |  group by: ss_store_sk
-|  |  |  |  limit: 2
-|  |  |  |  row-size=12B cardinality=2
-|  |  |  |
-|  |  |  02:SCAN HDFS [tpcds.store_sales]
-|  |  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |  |     predicates: ss_addr_sk IS NULL, ss_store_sk = 4
-|  |  |     row-size=12B cardinality=53.06K
-|  |  |
-|  |  01:AGGREGATE [FINALIZE]
-|  |  |  output: avg(ss_net_profit)
-|  |  |  group by: ss_item_sk
-|  |  |  row-size=16B cardinality=17.98K
-|  |  |
-|  |  00:SCAN HDFS [tpcds.store_sales ss1]
-|  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |     predicates: ss_store_sk = 4
-|  |     row-size=16B cardinality=480.07K
-|  |
-|  18:SCAN HDFS [tpcds.item i1]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     runtime filters: RF002 -> i1.i_item_sk
-|     row-size=38B cardinality=18.00K
-|
-19:SCAN HDFS [tpcds.item i2]
-   HDFS partitions=1/1 files=1 size=4.82MB
-   runtime filters: RF000 -> i2.i_item_sk
-   row-size=38B cardinality=18.00K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=90.56MB Threads=21
-Per-Host Resource Estimates: Memory=685MB
-PLAN-ROOT SINK
-|
-41:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: rnk ASC
-|  limit: 100
-|
-23:TOP-N [LIMIT=100]
-|  order by: rnk ASC
-|  row-size=68B cardinality=100
-|
-22:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: i2.i_item_sk = ss_item_sk
-|  runtime filters: RF000 <- ss_item_sk
-|  row-size=148B cardinality=1.80K
-|
-|--40:EXCHANGE [BROADCAST]
-|  |
-|  21:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: rank() = rank()
-|  |  row-size=110B cardinality=1.80K
-|  |
-|  |--39:EXCHANGE [UNPARTITIONED]
-|  |  |
-|  |  20:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: ss_item_sk = i1.i_item_sk
-|  |  |  row-size=74B cardinality=1.80K
-|  |  |
-|  |  |--38:EXCHANGE [UNPARTITIONED]
-|  |  |  |
-|  |  |  18:SCAN HDFS [tpcds.item i1]
-|  |  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |  |     row-size=38B cardinality=18.00K
-|  |  |
-|  |  08:SELECT
-|  |  |  predicates: rank() < 11
-|  |  |  row-size=36B cardinality=1.80K
-|  |  |
-|  |  07:ANALYTIC
-|  |  |  functions: rank()
-|  |  |  order by: avg(ss_net_profit) ASC
-|  |  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  |  row-size=36B cardinality=17.98K
-|  |  |
-|  |  37:MERGING-EXCHANGE [UNPARTITIONED]
-|  |  |  order by: avg(ss_net_profit) ASC
-|  |  |
-|  |  06:SORT
-|  |  |  order by: avg(ss_net_profit) ASC
-|  |  |  row-size=28B cardinality=17.98K
-|  |  |
-|  |  05:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
-|  |  |  predicates: avg(ss_net_profit) > 0.9 * avg(ss_net_profit)
-|  |  |  row-size=28B cardinality=17.98K
-|  |  |
-|  |  |--36:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  04:CARDINALITY CHECK
-|  |  |  |  limit: 1
-|  |  |  |  row-size=12B cardinality=1
-|  |  |  |
-|  |  |  35:EXCHANGE [UNPARTITIONED]
-|  |  |  |  limit: 2
-|  |  |  |
-|  |  |  34:AGGREGATE [FINALIZE]
-|  |  |  |  output: avg:merge(ss_net_profit)
-|  |  |  |  group by: ss_store_sk
-|  |  |  |  limit: 2
-|  |  |  |  row-size=12B cardinality=2
-|  |  |  |
-|  |  |  33:EXCHANGE [HASH(ss_store_sk)]
-|  |  |  |
-|  |  |  03:AGGREGATE [STREAMING]
-|  |  |  |  output: avg(ss_net_profit)
-|  |  |  |  group by: ss_store_sk
-|  |  |  |  row-size=12B cardinality=6
-|  |  |  |
-|  |  |  02:SCAN HDFS [tpcds.store_sales]
-|  |  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |  |     predicates: ss_addr_sk IS NULL, ss_store_sk = 4
-|  |  |     row-size=12B cardinality=53.06K
-|  |  |
-|  |  32:AGGREGATE [FINALIZE]
-|  |  |  output: avg:merge(ss_net_profit)
-|  |  |  group by: ss_item_sk
-|  |  |  row-size=16B cardinality=17.98K
-|  |  |
-|  |  31:EXCHANGE [HASH(ss_item_sk)]
-|  |  |
-|  |  01:AGGREGATE [STREAMING]
-|  |  |  output: avg(ss_net_profit)
-|  |  |  group by: ss_item_sk
-|  |  |  row-size=16B cardinality=17.98K
-|  |  |
-|  |  00:SCAN HDFS [tpcds.store_sales ss1]
-|  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |     predicates: ss_store_sk = 4
-|  |     row-size=16B cardinality=480.07K
-|  |
-|  17:SELECT
-|  |  predicates: rank() < 11
-|  |  row-size=36B cardinality=1.80K
-|  |
-|  16:ANALYTIC
-|  |  functions: rank()
-|  |  order by: avg(ss_net_profit) DESC
-|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  row-size=36B cardinality=17.98K
-|  |
-|  30:MERGING-EXCHANGE [UNPARTITIONED]
-|  |  order by: avg(ss_net_profit) DESC
-|  |
-|  15:SORT
-|  |  order by: avg(ss_net_profit) DESC
-|  |  row-size=28B cardinality=17.98K
-|  |
-|  14:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
-|  |  predicates: avg(ss_net_profit) > 0.9 * avg(ss_net_profit)
-|  |  row-size=28B cardinality=17.98K
-|  |
-|  |--29:EXCHANGE [BROADCAST]
-|  |  |
-|  |  13:CARDINALITY CHECK
-|  |  |  limit: 1
-|  |  |  row-size=12B cardinality=1
-|  |  |
-|  |  28:EXCHANGE [UNPARTITIONED]
-|  |  |  limit: 2
-|  |  |
-|  |  27:AGGREGATE [FINALIZE]
-|  |  |  output: avg:merge(ss_net_profit)
-|  |  |  group by: ss_store_sk
-|  |  |  limit: 2
-|  |  |  row-size=12B cardinality=2
-|  |  |
-|  |  26:EXCHANGE [HASH(ss_store_sk)]
-|  |  |
-|  |  12:AGGREGATE [STREAMING]
-|  |  |  output: avg(ss_net_profit)
-|  |  |  group by: ss_store_sk
-|  |  |  row-size=12B cardinality=6
-|  |  |
-|  |  11:SCAN HDFS [tpcds.store_sales]
-|  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |     predicates: ss_addr_sk IS NULL, ss_store_sk = 4
-|  |     row-size=12B cardinality=53.06K
-|  |
-|  25:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  group by: ss_item_sk
-|  |  row-size=16B cardinality=17.98K
-|  |
-|  24:EXCHANGE [HASH(ss_item_sk)]
-|  |
-|  10:AGGREGATE [STREAMING]
-|  |  output: avg(ss_net_profit)
-|  |  group by: ss_item_sk
-|  |  row-size=16B cardinality=17.98K
-|  |
-|  09:SCAN HDFS [tpcds.store_sales ss1]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_store_sk = 4
-|     row-size=16B cardinality=480.07K
-|
-19:SCAN HDFS [tpcds.item i2]
-   HDFS partitions=1/1 files=1 size=4.82MB
-   runtime filters: RF000 -> i2.i_item_sk
-   row-size=38B cardinality=18.00K
----- PARALLELPLANS
-Max Per-Host Resource Reservation: Memory=157.12MB Threads=28
-Per-Host Resource Estimates: Memory=368MB
-PLAN-ROOT SINK
-|
-41:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: rnk ASC
-|  limit: 100
-|
-23:TOP-N [LIMIT=100]
-|  order by: rnk ASC
-|  row-size=68B cardinality=100
-|
-22:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: i2.i_item_sk = ss_item_sk
-|  row-size=148B cardinality=1.80K
-|
-|--JOIN BUILD
-|  |  join-table-id=00 plan-id=01 cohort-id=01
-|  |  build expressions: ss_item_sk
-|  |  runtime filters: RF000 <- ss_item_sk
-|  |
-|  40:EXCHANGE [BROADCAST]
-|  |
-|  21:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: rank() = rank()
-|  |  row-size=110B cardinality=1.80K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=01 plan-id=02 cohort-id=02
-|  |  |  build expressions: rank()
-|  |  |
-|  |  39:EXCHANGE [UNPARTITIONED]
-|  |  |
-|  |  20:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: ss_item_sk = i1.i_item_sk
-|  |  |  row-size=74B cardinality=1.80K
-|  |  |
-|  |  |--JOIN BUILD
-|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
-|  |  |  |  build expressions: i1.i_item_sk
-|  |  |  |
-|  |  |  38:EXCHANGE [UNPARTITIONED]
-|  |  |  |
-|  |  |  18:SCAN HDFS [tpcds.item i1]
-|  |  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |  |     row-size=38B cardinality=18.00K
-|  |  |
-|  |  08:SELECT
-|  |  |  predicates: rank() < 11
-|  |  |  row-size=36B cardinality=1.80K
-|  |  |
-|  |  07:ANALYTIC
-|  |  |  functions: rank()
-|  |  |  order by: avg(ss_net_profit) ASC
-|  |  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  |  row-size=36B cardinality=17.98K
-|  |  |
-|  |  37:MERGING-EXCHANGE [UNPARTITIONED]
-|  |  |  order by: avg(ss_net_profit) ASC
-|  |  |
-|  |  06:SORT
-|  |  |  order by: avg(ss_net_profit) ASC
-|  |  |  row-size=28B cardinality=17.98K
-|  |  |
-|  |  05:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
-|  |  |  join table id: 03
-|  |  |  predicates: avg(ss_net_profit) > 0.9 * avg(ss_net_profit)
-|  |  |  row-size=28B cardinality=17.98K
-|  |  |
-|  |  |--JOIN BUILD
-|  |  |  |  join-table-id=03 plan-id=04 cohort-id=03
-|  |  |  |
-|  |  |  36:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  04:CARDINALITY CHECK
-|  |  |  |  limit: 1
-|  |  |  |  row-size=12B cardinality=1
-|  |  |  |
-|  |  |  35:EXCHANGE [UNPARTITIONED]
-|  |  |  |  limit: 2
-|  |  |  |
-|  |  |  34:AGGREGATE [FINALIZE]
-|  |  |  |  output: avg:merge(ss_net_profit)
-|  |  |  |  group by: ss_store_sk
-|  |  |  |  limit: 2
-|  |  |  |  row-size=12B cardinality=2
-|  |  |  |
-|  |  |  33:EXCHANGE [HASH(ss_store_sk)]
-|  |  |  |
-|  |  |  03:AGGREGATE [STREAMING]
-|  |  |  |  output: avg(ss_net_profit)
-|  |  |  |  group by: ss_store_sk
-|  |  |  |  row-size=12B cardinality=6
-|  |  |  |
-|  |  |  02:SCAN HDFS [tpcds.store_sales]
-|  |  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |  |     predicates: ss_addr_sk IS NULL, ss_store_sk = 4
-|  |  |     row-size=12B cardinality=53.06K
-|  |  |
-|  |  32:AGGREGATE [FINALIZE]
-|  |  |  output: avg:merge(ss_net_profit)
-|  |  |  group by: ss_item_sk
-|  |  |  row-size=16B cardinality=17.98K
-|  |  |
-|  |  31:EXCHANGE [HASH(ss_item_sk)]
-|  |  |
-|  |  01:AGGREGATE [STREAMING]
-|  |  |  output: avg(ss_net_profit)
-|  |  |  group by: ss_item_sk
-|  |  |  row-size=16B cardinality=17.98K
-|  |  |
-|  |  00:SCAN HDFS [tpcds.store_sales ss1]
-|  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |     predicates: ss_store_sk = 4
-|  |     row-size=16B cardinality=480.07K
-|  |
-|  17:SELECT
-|  |  predicates: rank() < 11
-|  |  row-size=36B cardinality=1.80K
-|  |
-|  16:ANALYTIC
-|  |  functions: rank()
-|  |  order by: avg(ss_net_profit) DESC
-|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  row-size=36B cardinality=17.98K
-|  |
-|  30:MERGING-EXCHANGE [UNPARTITIONED]
-|  |  order by: avg(ss_net_profit) DESC
-|  |
-|  15:SORT
-|  |  order by: avg(ss_net_profit) DESC
-|  |  row-size=28B cardinality=17.98K
-|  |
-|  14:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
-|  |  join table id: 04
-|  |  predicates: avg(ss_net_profit) > 0.9 * avg(ss_net_profit)
-|  |  row-size=28B cardinality=17.98K
-|  |
-|  |--JOIN BUILD
-|  |  |  join-table-id=04 plan-id=05 cohort-id=02
-|  |  |
-|  |  29:EXCHANGE [BROADCAST]
-|  |  |
-|  |  13:CARDINALITY CHECK
-|  |  |  limit: 1
-|  |  |  row-size=12B cardinality=1
-|  |  |
-|  |  28:EXCHANGE [UNPARTITIONED]
-|  |  |  limit: 2
-|  |  |
-|  |  27:AGGREGATE [FINALIZE]
-|  |  |  output: avg:merge(ss_net_profit)
-|  |  |  group by: ss_store_sk
-|  |  |  limit: 2
-|  |  |  row-size=12B cardinality=2
-|  |  |
-|  |  26:EXCHANGE [HASH(ss_store_sk)]
-|  |  |
-|  |  12:AGGREGATE [STREAMING]
-|  |  |  output: avg(ss_net_profit)
-|  |  |  group by: ss_store_sk
-|  |  |  row-size=12B cardinality=6
-|  |  |
-|  |  11:SCAN HDFS [tpcds.store_sales]
-|  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |     predicates: ss_addr_sk IS NULL, ss_store_sk = 4
-|  |     row-size=12B cardinality=53.06K
-|  |
-|  25:AGGREGATE [FINALIZE]
-|  |  output: avg:merge(ss_net_profit)
-|  |  group by: ss_item_sk
-|  |  row-size=16B cardinality=17.98K
-|  |
-|  24:EXCHANGE [HASH(ss_item_sk)]
-|  |
-|  10:AGGREGATE [STREAMING]
-|  |  output: avg(ss_net_profit)
-|  |  group by: ss_item_sk
-|  |  row-size=16B cardinality=17.98K
-|  |
-|  09:SCAN HDFS [tpcds.store_sales ss1]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     predicates: ss_store_sk = 4
-|     row-size=16B cardinality=480.07K
-|
-19:SCAN HDFS [tpcds.item i2]
-   HDFS partitions=1/1 files=1 size=4.82MB
-   runtime filters: RF000 -> i2.i_item_sk
-   row-size=38B cardinality=18.00K
-====
-# TPCDS-Q45
-SELECT ca_zip,
-       ca_city,
-       sum(ws_sales_price)
-FROM web_sales,
-     customer,
-     customer_address,
-     date_dim,
-     item
-WHERE ws_bill_customer_sk = c_customer_sk
-  AND c_current_addr_sk = ca_address_sk
-  AND ws_item_sk = i_item_sk
-  AND (SUBSTRING(ca_zip,1,5) IN ('85669',
-                              '86197',
-                              '88274',
-                              '83405',
-                              '86475',
-                              '85392',
-                              '85460',
-                              '80348',
-                              '81792')
-       OR i_item_id IN
-         (SELECT i_item_id
-          FROM item
-          WHERE i_item_sk IN (2,
-                              3,
-                              5,
-                              7,
-                              11,
-                              13,
-                              17,
-                              19,
-                              23,
-                              29) ))
-  AND ws_sold_date_sk = d_date_sk
-  AND d_qoy = 2
-  AND d_year = 2001
-GROUP BY ca_zip,
-         ca_city
-ORDER BY ca_zip,
-         ca_city
-LIMIT 100;
----- PLAN
-Max Per-Host Resource Reservation: Memory=62.62MB Threads=7
-Per-Host Resource Estimates: Memory=375MB
-PLAN-ROOT SINK
-|
-13:TOP-N [LIMIT=100]
-|  order by: ca_zip ASC, ca_city ASC
-|  row-size=54B cardinality=100
-|
-12:AGGREGATE [FINALIZE]
-|  output: sum(ws_sales_price)
-|  group by: ca_zip, ca_city
-|  row-size=54B cardinality=73.80K
-|
-11:HASH JOIN [LEFT OUTER JOIN]
-|  hash predicates: i_item_id = i_item_id
-|  other predicates: (substring(ca_zip, 1, 5) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792') OR i_item_id IS NOT NULL)
-|  row-size=146B cardinality=73.80K
-|
-|--06:AGGREGATE [FINALIZE]
-|  |  group by: i_item_id
-|  |  row-size=28B cardinality=10
-|  |
-|  05:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_item_sk IN (2, 3, 5, 7, 11, 13, 17, 19, 23, 29)
-|     row-size=36B cardinality=10
-|
-10:HASH JOIN [INNER JOIN]
-|  hash predicates: ws_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=118B cardinality=73.80K
-|
-|--04:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-09:HASH JOIN [INNER JOIN]
-|  hash predicates: c_current_addr_sk = ca_address_sk
-|  runtime filters: RF002 <- ca_address_sk
-|  row-size=82B cardinality=73.80K
-|
-|--02:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=42B cardinality=50.00K
-|
-08:HASH JOIN [INNER JOIN]
-|  hash predicates: ws_bill_customer_sk = c_customer_sk
-|  runtime filters: RF004 <- c_customer_sk
-|  row-size=40B cardinality=73.80K
-|
-|--01:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF002 -> c_current_addr_sk
-|     row-size=8B cardinality=100.00K
-|
-07:HASH JOIN [INNER JOIN]
-|  hash predicates: ws_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=32B cardinality=73.80K
-|
-|--03:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 2001, d_qoy = 2
-|     row-size=12B cardinality=186
-|
-00:SCAN HDFS [tpcds.web_sales]
-   HDFS partitions=1/1 files=1 size=140.07MB
-   runtime filters: RF000 -> ws_item_sk, RF004 -> ws_bill_customer_sk, RF006 -> ws_sold_date_sk
-   row-size=20B cardinality=719.38K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=77.38MB Threads=16
-Per-Host Resource Estimates: Memory=415MB
-PLAN-ROOT SINK
-|
-24:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: ca_zip ASC, ca_city ASC
-|  limit: 100
-|
-13:TOP-N [LIMIT=100]
-|  order by: ca_zip ASC, ca_city ASC
-|  row-size=54B cardinality=100
-|
-23:AGGREGATE [FINALIZE]
-|  output: sum:merge(ws_sales_price)
-|  group by: ca_zip, ca_city
-|  row-size=54B cardinality=73.80K
-|
-22:EXCHANGE [HASH(ca_zip,ca_city)]
-|
-12:AGGREGATE [STREAMING]
-|  output: sum(ws_sales_price)
-|  group by: ca_zip, ca_city
-|  row-size=54B cardinality=73.80K
-|
-11:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
-|  hash predicates: i_item_id = i_item_id
-|  other predicates: (substring(ca_zip, 1, 5) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792') OR i_item_id IS NOT NULL)
-|  row-size=146B cardinality=73.80K
-|
-|--21:EXCHANGE [BROADCAST]
-|  |
-|  20:AGGREGATE [FINALIZE]
-|  |  group by: i_item_id
-|  |  row-size=28B cardinality=10
-|  |
-|  19:EXCHANGE [HASH(i_item_id)]
-|  |
-|  06:AGGREGATE [STREAMING]
-|  |  group by: i_item_id
-|  |  row-size=28B cardinality=10
-|  |
-|  05:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_item_sk IN (2, 3, 5, 7, 11, 13, 17, 19, 23, 29)
-|     row-size=36B cardinality=10
-|
-10:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ws_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=118B cardinality=73.80K
-|
-|--18:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-09:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: c_current_addr_sk = ca_address_sk
-|  runtime filters: RF002 <- ca_address_sk
-|  row-size=82B cardinality=73.80K
-|
-|--17:EXCHANGE [HASH(ca_address_sk)]
-|  |
-|  02:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     row-size=42B cardinality=50.00K
-|
-16:EXCHANGE [HASH(c_current_addr_sk)]
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ws_bill_customer_sk = c_customer_sk
-|  runtime filters: RF004 <- c_customer_sk
-|  row-size=40B cardinality=73.80K
-|
-|--15:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF002 -> c_current_addr_sk
-|     row-size=8B cardinality=100.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ws_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=32B cardinality=73.80K
-|
-|--14:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 2001, d_qoy = 2
-|     row-size=12B cardinality=186
-|
-00:SCAN HDFS [tpcds.web_sales]
-   HDFS partitions=1/1 files=1 size=140.07MB
-   runtime filters: RF000 -> ws_item_sk, RF004 -> ws_bill_customer_sk, RF006 -> ws_sold_date_sk
-   row-size=20B cardinality=719.38K
-====
-# TPCDS-Q18
-select  i_item_id,
-        ca_country,
-        ca_state,
-        ca_county,
-        avg( cast(cs_quantity as decimal(12,2))) agg1,
-        avg( cast(cs_list_price as decimal(12,2))) agg2,
-        avg( cast(cs_coupon_amt as decimal(12,2))) agg3,
-        avg( cast(cs_sales_price as decimal(12,2))) agg4,
-        avg( cast(cs_net_profit as decimal(12,2))) agg5,
-        avg( cast(c_birth_year as decimal(12,2))) agg6,
-        avg( cast(cd1.cd_dep_count as decimal(12,2))) agg7
- from catalog_sales, customer_demographics cd1,
-      customer_demographics cd2, customer, customer_address, date_dim, item
- where cs_sold_date_sk = d_date_sk and
-       cs_item_sk = i_item_sk and
-       cs_bill_cdemo_sk = cd1.cd_demo_sk and
-       cs_bill_customer_sk = c_customer_sk and
-       cd1.cd_gender = 'M' and
-       cd1.cd_education_status = 'College' and
-       c_current_cdemo_sk = cd2.cd_demo_sk and
-       c_current_addr_sk = ca_address_sk and
-       c_birth_month in (9,5,12,4,1,10) and
-       d_year = 2001 and
-       ca_state in ('ND','WI','AL'
-                   ,'NC','OK','MS','TN')
- group by rollup (i_item_id, ca_country, ca_state, ca_county)
- order by ca_country,
-        ca_state,
-        ca_county,
-        i_item_id
- limit 100;
----- PLAN
-Max Per-Host Resource Reservation: Memory=111.38MB Threads=8
-Per-Host Resource Estimates: Memory=702MB
-PLAN-ROOT SINK
-|
-15:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_country WHEN 10 THEN ca_country WHEN 12 THEN ca_country WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_state WHEN 10 THEN ca_state WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_county WHEN 10 THEN NULL WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN i_item_id WHEN 10 THEN i_item_id WHEN 12 THEN i_item_id WHEN 14 THEN i_item_id WHEN 16 THEN NULL END ASC
-|  row-size=104B cardinality=100
-|
-14:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) END)
-|  group by: CASE valid_tid(16,8,10,12,14) WHEN 8 THEN i_item_id WHEN 10 THEN i_item_id WHEN 12 THEN i_item_id WHEN 14 THEN i_item_id WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_country WHEN 10 THEN ca_country WHEN 12 THEN ca_country WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_state WHEN 10 THEN ca_state WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_county WHEN 10 THEN NULL WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN 8 WHEN 10 THEN 10 WHEN 12 THEN 12 WHEN 14 THEN 14 WHEN 16 THEN 16 END
-|  row-size=108B cardinality=75.61K
-|
-13:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, ca_country, ca_state, ca_county
-|  Class 1
-|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, ca_country, ca_state, NULL
-|  Class 2
-|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, ca_country, NULL, NULL
-|  Class 3
-|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, NULL, NULL, NULL
-|  Class 4
-|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: NULL, NULL, NULL, NULL
-|  row-size=641B cardinality=75.61K
-|
-12:HASH JOIN [INNER JOIN]
-|  hash predicates: cs_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=220B cardinality=28.95K
-|
-|--06:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-11:HASH JOIN [INNER JOIN]
-|  hash predicates: cd2.cd_demo_sk = c_current_cdemo_sk
-|  runtime filters: RF002 <- c_current_cdemo_sk
-|  row-size=184B cardinality=28.95K
-|
-|--10:HASH JOIN [INNER JOIN]
-|  |  hash predicates: cd1.cd_demo_sk = cs_bill_cdemo_sk
-|  |  runtime filters: RF004 <- cs_bill_cdemo_sk
-|  |  row-size=180B cardinality=28.95K
-|  |
-|  |--09:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: c_current_addr_sk = ca_address_sk
-|  |  |  runtime filters: RF006 <- ca_address_sk
-|  |  |  row-size=137B cardinality=28.95K
-|  |  |
-|  |  |--04:SCAN HDFS [tpcds.customer_address]
-|  |  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |  |     predicates: ca_state IN ('ND', 'WI', 'AL', 'NC', 'OK', 'MS', 'TN')
-|  |  |     row-size=69B cardinality=6.86K
-|  |  |
-|  |  08:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: cs_bill_customer_sk = c_customer_sk
-|  |  |  runtime filters: RF008 <- c_customer_sk
-|  |  |  row-size=68B cardinality=181.77K
-|  |  |
-|  |  |--03:SCAN HDFS [tpcds.customer]
-|  |  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |  |     predicates: c_birth_month IN (9, 5, 12, 4, 1, 10)
-|  |  |     runtime filters: RF006 -> c_current_addr_sk
-|  |  |     row-size=20B cardinality=50.00K
-|  |  |
-|  |  07:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
-|  |  |  runtime filters: RF010 <- d_date_sk
-|  |  |  row-size=48B cardinality=294.63K
-|  |  |
-|  |  |--05:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_year = 2001
-|  |  |     row-size=8B cardinality=373
-|  |  |
-|  |  00:SCAN HDFS [tpcds.catalog_sales]
-|  |     HDFS partitions=1/1 files=1 size=282.20MB
-|  |     runtime filters: RF000 -> cs_item_sk, RF008 -> cs_bill_customer_sk, RF010 -> cs_sold_date_sk
-|  |     row-size=40B cardinality=1.44M
-|  |
-|  01:SCAN HDFS [tpcds.customer_demographics cd1]
-|     HDFS partitions=1/1 files=1 size=76.92MB
-|     predicates: cd1.cd_gender = 'M', cd1.cd_education_status = 'College'
-|     runtime filters: RF004 -> cd1.cd_demo_sk
-|     row-size=43B cardinality=194.03K
-|
-02:SCAN HDFS [tpcds.customer_demographics cd2]
-   HDFS partitions=1/1 files=1 size=76.92MB
-   runtime filters: RF002 -> cd2.cd_demo_sk
-   row-size=4B cardinality=1.92M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=228.94MB Threads=18
-Per-Host Resource Estimates: Memory=911MB
-PLAN-ROOT SINK
-|
-26:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_country WHEN 10 THEN ca_country WHEN 12 THEN ca_country WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_state WHEN 10 THEN ca_state WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_county WHEN 10 THEN NULL WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN i_item_id WHEN 10 THEN i_item_id WHEN 12 THEN i_item_id WHEN 14 THEN i_item_id WHEN 16 THEN NULL END ASC
-|  limit: 100
-|
-15:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_country WHEN 10 THEN ca_country WHEN 12 THEN ca_country WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_state WHEN 10 THEN ca_state WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_county WHEN 10 THEN NULL WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN i_item_id WHEN 10 THEN i_item_id WHEN 12 THEN i_item_id WHEN 14 THEN i_item_id WHEN 16 THEN NULL END ASC
-|  row-size=104B cardinality=100
-|
-14:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) END)
-|  group by: CASE valid_tid(16,8,10,12,14) WHEN 8 THEN i_item_id WHEN 10 THEN i_item_id WHEN 12 THEN i_item_id WHEN 14 THEN i_item_id WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_country WHEN 10 THEN ca_country WHEN 12 THEN ca_country WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_state WHEN 10 THEN ca_state WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_county WHEN 10 THEN NULL WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN 8 WHEN 10 THEN 10 WHEN 12 THEN 12 WHEN 14 THEN 14 WHEN 16 THEN 16 END
-|  row-size=108B cardinality=75.61K
-|
-25:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: avg:merge(CAST(cs_quantity AS DECIMAL(12,2))), avg:merge(CAST(cs_list_price AS DECIMAL(12,2))), avg:merge(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg:merge(CAST(cs_sales_price AS DECIMAL(12,2))), avg:merge(CAST(cs_net_profit AS DECIMAL(12,2))), avg:merge(CAST(c_birth_year AS DECIMAL(12,2))), avg:merge(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, ca_country, ca_state, ca_county
-|  Class 1
-|    output: avg:merge(CAST(cs_quantity AS DECIMAL(12,2))), avg:merge(CAST(cs_list_price AS DECIMAL(12,2))), avg:merge(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg:merge(CAST(cs_sales_price AS DECIMAL(12,2))), avg:merge(CAST(cs_net_profit AS DECIMAL(12,2))), avg:merge(CAST(c_birth_year AS DECIMAL(12,2))), avg:merge(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, ca_country, ca_state, NULL
-|  Class 2
-|    output: avg:merge(CAST(cs_quantity AS DECIMAL(12,2))), avg:merge(CAST(cs_list_price AS DECIMAL(12,2))), avg:merge(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg:merge(CAST(cs_sales_price AS DECIMAL(12,2))), avg:merge(CAST(cs_net_profit AS DECIMAL(12,2))), avg:merge(CAST(c_birth_year AS DECIMAL(12,2))), avg:merge(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, ca_country, NULL, NULL
-|  Class 3
-|    output: avg:merge(CAST(cs_quantity AS DECIMAL(12,2))), avg:merge(CAST(cs_list_price AS DECIMAL(12,2))), avg:merge(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg:merge(CAST(cs_sales_price AS DECIMAL(12,2))), avg:merge(CAST(cs_net_profit AS DECIMAL(12,2))), avg:merge(CAST(c_birth_year AS DECIMAL(12,2))), avg:merge(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, NULL, NULL, NULL
-|  Class 4
-|    output: avg:merge(CAST(cs_quantity AS DECIMAL(12,2))), avg:merge(CAST(cs_list_price AS DECIMAL(12,2))), avg:merge(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg:merge(CAST(cs_sales_price AS DECIMAL(12,2))), avg:merge(CAST(cs_net_profit AS DECIMAL(12,2))), avg:merge(CAST(c_birth_year AS DECIMAL(12,2))), avg:merge(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: NULL, NULL, NULL, NULL
-|  row-size=641B cardinality=75.61K
-|
-24:EXCHANGE [HASH(CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(i_item_id) WHEN 9 THEN murmur_hash(i_item_id) WHEN 11 THEN murmur_hash(i_item_id) WHEN 13 THEN murmur_hash(i_item_id) WHEN 15 THEN murmur_hash(NULL) END,CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(ca_country) WHEN 9 THEN murmur_hash(ca_country) WHEN 11 THEN murmur_hash(ca_country) WHEN 13 THEN murmur_hash(NULL) WHEN 15 THEN murmur_hash(NULL) END,CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(ca_state) WHEN 9 THEN murmur_hash(ca_state) WHEN 11 THEN murmur_hash(NULL) WHEN 13 THEN murmur_hash(NULL) WHEN 15 THEN murmur_hash(NULL) END,CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(ca_county) WHEN 9 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 13 THEN murmur_hash(NULL) WHEN 15 THEN murmur_hash(NULL) END)]
-|
-13:AGGREGATE [STREAMING]
-|  Class 0
-|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, ca_country, ca_state, ca_county
-|  Class 1
-|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, ca_country, ca_state, NULL
-|  Class 2
-|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, ca_country, NULL, NULL
-|  Class 3
-|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: i_item_id, NULL, NULL, NULL
-|  Class 4
-|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
-|    group by: NULL, NULL, NULL, NULL
-|  row-size=641B cardinality=75.61K
-|
-12:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: cs_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=220B cardinality=28.95K
-|
-|--23:EXCHANGE [BROADCAST]
-|  |
-|  06:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-11:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: c_current_cdemo_sk = cd2.cd_demo_sk
-|  runtime filters: RF002 <- cd2.cd_demo_sk
-|  row-size=184B cardinality=28.95K
-|
-|--22:EXCHANGE [HASH(cd2.cd_demo_sk)]
-|  |
-|  02:SCAN HDFS [tpcds.customer_demographics cd2]
-|     HDFS partitions=1/1 files=1 size=76.92MB
-|     row-size=4B cardinality=1.92M
-|
-21:EXCHANGE [HASH(c_current_cdemo_sk)]
-|
-10:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: cs_bill_cdemo_sk = cd1.cd_demo_sk
-|  runtime filters: RF004 <- cd1.cd_demo_sk
-|  row-size=180B cardinality=28.95K
-|
-|--20:EXCHANGE [HASH(cd1.cd_demo_sk)]
-|  |
-|  01:SCAN HDFS [tpcds.customer_demographics cd1]
-|     HDFS partitions=1/1 files=1 size=76.92MB
-|     predicates: cd1.cd_gender = 'M', cd1.cd_education_status = 'College'
-|     row-size=43B cardinality=194.03K
-|
-19:EXCHANGE [HASH(cs_bill_cdemo_sk)]
-|
-09:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: c_current_addr_sk = ca_address_sk
-|  runtime filters: RF006 <- ca_address_sk
-|  row-size=137B cardinality=28.95K
-|
-|--18:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     predicates: ca_state IN ('ND', 'WI', 'AL', 'NC', 'OK', 'MS', 'TN')
-|     row-size=69B cardinality=6.86K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: cs_bill_customer_sk = c_customer_sk
-|  runtime filters: RF008 <- c_customer_sk
-|  row-size=68B cardinality=181.77K
-|
-|--17:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     predicates: c_birth_month IN (9, 5, 12, 4, 1, 10)
-|     runtime filters: RF002 -> c_current_cdemo_sk, RF006 -> c_current_addr_sk
-|     row-size=20B cardinality=50.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: cs_sold_date_sk = d_date_sk
-|  runtime filters: RF010 <- d_date_sk
-|  row-size=48B cardinality=294.63K
-|
-|--16:EXCHANGE [BROADCAST]
-|  |
-|  05:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 2001
-|     row-size=8B cardinality=373
-|
-00:SCAN HDFS [tpcds.catalog_sales]
-   HDFS partitions=1/1 files=1 size=282.20MB
-   runtime filters: RF000 -> cs_item_sk, RF004 -> cs_bill_cdemo_sk, RF008 -> cs_bill_customer_sk, RF010 -> cs_sold_date_sk
-   row-size=40B cardinality=1.44M
-====
-# TPCDS-Q22
-select  i_product_name
-             ,i_brand
-             ,i_class
-             ,i_category
-             ,avg(inv_quantity_on_hand) qoh
-       from inventory
-           ,date_dim
-           ,item
-           ,warehouse
-       where inv_date_sk=d_date_sk
-              and inv_item_sk=i_item_sk
-              and inv_warehouse_sk = w_warehouse_sk
-              and d_month_seq between 1212 and 1212 + 11
-       group by rollup(i_product_name
-                       ,i_brand
-                       ,i_class
-                       ,i_category)
-order by qoh, i_product_name, i_brand, i_class, i_category
-limit 100;
----- PLAN
-Max Per-Host Resource Reservation: Memory=149.44MB Threads=5
-Per-Host Resource Estimates: Memory=17.43GB
-PLAN-ROOT SINK
-|
-09:TOP-N [LIMIT=100]
-|  order by: aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END) ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_brand WHEN 7 THEN i_brand WHEN 9 THEN i_brand WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_class WHEN 7 THEN i_class WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_category WHEN 7 THEN NULL WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC
-|  row-size=56B cardinality=100
-|
-08:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END)
-|  group by: CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_brand WHEN 7 THEN i_brand WHEN 9 THEN i_brand WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_class WHEN 7 THEN i_class WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_category WHEN 7 THEN NULL WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN 5 WHEN 7 THEN 7 WHEN 9 THEN 9 WHEN 11 THEN 11 WHEN 13 THEN 13 END
-|  row-size=60B cardinality=35.25M
-|
-07:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: avg(inv_quantity_on_hand)
-|    group by: i_product_name, i_brand, i_class, i_category
-|  Class 1
-|    output: avg(inv_quantity_on_hand)
-|    group by: i_product_name, i_brand, i_class, NULL
-|  Class 2
-|    output: avg(inv_quantity_on_hand)
-|    group by: i_product_name, i_brand, NULL, NULL
-|  Class 3
-|    output: avg(inv_quantity_on_hand)
-|    group by: i_product_name, NULL, NULL, NULL
-|  Class 4
-|    output: avg(inv_quantity_on_hand)
-|    group by: NULL, NULL, NULL, NULL
-|  row-size=422B cardinality=35.25M
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: inv_warehouse_sk = w_warehouse_sk
-|  runtime filters: RF000 <- w_warehouse_sk
-|  row-size=136B cardinality=11.74M
-|
-|--03:SCAN HDFS [tpcds.warehouse]
-|     HDFS partitions=1/1 files=1 size=585B
-|     row-size=4B cardinality=5
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: inv_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=132B cardinality=11.74M
-|
-|--02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=104B cardinality=18.00K
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: inv_date_sk = d_date_sk
-|  runtime filters: RF004 <- d_date_sk
-|  row-size=28B cardinality=11.74M
-|
-|--01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|     row-size=8B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.inventory]
-   HDFS partitions=1/1 files=1 size=225.47MB
-   runtime filters: RF000 -> inv_warehouse_sk, RF002 -> inv_item_sk, RF004 -> inv_date_sk
-   row-size=20B cardinality=11.74M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=293.20MB Threads=10
-Per-Host Resource Estimates: Memory=41.64GB
-PLAN-ROOT SINK
-|
-15:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END) ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_brand WHEN 7 THEN i_brand WHEN 9 THEN i_brand WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_class WHEN 7 THEN i_class WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_category WHEN 7 THEN NULL WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC
-|  limit: 100
-|
-09:TOP-N [LIMIT=100]
-|  order by: aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END) ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_brand WHEN 7 THEN i_brand WHEN 9 THEN i_brand WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_class WHEN 7 THEN i_class WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_category WHEN 7 THEN NULL WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC
-|  row-size=56B cardinality=100
-|
-08:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END)
-|  group by: CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_brand WHEN 7 THEN i_brand WHEN 9 THEN i_brand WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_class WHEN 7 THEN i_class WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_category WHEN 7 THEN NULL WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN 5 WHEN 7 THEN 7 WHEN 9 THEN 9 WHEN 11 THEN 11 WHEN 13 THEN 13 END
-|  row-size=60B cardinality=35.25M
-|
-14:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: avg:merge(inv_quantity_on_hand)
-|    group by: i_product_name, i_brand, i_class, i_category
-|  Class 1
-|    output: avg:merge(inv_quantity_on_hand)
-|    group by: i_product_name, i_brand, i_class, NULL
-|  Class 2
-|    output: avg:merge(inv_quantity_on_hand)
-|    group by: i_product_name, i_brand, NULL, NULL
-|  Class 3
-|    output: avg:merge(inv_quantity_on_hand)
-|    group by: i_product_name, NULL, NULL, NULL
-|  Class 4
-|    output: avg:merge(inv_quantity_on_hand)
-|    group by: NULL, NULL, NULL, NULL
-|  row-size=422B cardinality=35.25M
-|
-13:EXCHANGE [HASH(CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_product_name) WHEN 6 THEN murmur_hash(i_product_name) WHEN 8 THEN murmur_hash(i_product_name) WHEN 10 THEN murmur_hash(i_product_name) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_brand) WHEN 6 THEN murmur_hash(i_brand) WHEN 8 THEN murmur_hash(i_brand) WHEN 10 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_class) WHEN 6 THEN murmur_hash(i_class) WHEN 8 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_category) WHEN 6 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END)]
-|
-07:AGGREGATE [STREAMING]
-|  Class 0
-|    output: avg(inv_quantity_on_hand)
-|    group by: i_product_name, i_brand, i_class, i_category
-|  Class 1
-|    output: avg(inv_quantity_on_hand)
-|    group by: i_product_name, i_brand, i_class, NULL
-|  Class 2
-|    output: avg(inv_quantity_on_hand)
-|    group by: i_product_name, i_brand, NULL, NULL
-|  Class 3
-|    output: avg(inv_quantity_on_hand)
-|    group by: i_product_name, NULL, NULL, NULL
-|  Class 4
-|    output: avg(inv_quantity_on_hand)
-|    group by: NULL, NULL, NULL, NULL
-|  row-size=422B cardinality=35.25M
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: inv_warehouse_sk = w_warehouse_sk
-|  runtime filters: RF000 <- w_warehouse_sk
-|  row-size=136B cardinality=11.74M
-|
-|--12:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.warehouse]
-|     HDFS partitions=1/1 files=1 size=585B
-|     row-size=4B cardinality=5
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: inv_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=132B cardinality=11.74M
-|
-|--11:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=104B cardinality=18.00K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: inv_date_sk = d_date_sk
-|  runtime filters: RF004 <- d_date_sk
-|  row-size=28B cardinality=11.74M
-|
-|--10:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|     row-size=8B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.inventory]
-   HDFS partitions=1/1 files=1 size=225.47MB
-   runtime filters: RF000 -> inv_warehouse_sk, RF002 -> inv_item_sk, RF004 -> inv_date_sk
-   row-size=20B cardinality=11.74M
-====
-# TPCDS-Q67
-select  *
-from (select i_category
-            ,i_class
-            ,i_brand
-            ,i_product_name
-            ,d_year
-            ,d_qoy
-            ,d_moy
-            ,s_store_id
-            ,sumsales
-            ,rank() over (partition by i_category order by sumsales desc) rk
-      from (select i_category
-                  ,i_class
-                  ,i_brand
-                  ,i_product_name
-                  ,d_year
-                  ,d_qoy
-                  ,d_moy
-                  ,s_store_id
-                  ,sum(coalesce(ss_sales_price*ss_quantity,0)) sumsales
-            from store_sales
-                ,date_dim
-                ,store
-                ,item
-       where  ss_sold_date_sk=d_date_sk
-          and ss_item_sk=i_item_sk
-          and ss_store_sk = s_store_sk
-          and d_month_seq between 1212 and 1212+11
-       group by  rollup(i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy,s_store_id))dw1) dw2
-where rk <= 100
-order by i_category
-        ,i_class
-        ,i_brand
-        ,i_product_name
-        ,d_year
-        ,d_qoy
-        ,d_moy
-        ,s_store_id
-        ,sumsales
-        ,rk
-limit 100;
----- PLAN
-Max Per-Host Resource Reservation: Memory=251.75MB Threads=5
-Per-Host Resource Estimates: Memory=18.41GB
-PLAN-ROOT SINK
-|
-12:TOP-N [LIMIT=100]
-|  order by: i_category ASC, i_class ASC, i_brand ASC, i_product_name ASC, d_year ASC, d_qoy ASC, d_moy ASC, s_store_id ASC, sumsales ASC, rk ASC
-|  row-size=96B cardinality=100
-|
-11:SELECT
-|  predicates: rank() <= 100
-|  row-size=100B cardinality=100
-|
-10:ANALYTIC
-|  functions: rank()
-|  partition by: i_category
-|  order by: aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END) DESC
-|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  row-size=100B cardinality=100
-|
-09:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END ASC NULLS LAST, aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END) DESC
-|  row-size=92B cardinality=100
-|
-08:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END)
-|  group by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_class WHEN 5 THEN i_class WHEN 6 THEN i_class WHEN 7 THEN i_class WHEN 8 THEN i_class WHEN 9 THEN i_class WHEN 10 THEN i_class WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_brand WHEN 5 THEN i_brand WHEN 6 THEN i_brand WHEN 7 THEN i_brand WHEN 8 THEN i_brand WHEN 9 THEN i_brand WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_product_name WHEN 5 THEN i_product_name WHEN 6 THEN i_product_name WHEN 7 THEN i_product_name WHEN 8 THEN i_product_name WHEN 9 THEN NULL WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN d_year WHEN 5 THEN d_year WHEN 6 THEN d_year WHEN 7 THEN d_year WHEN 8 THEN NULL WHEN 9 THEN NULL WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN d_qoy WHEN 5 THEN d_qoy WHEN 6 THEN d_qoy WHEN 7 THEN NULL WHEN 8 THEN NULL WHEN 9 THEN NULL WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN d_moy WHEN 5 THEN d_moy WHEN 6 THEN NULL WHEN 7 THEN NULL WHEN 8 THEN NULL WHEN 9 THEN NULL WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN s_store_id WHEN 5 THEN NULL WHEN 6 THEN NULL WHEN 7 THEN NULL WHEN 8 THEN NULL WHEN 9 THEN NULL WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN 4 WHEN 5 THEN 5 WHEN 6 THEN 6 WHEN 7 THEN 7 WHEN 8 THEN 8 WHEN 9 THEN 9 WHEN 10 THEN 10 WHEN 11 THEN 11 WHEN 12 THEN 12 END
-|  row-size=92B cardinality=15.09M
-|
-07:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, s_store_id
-|  Class 1
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, NULL
-|  Class 2
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, NULL, NULL
-|  Class 3
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, NULL, NULL, NULL
-|  Class 4
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, NULL, NULL, NULL, NULL
-|  Class 5
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, NULL, NULL, NULL, NULL, NULL
-|  Class 6
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, NULL, NULL, NULL, NULL, NULL, NULL
-|  Class 7
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-|  Class 8
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-|  row-size=1.07KB cardinality=15.09M
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=180B cardinality=2.88M
-|
-|--03:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=104B cardinality=18.00K
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF002 <- s_store_sk
-|  row-size=76B cardinality=2.88M
-|
-|--02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=32B cardinality=12
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF004 <- d_date_sk
-|  row-size=44B cardinality=2.88M
-|
-|--01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|     row-size=20B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_item_sk, RF002 -> ss_store_sk, RF004 -> ss_sold_date_sk
-   row-size=24B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=493.51MB Threads=11
-Per-Host Resource Estimates: Memory=53.04GB
-PLAN-ROOT SINK
-|
-20:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: i_category ASC, i_class ASC, i_brand ASC, i_product_name ASC, d_year ASC, d_qoy ASC, d_moy ASC, s_store_id ASC, sumsales ASC, rk ASC
-|  limit: 100
-|
-12:TOP-N [LIMIT=100]
-|  order by: i_category ASC, i_class ASC, i_brand ASC, i_product_name ASC, d_year ASC, d_qoy ASC, d_moy ASC, s_store_id ASC, sumsales ASC, rk ASC
-|  row-size=96B cardinality=100
-|
-11:SELECT
-|  predicates: rank() <= 100
-|  row-size=100B cardinality=100
-|
-10:ANALYTIC
-|  functions: rank()
-|  partition by: i_category
-|  order by: aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END) DESC
-|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  row-size=100B cardinality=100
-|
-19:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END ASC NULLS LAST, aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END) DESC
-|  row-size=92B cardinality=100
-|
-18:EXCHANGE [HASH(CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END)]
-|
-09:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END ASC NULLS LAST, aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END) DESC
-|  row-size=92B cardinality=100
-|
-08:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END)
-|  group by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_class WHEN 5 THEN i_class WHEN 6 THEN i_class WHEN 7 THEN i_class WHEN 8 THEN i_class WHEN 9 THEN i_class WHEN 10 THEN i_class WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_brand WHEN 5 THEN i_brand WHEN 6 THEN i_brand WHEN 7 THEN i_brand WHEN 8 THEN i_brand WHEN 9 THEN i_brand WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_product_name WHEN 5 THEN i_product_name WHEN 6 THEN i_product_name WHEN 7 THEN i_product_name WHEN 8 THEN i_product_name WHEN 9 THEN NULL WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN d_year WHEN 5 THEN d_year WHEN 6 THEN d_year WHEN 7 THEN d_year WHEN 8 THEN NULL WHEN 9 THEN NULL WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN d_qoy WHEN 5 THEN d_qoy WHEN 6 THEN d_qoy WHEN 7 THEN NULL WHEN 8 THEN NULL WHEN 9 THEN NULL WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN d_moy WHEN 5 THEN d_moy WHEN 6 THEN NULL WHEN 7 THEN NULL WHEN 8 THEN NULL WHEN 9 THEN NULL WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN s_store_id WHEN 5 THEN NULL WHEN 6 THEN NULL WHEN 7 THEN NULL WHEN 8 THEN NULL WHEN 9 THEN NULL WHEN 10 THEN NULL WHEN 11 THEN NULL WHEN 12 THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN 4 WHEN 5 THEN 5 WHEN 6 THEN 6 WHEN 7 THEN 7 WHEN 8 THEN 8 WHEN 9 THEN 9 WHEN 10 THEN 10 WHEN 11 THEN 11 WHEN 12 THEN 12 END
-|  row-size=92B cardinality=15.09M
-|
-17:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, s_store_id
-|  Class 1
-|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, NULL
-|  Class 2
-|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, NULL, NULL
-|  Class 3
-|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, NULL, NULL, NULL
-|  Class 4
-|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, NULL, NULL, NULL, NULL
-|  Class 5
-|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, NULL, NULL, NULL, NULL, NULL
-|  Class 6
-|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, NULL, NULL, NULL, NULL, NULL, NULL
-|  Class 7
-|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-|  Class 8
-|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-|  row-size=1.07KB cardinality=15.09M
-|
-16:EXCHANGE [HASH(CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_category) WHEN 5 THEN murmur_hash(i_category) WHEN 6 THEN murmur_hash(i_category) WHEN 7 THEN murmur_hash(i_category) WHEN 8 THEN murmur_hash(i_category) WHEN 9 THEN murmur_hash(i_category) WHEN 10 THEN murmur_hash(i_category) WHEN 11 THEN murmur_hash(i_category) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_class) WHEN 5 THEN murmur_hash(i_class) WHEN 6 THEN murmur_hash(i_class) WHEN 7 THEN murmur_hash(i_class) WHEN 8 THEN murmur_hash(i_class) WHEN 9 THEN murmur_hash(i_class) WHEN 10 THEN murmur_hash(i_class) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_brand) WHEN 5 THEN murmur_hash(i_brand) WHEN 6 THEN murmur_hash(i_brand) WHEN 7 THEN murmur_hash(i_brand) WHEN 8 THEN murmur_hash(i_brand) WHEN 9 THEN murmur_hash(i_brand) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_product_name) WHEN 5 THEN murmur_hash(i_product_name) WHEN 6 THEN murmur_hash(i_product_name) WHEN 7 THEN murmur_hash(i_product_name) WHEN 8 THEN murmur_hash(i_product_name) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(d_year) WHEN 5 THEN murmur_hash(d_year) WHEN 6 THEN murmur_hash(d_year) WHEN 7 THEN murmur_hash(d_year) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(d_qoy) WHEN 5 THEN murmur_hash(d_qoy) WHEN 6 THEN murmur_hash(d_qoy) WHEN 7 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(d_moy) WHEN 5 THEN murmur_hash(d_moy) WHEN 6 THEN murmur_hash(NULL) WHEN 7 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(s_store_id) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) WHEN 7 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END)]
-|
-07:AGGREGATE [STREAMING]
-|  Class 0
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, s_store_id
-|  Class 1
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, NULL
-|  Class 2
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, NULL, NULL
-|  Class 3
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, d_year, NULL, NULL, NULL
-|  Class 4
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, i_product_name, NULL, NULL, NULL, NULL
-|  Class 5
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, i_brand, NULL, NULL, NULL, NULL, NULL
-|  Class 6
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, i_class, NULL, NULL, NULL, NULL, NULL, NULL
-|  Class 7
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: i_category, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-|  Class 8
-|    output: sum(coalesce(ss_sales_price * ss_quantity, 0))
-|    group by: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
-|  row-size=1.07KB cardinality=15.09M
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=180B cardinality=2.88M
-|
-|--15:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=104B cardinality=18.00K
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF002 <- s_store_sk
-|  row-size=76B cardinality=2.88M
-|
-|--14:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=32B cardinality=12
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF004 <- d_date_sk
-|  row-size=44B cardinality=2.88M
-|
-|--13:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|     row-size=20B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_item_sk, RF002 -> ss_store_sk, RF004 -> ss_sold_date_sk
-   row-size=24B cardinality=2.88M
-====
-# TPCDS-Q5
-with ssr as
- (select s_store_id,
-        sum(sales_price) as sales,
-        sum(profit) as profit,
-        sum(return_amt) as `returns`,
-        sum(net_loss) as profit_loss
- from
-  ( select  ss_store_sk as store_sk,
-            ss_sold_date_sk  as date_sk,
-            ss_ext_sales_price as sales_price,
-            ss_net_profit as profit,
-            cast(0 as decimal(7,2)) as return_amt,
-            cast(0 as decimal(7,2)) as net_loss
-    from store_sales
-    union all
-    select sr_store_sk as store_sk,
-           sr_returned_date_sk as date_sk,
-           cast(0 as decimal(7,2)) as sales_price,
-           cast(0 as decimal(7,2)) as profit,
-           sr_return_amt as return_amt,
-           sr_net_loss as net_loss
-    from store_returns
-   ) salesreturns,
-     date_dim,
-     store
- where date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  INTERVAL 14 days)
-       and store_sk = s_store_sk
- group by s_store_id)
- ,
- csr as
- (select cp_catalog_page_id,
-        sum(sales_price) as sales,
-        sum(profit) as profit,
-        sum(return_amt) as `returns`,
-        sum(net_loss) as profit_loss
- from
-  ( select  cs_catalog_page_sk as page_sk,
-            cs_sold_date_sk  as date_sk,
-            cs_ext_sales_price as sales_price,
-            cs_net_profit as profit,
-            cast(0 as decimal(7,2)) as return_amt,
-            cast(0 as decimal(7,2)) as net_loss
-    from catalog_sales
-    union all
-    select cr_catalog_page_sk as page_sk,
-           cr_returned_date_sk as date_sk,
-           cast(0 as decimal(7,2)) as sales_price,
-           cast(0 as decimal(7,2)) as profit,
-           cr_return_amount as return_amt,
-           cr_net_loss as net_loss
-    from catalog_returns
-   ) salesreturns,
-     date_dim,
-     catalog_page
- where date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  INTERVAL 14 days)
-       and page_sk = cp_catalog_page_sk
- group by cp_catalog_page_id)
- ,
- wsr as
- (select web_site_id,
-        sum(sales_price) as sales,
-        sum(profit) as profit,
-        sum(return_amt) as `returns`,
-        sum(net_loss) as profit_loss
- from
-  ( select  ws_web_site_sk as wsr_web_site_sk,
-            ws_sold_date_sk  as date_sk,
-            ws_ext_sales_price as sales_price,
-            ws_net_profit as profit,
-            cast(0 as decimal(7,2)) as return_amt,
-            cast(0 as decimal(7,2)) as net_loss
-    from web_sales
-    union all
-    select ws_web_site_sk as wsr_web_site_sk,
-           wr_returned_date_sk as date_sk,
-           cast(0 as decimal(7,2)) as sales_price,
-           cast(0 as decimal(7,2)) as profit,
-           wr_return_amt as return_amt,
-           wr_net_loss as net_loss
-    from web_returns left outer join web_sales on
-         ( wr_item_sk = ws_item_sk
-           and wr_order_number = ws_order_number)
-   ) salesreturns,
-     date_dim,
-     web_site
- where date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  INTERVAL 14 days)
-       and wsr_web_site_sk = web_site_sk
- group by web_site_id)
-  select  channel
-        , id
-        , sum(sales) as sales
-        , sum(`returns`) as `returns`
-        , sum(profit) as profit
- from
- (select 'store channel' as channel
-        , 'store' || s_store_id as id
-        , sales
-        , `returns`
-        , (profit - profit_loss) as profit
- from   ssr
- union all
- select 'catalog channel' as channel
-        , 'catalog_page' || cp_catalog_page_id as id
-        , sales
-        , `returns`
-        , (profit - profit_loss) as profit
- from  csr
- union all
- select 'web channel' as channel
-        , 'web_site' || web_site_id as id
-        , sales
-        , `returns`
-        , (profit - profit_loss) as profit
- from   wsr
- ) x
- group by rollup (channel, id)
- order by channel
-         ,id
- limit 100;
----- PLAN
-Max Per-Host Resource Reservation: Memory=47.39MB Threads=5
-Per-Host Resource Estimates: Memory=333MB
-PLAN-ROOT SINK
-|
-29:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(27,28,29) WHEN 27 THEN channel WHEN 28 THEN channel WHEN 29 THEN NULL END ASC, CASE valid_tid(27,28,29) WHEN 27 THEN id WHEN 28 THEN NULL WHEN 29 THEN NULL END ASC
-|  row-size=72B cardinality=100
-|
-28:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(sales) WHEN 28 THEN sum(sales) WHEN 29 THEN sum(sales) END), aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(`returns`) WHEN 28 THEN sum(`returns`) WHEN 29 THEN sum(`returns`) END), aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(profit) WHEN 28 THEN sum(profit) WHEN 29 THEN sum(profit) END)
-|  group by: CASE valid_tid(27,28,29) WHEN 27 THEN channel WHEN 28 THEN channel WHEN 29 THEN NULL END, CASE valid_tid(27,28,29) WHEN 27 THEN id WHEN 28 THEN NULL WHEN 29 THEN NULL END, CASE valid_tid(27,28,29) WHEN 27 THEN 27 WHEN 28 THEN 28 WHEN 29 THEN 29 END
-|  row-size=76B cardinality=11.56K
-|
-27:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, id
-|  Class 1
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, NULL
-|  Class 2
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: NULL, NULL
-|  row-size=216B cardinality=11.56K
-|
-00:UNION
-|  row-size=72B cardinality=11.56K
-|
-|--26:AGGREGATE [FINALIZE]
-|  |  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
-|  |  group by: web_site_id
-|  |  row-size=92B cardinality=15
-|  |
-|  25:HASH JOIN [INNER JOIN]
-|  |  hash predicates: wsr_web_site_sk = web_site_sk
-|  |  runtime filters: RF008 <- web_site_sk
-|  |  row-size=82B cardinality=791.15K
-|  |
-|  |--23:SCAN HDFS [tpcds.web_site]
-|  |     HDFS partitions=1/1 files=1 size=8.57KB
-|  |     row-size=32B cardinality=30
-|  |
-|  24:HASH JOIN [INNER JOIN]
-|  |  hash predicates: date_sk = d_date_sk
-|  |  runtime filters: RF010 <- d_date_sk
-|  |  row-size=50B cardinality=791.15K
-|  |
-|  |--22:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-08-18', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  17:UNION
-|  |  row-size=24B cardinality=791.15K
-|  |
-|  |--21:HASH JOIN [RIGHT OUTER JOIN]
-|  |  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
-|  |  |  runtime filters: RF012 <- wr_item_sk, RF013 <- wr_order_number
-|  |  |  row-size=48B cardinality=71.76K
-|  |  |
-|  |  |--19:SCAN HDFS [tpcds.web_returns]
-|  |  |     HDFS partitions=1/1 files=1 size=9.35MB
-|  |  |     runtime filters: RF010 -> tpcds.web_returns.wr_returned_date_sk
-|  |  |     row-size=28B cardinality=71.76K
-|  |  |
-|  |  20:SCAN HDFS [tpcds.web_sales]
-|  |     HDFS partitions=1/1 files=1 size=140.07MB
-|  |     runtime filters: RF008 -> tpcds.web_sales.ws_web_site_sk, RF012 -> ws_item_sk, RF013 -> ws_order_number
-|  |     row-size=20B cardinality=719.38K
-|  |
-|  18:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF008 -> tpcds.web_sales.ws_web_site_sk, RF010 -> tpcds.web_sales.ws_sold_date_sk
-|     row-size=16B cardinality=719.38K
-|
-|--16:AGGREGATE [FINALIZE]
-|  |  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
-|  |  group by: cp_catalog_page_id
-|  |  row-size=92B cardinality=11.54K
-|  |
-|  15:HASH JOIN [INNER JOIN]
-|  |  hash predicates: page_sk = cp_catalog_page_sk
-|  |  runtime filters: RF004 <- cp_catalog_page_sk
-|  |  row-size=82B cardinality=1.59M
-|  |
-|  |--13:SCAN HDFS [tpcds.catalog_page]
-|  |     HDFS partitions=1/1 files=1 size=1.56MB
-|  |     row-size=32B cardinality=11.72K
-|  |
-|  14:HASH JOIN [INNER JOIN]
-|  |  hash predicates: date_sk = d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |  row-size=50B cardinality=1.59M
-|  |
-|  |--12:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-08-18', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  09:UNION
-|  |  row-size=24B cardinality=1.59M
-|  |
-|  |--11:SCAN HDFS [tpcds.catalog_returns]
-|  |     HDFS partitions=1/1 files=1 size=20.39MB
-|  |     runtime filters: RF004 -> tpcds.catalog_returns.cr_catalog_page_sk, RF006 -> tpcds.catalog_returns.cr_returned_date_sk
-|  |     row-size=16B cardinality=144.07K
-|  |
-|  10:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF004 -> tpcds.catalog_sales.cs_catalog_page_sk, RF006 -> tpcds.catalog_sales.cs_sold_date_sk
-|     row-size=16B cardinality=1.44M
-|
-08:AGGREGATE [FINALIZE]
-|  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
-|  group by: s_store_id
-|  row-size=92B cardinality=6
-|
-07:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=82B cardinality=3.17M
-|
-|--05:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=32B cardinality=12
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=50B cardinality=3.17M
-|
-|--04:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_date <= DATE '1998-08-18', d_date >= DATE '1998-08-04'
-|     row-size=26B cardinality=7.30K
-|
-01:UNION
-|  row-size=24B cardinality=3.17M
-|
-|--03:SCAN HDFS [tpcds.store_returns]
-|     HDFS partitions=1/1 files=1 size=31.19MB
-|     runtime filters: RF000 -> tpcds.store_returns.sr_store_sk, RF002 -> tpcds.store_returns.sr_returned_date_sk
-|     row-size=16B cardinality=287.51K
-|
-02:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_store_sk, RF002 -> tpcds.store_sales.ss_sold_date_sk
-   row-size=16B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=114.27MB Threads=25
-Per-Host Resource Estimates: Memory=1.02GB
-PLAN-ROOT SINK
-|
-46:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: CASE valid_tid(27,28,29) WHEN 27 THEN channel WHEN 28 THEN channel WHEN 29 THEN NULL END ASC, CASE valid_tid(27,28,29) WHEN 27 THEN id WHEN 28 THEN NULL WHEN 29 THEN NULL END ASC
-|  limit: 100
-|
-29:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(27,28,29) WHEN 27 THEN channel WHEN 28 THEN channel WHEN 29 THEN NULL END ASC, CASE valid_tid(27,28,29) WHEN 27 THEN id WHEN 28 THEN NULL WHEN 29 THEN NULL END ASC
-|  row-size=72B cardinality=100
-|
-28:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(sales) WHEN 28 THEN sum(sales) WHEN 29 THEN sum(sales) END), aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(`returns`) WHEN 28 THEN sum(`returns`) WHEN 29 THEN sum(`returns`) END), aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(profit) WHEN 28 THEN sum(profit) WHEN 29 THEN sum(profit) END)
-|  group by: CASE valid_tid(27,28,29) WHEN 27 THEN channel WHEN 28 THEN channel WHEN 29 THEN NULL END, CASE valid_tid(27,28,29) WHEN 27 THEN id WHEN 28 THEN NULL WHEN 29 THEN NULL END, CASE valid_tid(27,28,29) WHEN 27 THEN 27 WHEN 28 THEN 28 WHEN 29 THEN 29 END
-|  row-size=76B cardinality=11.56K
-|
-45:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
-|    group by: channel, id
-|  Class 1
-|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
-|    group by: channel, NULL
-|  Class 2
-|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
-|    group by: NULL, NULL
-|  row-size=216B cardinality=11.56K
-|
-44:EXCHANGE [HASH(CASE valid_tid(27,28,29) WHEN 27 THEN murmur_hash(channel) WHEN 28 THEN murmur_hash(channel) WHEN 29 THEN murmur_hash(NULL) END,CASE valid_tid(27,28,29) WHEN 27 THEN murmur_hash(id) WHEN 28 THEN murmur_hash(NULL) WHEN 29 THEN murmur_hash(NULL) END)]
-|
-27:AGGREGATE [STREAMING]
-|  Class 0
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, id
-|  Class 1
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, NULL
-|  Class 2
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: NULL, NULL
-|  row-size=216B cardinality=11.56K
-|
-00:UNION
-|  row-size=72B cardinality=11.56K
-|
-|--43:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(sales_price), sum:merge(profit), sum:merge(return_amt), sum:merge(net_loss)
-|  |  group by: web_site_id
-|  |  row-size=92B cardinality=15
-|  |
-|  42:EXCHANGE [HASH(web_site_id)]
-|  |
-|  26:AGGREGATE [STREAMING]
-|  |  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
-|  |  group by: web_site_id
-|  |  row-size=92B cardinality=15
-|  |
-|  25:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: wsr_web_site_sk = web_site_sk
-|  |  runtime filters: RF008 <- web_site_sk
-|  |  row-size=82B cardinality=791.15K
-|  |
-|  |--41:EXCHANGE [BROADCAST]
-|  |  |
-|  |  23:SCAN HDFS [tpcds.web_site]
-|  |     HDFS partitions=1/1 files=1 size=8.57KB
-|  |     row-size=32B cardinality=30
-|  |
-|  24:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: date_sk = d_date_sk
-|  |  runtime filters: RF010 <- d_date_sk
-|  |  row-size=50B cardinality=791.15K
-|  |
-|  |--40:EXCHANGE [BROADCAST]
-|  |  |
-|  |  22:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-08-18', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  17:UNION
-|  |  row-size=24B cardinality=791.15K
-|  |
-|  |--21:HASH JOIN [RIGHT OUTER JOIN, PARTITIONED]
-|  |  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
-|  |  |  runtime filters: RF012 <- wr_item_sk, RF013 <- wr_order_number
-|  |  |  row-size=48B cardinality=71.76K
-|  |  |
-|  |  |--39:EXCHANGE [HASH(wr_item_sk,wr_order_number)]
-|  |  |  |
-|  |  |  19:SCAN HDFS [tpcds.web_returns]
-|  |  |     HDFS partitions=1/1 files=1 size=9.35MB
-|  |  |     runtime filters: RF010 -> tpcds.web_returns.wr_returned_date_sk
-|  |  |     row-size=28B cardinality=71.76K
-|  |  |
-|  |  38:EXCHANGE [HASH(ws_item_sk,ws_order_number)]
-|  |  |
-|  |  20:SCAN HDFS [tpcds.web_sales]
-|  |     HDFS partitions=1/1 files=1 size=140.07MB
-|  |     runtime filters: RF008 -> tpcds.web_sales.ws_web_site_sk, RF012 -> ws_item_sk, RF013 -> ws_order_number
-|  |     row-size=20B cardinality=719.38K
-|  |
-|  18:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF008 -> tpcds.web_sales.ws_web_site_sk, RF010 -> tpcds.web_sales.ws_sold_date_sk
-|     row-size=16B cardinality=719.38K
-|
-|--37:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(sales_price), sum:merge(profit), sum:merge(return_amt), sum:merge(net_loss)
-|  |  group by: cp_catalog_page_id
-|  |  row-size=92B cardinality=11.54K
-|  |
-|  36:EXCHANGE [HASH(cp_catalog_page_id)]
-|  |
-|  16:AGGREGATE [STREAMING]
-|  |  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
-|  |  group by: cp_catalog_page_id
-|  |  row-size=92B cardinality=11.54K
-|  |
-|  15:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: page_sk = cp_catalog_page_sk
-|  |  runtime filters: RF004 <- cp_catalog_page_sk
-|  |  row-size=82B cardinality=1.59M
-|  |
-|  |--35:EXCHANGE [BROADCAST]
-|  |  |
-|  |  13:SCAN HDFS [tpcds.catalog_page]
-|  |     HDFS partitions=1/1 files=1 size=1.56MB
-|  |     row-size=32B cardinality=11.72K
-|  |
-|  14:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: date_sk = d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |  row-size=50B cardinality=1.59M
-|  |
-|  |--34:EXCHANGE [BROADCAST]
-|  |  |
-|  |  12:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-08-18', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  09:UNION
-|  |  row-size=24B cardinality=1.59M
-|  |
-|  |--11:SCAN HDFS [tpcds.catalog_returns]
-|  |     HDFS partitions=1/1 files=1 size=20.39MB
-|  |     runtime filters: RF004 -> tpcds.catalog_returns.cr_catalog_page_sk, RF006 -> tpcds.catalog_returns.cr_returned_date_sk
-|  |     row-size=16B cardinality=144.07K
-|  |
-|  10:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF004 -> tpcds.catalog_sales.cs_catalog_page_sk, RF006 -> tpcds.catalog_sales.cs_sold_date_sk
-|     row-size=16B cardinality=1.44M
-|
-33:AGGREGATE [FINALIZE]
-|  output: sum:merge(sales_price), sum:merge(profit), sum:merge(return_amt), sum:merge(net_loss)
-|  group by: s_store_id
-|  row-size=92B cardinality=6
-|
-32:EXCHANGE [HASH(s_store_id)]
-|
-08:AGGREGATE [STREAMING]
-|  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
-|  group by: s_store_id
-|  row-size=92B cardinality=6
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=82B cardinality=3.17M
-|
-|--31:EXCHANGE [BROADCAST]
-|  |
-|  05:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=32B cardinality=12
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=50B cardinality=3.17M
-|
-|--30:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_date <= DATE '1998-08-18', d_date >= DATE '1998-08-04'
-|     row-size=26B cardinality=7.30K
-|
-01:UNION
-|  row-size=24B cardinality=3.17M
-|
-|--03:SCAN HDFS [tpcds.store_returns]
-|     HDFS partitions=1/1 files=1 size=31.19MB
-|     runtime filters: RF000 -> tpcds.store_returns.sr_store_sk, RF002 -> tpcds.store_returns.sr_returned_date_sk
-|     row-size=16B cardinality=287.51K
-|
-02:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_store_sk, RF002 -> tpcds.store_sales.ss_sold_date_sk
-   row-size=16B cardinality=2.88M
-====
-# TPCDS-Q77
-with ss as
- (select s_store_sk,
-         sum(ss_ext_sales_price) as sales,
-         sum(ss_net_profit) as profit
- from store_sales,
-      date_dim,
-      store
- where ss_sold_date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  interval 30 days)
-       and ss_store_sk = s_store_sk
- group by s_store_sk)
- ,
- sr as
- (select s_store_sk,
-         sum(sr_return_amt) as `returns`,
-         sum(sr_net_loss) as profit_loss
- from store_returns,
-      date_dim,
-      store
- where sr_returned_date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  interval 30 days)
-       and sr_store_sk = s_store_sk
- group by s_store_sk),
- cs as
- (select cs_call_center_sk,
-        sum(cs_ext_sales_price) as sales,
-        sum(cs_net_profit) as profit
- from catalog_sales,
-      date_dim
- where cs_sold_date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  interval 30 days)
- group by cs_call_center_sk
- ),
- cr as
- (select
-        sum(cr_return_amount) as `returns`,
-        sum(cr_net_loss) as profit_loss
- from catalog_returns,
-      date_dim
- where cr_returned_date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  interval 30 days)
- ),
- ws as
- ( select wp_web_page_sk,
-        sum(ws_ext_sales_price) as sales,
-        sum(ws_net_profit) as profit
- from web_sales,
-      date_dim,
-      web_page
- where ws_sold_date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  interval 30 days)
-       and ws_web_page_sk = wp_web_page_sk
- group by wp_web_page_sk),
- wr as
- (select wp_web_page_sk,
-        sum(wr_return_amt) as `returns`,
-        sum(wr_net_loss) as profit_loss
- from web_returns,
-      date_dim,
-      web_page
- where wr_returned_date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  interval 30 days)
-       and wr_web_page_sk = wp_web_page_sk
- group by wp_web_page_sk)
-  select  channel
-        , id
-        , sum(sales) as sales
-        , sum(`returns`) as `returns`
-        , sum(profit) as profit
- from
- (select 'store channel' as channel
-        , ss.s_store_sk as id
-        , sales
-        , coalesce(`returns`, 0) as `returns`
-        , (profit - coalesce(profit_loss,0)) as profit
- from   ss left join sr
-        on  ss.s_store_sk = sr.s_store_sk
- union all
- select 'catalog channel' as channel
-        , cs_call_center_sk as id
-        , sales
-        , `returns`
-        , (profit - profit_loss) as profit
- from  cs
-       , cr
- union all
- select 'web channel' as channel
-        , ws.wp_web_page_sk as id
-        , sales
-        , coalesce(`returns`, 0) `returns`
-        , (profit - coalesce(profit_loss,0)) as profit
- from   ws left join wr
-        on  ws.wp_web_page_sk = wr.wp_web_page_sk
- ) x
- group by rollup (channel, id)
- order by channel
-         ,id
-         ,sales desc
- limit 100;
----- PLAN
-Max Per-Host Resource Reservation: Memory=55.58MB Threads=7
-Per-Host Resource Estimates: Memory=416MB
-PLAN-ROOT SINK
-|
-38:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(32,30,31) WHEN 30 THEN channel WHEN 31 THEN channel WHEN 32 THEN NULL END ASC, CASE valid_tid(32,30,31) WHEN 30 THEN id WHEN 31 THEN NULL WHEN 32 THEN NULL END ASC, aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(sales) WHEN 31 THEN sum(sales) WHEN 32 THEN sum(sales) END) DESC
-|  row-size=64B cardinality=82
-|
-37:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(sales) WHEN 31 THEN sum(sales) WHEN 32 THEN sum(sales) END), aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(`returns`) WHEN 31 THEN sum(`returns`) WHEN 32 THEN sum(`returns`) END), aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(profit) WHEN 31 THEN sum(profit) WHEN 32 THEN sum(profit) END)
-|  group by: CASE valid_tid(32,30,31) WHEN 30 THEN channel WHEN 31 THEN channel WHEN 32 THEN NULL END, CASE valid_tid(32,30,31) WHEN 30 THEN id WHEN 31 THEN NULL WHEN 32 THEN NULL END, CASE valid_tid(32,30,31) WHEN 30 THEN 30 WHEN 31 THEN 31 WHEN 32 THEN 32 END
-|  row-size=68B cardinality=82
-|
-36:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, id
-|  Class 1
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, NULL
-|  Class 2
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: NULL, NULL
-|  row-size=192B cardinality=82
-|
-00:UNION
-|  row-size=64B cardinality=78
-|
-|--35:HASH JOIN [LEFT OUTER JOIN]
-|  |  hash predicates: wp_web_page_sk = wp_web_page_sk
-|  |  row-size=72B cardinality=60
-|  |
-|  |--34:AGGREGATE [FINALIZE]
-|  |  |  output: sum(wr_return_amt), sum(wr_net_loss)
-|  |  |  group by: wp_web_page_sk
-|  |  |  row-size=36B cardinality=60
-|  |  |
-|  |  33:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: wr_web_page_sk = wp_web_page_sk
-|  |  |  runtime filters: RF016 <- wp_web_page_sk
-|  |  |  row-size=46B cardinality=71.76K
-|  |  |
-|  |  |--31:SCAN HDFS [tpcds.web_page]
-|  |  |     HDFS partitions=1/1 files=1 size=5.64KB
-|  |  |     row-size=4B cardinality=60
-|  |  |
-|  |  32:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: wr_returned_date_sk = d_date_sk
-|  |  |  runtime filters: RF018 <- d_date_sk
-|  |  |  row-size=42B cardinality=71.76K
-|  |  |
-|  |  |--30:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |  |     row-size=26B cardinality=7.30K
-|  |  |
-|  |  29:SCAN HDFS [tpcds.web_returns]
-|  |     HDFS partitions=1/1 files=1 size=9.35MB
-|  |     runtime filters: RF016 -> wr_web_page_sk, RF018 -> wr_returned_date_sk
-|  |     row-size=16B cardinality=71.76K
-|  |
-|  28:AGGREGATE [FINALIZE]
-|  |  output: sum(ws_ext_sales_price), sum(ws_net_profit)
-|  |  group by: wp_web_page_sk
-|  |  row-size=36B cardinality=60
-|  |
-|  27:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ws_web_page_sk = wp_web_page_sk
-|  |  runtime filters: RF012 <- wp_web_page_sk
-|  |  row-size=46B cardinality=719.38K
-|  |
-|  |--25:SCAN HDFS [tpcds.web_page]
-|  |     HDFS partitions=1/1 files=1 size=5.64KB
-|  |     row-size=4B cardinality=60
-|  |
-|  26:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ws_sold_date_sk = d_date_sk
-|  |  runtime filters: RF014 <- d_date_sk
-|  |  row-size=42B cardinality=719.38K
-|  |
-|  |--24:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  23:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF012 -> ws_web_page_sk, RF014 -> ws_sold_date_sk
-|     row-size=16B cardinality=719.38K
-|
-|--22:NESTED LOOP JOIN [CROSS JOIN]
-|  |  row-size=68B cardinality=6
-|  |
-|  |--21:AGGREGATE [FINALIZE]
-|  |  |  output: sum(cr_return_amount), sum(cr_net_loss)
-|  |  |  row-size=32B cardinality=1
-|  |  |
-|  |  20:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: cr_returned_date_sk = d_date_sk
-|  |  |  runtime filters: RF010 <- d_date_sk
-|  |  |  row-size=38B cardinality=144.07K
-|  |  |
-|  |  |--19:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |  |     row-size=26B cardinality=7.30K
-|  |  |
-|  |  18:SCAN HDFS [tpcds.catalog_returns]
-|  |     HDFS partitions=1/1 files=1 size=20.39MB
-|  |     runtime filters: RF010 -> cr_returned_date_sk
-|  |     row-size=12B cardinality=144.07K
-|  |
-|  17:AGGREGATE [FINALIZE]
-|  |  output: sum(cs_ext_sales_price), sum(cs_net_profit)
-|  |  group by: cs_call_center_sk
-|  |  row-size=36B cardinality=6
-|  |
-|  16:HASH JOIN [INNER JOIN]
-|  |  hash predicates: cs_sold_date_sk = d_date_sk
-|  |  runtime filters: RF008 <- d_date_sk
-|  |  row-size=42B cardinality=1.44M
-|  |
-|  |--15:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  14:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF008 -> cs_sold_date_sk
-|     row-size=16B cardinality=1.44M
-|
-13:HASH JOIN [LEFT OUTER JOIN]
-|  hash predicates: s_store_sk = s_store_sk
-|  row-size=72B cardinality=12
-|
-|--12:AGGREGATE [FINALIZE]
-|  |  output: sum(sr_return_amt), sum(sr_net_loss)
-|  |  group by: s_store_sk
-|  |  row-size=36B cardinality=12
-|  |
-|  11:HASH JOIN [INNER JOIN]
-|  |  hash predicates: sr_store_sk = s_store_sk
-|  |  runtime filters: RF004 <- s_store_sk
-|  |  row-size=46B cardinality=287.51K
-|  |
-|  |--09:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=4B cardinality=12
-|  |
-|  10:HASH JOIN [INNER JOIN]
-|  |  hash predicates: sr_returned_date_sk = d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |  row-size=42B cardinality=287.51K
-|  |
-|  |--08:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  07:SCAN HDFS [tpcds.store_returns]
-|     HDFS partitions=1/1 files=1 size=31.19MB
-|     runtime filters: RF004 -> sr_store_sk, RF006 -> sr_returned_date_sk
-|     row-size=16B cardinality=287.51K
-|
-06:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price), sum(ss_net_profit)
-|  group by: s_store_sk
-|  row-size=36B cardinality=12
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=46B cardinality=2.88M
-|
-|--03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=4B cardinality=12
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=42B cardinality=2.88M
-|
-|--02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|     row-size=26B cardinality=7.30K
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk
-   row-size=16B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=154.97MB Threads=36
-Per-Host Resource Estimates: Memory=1.23GB
-PLAN-ROOT SINK
-|
-64:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: CASE valid_tid(32,30,31) WHEN 30 THEN channel WHEN 31 THEN channel WHEN 32 THEN NULL END ASC, CASE valid_tid(32,30,31) WHEN 30 THEN id WHEN 31 THEN NULL WHEN 32 THEN NULL END ASC, aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(sales) WHEN 31 THEN sum(sales) WHEN 32 THEN sum(sales) END) DESC
-|  limit: 100
-|
-38:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(32,30,31) WHEN 30 THEN channel WHEN 31 THEN channel WHEN 32 THEN NULL END ASC, CASE valid_tid(32,30,31) WHEN 30 THEN id WHEN 31 THEN NULL WHEN 32 THEN NULL END ASC, aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(sales) WHEN 31 THEN sum(sales) WHEN 32 THEN sum(sales) END) DESC
-|  row-size=64B cardinality=82
-|
-37:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(sales) WHEN 31 THEN sum(sales) WHEN 32 THEN sum(sales) END), aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(`returns`) WHEN 31 THEN sum(`returns`) WHEN 32 THEN sum(`returns`) END), aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(profit) WHEN 31 THEN sum(profit) WHEN 32 THEN sum(profit) END)
-|  group by: CASE valid_tid(32,30,31) WHEN 30 THEN channel WHEN 31 THEN channel WHEN 32 THEN NULL END, CASE valid_tid(32,30,31) WHEN 30 THEN id WHEN 31 THEN NULL WHEN 32 THEN NULL END, CASE valid_tid(32,30,31) WHEN 30 THEN 30 WHEN 31 THEN 31 WHEN 32 THEN 32 END
-|  row-size=68B cardinality=82
-|
-63:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
-|    group by: channel, id
-|  Class 1
-|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
-|    group by: channel, NULL
-|  Class 2
-|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
-|    group by: NULL, NULL
-|  row-size=192B cardinality=82
-|
-62:EXCHANGE [HASH(CASE valid_tid(32,30,31) WHEN 30 THEN murmur_hash(channel) WHEN 31 THEN murmur_hash(channel) WHEN 32 THEN murmur_hash(NULL) END,CASE valid_tid(32,30,31) WHEN 30 THEN murmur_hash(id) WHEN 31 THEN murmur_hash(NULL) WHEN 32 THEN murmur_hash(NULL) END)]
-|
-36:AGGREGATE [STREAMING]
-|  Class 0
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, id
-|  Class 1
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, NULL
-|  Class 2
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: NULL, NULL
-|  row-size=192B cardinality=82
-|
-00:UNION
-|  row-size=64B cardinality=78
-|
-|--35:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
-|  |  hash predicates: wp_web_page_sk = wp_web_page_sk
-|  |  row-size=72B cardinality=60
-|  |
-|  |--61:AGGREGATE [FINALIZE]
-|  |  |  output: sum:merge(wr_return_amt), sum:merge(wr_net_loss)
-|  |  |  group by: wp_web_page_sk
-|  |  |  row-size=36B cardinality=60
-|  |  |
-|  |  60:EXCHANGE [HASH(wp_web_page_sk)]
-|  |  |
-|  |  34:AGGREGATE [STREAMING]
-|  |  |  output: sum(wr_return_amt), sum(wr_net_loss)
-|  |  |  group by: wp_web_page_sk
-|  |  |  row-size=36B cardinality=60
-|  |  |
-|  |  33:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: wr_web_page_sk = wp_web_page_sk
-|  |  |  runtime filters: RF016 <- wp_web_page_sk
-|  |  |  row-size=46B cardinality=71.76K
-|  |  |
-|  |  |--59:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  31:SCAN HDFS [tpcds.web_page]
-|  |  |     HDFS partitions=1/1 files=1 size=5.64KB
-|  |  |     row-size=4B cardinality=60
-|  |  |
-|  |  32:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: wr_returned_date_sk = d_date_sk
-|  |  |  runtime filters: RF018 <- d_date_sk
-|  |  |  row-size=42B cardinality=71.76K
-|  |  |
-|  |  |--58:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  30:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |  |     row-size=26B cardinality=7.30K
-|  |  |
-|  |  29:SCAN HDFS [tpcds.web_returns]
-|  |     HDFS partitions=1/1 files=1 size=9.35MB
-|  |     runtime filters: RF016 -> wr_web_page_sk, RF018 -> wr_returned_date_sk
-|  |     row-size=16B cardinality=71.76K
-|  |
-|  57:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ws_ext_sales_price), sum:merge(ws_net_profit)
-|  |  group by: wp_web_page_sk
-|  |  row-size=36B cardinality=60
-|  |
-|  56:EXCHANGE [HASH(wp_web_page_sk)]
-|  |
-|  28:AGGREGATE [STREAMING]
-|  |  output: sum(ws_ext_sales_price), sum(ws_net_profit)
-|  |  group by: wp_web_page_sk
-|  |  row-size=36B cardinality=60
-|  |
-|  27:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ws_web_page_sk = wp_web_page_sk
-|  |  runtime filters: RF012 <- wp_web_page_sk
-|  |  row-size=46B cardinality=719.38K
-|  |
-|  |--55:EXCHANGE [BROADCAST]
-|  |  |
-|  |  25:SCAN HDFS [tpcds.web_page]
-|  |     HDFS partitions=1/1 files=1 size=5.64KB
-|  |     row-size=4B cardinality=60
-|  |
-|  26:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ws_sold_date_sk = d_date_sk
-|  |  runtime filters: RF014 <- d_date_sk
-|  |  row-size=42B cardinality=719.38K
-|  |
-|  |--54:EXCHANGE [BROADCAST]
-|  |  |
-|  |  24:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  23:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF012 -> ws_web_page_sk, RF014 -> ws_sold_date_sk
-|     row-size=16B cardinality=719.38K
-|
-|--22:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
-|  |  row-size=68B cardinality=6
-|  |
-|  |--53:EXCHANGE [BROADCAST]
-|  |  |
-|  |  52:AGGREGATE [FINALIZE]
-|  |  |  output: sum:merge(cr_return_amount), sum:merge(cr_net_loss)
-|  |  |  row-size=32B cardinality=1
-|  |  |
-|  |  51:EXCHANGE [UNPARTITIONED]
-|  |  |
-|  |  21:AGGREGATE
-|  |  |  output: sum(cr_return_amount), sum(cr_net_loss)
-|  |  |  row-size=32B cardinality=1
-|  |  |
-|  |  20:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: cr_returned_date_sk = d_date_sk
-|  |  |  runtime filters: RF010 <- d_date_sk
-|  |  |  row-size=38B cardinality=144.07K
-|  |  |
-|  |  |--50:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  19:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |  |     row-size=26B cardinality=7.30K
-|  |  |
-|  |  18:SCAN HDFS [tpcds.catalog_returns]
-|  |     HDFS partitions=1/1 files=1 size=20.39MB
-|  |     runtime filters: RF010 -> cr_returned_date_sk
-|  |     row-size=12B cardinality=144.07K
-|  |
-|  49:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(cs_ext_sales_price), sum:merge(cs_net_profit)
-|  |  group by: cs_call_center_sk
-|  |  row-size=36B cardinality=6
-|  |
-|  48:EXCHANGE [HASH(cs_call_center_sk)]
-|  |
-|  17:AGGREGATE [STREAMING]
-|  |  output: sum(cs_ext_sales_price), sum(cs_net_profit)
-|  |  group by: cs_call_center_sk
-|  |  row-size=36B cardinality=6
-|  |
-|  16:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: cs_sold_date_sk = d_date_sk
-|  |  runtime filters: RF008 <- d_date_sk
-|  |  row-size=42B cardinality=1.44M
-|  |
-|  |--47:EXCHANGE [BROADCAST]
-|  |  |
-|  |  15:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  14:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF008 -> cs_sold_date_sk
-|     row-size=16B cardinality=1.44M
-|
-13:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
-|  hash predicates: s_store_sk = s_store_sk
-|  row-size=72B cardinality=12
-|
-|--46:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(sr_return_amt), sum:merge(sr_net_loss)
-|  |  group by: s_store_sk
-|  |  row-size=36B cardinality=12
-|  |
-|  45:EXCHANGE [HASH(s_store_sk)]
-|  |
-|  12:AGGREGATE [STREAMING]
-|  |  output: sum(sr_return_amt), sum(sr_net_loss)
-|  |  group by: s_store_sk
-|  |  row-size=36B cardinality=12
-|  |
-|  11:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: sr_store_sk = s_store_sk
-|  |  runtime filters: RF004 <- s_store_sk
-|  |  row-size=46B cardinality=287.51K
-|  |
-|  |--44:EXCHANGE [BROADCAST]
-|  |  |
-|  |  09:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=4B cardinality=12
-|  |
-|  10:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: sr_returned_date_sk = d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |  row-size=42B cardinality=287.51K
-|  |
-|  |--43:EXCHANGE [BROADCAST]
-|  |  |
-|  |  08:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  07:SCAN HDFS [tpcds.store_returns]
-|     HDFS partitions=1/1 files=1 size=31.19MB
-|     runtime filters: RF004 -> sr_store_sk, RF006 -> sr_returned_date_sk
-|     row-size=16B cardinality=287.51K
-|
-42:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price), sum:merge(ss_net_profit)
-|  group by: s_store_sk
-|  row-size=36B cardinality=12
-|
-41:EXCHANGE [HASH(s_store_sk)]
-|
-06:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price), sum(ss_net_profit)
-|  group by: s_store_sk
-|  row-size=36B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=46B cardinality=2.88M
-|
-|--40:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=4B cardinality=12
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=42B cardinality=2.88M
-|
-|--39:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|     row-size=26B cardinality=7.30K
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk
-   row-size=16B cardinality=2.88M
-====
-# TPCDS-Q70
-select
-    sum(ss_net_profit) as total_sum
-   ,s_state
-   ,s_county
-   ,grouping(s_state)+grouping(s_county) as lochierarchy
-   ,rank() over (
-        partition by grouping(s_state)+grouping(s_county),
-        case when grouping(s_county) = 0 then s_state end
-        order by sum(ss_net_profit) desc) as rank_within_parent
- from
-    store_sales
-   ,date_dim       d1
-   ,store
- where
-    d1.d_month_seq between 1212 and 1212+11
- and d1.d_date_sk = ss_sold_date_sk
- and s_store_sk  = ss_store_sk
- and s_state in
-             ( select s_state
-               from  (select s_state as s_state,
-                            rank() over ( partition by s_state order by sum(ss_net_profit) desc) as ranking
-                      from   store_sales, store, date_dim
-                      where  d_month_seq between 1212 and 1212+11
-                            and d_date_sk = ss_sold_date_sk
-                            and s_store_sk  = ss_store_sk
-                      group by s_state
-                     ) tmp1
-               where ranking <= 5
-             )
- group by rollup(s_state,s_county)
- order by
-   lochierarchy desc
-  -- Modified from original because Impala does not allow aliases within order by
-  -- expressions, except at the top level.
-  ,case when grouping(s_state)+grouping(s_county) = 0 then s_state end
-  ,rank_within_parent
- limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=52.77MB Threads=7
-Per-Host Resource Estimates: Memory=437MB
-PLAN-ROOT SINK
-|
-19:TOP-N [LIMIT=100]
-|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END ASC, rank() ASC
-|  row-size=50B cardinality=3
-|
-18:ANALYTIC
-|  functions: rank()
-|  partition by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END), CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END
-|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END) DESC
-|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  row-size=54B cardinality=3
-|
-17:SORT
-|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END) DESC
-|  row-size=46B cardinality=3
-|
-16:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END), aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END), aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END)
-|  group by: CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END, CASE valid_tid(11,12,13) WHEN 11 THEN s_county WHEN 12 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(11,12,13) WHEN 11 THEN 11 WHEN 12 THEN 12 WHEN 13 THEN 13 END
-|  row-size=46B cardinality=3
-|
-15:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum(ss_net_profit)
-|    group by: s_state, s_county
-|  Class 1
-|    output: sum(ss_net_profit)
-|    group by: s_state, NULL
-|  Class 2
-|    output: sum(ss_net_profit)
-|    group by: NULL, NULL
-|  row-size=141B cardinality=3
-|
-14:HASH JOIN [LEFT SEMI JOIN]
-|  hash predicates: s_state = s_state
-|  runtime filters: RF000 <- s_state
-|  row-size=67B cardinality=2.88M
-|
-|--11:SELECT
-|  |  predicates: rank() <= 5
-|  |  row-size=38B cardinality=1
-|  |
-|  10:ANALYTIC
-|  |  functions: rank()
-|  |  partition by: s_state
-|  |  order by: sum(ss_net_profit) DESC
-|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  row-size=38B cardinality=1
-|  |
-|  09:SORT
-|  |  order by: s_state ASC NULLS LAST, sum(ss_net_profit) DESC
-|  |  row-size=30B cardinality=1
-|  |
-|  08:AGGREGATE [FINALIZE]
-|  |  output: sum(ss_net_profit)
-|  |  group by: s_state
-|  |  row-size=30B cardinality=1
-|  |
-|  07:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |  row-size=38B cardinality=2.88M
-|  |
-|  |--05:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|  |     row-size=8B cardinality=7.30K
-|  |
-|  06:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  runtime filters: RF008 <- s_store_sk
-|  |  row-size=30B cardinality=2.88M
-|  |
-|  |--04:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=18B cardinality=12
-|  |
-|  03:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF006 -> ss_sold_date_sk, RF008 -> ss_store_sk
-|     row-size=12B cardinality=2.88M
-|
-13:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF002 <- s_store_sk
-|  row-size=67B cardinality=2.88M
-|
-|--02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF000 -> s_state
-|     row-size=47B cardinality=12
-|
-12:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d1.d_date_sk
-|  runtime filters: RF004 <- d1.d_date_sk
-|  row-size=20B cardinality=2.88M
-|
-|--01:SCAN HDFS [tpcds.date_dim d1]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d1.d_month_seq <= 1223, d1.d_month_seq >= 1212
-|     row-size=8B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF002 -> ss_store_sk, RF004 -> ss_sold_date_sk
-   row-size=12B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=97.39MB Threads=16
-Per-Host Resource Estimates: Memory=554MB
-PLAN-ROOT SINK
-|
-30:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END ASC, rank() ASC
-|  limit: 100
-|
-19:TOP-N [LIMIT=100]
-|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END ASC, rank() ASC
-|  row-size=50B cardinality=3
-|
-18:ANALYTIC
-|  functions: rank()
-|  partition by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END), CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END
-|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END) DESC
-|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  row-size=54B cardinality=3
-|
-17:SORT
-|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END) DESC
-|  row-size=46B cardinality=3
-|
-29:EXCHANGE [HASH(aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END),CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END)]
-|
-16:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END), aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END), aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END)
-|  group by: CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END, CASE valid_tid(11,12,13) WHEN 11 THEN s_county WHEN 12 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(11,12,13) WHEN 11 THEN 11 WHEN 12 THEN 12 WHEN 13 THEN 13 END
-|  row-size=46B cardinality=3
-|
-28:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum:merge(ss_net_profit)
-|    group by: s_state, s_county
-|  Class 1
-|    output: sum:merge(ss_net_profit)
-|    group by: s_state, NULL
-|  Class 2
-|    output: sum:merge(ss_net_profit)
-|    group by: NULL, NULL
-|  row-size=141B cardinality=3
-|
-27:EXCHANGE [HASH(CASE valid_tid(11,12,13) WHEN 11 THEN murmur_hash(s_state) WHEN 12 THEN murmur_hash(s_state) WHEN 13 THEN murmur_hash(NULL) END,CASE valid_tid(11,12,13) WHEN 11 THEN murmur_hash(s_county) WHEN 12 THEN murmur_hash(NULL) WHEN 13 THEN murmur_hash(NULL) END)]
-|
-15:AGGREGATE [STREAMING]
-|  Class 0
-|    output: sum(ss_net_profit)
-|    group by: s_state, s_county
-|  Class 1
-|    output: sum(ss_net_profit)
-|    group by: s_state, NULL
-|  Class 2
-|    output: sum(ss_net_profit)
-|    group by: NULL, NULL
-|  row-size=141B cardinality=3
-|
-14:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  hash predicates: s_state = s_state
-|  runtime filters: RF000 <- s_state
-|  row-size=67B cardinality=2.88M
-|
-|--26:EXCHANGE [BROADCAST]
-|  |
-|  11:SELECT
-|  |  predicates: rank() <= 5
-|  |  row-size=38B cardinality=1
-|  |
-|  10:ANALYTIC
-|  |  functions: rank()
-|  |  partition by: s_state
-|  |  order by: sum(ss_net_profit) DESC
-|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  |  row-size=38B cardinality=1
-|  |
-|  09:SORT
-|  |  order by: s_state ASC NULLS LAST, sum(ss_net_profit) DESC
-|  |  row-size=30B cardinality=1
-|  |
-|  25:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ss_net_profit)
-|  |  group by: s_state
-|  |  row-size=30B cardinality=1
-|  |
-|  24:EXCHANGE [HASH(s_state)]
-|  |
-|  08:AGGREGATE [STREAMING]
-|  |  output: sum(ss_net_profit)
-|  |  group by: s_state
-|  |  row-size=30B cardinality=1
-|  |
-|  07:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |  row-size=38B cardinality=2.88M
-|  |
-|  |--23:EXCHANGE [BROADCAST]
-|  |  |
-|  |  05:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1223, d_month_seq >= 1212
-|  |     row-size=8B cardinality=7.30K
-|  |
-|  06:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_store_sk = s_store_sk
-|  |  runtime filters: RF008 <- s_store_sk
-|  |  row-size=30B cardinality=2.88M
-|  |
-|  |--22:EXCHANGE [BROADCAST]
-|  |  |
-|  |  04:SCAN HDFS [tpcds.store]
-|  |     HDFS partitions=1/1 files=1 size=3.08KB
-|  |     row-size=18B cardinality=12
-|  |
-|  03:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF006 -> ss_sold_date_sk, RF008 -> ss_store_sk
-|     row-size=12B cardinality=2.88M
-|
-13:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF002 <- s_store_sk
-|  row-size=67B cardinality=2.88M
-|
-|--21:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     runtime filters: RF000 -> s_state
-|     row-size=47B cardinality=12
-|
-12:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d1.d_date_sk
-|  runtime filters: RF004 <- d1.d_date_sk
-|  row-size=20B cardinality=2.88M
-|
-|--20:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim d1]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d1.d_month_seq <= 1223, d1.d_month_seq >= 1212
-|     row-size=8B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF002 -> ss_store_sk, RF004 -> ss_sold_date_sk
-   row-size=12B cardinality=2.88M
-====
-# TPCDS-Q80
-with ssr as
- (select  s_store_id as store_id,
-          sum(ss_ext_sales_price) as sales,
-          sum(coalesce(sr_return_amt, 0)) as `returns`,
-          sum(ss_net_profit - coalesce(sr_net_loss, 0)) as profit
-  from store_sales left outer join store_returns on
-         (ss_item_sk = sr_item_sk and ss_ticket_number = sr_ticket_number),
-     date_dim,
-     store,
-     item,
-     promotion
- where ss_sold_date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  interval 30 days)
-       and ss_store_sk = s_store_sk
-       and ss_item_sk = i_item_sk
-       and i_current_price > 50
-       and ss_promo_sk = p_promo_sk
-       and p_channel_tv = 'N'
- group by s_store_id)
- ,
- csr as
- (select  cp_catalog_page_id as catalog_page_id,
-          sum(cs_ext_sales_price) as sales,
-          sum(coalesce(cr_return_amount, 0)) as `returns`,
-          sum(cs_net_profit - coalesce(cr_net_loss, 0)) as profit
-  from catalog_sales left outer join catalog_returns on
-         (cs_item_sk = cr_item_sk and cs_order_number = cr_order_number),
-     date_dim,
-     catalog_page,
-     item,
-     promotion
- where cs_sold_date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  interval 30 days)
-        and cs_catalog_page_sk = cp_catalog_page_sk
-       and cs_item_sk = i_item_sk
-       and i_current_price > 50
-       and cs_promo_sk = p_promo_sk
-       and p_channel_tv = 'N'
-group by cp_catalog_page_id)
- ,
- wsr as
- (select  web_site_id,
-          sum(ws_ext_sales_price) as sales,
-          sum(coalesce(wr_return_amt, 0)) as `returns`,
-          sum(ws_net_profit - coalesce(wr_net_loss, 0)) as profit
-  from web_sales left outer join web_returns on
-         (ws_item_sk = wr_item_sk and ws_order_number = wr_order_number),
-     date_dim,
-     web_site,
-     item,
-     promotion
- where ws_sold_date_sk = d_date_sk
-       and d_date between cast('1998-08-04' as date)
-                  and (cast('1998-08-04' as date) +  interval 30 days)
-        and ws_web_site_sk = web_site_sk
-       and ws_item_sk = i_item_sk
-       and i_current_price > 50
-       and ws_promo_sk = p_promo_sk
-       and p_channel_tv = 'N'
-group by web_site_id)
-  select  channel
-        , id
-        , sum(sales) as sales
-        , sum(`returns`) as `returns`
-        , sum(profit) as profit
- from
- (select 'store channel' as channel
-        , 'store' || store_id as id
-        , sales
-        , `returns`
-        , profit
- from   ssr
- union all
- select 'catalog channel' as channel
-        , 'catalog_page' || catalog_page_id as id
-        , sales
-        , `returns`
-        , profit
- from  csr
- union all
- select 'web channel' as channel
-        , 'web_site' || web_site_id as id
-        , sales
-        , `returns`
-        , profit
- from   wsr
- ) x
- group by rollup (channel, id)
- order by channel
-         ,id
- limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=66.95MB Threads=7
-Per-Host Resource Estimates: Memory=436MB
-PLAN-ROOT SINK
-|
-39:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(26,27,28) WHEN 26 THEN channel WHEN 27 THEN channel WHEN 28 THEN NULL END ASC, CASE valid_tid(26,27,28) WHEN 26 THEN id WHEN 27 THEN NULL WHEN 28 THEN NULL END ASC
-|  row-size=72B cardinality=100
-|
-38:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(sales) WHEN 27 THEN sum(sales) WHEN 28 THEN sum(sales) END), aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(`returns`) WHEN 27 THEN sum(`returns`) WHEN 28 THEN sum(`returns`) END), aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(profit) WHEN 27 THEN sum(profit) WHEN 28 THEN sum(profit) END)
-|  group by: CASE valid_tid(26,27,28) WHEN 26 THEN channel WHEN 27 THEN channel WHEN 28 THEN NULL END, CASE valid_tid(26,27,28) WHEN 26 THEN id WHEN 27 THEN NULL WHEN 28 THEN NULL END, CASE valid_tid(26,27,28) WHEN 26 THEN 26 WHEN 27 THEN 27 WHEN 28 THEN 28 END
-|  row-size=76B cardinality=11.56K
-|
-37:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, id
-|  Class 1
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, NULL
-|  Class 2
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: NULL, NULL
-|  row-size=216B cardinality=11.56K
-|
-00:UNION
-|  row-size=72B cardinality=11.56K
-|
-|--36:AGGREGATE [FINALIZE]
-|  |  output: sum(ws_ext_sales_price), sum(coalesce(wr_return_amt, 0)), sum(ws_net_profit - coalesce(wr_net_loss, 0))
-|  |  group by: web_site_id
-|  |  row-size=76B cardinality=15
-|  |
-|  35:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ws_web_site_sk = web_site_sk
-|  |  row-size=147B cardinality=71.46K
-|  |
-|  |--28:SCAN HDFS [tpcds.web_site]
-|  |     HDFS partitions=1/1 files=1 size=8.57KB
-|  |     row-size=32B cardinality=30
-|  |
-|  34:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ws_sold_date_sk = d_date_sk
-|  |  row-size=115B cardinality=71.46K
-|  |
-|  |--27:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  33:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ws_promo_sk = p_promo_sk
-|  |  runtime filters: RF020 <- p_promo_sk
-|  |  row-size=89B cardinality=71.46K
-|  |
-|  |--30:SCAN HDFS [tpcds.promotion]
-|  |     HDFS partitions=1/1 files=1 size=36.36KB
-|  |     predicates: p_channel_tv = 'N'
-|  |     row-size=17B cardinality=300
-|  |
-|  32:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ws_item_sk = i_item_sk
-|  |  runtime filters: RF022 <- i_item_sk
-|  |  row-size=72B cardinality=71.94K
-|  |
-|  |--29:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_current_price > 50
-|  |     row-size=12B cardinality=1.80K
-|  |
-|  31:HASH JOIN [LEFT OUTER JOIN]
-|  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
-|  |  row-size=60B cardinality=719.38K
-|  |
-|  |--26:SCAN HDFS [tpcds.web_returns]
-|  |     HDFS partitions=1/1 files=1 size=9.35MB
-|  |     runtime filters: RF022 -> tpcds.web_returns.wr_item_sk
-|  |     row-size=24B cardinality=71.76K
-|  |
-|  25:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF022 -> ws_item_sk, RF020 -> ws_promo_sk
-|     row-size=36B cardinality=719.38K
-|
-|--24:AGGREGATE [FINALIZE]
-|  |  output: sum(cs_ext_sales_price), sum(coalesce(cr_return_amount, 0)), sum(cs_net_profit - coalesce(cr_net_loss, 0))
-|  |  group by: cp_catalog_page_id
-|  |  row-size=76B cardinality=11.54K
-|  |
-|  23:HASH JOIN [INNER JOIN]
-|  |  hash predicates: cs_catalog_page_sk = cp_catalog_page_sk
-|  |  runtime filters: RF008 <- cp_catalog_page_sk
-|  |  row-size=147B cardinality=143.20K
-|  |
-|  |--16:SCAN HDFS [tpcds.catalog_page]
-|  |     HDFS partitions=1/1 files=1 size=1.56MB
-|  |     row-size=32B cardinality=11.72K
-|  |
-|  22:HASH JOIN [INNER JOIN]
-|  |  hash predicates: cs_sold_date_sk = d_date_sk
-|  |  runtime filters: RF010 <- d_date_sk
-|  |  row-size=115B cardinality=143.20K
-|  |
-|  |--15:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  21:HASH JOIN [INNER JOIN]
-|  |  hash predicates: cs_promo_sk = p_promo_sk
-|  |  runtime filters: RF012 <- p_promo_sk
-|  |  row-size=89B cardinality=143.20K
-|  |
-|  |--18:SCAN HDFS [tpcds.promotion]
-|  |     HDFS partitions=1/1 files=1 size=36.36KB
-|  |     predicates: p_channel_tv = 'N'
-|  |     row-size=17B cardinality=300
-|  |
-|  20:HASH JOIN [INNER JOIN]
-|  |  hash predicates: cs_item_sk = i_item_sk
-|  |  runtime filters: RF014 <- i_item_sk
-|  |  row-size=72B cardinality=144.16K
-|  |
-|  |--17:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_current_price > 50
-|  |     row-size=12B cardinality=1.80K
-|  |
-|  19:HASH JOIN [LEFT OUTER JOIN]
-|  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
-|  |  row-size=60B cardinality=1.44M
-|  |
-|  |--14:SCAN HDFS [tpcds.catalog_returns]
-|  |     HDFS partitions=1/1 files=1 size=20.39MB
-|  |     runtime filters: RF014 -> tpcds.catalog_returns.cr_item_sk
-|  |     row-size=24B cardinality=144.07K
-|  |
-|  13:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF014 -> cs_item_sk, RF012 -> cs_promo_sk, RF008 -> cs_catalog_page_sk, RF010 -> cs_sold_date_sk
-|     row-size=36B cardinality=1.44M
-|
-12:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price), sum(coalesce(sr_return_amt, 0)), sum(ss_net_profit - coalesce(sr_net_loss, 0))
-|  group by: s_store_id
-|  row-size=76B cardinality=6
-|
-11:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=147B cardinality=286.13K
-|
-|--04:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=32B cardinality=12
-|
-10:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=115B cardinality=286.13K
-|
-|--03:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|     row-size=26B cardinality=7.30K
-|
-09:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_promo_sk = p_promo_sk
-|  runtime filters: RF004 <- p_promo_sk
-|  row-size=89B cardinality=286.13K
-|
-|--06:SCAN HDFS [tpcds.promotion]
-|     HDFS partitions=1/1 files=1 size=36.36KB
-|     predicates: p_channel_tv = 'N'
-|     row-size=17B cardinality=300
-|
-08:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF006 <- i_item_sk
-|  row-size=72B cardinality=288.04K
-|
-|--05:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_current_price > 50
-|     row-size=12B cardinality=1.80K
-|
-07:HASH JOIN [LEFT OUTER JOIN]
-|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
-|  row-size=60B cardinality=2.88M
-|
-|--02:SCAN HDFS [tpcds.store_returns]
-|     HDFS partitions=1/1 files=1 size=31.19MB
-|     runtime filters: RF006 -> tpcds.store_returns.sr_item_sk
-|     row-size=24B cardinality=287.51K
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF006 -> ss_item_sk, RF004 -> ss_promo_sk, RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk
-   row-size=36B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=174.21MB Threads=39
-Per-Host Resource Estimates: Memory=1.23GB
-PLAN-ROOT SINK
-|
-63:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: CASE valid_tid(26,27,28) WHEN 26 THEN channel WHEN 27 THEN channel WHEN 28 THEN NULL END ASC, CASE valid_tid(26,27,28) WHEN 26 THEN id WHEN 27 THEN NULL WHEN 28 THEN NULL END ASC
-|  limit: 100
-|
-39:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(26,27,28) WHEN 26 THEN channel WHEN 27 THEN channel WHEN 28 THEN NULL END ASC, CASE valid_tid(26,27,28) WHEN 26 THEN id WHEN 27 THEN NULL WHEN 28 THEN NULL END ASC
-|  row-size=72B cardinality=100
-|
-38:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(sales) WHEN 27 THEN sum(sales) WHEN 28 THEN sum(sales) END), aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(`returns`) WHEN 27 THEN sum(`returns`) WHEN 28 THEN sum(`returns`) END), aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(profit) WHEN 27 THEN sum(profit) WHEN 28 THEN sum(profit) END)
-|  group by: CASE valid_tid(26,27,28) WHEN 26 THEN channel WHEN 27 THEN channel WHEN 28 THEN NULL END, CASE valid_tid(26,27,28) WHEN 26 THEN id WHEN 27 THEN NULL WHEN 28 THEN NULL END, CASE valid_tid(26,27,28) WHEN 26 THEN 26 WHEN 27 THEN 27 WHEN 28 THEN 28 END
-|  row-size=76B cardinality=11.56K
-|
-62:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
-|    group by: channel, id
-|  Class 1
-|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
-|    group by: channel, NULL
-|  Class 2
-|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
-|    group by: NULL, NULL
-|  row-size=216B cardinality=11.56K
-|
-61:EXCHANGE [HASH(CASE valid_tid(26,27,28) WHEN 26 THEN murmur_hash(channel) WHEN 27 THEN murmur_hash(channel) WHEN 28 THEN murmur_hash(NULL) END,CASE valid_tid(26,27,28) WHEN 26 THEN murmur_hash(id) WHEN 27 THEN murmur_hash(NULL) WHEN 28 THEN murmur_hash(NULL) END)]
-|
-37:AGGREGATE [STREAMING]
-|  Class 0
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, id
-|  Class 1
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: channel, NULL
-|  Class 2
-|    output: sum(sales), sum(returns), sum(profit)
-|    group by: NULL, NULL
-|  row-size=216B cardinality=11.56K
-|
-00:UNION
-|  row-size=72B cardinality=11.56K
-|
-|--60:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ws_ext_sales_price), sum:merge(coalesce(wr_return_amt, 0)), sum:merge(ws_net_profit - coalesce(wr_net_loss, 0))
-|  |  group by: web_site_id
-|  |  row-size=76B cardinality=15
-|  |
-|  59:EXCHANGE [HASH(web_site_id)]
-|  |
-|  36:AGGREGATE [STREAMING]
-|  |  output: sum(ws_ext_sales_price), sum(coalesce(wr_return_amt, 0)), sum(ws_net_profit - coalesce(wr_net_loss, 0))
-|  |  group by: web_site_id
-|  |  row-size=76B cardinality=15
-|  |
-|  35:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ws_web_site_sk = web_site_sk
-|  |  row-size=147B cardinality=71.46K
-|  |
-|  |--58:EXCHANGE [BROADCAST]
-|  |  |
-|  |  28:SCAN HDFS [tpcds.web_site]
-|  |     HDFS partitions=1/1 files=1 size=8.57KB
-|  |     row-size=32B cardinality=30
-|  |
-|  34:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ws_sold_date_sk = d_date_sk
-|  |  row-size=115B cardinality=71.46K
-|  |
-|  |--57:EXCHANGE [BROADCAST]
-|  |  |
-|  |  27:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  33:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ws_promo_sk = p_promo_sk
-|  |  runtime filters: RF020 <- p_promo_sk
-|  |  row-size=89B cardinality=71.46K
-|  |
-|  |--56:EXCHANGE [BROADCAST]
-|  |  |
-|  |  30:SCAN HDFS [tpcds.promotion]
-|  |     HDFS partitions=1/1 files=1 size=36.36KB
-|  |     predicates: p_channel_tv = 'N'
-|  |     row-size=17B cardinality=300
-|  |
-|  32:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ws_item_sk = i_item_sk
-|  |  runtime filters: RF022 <- i_item_sk
-|  |  row-size=72B cardinality=71.94K
-|  |
-|  |--55:EXCHANGE [BROADCAST]
-|  |  |
-|  |  29:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_current_price > 50
-|  |     row-size=12B cardinality=1.80K
-|  |
-|  31:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
-|  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
-|  |  row-size=60B cardinality=719.38K
-|  |
-|  |--54:EXCHANGE [BROADCAST]
-|  |  |
-|  |  26:SCAN HDFS [tpcds.web_returns]
-|  |     HDFS partitions=1/1 files=1 size=9.35MB
-|  |     runtime filters: RF022 -> tpcds.web_returns.wr_item_sk
-|  |     row-size=24B cardinality=71.76K
-|  |
-|  25:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF022 -> ws_item_sk, RF020 -> ws_promo_sk
-|     row-size=36B cardinality=719.38K
-|
-|--53:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(cs_ext_sales_price), sum:merge(coalesce(cr_return_amount, 0)), sum:merge(cs_net_profit - coalesce(cr_net_loss, 0))
-|  |  group by: cp_catalog_page_id
-|  |  row-size=76B cardinality=11.54K
-|  |
-|  52:EXCHANGE [HASH(cp_catalog_page_id)]
-|  |
-|  24:AGGREGATE [STREAMING]
-|  |  output: sum(cs_ext_sales_price), sum(coalesce(cr_return_amount, 0)), sum(cs_net_profit - coalesce(cr_net_loss, 0))
-|  |  group by: cp_catalog_page_id
-|  |  row-size=76B cardinality=11.54K
-|  |
-|  23:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: cs_catalog_page_sk = cp_catalog_page_sk
-|  |  runtime filters: RF008 <- cp_catalog_page_sk
-|  |  row-size=147B cardinality=143.20K
-|  |
-|  |--51:EXCHANGE [BROADCAST]
-|  |  |
-|  |  16:SCAN HDFS [tpcds.catalog_page]
-|  |     HDFS partitions=1/1 files=1 size=1.56MB
-|  |     row-size=32B cardinality=11.72K
-|  |
-|  22:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: cs_sold_date_sk = d_date_sk
-|  |  runtime filters: RF010 <- d_date_sk
-|  |  row-size=115B cardinality=143.20K
-|  |
-|  |--50:EXCHANGE [BROADCAST]
-|  |  |
-|  |  15:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|  |     row-size=26B cardinality=7.30K
-|  |
-|  21:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: cs_promo_sk = p_promo_sk
-|  |  runtime filters: RF012 <- p_promo_sk
-|  |  row-size=89B cardinality=143.20K
-|  |
-|  |--49:EXCHANGE [BROADCAST]
-|  |  |
-|  |  18:SCAN HDFS [tpcds.promotion]
-|  |     HDFS partitions=1/1 files=1 size=36.36KB
-|  |     predicates: p_channel_tv = 'N'
-|  |     row-size=17B cardinality=300
-|  |
-|  20:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: cs_item_sk = i_item_sk
-|  |  runtime filters: RF014 <- i_item_sk
-|  |  row-size=72B cardinality=144.16K
-|  |
-|  |--48:EXCHANGE [BROADCAST]
-|  |  |
-|  |  17:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_current_price > 50
-|  |     row-size=12B cardinality=1.80K
-|  |
-|  19:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
-|  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
-|  |  row-size=60B cardinality=1.44M
-|  |
-|  |--47:EXCHANGE [BROADCAST]
-|  |  |
-|  |  14:SCAN HDFS [tpcds.catalog_returns]
-|  |     HDFS partitions=1/1 files=1 size=20.39MB
-|  |     runtime filters: RF014 -> tpcds.catalog_returns.cr_item_sk
-|  |     row-size=24B cardinality=144.07K
-|  |
-|  13:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF014 -> cs_item_sk, RF012 -> cs_promo_sk, RF008 -> cs_catalog_page_sk, RF010 -> cs_sold_date_sk
-|     row-size=36B cardinality=1.44M
-|
-46:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price), sum:merge(coalesce(sr_return_amt, 0)), sum:merge(ss_net_profit - coalesce(sr_net_loss, 0))
-|  group by: s_store_id
-|  row-size=76B cardinality=6
-|
-45:EXCHANGE [HASH(s_store_id)]
-|
-12:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price), sum(coalesce(sr_return_amt, 0)), sum(ss_net_profit - coalesce(sr_net_loss, 0))
-|  group by: s_store_id
-|  row-size=76B cardinality=6
-|
-11:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=147B cardinality=286.13K
-|
-|--44:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     row-size=32B cardinality=12
-|
-10:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF002 <- d_date_sk
-|  row-size=115B cardinality=286.13K
-|
-|--43:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_date <= DATE '1998-09-03', d_date >= DATE '1998-08-04'
-|     row-size=26B cardinality=7.30K
-|
-09:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_promo_sk = p_promo_sk
-|  runtime filters: RF004 <- p_promo_sk
-|  row-size=89B cardinality=286.13K
-|
-|--42:EXCHANGE [BROADCAST]
-|  |
-|  06:SCAN HDFS [tpcds.promotion]
-|     HDFS partitions=1/1 files=1 size=36.36KB
-|     predicates: p_channel_tv = 'N'
-|     row-size=17B cardinality=300
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF006 <- i_item_sk
-|  row-size=72B cardinality=288.04K
-|
-|--41:EXCHANGE [BROADCAST]
-|  |
-|  05:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_current_price > 50
-|     row-size=12B cardinality=1.80K
-|
-07:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
-|  row-size=60B cardinality=2.88M
-|
-|--40:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.store_returns]
-|     HDFS partitions=1/1 files=1 size=31.19MB
-|     runtime filters: RF006 -> tpcds.store_returns.sr_item_sk
-|     row-size=24B cardinality=287.51K
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF006 -> ss_item_sk, RF004 -> ss_promo_sk, RF000 -> ss_store_sk, RF002 -> ss_sold_date_sk
-   row-size=36B cardinality=2.88M
-====
-# TPCDS-Q86
-select
-    sum(ws_net_paid) as total_sum
-   ,i_category
-   ,i_class
-   ,grouping(i_category)+grouping(i_class) as lochierarchy
-   ,rank() over (
-        partition by grouping(i_category)+grouping(i_class),
-        case when grouping(i_class) = 0 then i_category end
-        order by sum(ws_net_paid) desc) as rank_within_parent
- from
-    web_sales
-   ,date_dim       d1
-   ,item
- where
-    d1.d_month_seq between 1212 and 1212+11
- and d1.d_date_sk = ws_sold_date_sk
- and i_item_sk  = ws_item_sk
- group by rollup(i_category,i_class)
- order by
-   lochierarchy desc,
-  -- Modified from original because Impala does not allow aliases within order by
-  -- expressions, except at the top level.
-   case when grouping(i_category)+grouping(i_class) = 0 then i_category end,
-   rank_within_parent
- limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=33.88MB Threads=4
-Per-Host Resource Estimates: Memory=250MB
-PLAN-ROOT SINK
-|
-09:TOP-N [LIMIT=100]
-|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END ASC, rank() ASC
-|  row-size=50B cardinality=100
-|
-08:ANALYTIC
-|  functions: rank()
-|  partition by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END), CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END
-|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END) DESC
-|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  row-size=54B cardinality=1.00K
-|
-07:SORT
-|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END) DESC
-|  row-size=46B cardinality=1.00K
-|
-06:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END), aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END), aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END)
-|  group by: CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END, CASE valid_tid(3,4,5) WHEN 3 THEN i_class WHEN 4 THEN NULL WHEN 5 THEN NULL END, CASE valid_tid(3,4,5) WHEN 3 THEN 3 WHEN 4 THEN 4 WHEN 5 THEN 5 END
-|  row-size=46B cardinality=1.00K
-|
-05:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum(ws_net_paid)
-|    group by: i_category, i_class
-|  Class 1
-|    output: sum(ws_net_paid)
-|    group by: i_category, NULL
-|  Class 2
-|    output: sum(ws_net_paid)
-|    group by: NULL, NULL
-|  row-size=140B cardinality=1.00K
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ws_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=70B cardinality=719.38K
-|
-|--02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=46B cardinality=18.00K
-|
-03:HASH JOIN [INNER JOIN]
-|  hash predicates: ws_sold_date_sk = d1.d_date_sk
-|  runtime filters: RF002 <- d1.d_date_sk
-|  row-size=24B cardinality=719.38K
-|
-|--01:SCAN HDFS [tpcds.date_dim d1]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d1.d_month_seq <= 1223, d1.d_month_seq >= 1212
-|     row-size=8B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.web_sales]
-   HDFS partitions=1/1 files=1 size=140.07MB
-   runtime filters: RF000 -> ws_item_sk, RF002 -> ws_sold_date_sk
-   row-size=16B cardinality=719.38K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=59.62MB Threads=9
-Per-Host Resource Estimates: Memory=333MB
-PLAN-ROOT SINK
-|
-15:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END ASC, rank() ASC
-|  limit: 100
-|
-09:TOP-N [LIMIT=100]
-|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END ASC, rank() ASC
-|  row-size=50B cardinality=100
-|
-08:ANALYTIC
-|  functions: rank()
-|  partition by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END), CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END
-|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END) DESC
-|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  row-size=54B cardinality=1.00K
-|
-07:SORT
-|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END) DESC
-|  row-size=46B cardinality=1.00K
-|
-14:EXCHANGE [HASH(aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END),CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END)]
-|
-06:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END), aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END), aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END)
-|  group by: CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END, CASE valid_tid(3,4,5) WHEN 3 THEN i_class WHEN 4 THEN NULL WHEN 5 THEN NULL END, CASE valid_tid(3,4,5) WHEN 3 THEN 3 WHEN 4 THEN 4 WHEN 5 THEN 5 END
-|  row-size=46B cardinality=1.00K
-|
-13:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum:merge(ws_net_paid)
-|    group by: i_category, i_class
-|  Class 1
-|    output: sum:merge(ws_net_paid)
-|    group by: i_category, NULL
-|  Class 2
-|    output: sum:merge(ws_net_paid)
-|    group by: NULL, NULL
-|  row-size=140B cardinality=1.00K
-|
-12:EXCHANGE [HASH(CASE valid_tid(3,4,5) WHEN 3 THEN murmur_hash(i_category) WHEN 4 THEN murmur_hash(i_category) WHEN 5 THEN murmur_hash(NULL) END,CASE valid_tid(3,4,5) WHEN 3 THEN murmur_hash(i_class) WHEN 4 THEN murmur_hash(NULL) WHEN 5 THEN murmur_hash(NULL) END)]
-|
-05:AGGREGATE [STREAMING]
-|  Class 0
-|    output: sum(ws_net_paid)
-|    group by: i_category, i_class
-|  Class 1
-|    output: sum(ws_net_paid)
-|    group by: i_category, NULL
-|  Class 2
-|    output: sum(ws_net_paid)
-|    group by: NULL, NULL
-|  row-size=140B cardinality=1.00K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ws_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=70B cardinality=719.38K
-|
-|--11:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=46B cardinality=18.00K
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ws_sold_date_sk = d1.d_date_sk
-|  runtime filters: RF002 <- d1.d_date_sk
-|  row-size=24B cardinality=719.38K
-|
-|--10:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim d1]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d1.d_month_seq <= 1223, d1.d_month_seq >= 1212
-|     row-size=8B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.web_sales]
-   HDFS partitions=1/1 files=1 size=140.07MB
-   runtime filters: RF000 -> ws_item_sk, RF002 -> ws_sold_date_sk
-   row-size=16B cardinality=719.38K
-====
-# TPCDS-Q27
-select i_item_id,
-       s_state, grouping(s_state) g_state,
-       avg(ss_quantity) agg1,
-       avg(ss_list_price) agg2,
-       avg(ss_coupon_amt) agg3,
-       avg(ss_sales_price) agg4
-from store_sales, customer_demographics, date_dim, store, item
-where ss_sold_date_sk = d_date_sk and
-      ss_item_sk = i_item_sk and
-      ss_store_sk = s_store_sk and
-      ss_cdemo_sk = cd_demo_sk and
-      cd_gender = 'M' and
-      cd_marital_status = 'S' and
-      cd_education_status = 'College' and
-      d_year = 2002 and
-      s_state in ('TN')
-group by rollup (i_item_id, s_state)
-order by i_item_id
-        ,s_state
-limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=50.32MB Threads=6
-Per-Host Resource Estimates: Memory=434MB
-PLAN-ROOT SINK
-|
-11:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(6,8,10) WHEN 6 THEN i_item_id WHEN 8 THEN i_item_id WHEN 10 THEN NULL END ASC, CASE valid_tid(6,8,10) WHEN 6 THEN s_state WHEN 8 THEN NULL WHEN 10 THEN NULL END ASC
-|  row-size=57B cardinality=100
-|
-10:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN 0 WHEN 8 THEN 1 WHEN 10 THEN 1 END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_quantity) WHEN 8 THEN avg(ss_quantity) WHEN 10 THEN avg(ss_quantity) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_list_price) WHEN 8 THEN avg(ss_list_price) WHEN 10 THEN avg(ss_list_price) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_coupon_amt) WHEN 8 THEN avg(ss_coupon_amt) WHEN 10 THEN avg(ss_coupon_amt) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_sales_price) WHEN 8 THEN avg(ss_sales_price) WHEN 10 THEN avg(ss_sales_price) END)
-|  group by: CASE valid_tid(6,8,10) WHEN 6 THEN i_item_id WHEN 8 THEN i_item_id WHEN 10 THEN NULL END, CASE valid_tid(6,8,10) WHEN 6 THEN s_state WHEN 8 THEN NULL WHEN 10 THEN NULL END, CASE valid_tid(6,8,10) WHEN 6 THEN 6 WHEN 8 THEN 8 WHEN 10 THEN 10 END
-|  row-size=61B cardinality=17.71K
-|
-09:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|    group by: i_item_id, s_state
-|  Class 1
-|    output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|    group by: i_item_id, NULL
-|  Class 2
-|    output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|    group by: NULL, NULL
-|  row-size=202B cardinality=17.71K
-|
-08:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=150B cardinality=263.34K
-|
-|--04:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-07:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF002 <- s_store_sk
-|  row-size=114B cardinality=263.34K
-|
-|--03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_state IN ('TN')
-|     row-size=18B cardinality=12
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_cdemo_sk = cd_demo_sk
-|  runtime filters: RF004 <- cd_demo_sk
-|  row-size=96B cardinality=263.34K
-|
-|--01:SCAN HDFS [tpcds.customer_demographics]
-|     HDFS partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
-|     row-size=52B cardinality=97.40K
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=44B cardinality=589.03K
-|
-|--02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 2002
-|     row-size=8B cardinality=373
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_item_sk, RF002 -> ss_store_sk, RF004 -> ss_cdemo_sk, RF006 -> ss_sold_date_sk
-   row-size=36B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=67.95MB Threads=12
-Per-Host Resource Estimates: Memory=510MB
-PLAN-ROOT SINK
-|
-18:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: CASE valid_tid(6,8,10) WHEN 6 THEN i_item_id WHEN 8 THEN i_item_id WHEN 10 THEN NULL END ASC, CASE valid_tid(6,8,10) WHEN 6 THEN s_state WHEN 8 THEN NULL WHEN 10 THEN NULL END ASC
-|  limit: 100
-|
-11:TOP-N [LIMIT=100]
-|  order by: CASE valid_tid(6,8,10) WHEN 6 THEN i_item_id WHEN 8 THEN i_item_id WHEN 10 THEN NULL END ASC, CASE valid_tid(6,8,10) WHEN 6 THEN s_state WHEN 8 THEN NULL WHEN 10 THEN NULL END ASC
-|  row-size=57B cardinality=100
-|
-10:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN 0 WHEN 8 THEN 1 WHEN 10 THEN 1 END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_quantity) WHEN 8 THEN avg(ss_quantity) WHEN 10 THEN avg(ss_quantity) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_list_price) WHEN 8 THEN avg(ss_list_price) WHEN 10 THEN avg(ss_list_price) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_coupon_amt) WHEN 8 THEN avg(ss_coupon_amt) WHEN 10 THEN avg(ss_coupon_amt) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_sales_price) WHEN 8 THEN avg(ss_sales_price) WHEN 10 THEN avg(ss_sales_price) END)
-|  group by: CASE valid_tid(6,8,10) WHEN 6 THEN i_item_id WHEN 8 THEN i_item_id WHEN 10 THEN NULL END, CASE valid_tid(6,8,10) WHEN 6 THEN s_state WHEN 8 THEN NULL WHEN 10 THEN NULL END, CASE valid_tid(6,8,10) WHEN 6 THEN 6 WHEN 8 THEN 8 WHEN 10 THEN 10 END
-|  row-size=61B cardinality=17.71K
-|
-17:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
-|    group by: i_item_id, s_state
-|  Class 1
-|    output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
-|    group by: i_item_id, NULL
-|  Class 2
-|    output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
-|    group by: NULL, NULL
-|  row-size=202B cardinality=17.71K
-|
-16:EXCHANGE [HASH(CASE valid_tid(5,7,9) WHEN 5 THEN murmur_hash(i_item_id) WHEN 7 THEN murmur_hash(i_item_id) WHEN 9 THEN murmur_hash(NULL) END,CASE valid_tid(5,7,9) WHEN 5 THEN murmur_hash(s_state) WHEN 7 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) END)]
-|
-09:AGGREGATE [STREAMING]
-|  Class 0
-|    output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|    group by: i_item_id, s_state
-|  Class 1
-|    output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|    group by: i_item_id, NULL
-|  Class 2
-|    output: avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
-|    group by: NULL, NULL
-|  row-size=202B cardinality=17.71K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF000 <- i_item_sk
-|  row-size=150B cardinality=263.34K
-|
-|--15:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=36B cardinality=18.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF002 <- s_store_sk
-|  row-size=114B cardinality=263.34K
-|
-|--14:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_state IN ('TN')
-|     row-size=18B cardinality=12
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_cdemo_sk = cd_demo_sk
-|  runtime filters: RF004 <- cd_demo_sk
-|  row-size=96B cardinality=263.34K
-|
-|--13:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.customer_demographics]
-|     HDFS partitions=1/1 files=1 size=76.92MB
-|     predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
-|     row-size=52B cardinality=97.40K
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=44B cardinality=589.03K
-|
-|--12:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 2002
-|     row-size=8B cardinality=373
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_item_sk, RF002 -> ss_store_sk, RF004 -> ss_cdemo_sk, RF006 -> ss_sold_date_sk
-   row-size=36B cardinality=2.88M
-====
-# TPCDS-Q36
-select
-    sum(ss_net_profit)/sum(ss_ext_sales_price) as gross_margin
-   ,i_category
-   ,i_class
-   ,grouping(i_category)+grouping(i_class) as lochierarchy
-   ,rank() over (
-        partition by grouping(i_category)+grouping(i_class),
-        case when grouping(i_class) = 0 then i_category end
-        order by sum(ss_net_profit)/sum(ss_ext_sales_price) asc) as rank_within_parent
- from
-    store_sales
-   ,date_dim       d1
-   ,item
-   ,store
- where
-    d1.d_year = 2001
- and d1.d_date_sk = ss_sold_date_sk
- and i_item_sk  = ss_item_sk
- and s_store_sk  = ss_store_sk
- and s_state in ('TN')
- group by rollup(i_category,i_class)
- order by
-   lochierarchy desc
-  -- Modified from original because Impala does not allow aliases within order by
-  -- expressions, except at the top level.
-  ,case when grouping(i_category)+grouping(i_class) = 0 then i_category end
-  ,rank_within_parent
-  limit 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=36.82MB Threads=5
-Per-Host Resource Estimates: Memory=253MB
-PLAN-ROOT SINK
-|
-11:TOP-N [LIMIT=100]
-|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END ASC, rank() ASC
-|  row-size=66B cardinality=100
-|
-10:ANALYTIC
-|  functions: rank()
-|  partition by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END), CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END
-|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END) / aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END) ASC
-|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  row-size=70B cardinality=1.00K
-|
-09:SORT
-|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END) / aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END) ASC
-|  row-size=62B cardinality=1.00K
-|
-08:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END), aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END), aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END), aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END)
-|  group by: CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END, CASE valid_tid(4,5,6) WHEN 4 THEN i_class WHEN 5 THEN NULL WHEN 6 THEN NULL END, CASE valid_tid(4,5,6) WHEN 4 THEN 4 WHEN 5 THEN 5 WHEN 6 THEN 6 END
-|  row-size=62B cardinality=1.00K
-|
-07:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
-|    group by: i_category, i_class
-|  Class 1
-|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
-|    group by: i_category, NULL
-|  Class 2
-|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
-|    group by: NULL, NULL
-|  row-size=188B cardinality=1.00K
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=96B cardinality=589.03K
-|
-|--03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_state IN ('TN')
-|     row-size=18B cardinality=12
-|
-05:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=78B cardinality=589.03K
-|
-|--02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=46B cardinality=18.00K
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d1.d_date_sk
-|  runtime filters: RF004 <- d1.d_date_sk
-|  row-size=32B cardinality=589.03K
-|
-|--01:SCAN HDFS [tpcds.date_dim d1]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d1.d_year = 2001
-|     row-size=8B cardinality=373
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_item_sk, RF004 -> ss_sold_date_sk
-   row-size=24B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=62.57MB Threads=11
-Per-Host Resource Estimates: Memory=336MB
-PLAN-ROOT SINK
-|
-18:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END ASC, rank() ASC
-|  limit: 100
-|
-11:TOP-N [LIMIT=100]
-|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END ASC, rank() ASC
-|  row-size=66B cardinality=100
-|
-10:ANALYTIC
-|  functions: rank()
-|  partition by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END), CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END
-|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END) / aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END) ASC
-|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
-|  row-size=70B cardinality=1.00K
-|
-09:SORT
-|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END) / aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END) ASC
-|  row-size=62B cardinality=1.00K
-|
-17:EXCHANGE [HASH(aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END),CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END)]
-|
-08:AGGREGATE [FINALIZE]
-|  output: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END), aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END), aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END), aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END)
-|  group by: CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END, CASE valid_tid(4,5,6) WHEN 4 THEN i_class WHEN 5 THEN NULL WHEN 6 THEN NULL END, CASE valid_tid(4,5,6) WHEN 4 THEN 4 WHEN 5 THEN 5 WHEN 6 THEN 6 END
-|  row-size=62B cardinality=1.00K
-|
-16:AGGREGATE [FINALIZE]
-|  Class 0
-|    output: sum:merge(ss_net_profit), sum:merge(ss_ext_sales_price)
-|    group by: i_category, i_class
-|  Class 1
-|    output: sum:merge(ss_net_profit), sum:merge(ss_ext_sales_price)
-|    group by: i_category, NULL
-|  Class 2
-|    output: sum:merge(ss_net_profit), sum:merge(ss_ext_sales_price)
-|    group by: NULL, NULL
-|  row-size=188B cardinality=1.00K
-|
-15:EXCHANGE [HASH(CASE valid_tid(4,5,6) WHEN 4 THEN murmur_hash(i_category) WHEN 5 THEN murmur_hash(i_category) WHEN 6 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6) WHEN 4 THEN murmur_hash(i_class) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) END)]
-|
-07:AGGREGATE [STREAMING]
-|  Class 0
-|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
-|    group by: i_category, i_class
-|  Class 1
-|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
-|    group by: i_category, NULL
-|  Class 2
-|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
-|    group by: NULL, NULL
-|  row-size=188B cardinality=1.00K
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_store_sk = s_store_sk
-|  runtime filters: RF000 <- s_store_sk
-|  row-size=96B cardinality=589.03K
-|
-|--14:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.store]
-|     HDFS partitions=1/1 files=1 size=3.08KB
-|     predicates: s_state IN ('TN')
-|     row-size=18B cardinality=12
-|
-05:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=78B cardinality=589.03K
-|
-|--13:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     row-size=46B cardinality=18.00K
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d1.d_date_sk
-|  runtime filters: RF004 <- d1.d_date_sk
-|  row-size=32B cardinality=589.03K
-|
-|--12:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim d1]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d1.d_year = 2001
-|     row-size=8B cardinality=373
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> ss_store_sk, RF002 -> ss_item_sk, RF004 -> ss_sold_date_sk
-   row-size=24B cardinality=2.88M
-====
-# TPCDS-Q38
-SELECT count(*)
-FROM
-  (SELECT DISTINCT c_last_name,
-                   c_first_name,
-                   d_date
-   FROM store_sales,
-        date_dim,
-        customer
-   WHERE store_sales.ss_sold_date_sk = date_dim.d_date_sk
-     AND store_sales.ss_customer_sk = customer.c_customer_sk
-     AND d_month_seq BETWEEN 1200 AND 1200 + 11 INTERSECT
-     SELECT DISTINCT c_last_name,
-                     c_first_name,
-                     d_date
-     FROM catalog_sales,
-          date_dim,
-          customer WHERE catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
-     AND catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
-     AND d_month_seq BETWEEN 1200 AND 1200 + 11 INTERSECT
-     SELECT DISTINCT c_last_name,
-                     c_first_name,
-                     d_date
-     FROM web_sales,
-          date_dim,
-          customer WHERE web_sales.ws_sold_date_sk = date_dim.d_date_sk
-     AND web_sales.ws_bill_customer_sk = customer.c_customer_sk
-     AND d_month_seq BETWEEN 1200 AND 1200 + 11 ) hot_cust
-LIMIT 100
----- PLAN
-Max Per-Host Resource Reservation: Memory=194.69MB Threads=10
-Per-Host Resource Estimates: Memory=861MB
-PLAN-ROOT SINK
-|
-20:AGGREGATE [FINALIZE]
-|  output: count(*)
-|  limit: 100
-|  row-size=8B cardinality=1
-|
-19:HASH JOIN [INNER JOIN]
-|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
-|  runtime filters: RF000 <- c_first_name, RF001 <- c_last_name, RF002 <- d_date
-|  row-size=174B cardinality=2.88M
-|
-|--17:AGGREGATE [FINALIZE]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=719.38K
-|  |
-|  16:HASH JOIN [INNER JOIN]
-|  |  hash predicates: web_sales.ws_bill_customer_sk = customer.c_customer_sk
-|  |  row-size=78B cardinality=719.38K
-|  |
-|  |--14:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     row-size=40B cardinality=100.00K
-|  |
-|  15:HASH JOIN [INNER JOIN]
-|  |  hash predicates: web_sales.ws_sold_date_sk = date_dim.d_date_sk
-|  |  row-size=38B cardinality=719.38K
-|  |
-|  |--13:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|  |     row-size=30B cardinality=7.30K
-|  |
-|  12:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     row-size=8B cardinality=719.38K
-|
-18:HASH JOIN [INNER JOIN]
-|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
-|  runtime filters: RF006 <- c_first_name, RF007 <- c_last_name, RF008 <- d_date
-|  row-size=116B cardinality=2.88M
-|
-|--11:AGGREGATE [FINALIZE]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=1.44M
-|  |
-|  10:HASH JOIN [INNER JOIN]
-|  |  hash predicates: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
-|  |  runtime filters: RF016 <- customer.c_customer_sk
-|  |  row-size=78B cardinality=1.44M
-|  |
-|  |--08:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     row-size=40B cardinality=100.00K
-|  |
-|  09:HASH JOIN [INNER JOIN]
-|  |  hash predicates: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
-|  |  runtime filters: RF018 <- date_dim.d_date_sk
-|  |  row-size=38B cardinality=1.44M
-|  |
-|  |--07:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|  |     row-size=30B cardinality=7.30K
-|  |
-|  06:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF016 -> catalog_sales.cs_bill_customer_sk, RF018 -> catalog_sales.cs_sold_date_sk
-|     row-size=8B cardinality=1.44M
-|
-05:AGGREGATE [FINALIZE]
-|  group by: c_last_name, c_first_name, d_date
-|  row-size=58B cardinality=2.88M
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_customer_sk = customer.c_customer_sk
-|  runtime filters: RF012 <- customer.c_customer_sk
-|  row-size=78B cardinality=2.88M
-|
-|--02:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> tpcds.customer.c_first_name, RF001 -> tpcds.customer.c_last_name, RF006 -> tpcds.customer.c_first_name, RF007 -> tpcds.customer.c_last_name
-|     row-size=40B cardinality=100.00K
-|
-03:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  runtime filters: RF014 <- date_dim.d_date_sk
-|  row-size=38B cardinality=2.88M
-|
-|--01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|     runtime filters: RF002 -> tpcds.date_dim.d_date, RF008 -> tpcds.date_dim.d_date
-|     row-size=30B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF012 -> store_sales.ss_customer_sk, RF014 -> store_sales.ss_sold_date_sk
-   row-size=8B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=363.06MB Threads=22
-Per-Host Resource Estimates: Memory=1.21GB
-PLAN-ROOT SINK
-|
-36:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  limit: 100
-|  row-size=8B cardinality=1
-|
-35:EXCHANGE [UNPARTITIONED]
-|
-20:AGGREGATE
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-19:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
-|  runtime filters: RF000 <- c_first_name, RF001 <- c_last_name, RF002 <- d_date
-|  row-size=174B cardinality=2.88M
-|
-|--34:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
-|  |
-|  33:AGGREGATE [FINALIZE]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=719.38K
-|  |
-|  32:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
-|  |
-|  17:AGGREGATE [STREAMING]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=719.38K
-|  |
-|  16:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: web_sales.ws_bill_customer_sk = customer.c_customer_sk
-|  |  row-size=78B cardinality=719.38K
-|  |
-|  |--31:EXCHANGE [BROADCAST]
-|  |  |
-|  |  14:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     row-size=40B cardinality=100.00K
-|  |
-|  15:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: web_sales.ws_sold_date_sk = date_dim.d_date_sk
-|  |  row-size=38B cardinality=719.38K
-|  |
-|  |--30:EXCHANGE [BROADCAST]
-|  |  |
-|  |  13:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|  |     row-size=30B cardinality=7.30K
-|  |
-|  12:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     row-size=8B cardinality=719.38K
-|
-18:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
-|  runtime filters: RF006 <- c_first_name, RF007 <- c_last_name, RF008 <- d_date
-|  row-size=116B cardinality=2.88M
-|
-|--29:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
-|  |
-|  28:AGGREGATE [FINALIZE]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=1.44M
-|  |
-|  27:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
-|  |
-|  11:AGGREGATE [STREAMING]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=1.44M
-|  |
-|  10:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
-|  |  runtime filters: RF016 <- customer.c_customer_sk
-|  |  row-size=78B cardinality=1.44M
-|  |
-|  |--26:EXCHANGE [BROADCAST]
-|  |  |
-|  |  08:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     row-size=40B cardinality=100.00K
-|  |
-|  09:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
-|  |  runtime filters: RF018 <- date_dim.d_date_sk
-|  |  row-size=38B cardinality=1.44M
-|  |
-|  |--25:EXCHANGE [BROADCAST]
-|  |  |
-|  |  07:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|  |     row-size=30B cardinality=7.30K
-|  |
-|  06:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF016 -> catalog_sales.cs_bill_customer_sk, RF018 -> catalog_sales.cs_sold_date_sk
-|     row-size=8B cardinality=1.44M
-|
-24:AGGREGATE [FINALIZE]
-|  group by: c_last_name, c_first_name, d_date
-|  row-size=58B cardinality=2.88M
-|
-23:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
-|
-05:AGGREGATE [STREAMING]
-|  group by: c_last_name, c_first_name, d_date
-|  row-size=58B cardinality=2.88M
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_customer_sk = customer.c_customer_sk
-|  runtime filters: RF012 <- customer.c_customer_sk
-|  row-size=78B cardinality=2.88M
-|
-|--22:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> tpcds.customer.c_first_name, RF001 -> tpcds.customer.c_last_name, RF006 -> tpcds.customer.c_first_name, RF007 -> tpcds.customer.c_last_name
-|     row-size=40B cardinality=100.00K
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  runtime filters: RF014 <- date_dim.d_date_sk
-|  row-size=38B cardinality=2.88M
-|
-|--21:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|     runtime filters: RF002 -> tpcds.date_dim.d_date, RF008 -> tpcds.date_dim.d_date
-|     row-size=30B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF012 -> store_sales.ss_customer_sk, RF014 -> store_sales.ss_sold_date_sk
-   row-size=8B cardinality=2.88M
-====
-# TPCDS-Q87
-SELECT count(*)
-FROM ((SELECT DISTINCT c_last_name,
-                         c_first_name,
-                         d_date
-         FROM store_sales,
-              date_dim,
-              customer
-         WHERE store_sales.ss_sold_date_sk = date_dim.d_date_sk
-           AND store_sales.ss_customer_sk = customer.c_customer_sk
-           AND d_month_seq BETWEEN 1200 AND 1200+11)
-      EXCEPT
-        (SELECT DISTINCT c_last_name,
-                         c_first_name,
-                         d_date
-         FROM catalog_sales,
-              date_dim,
-              customer
-         WHERE catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
-           AND catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
-           AND d_month_seq BETWEEN 1200 AND 1200+11)
-      EXCEPT
-        (SELECT DISTINCT c_last_name,
-                         c_first_name,
-                         d_date
-         FROM web_sales,
-              date_dim,
-              customer
-         WHERE web_sales.ws_sold_date_sk = date_dim.d_date_sk
-           AND web_sales.ws_bill_customer_sk = customer.c_customer_sk
-           AND d_month_seq BETWEEN 1200 AND 1200+11)) cool_cust;
----- PLAN
-Max Per-Host Resource Reservation: Memory=190.69MB Threads=10
-Per-Host Resource Estimates: Memory=857MB
-PLAN-ROOT SINK
-|
-20:AGGREGATE [FINALIZE]
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-19:HASH JOIN [LEFT ANTI JOIN]
-|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
-|  row-size=58B cardinality=2.88M
-|
-|--17:AGGREGATE [FINALIZE]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=719.38K
-|  |
-|  16:HASH JOIN [INNER JOIN]
-|  |  hash predicates: web_sales.ws_bill_customer_sk = customer.c_customer_sk
-|  |  runtime filters: RF008 <- customer.c_customer_sk
-|  |  row-size=78B cardinality=719.38K
-|  |
-|  |--14:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     row-size=40B cardinality=100.00K
-|  |
-|  15:HASH JOIN [INNER JOIN]
-|  |  hash predicates: web_sales.ws_sold_date_sk = date_dim.d_date_sk
-|  |  runtime filters: RF010 <- date_dim.d_date_sk
-|  |  row-size=38B cardinality=719.38K
-|  |
-|  |--13:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|  |     row-size=30B cardinality=7.30K
-|  |
-|  12:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF008 -> web_sales.ws_bill_customer_sk, RF010 -> web_sales.ws_sold_date_sk
-|     row-size=8B cardinality=719.38K
-|
-18:HASH JOIN [LEFT ANTI JOIN]
-|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
-|  row-size=58B cardinality=2.88M
-|
-|--11:AGGREGATE [FINALIZE]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=1.44M
-|  |
-|  10:HASH JOIN [INNER JOIN]
-|  |  hash predicates: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
-|  |  runtime filters: RF004 <- customer.c_customer_sk
-|  |  row-size=78B cardinality=1.44M
-|  |
-|  |--08:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     row-size=40B cardinality=100.00K
-|  |
-|  09:HASH JOIN [INNER JOIN]
-|  |  hash predicates: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
-|  |  runtime filters: RF006 <- date_dim.d_date_sk
-|  |  row-size=38B cardinality=1.44M
-|  |
-|  |--07:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|  |     row-size=30B cardinality=7.30K
-|  |
-|  06:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF004 -> catalog_sales.cs_bill_customer_sk, RF006 -> catalog_sales.cs_sold_date_sk
-|     row-size=8B cardinality=1.44M
-|
-05:AGGREGATE [FINALIZE]
-|  group by: c_last_name, c_first_name, d_date
-|  row-size=58B cardinality=2.88M
-|
-04:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_customer_sk = customer.c_customer_sk
-|  runtime filters: RF000 <- customer.c_customer_sk
-|  row-size=78B cardinality=2.88M
-|
-|--02:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     row-size=40B cardinality=100.00K
-|
-03:HASH JOIN [INNER JOIN]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  runtime filters: RF002 <- date_dim.d_date_sk
-|  row-size=38B cardinality=2.88M
-|
-|--01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|     row-size=30B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> store_sales.ss_customer_sk, RF002 -> store_sales.ss_sold_date_sk
-   row-size=8B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=353.06MB Threads=22
-Per-Host Resource Estimates: Memory=1.20GB
-PLAN-ROOT SINK
-|
-36:AGGREGATE [FINALIZE]
-|  output: count:merge(*)
-|  row-size=8B cardinality=1
-|
-35:EXCHANGE [UNPARTITIONED]
-|
-20:AGGREGATE
-|  output: count(*)
-|  row-size=8B cardinality=1
-|
-19:HASH JOIN [LEFT ANTI JOIN, PARTITIONED]
-|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
-|  row-size=58B cardinality=2.88M
-|
-|--34:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
-|  |
-|  33:AGGREGATE [FINALIZE]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=719.38K
-|  |
-|  32:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
-|  |
-|  17:AGGREGATE [STREAMING]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=719.38K
-|  |
-|  16:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: web_sales.ws_bill_customer_sk = customer.c_customer_sk
-|  |  runtime filters: RF008 <- customer.c_customer_sk
-|  |  row-size=78B cardinality=719.38K
-|  |
-|  |--31:EXCHANGE [BROADCAST]
-|  |  |
-|  |  14:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     row-size=40B cardinality=100.00K
-|  |
-|  15:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: web_sales.ws_sold_date_sk = date_dim.d_date_sk
-|  |  runtime filters: RF010 <- date_dim.d_date_sk
-|  |  row-size=38B cardinality=719.38K
-|  |
-|  |--30:EXCHANGE [BROADCAST]
-|  |  |
-|  |  13:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|  |     row-size=30B cardinality=7.30K
-|  |
-|  12:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF008 -> web_sales.ws_bill_customer_sk, RF010 -> web_sales.ws_sold_date_sk
-|     row-size=8B cardinality=719.38K
-|
-18:HASH JOIN [LEFT ANTI JOIN, PARTITIONED]
-|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
-|  row-size=58B cardinality=2.88M
-|
-|--29:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
-|  |
-|  28:AGGREGATE [FINALIZE]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=1.44M
-|  |
-|  27:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
-|  |
-|  11:AGGREGATE [STREAMING]
-|  |  group by: c_last_name, c_first_name, d_date
-|  |  row-size=58B cardinality=1.44M
-|  |
-|  10:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
-|  |  runtime filters: RF004 <- customer.c_customer_sk
-|  |  row-size=78B cardinality=1.44M
-|  |
-|  |--26:EXCHANGE [BROADCAST]
-|  |  |
-|  |  08:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     row-size=40B cardinality=100.00K
-|  |
-|  09:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
-|  |  runtime filters: RF006 <- date_dim.d_date_sk
-|  |  row-size=38B cardinality=1.44M
-|  |
-|  |--25:EXCHANGE [BROADCAST]
-|  |  |
-|  |  07:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|  |     row-size=30B cardinality=7.30K
-|  |
-|  06:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF004 -> catalog_sales.cs_bill_customer_sk, RF006 -> catalog_sales.cs_sold_date_sk
-|     row-size=8B cardinality=1.44M
-|
-24:AGGREGATE [FINALIZE]
-|  group by: c_last_name, c_first_name, d_date
-|  row-size=58B cardinality=2.88M
-|
-23:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
-|
-05:AGGREGATE [STREAMING]
-|  group by: c_last_name, c_first_name, d_date
-|  row-size=58B cardinality=2.88M
-|
-04:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_customer_sk = customer.c_customer_sk
-|  runtime filters: RF000 <- customer.c_customer_sk
-|  row-size=78B cardinality=2.88M
-|
-|--22:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     row-size=40B cardinality=100.00K
-|
-03:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
-|  runtime filters: RF002 <- date_dim.d_date_sk
-|  row-size=38B cardinality=2.88M
-|
-|--21:EXCHANGE [BROADCAST]
-|  |
-|  01:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_month_seq <= 1211, d_month_seq >= 1200
-|     row-size=30B cardinality=7.30K
-|
-00:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> store_sales.ss_customer_sk, RF002 -> store_sales.ss_sold_date_sk
-   row-size=8B cardinality=2.88M
-====
-# Q23-1
-with frequent_ss_items as
- (select substr(i_item_desc,1,30) itemdesc,i_item_sk item_sk,d_date solddate,count(*) cnt
-  from store_sales
-      ,date_dim
-      ,item
-  where ss_sold_date_sk = d_date_sk
-    and ss_item_sk = i_item_sk
-    and d_year in (2000,2000+1,2000+2,2000+3)
-  group by substr(i_item_desc,1,30),i_item_sk,d_date
-  having count(*) >4),
- max_store_sales as
- (select max(csales) tpcds_cmax
-  from (select c_customer_sk,sum(ss_quantity*ss_sales_price) csales
-        from store_sales
-            ,customer
-            ,date_dim
-        where ss_customer_sk = c_customer_sk
-         and ss_sold_date_sk = d_date_sk
-         and d_year in (2000,2000+1,2000+2,2000+3)
-        group by c_customer_sk) x),
- best_ss_customer as
- (select c_customer_sk,sum(ss_quantity*ss_sales_price) ssales
-  from store_sales
-      ,customer
-  where ss_customer_sk = c_customer_sk
-  group by c_customer_sk
-  having sum(ss_quantity*ss_sales_price) > (50/100.0) * (select
-  *
-from
- max_store_sales))
-  select  sum(sales)
- from (select cs_quantity*cs_list_price sales
-       from catalog_sales
-           ,date_dim
-       where d_year = 2000
-         and d_moy = 2
-         and cs_sold_date_sk = d_date_sk
-         and cs_item_sk in (select item_sk from frequent_ss_items)
-         and cs_bill_customer_sk in (select c_customer_sk from best_ss_customer)
-      union all
-      select ws_quantity*ws_list_price sales
-       from web_sales
-           ,date_dim
-       where d_year = 2000
-         and d_moy = 2
-         and ws_sold_date_sk = d_date_sk
-         and ws_item_sk in (select item_sk from frequent_ss_items)
-         and ws_bill_customer_sk in (select c_customer_sk from best_ss_customer)) y
- limit 100;
----- PLAN
-Max Per-Host Resource Reservation: Memory=122.44MB Threads=11
-Per-Host Resource Estimates: Memory=910MB
-PLAN-ROOT SINK
-|
-49:AGGREGATE [FINALIZE]
-|  output: sum(sales)
-|  limit: 100
-|  row-size=16B cardinality=1
-|
-00:UNION
-|  row-size=8B cardinality=128.16K
-|
-|--48:HASH JOIN [RIGHT SEMI JOIN]
-|  |  hash predicates: c_customer_sk = ws_bill_customer_sk
-|  |  runtime filters: RF016 <- ws_bill_customer_sk
-|  |  row-size=36B cardinality=42.85K
-|  |
-|  |--47:HASH JOIN [LEFT SEMI JOIN]
-|  |  |  hash predicates: ws_item_sk = i_item_sk
-|  |  |  row-size=36B cardinality=42.85K
-|  |  |
-|  |  |--46:AGGREGATE [FINALIZE]
-|  |  |  |  group by: i_item_sk
-|  |  |  |  row-size=8B cardinality=17.98K
-|  |  |  |
-|  |  |  32:AGGREGATE [FINALIZE]
-|  |  |  |  output: count(*)
-|  |  |  |  group by: substr(i_item_desc, 1, 30), i_item_sk, d_date
-|  |  |  |  having: count(*) > 4
-|  |  |  |  row-size=50B cardinality=235.45K
-|  |  |  |
-|  |  |  31:HASH JOIN [INNER JOIN]
-|  |  |  |  hash predicates: ss_item_sk = i_item_sk
-|  |  |  |  row-size=162B cardinality=2.35M
-|  |  |  |
-|  |  |  |--29:SCAN HDFS [tpcds.item]
-|  |  |  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |  |  |     row-size=120B cardinality=18.00K
-|  |  |  |
-|  |  |  30:HASH JOIN [INNER JOIN]
-|  |  |  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  |  |  runtime filters: RF030 <- d_date_sk
-|  |  |  |  row-size=42B cardinality=2.35M
-|  |  |  |
-|  |  |  |--28:SCAN HDFS [tpcds.date_dim]
-|  |  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |  |     predicates: d_year IN (2000, 2001, 2002, 2003)
-|  |  |  |     row-size=30B cardinality=1.49K
-|  |  |  |
-|  |  |  27:SCAN HDFS [tpcds.store_sales]
-|  |  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |  |     runtime filters: RF030 -> ss_sold_date_sk
-|  |  |     row-size=12B cardinality=2.88M
-|  |  |
-|  |  45:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
-|  |  |  runtime filters: RF026 <- d_date_sk
-|  |  |  row-size=36B cardinality=42.85K
-|  |  |
-|  |  |--26:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_year = 2000, d_moy = 2
-|  |  |     row-size=12B cardinality=108
-|  |  |
-|  |  25:SCAN HDFS [tpcds.web_sales]
-|  |     HDFS partitions=1/1 files=1 size=140.07MB
-|  |     runtime filters: RF026 -> ws_sold_date_sk
-|  |     row-size=24B cardinality=719.38K
-|  |
-|  44:NESTED LOOP JOIN [INNER JOIN]
-|  |  predicates: sum(ss_quantity * ss_sales_price) > 0.500000 * max(csales)
-|  |  row-size=36B cardinality=100.00K
-|  |
-|  |--43:AGGREGATE [FINALIZE]
-|  |  |  output: max(sum(ss_quantity * ss_sales_price))
-|  |  |  row-size=16B cardinality=1
-|  |  |
-|  |  42:AGGREGATE [FINALIZE]
-|  |  |  output: sum(ss_quantity * ss_sales_price)
-|  |  |  group by: c_customer_sk
-|  |  |  row-size=20B cardinality=100.00K
-|  |  |
-|  |  41:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ss_customer_sk = c_customer_sk
-|  |  |  row-size=28B cardinality=2.35M
-|  |  |
-|  |  |--38:SCAN HDFS [tpcds.customer]
-|  |  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |  |     row-size=4B cardinality=100.00K
-|  |  |
-|  |  40:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  |  runtime filters: RF022 <- d_date_sk
-|  |  |  row-size=24B cardinality=2.35M
-|  |  |
-|  |  |--39:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_year IN (2000, 2001, 2002, 2003)
-|  |  |     row-size=8B cardinality=1.49K
-|  |  |
-|  |  37:SCAN HDFS [tpcds.store_sales]
-|  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |     runtime filters: RF022 -> ss_sold_date_sk
-|  |     row-size=16B cardinality=2.88M
-|  |
-|  36:AGGREGATE [FINALIZE]
-|  |  output: sum(ss_quantity * ss_sales_price)
-|  |  group by: c_customer_sk
-|  |  row-size=20B cardinality=100.00K
-|  |
-|  35:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_customer_sk = c_customer_sk
-|  |  row-size=16B cardinality=2.88M
-|  |
-|  |--34:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     runtime filters: RF016 -> tpcds.customer.c_customer_sk
-|  |     row-size=4B cardinality=100.00K
-|  |
-|  33:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF016 -> tpcds.store_sales.ss_customer_sk
-|     row-size=12B cardinality=2.88M
-|
-24:HASH JOIN [RIGHT SEMI JOIN]
-|  hash predicates: c_customer_sk = cs_bill_customer_sk
-|  runtime filters: RF000 <- cs_bill_customer_sk
-|  row-size=36B cardinality=85.31K
-|
-|--23:HASH JOIN [LEFT SEMI JOIN]
-|  |  hash predicates: cs_item_sk = i_item_sk
-|  |  row-size=36B cardinality=85.31K
-|  |
-|  |--22:AGGREGATE [FINALIZE]
-|  |  |  group by: i_item_sk
-|  |  |  row-size=8B cardinality=17.98K
-|  |  |
-|  |  08:AGGREGATE [FINALIZE]
-|  |  |  output: count(*)
-|  |  |  group by: substr(i_item_desc, 1, 30), i_item_sk, d_date
-|  |  |  having: count(*) > 4
-|  |  |  row-size=50B cardinality=235.45K
-|  |  |
-|  |  07:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ss_item_sk = i_item_sk
-|  |  |  row-size=162B cardinality=2.35M
-|  |  |
-|  |  |--05:SCAN HDFS [tpcds.item]
-|  |  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |  |     row-size=120B cardinality=18.00K
-|  |  |
-|  |  06:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  |  runtime filters: RF014 <- d_date_sk
-|  |  |  row-size=42B cardinality=2.35M
-|  |  |
-|  |  |--04:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_year IN (2000, 2001, 2002, 2003)
-|  |  |     row-size=30B cardinality=1.49K
-|  |  |
-|  |  03:SCAN HDFS [tpcds.store_sales]
-|  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |     runtime filters: RF014 -> ss_sold_date_sk
-|  |     row-size=12B cardinality=2.88M
-|  |
-|  21:HASH JOIN [INNER JOIN]
-|  |  hash predicates: cs_sold_date_sk = d_date_sk
-|  |  runtime filters: RF010 <- d_date_sk
-|  |  row-size=36B cardinality=85.31K
-|  |
-|  |--02:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 2000, d_moy = 2
-|  |     row-size=12B cardinality=108
-|  |
-|  01:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF010 -> cs_sold_date_sk
-|     row-size=24B cardinality=1.44M
-|
-20:NESTED LOOP JOIN [INNER JOIN]
-|  predicates: sum(ss_quantity * ss_sales_price) > 0.500000 * max(csales)
-|  row-size=36B cardinality=100.00K
-|
-|--19:AGGREGATE [FINALIZE]
-|  |  output: max(sum(ss_quantity * ss_sales_price))
-|  |  row-size=16B cardinality=1
-|  |
-|  18:AGGREGATE [FINALIZE]
-|  |  output: sum(ss_quantity * ss_sales_price)
-|  |  group by: c_customer_sk
-|  |  row-size=20B cardinality=100.00K
-|  |
-|  17:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_customer_sk = c_customer_sk
-|  |  runtime filters: RF004 <- c_customer_sk
-|  |  row-size=28B cardinality=2.35M
-|  |
-|  |--14:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     row-size=4B cardinality=100.00K
-|  |
-|  16:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |  row-size=24B cardinality=2.35M
-|  |
-|  |--15:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year IN (2000, 2001, 2002, 2003)
-|  |     row-size=8B cardinality=1.49K
-|  |
-|  13:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF006 -> ss_sold_date_sk, RF004 -> ss_customer_sk
-|     row-size=16B cardinality=2.88M
-|
-12:AGGREGATE [FINALIZE]
-|  output: sum(ss_quantity * ss_sales_price)
-|  group by: c_customer_sk
-|  row-size=20B cardinality=100.00K
-|
-11:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF002 <- c_customer_sk
-|  row-size=16B cardinality=2.88M
-|
-|--10:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> tpcds.customer.c_customer_sk
-|     row-size=4B cardinality=100.00K
-|
-09:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_customer_sk, RF002 -> ss_customer_sk
-   row-size=12B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=370.38MB Threads=50
-Per-Host Resource Estimates: Memory=2.09GB
-PLAN-ROOT SINK
-|
-89:AGGREGATE [FINALIZE]
-|  output: sum:merge(sales)
-|  limit: 100
-|  row-size=16B cardinality=1
-|
-88:EXCHANGE [UNPARTITIONED]
-|
-49:AGGREGATE
-|  output: sum(sales)
-|  row-size=16B cardinality=1
-|
-00:UNION
-|  row-size=8B cardinality=128.16K
-|
-|--48:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
-|  |  hash predicates: c_customer_sk = ws_bill_customer_sk
-|  |  runtime filters: RF016 <- ws_bill_customer_sk
-|  |  row-size=36B cardinality=42.85K
-|  |
-|  |--87:EXCHANGE [HASH(ws_bill_customer_sk)]
-|  |  |
-|  |  47:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  |  |  hash predicates: ws_item_sk = i_item_sk
-|  |  |  row-size=36B cardinality=42.85K
-|  |  |
-|  |  |--86:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  85:AGGREGATE [FINALIZE]
-|  |  |  |  group by: i_item_sk
-|  |  |  |  row-size=8B cardinality=17.98K
-|  |  |  |
-|  |  |  84:EXCHANGE [HASH(i_item_sk)]
-|  |  |  |
-|  |  |  46:AGGREGATE [STREAMING]
-|  |  |  |  group by: i_item_sk
-|  |  |  |  row-size=8B cardinality=17.98K
-|  |  |  |
-|  |  |  83:AGGREGATE [FINALIZE]
-|  |  |  |  output: count:merge(*)
-|  |  |  |  group by: substr(i_item_desc, 1, 30), i_item_sk, d_date
-|  |  |  |  having: count(*) > 4
-|  |  |  |  row-size=50B cardinality=235.45K
-|  |  |  |
-|  |  |  82:EXCHANGE [HASH(substr(i_item_desc, 1, 30),i_item_sk,d_date)]
-|  |  |  |
-|  |  |  32:AGGREGATE [STREAMING]
-|  |  |  |  output: count(*)
-|  |  |  |  group by: substr(i_item_desc, 1, 30), i_item_sk, d_date
-|  |  |  |  row-size=50B cardinality=2.35M
-|  |  |  |
-|  |  |  31:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  |  hash predicates: ss_item_sk = i_item_sk
-|  |  |  |  row-size=162B cardinality=2.35M
-|  |  |  |
-|  |  |  |--81:EXCHANGE [BROADCAST]
-|  |  |  |  |
-|  |  |  |  29:SCAN HDFS [tpcds.item]
-|  |  |  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |  |  |     row-size=120B cardinality=18.00K
-|  |  |  |
-|  |  |  30:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  |  |  runtime filters: RF030 <- d_date_sk
-|  |  |  |  row-size=42B cardinality=2.35M
-|  |  |  |
-|  |  |  |--80:EXCHANGE [BROADCAST]
-|  |  |  |  |
-|  |  |  |  28:SCAN HDFS [tpcds.date_dim]
-|  |  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |  |     predicates: d_year IN (2000, 2001, 2002, 2003)
-|  |  |  |     row-size=30B cardinality=1.49K
-|  |  |  |
-|  |  |  27:SCAN HDFS [tpcds.store_sales]
-|  |  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |  |     runtime filters: RF030 -> ss_sold_date_sk
-|  |  |     row-size=12B cardinality=2.88M
-|  |  |
-|  |  45:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
-|  |  |  runtime filters: RF026 <- d_date_sk
-|  |  |  row-size=36B cardinality=42.85K
-|  |  |
-|  |  |--79:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  26:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_year = 2000, d_moy = 2
-|  |  |     row-size=12B cardinality=108
-|  |  |
-|  |  25:SCAN HDFS [tpcds.web_sales]
-|  |     HDFS partitions=1/1 files=1 size=140.07MB
-|  |     runtime filters: RF026 -> ws_sold_date_sk
-|  |     row-size=24B cardinality=719.38K
-|  |
-|  44:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
-|  |  predicates: sum(ss_quantity * ss_sales_price) > 0.500000 * max(csales)
-|  |  row-size=36B cardinality=100.00K
-|  |
-|  |--78:EXCHANGE [BROADCAST]
-|  |  |
-|  |  77:AGGREGATE [FINALIZE]
-|  |  |  output: max:merge(csales)
-|  |  |  row-size=16B cardinality=1
-|  |  |
-|  |  76:EXCHANGE [UNPARTITIONED]
-|  |  |
-|  |  43:AGGREGATE
-|  |  |  output: max(sum(ss_quantity * ss_sales_price))
-|  |  |  row-size=16B cardinality=1
-|  |  |
-|  |  75:AGGREGATE [FINALIZE]
-|  |  |  output: sum:merge(ss_quantity * ss_sales_price)
-|  |  |  group by: c_customer_sk
-|  |  |  row-size=20B cardinality=100.00K
-|  |  |
-|  |  74:EXCHANGE [HASH(c_customer_sk)]
-|  |  |
-|  |  42:AGGREGATE [STREAMING]
-|  |  |  output: sum(ss_quantity * ss_sales_price)
-|  |  |  group by: c_customer_sk
-|  |  |  row-size=20B cardinality=100.00K
-|  |  |
-|  |  41:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: ss_customer_sk = c_customer_sk
-|  |  |  row-size=28B cardinality=2.35M
-|  |  |
-|  |  |--73:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  38:SCAN HDFS [tpcds.customer]
-|  |  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |  |     row-size=4B cardinality=100.00K
-|  |  |
-|  |  40:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  |  runtime filters: RF022 <- d_date_sk
-|  |  |  row-size=24B cardinality=2.35M
-|  |  |
-|  |  |--72:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  39:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_year IN (2000, 2001, 2002, 2003)
-|  |  |     row-size=8B cardinality=1.49K
-|  |  |
-|  |  37:SCAN HDFS [tpcds.store_sales]
-|  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |     runtime filters: RF022 -> ss_sold_date_sk
-|  |     row-size=16B cardinality=2.88M
-|  |
-|  71:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ss_quantity * ss_sales_price)
-|  |  group by: c_customer_sk
-|  |  row-size=20B cardinality=100.00K
-|  |
-|  70:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  36:AGGREGATE [STREAMING]
-|  |  output: sum(ss_quantity * ss_sales_price)
-|  |  group by: c_customer_sk
-|  |  row-size=20B cardinality=100.00K
-|  |
-|  35:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_customer_sk = c_customer_sk
-|  |  row-size=16B cardinality=2.88M
-|  |
-|  |--69:EXCHANGE [BROADCAST]
-|  |  |
-|  |  34:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     runtime filters: RF016 -> tpcds.customer.c_customer_sk
-|  |     row-size=4B cardinality=100.00K
-|  |
-|  33:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF016 -> tpcds.store_sales.ss_customer_sk
-|     row-size=12B cardinality=2.88M
-|
-24:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
-|  hash predicates: c_customer_sk = cs_bill_customer_sk
-|  runtime filters: RF000 <- cs_bill_customer_sk
-|  row-size=36B cardinality=85.31K
-|
-|--68:EXCHANGE [HASH(cs_bill_customer_sk)]
-|  |
-|  23:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  |  hash predicates: cs_item_sk = i_item_sk
-|  |  row-size=36B cardinality=85.31K
-|  |
-|  |--67:EXCHANGE [BROADCAST]
-|  |  |
-|  |  66:AGGREGATE [FINALIZE]
-|  |  |  group by: i_item_sk
-|  |  |  row-size=8B cardinality=17.98K
-|  |  |
-|  |  65:EXCHANGE [HASH(i_item_sk)]
-|  |  |
-|  |  22:AGGREGATE [STREAMING]
-|  |  |  group by: i_item_sk
-|  |  |  row-size=8B cardinality=17.98K
-|  |  |
-|  |  64:AGGREGATE [FINALIZE]
-|  |  |  output: count:merge(*)
-|  |  |  group by: substr(i_item_desc, 1, 30), i_item_sk, d_date
-|  |  |  having: count(*) > 4
-|  |  |  row-size=50B cardinality=235.45K
-|  |  |
-|  |  63:EXCHANGE [HASH(substr(i_item_desc, 1, 30),i_item_sk,d_date)]
-|  |  |
-|  |  08:AGGREGATE [STREAMING]
-|  |  |  output: count(*)
-|  |  |  group by: substr(i_item_desc, 1, 30), i_item_sk, d_date
-|  |  |  row-size=50B cardinality=2.35M
-|  |  |
-|  |  07:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: ss_item_sk = i_item_sk
-|  |  |  row-size=162B cardinality=2.35M
-|  |  |
-|  |  |--62:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  05:SCAN HDFS [tpcds.item]
-|  |  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |  |     row-size=120B cardinality=18.00K
-|  |  |
-|  |  06:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  |  runtime filters: RF014 <- d_date_sk
-|  |  |  row-size=42B cardinality=2.35M
-|  |  |
-|  |  |--61:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  04:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_year IN (2000, 2001, 2002, 2003)
-|  |  |     row-size=30B cardinality=1.49K
-|  |  |
-|  |  03:SCAN HDFS [tpcds.store_sales]
-|  |     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|  |     runtime filters: RF014 -> ss_sold_date_sk
-|  |     row-size=12B cardinality=2.88M
-|  |
-|  21:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: cs_sold_date_sk = d_date_sk
-|  |  runtime filters: RF010 <- d_date_sk
-|  |  row-size=36B cardinality=85.31K
-|  |
-|  |--60:EXCHANGE [BROADCAST]
-|  |  |
-|  |  02:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 2000, d_moy = 2
-|  |     row-size=12B cardinality=108
-|  |
-|  01:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF010 -> cs_sold_date_sk
-|     row-size=24B cardinality=1.44M
-|
-20:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
-|  predicates: sum(ss_quantity * ss_sales_price) > 0.500000 * max(csales)
-|  row-size=36B cardinality=100.00K
-|
-|--59:EXCHANGE [BROADCAST]
-|  |
-|  58:AGGREGATE [FINALIZE]
-|  |  output: max:merge(csales)
-|  |  row-size=16B cardinality=1
-|  |
-|  57:EXCHANGE [UNPARTITIONED]
-|  |
-|  19:AGGREGATE
-|  |  output: max(sum(ss_quantity * ss_sales_price))
-|  |  row-size=16B cardinality=1
-|  |
-|  56:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ss_quantity * ss_sales_price)
-|  |  group by: c_customer_sk
-|  |  row-size=20B cardinality=100.00K
-|  |
-|  55:EXCHANGE [HASH(c_customer_sk)]
-|  |
-|  18:AGGREGATE [STREAMING]
-|  |  output: sum(ss_quantity * ss_sales_price)
-|  |  group by: c_customer_sk
-|  |  row-size=20B cardinality=100.00K
-|  |
-|  17:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_customer_sk = c_customer_sk
-|  |  runtime filters: RF004 <- c_customer_sk
-|  |  row-size=28B cardinality=2.35M
-|  |
-|  |--54:EXCHANGE [BROADCAST]
-|  |  |
-|  |  14:SCAN HDFS [tpcds.customer]
-|  |     HDFS partitions=1/1 files=1 size=12.60MB
-|  |     row-size=4B cardinality=100.00K
-|  |
-|  16:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ss_sold_date_sk = d_date_sk
-|  |  runtime filters: RF006 <- d_date_sk
-|  |  row-size=24B cardinality=2.35M
-|  |
-|  |--53:EXCHANGE [BROADCAST]
-|  |  |
-|  |  15:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year IN (2000, 2001, 2002, 2003)
-|  |     row-size=8B cardinality=1.49K
-|  |
-|  13:SCAN HDFS [tpcds.store_sales]
-|     HDFS partitions=1824/1824 files=1824 size=346.60MB
-|     runtime filters: RF006 -> ss_sold_date_sk, RF004 -> ss_customer_sk
-|     row-size=16B cardinality=2.88M
-|
-52:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_quantity * ss_sales_price)
-|  group by: c_customer_sk
-|  row-size=20B cardinality=100.00K
-|
-51:EXCHANGE [HASH(c_customer_sk)]
-|
-12:AGGREGATE [STREAMING]
-|  output: sum(ss_quantity * ss_sales_price)
-|  group by: c_customer_sk
-|  row-size=20B cardinality=100.00K
-|
-11:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_customer_sk = c_customer_sk
-|  runtime filters: RF002 <- c_customer_sk
-|  row-size=16B cardinality=2.88M
-|
-|--50:EXCHANGE [BROADCAST]
-|  |
-|  10:SCAN HDFS [tpcds.customer]
-|     HDFS partitions=1/1 files=1 size=12.60MB
-|     runtime filters: RF000 -> tpcds.customer.c_customer_sk
-|     row-size=4B cardinality=100.00K
-|
-09:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF000 -> tpcds.store_sales.ss_customer_sk, RF002 -> ss_customer_sk
-   row-size=12B cardinality=2.88M
-====
-# TPCDS-Q33
-with ss as (
- select
-          i_manufact_id,sum(ss_ext_sales_price) total_sales
- from
-  store_sales,
-  date_dim,
-         customer_address,
-         item
- where
-         i_manufact_id in (select
-  i_manufact_id
-from
- item
-where i_category in ('Electronics'))
- and     ss_item_sk              = i_item_sk
- and     ss_sold_date_sk         = d_date_sk
- and     d_year                  = 1998
- and     d_moy                   = 5
- and     ss_addr_sk              = ca_address_sk
- and     ca_gmt_offset           = -5
- group by i_manufact_id),
- cs as (
- select
-          i_manufact_id,sum(cs_ext_sales_price) total_sales
- from
-  catalog_sales,
-  date_dim,
-         customer_address,
-         item
- where
-         i_manufact_id               in (select
-  i_manufact_id
-from
- item
-where i_category in ('Electronics'))
- and     cs_item_sk              = i_item_sk
- and     cs_sold_date_sk         = d_date_sk
- and     d_year                  = 1998
- and     d_moy                   = 5
- and     cs_bill_addr_sk         = ca_address_sk
- and     ca_gmt_offset           = -5
- group by i_manufact_id),
- ws as (
- select
-          i_manufact_id,sum(ws_ext_sales_price) total_sales
- from
-  web_sales,
-  date_dim,
-         customer_address,
-         item
- where
-         i_manufact_id               in (select
-  i_manufact_id
-from
- item
-where i_category in ('Electronics'))
- and     ws_item_sk              = i_item_sk
- and     ws_sold_date_sk         = d_date_sk
- and     d_year                  = 1998
- and     d_moy                   = 5
- and     ws_bill_addr_sk         = ca_address_sk
- and     ca_gmt_offset           = -5
- group by i_manufact_id)
-  select  i_manufact_id ,sum(total_sales) total_sales
- from  (select * from ss
-        union all
-        select * from cs
-        union all
-        select * from ws) tmp1
- group by i_manufact_id
- order by total_sales
-limit 100;
----- PLAN
-Max Per-Host Resource Reservation: Memory=59.69MB Threads=6
-Per-Host Resource Estimates: Memory=348MB
-PLAN-ROOT SINK
-|
-32:TOP-N [LIMIT=100]
-|  order by: sum(total_sales) ASC
-|  row-size=20B cardinality=100
-|
-31:AGGREGATE [FINALIZE]
-|  output: sum(total_sales)
-|  group by: i_manufact_id
-|  row-size=20B cardinality=2.83K
-|
-00:UNION
-|  row-size=20B cardinality=2.83K
-|
-|--30:AGGREGATE [FINALIZE]
-|  |  output: sum(ws_ext_sales_price)
-|  |  group by: i_manufact_id
-|  |  row-size=20B cardinality=944
-|  |
-|  29:HASH JOIN [LEFT SEMI JOIN]
-|  |  hash predicates: i_manufact_id = i_manufact_id
-|  |  row-size=52B cardinality=9.81K
-|  |
-|  |--25:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_category IN ('Electronics')
-|  |     row-size=22B cardinality=1.80K
-|  |
-|  28:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ws_item_sk = i_item_sk
-|  |  row-size=52B cardinality=9.81K
-|  |
-|  |--24:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     row-size=12B cardinality=18.00K
-|  |
-|  27:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
-|  |  runtime filters: RF020 <- ca_address_sk
-|  |  row-size=40B cardinality=9.81K
-|  |
-|  |--23:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     predicates: ca_gmt_offset = -5
-|  |     row-size=8B cardinality=8.33K
-|  |
-|  26:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ws_sold_date_sk = d_date_sk
-|  |  runtime filters: RF022 <- d_date_sk
-|  |  row-size=32B cardinality=42.85K
-|  |
-|  |--22:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 1998, d_moy = 5
-|  |     row-size=12B cardinality=108
-|  |
-|  21:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF022 -> ws_sold_date_sk, RF020 -> ws_bill_addr_sk
-|     row-size=20B cardinality=719.38K
-|
-|--20:AGGREGATE [FINALIZE]
-|  |  output: sum(cs_ext_sales_price)
-|  |  group by: i_manufact_id
-|  |  row-size=20B cardinality=944
-|  |
-|  19:HASH JOIN [LEFT SEMI JOIN]
-|  |  hash predicates: i_manufact_id = i_manufact_id
-|  |  runtime filters: RF008 <- i_manufact_id
-|  |  row-size=52B cardinality=14.81K
-|  |
-|  |--15:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_category IN ('Electronics')
-|  |     row-size=22B cardinality=1.80K
-|  |
-|  18:HASH JOIN [INNER JOIN]
-|  |  hash predicates: cs_item_sk = i_item_sk
-|  |  runtime filters: RF010 <- i_item_sk
-|  |  row-size=52B cardinality=14.81K
-|  |
-|  |--14:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     runtime filters: RF008 -> i_manufact_id
-|  |     row-size=12B cardinality=18.00K
-|  |
-|  17:HASH JOIN [INNER JOIN]
-|  |  hash predicates: cs_bill_addr_sk = ca_address_sk
-|  |  runtime filters: RF012 <- ca_address_sk
-|  |  row-size=40B cardinality=14.81K
-|  |
-|  |--13:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     predicates: ca_gmt_offset = -5
-|  |     row-size=8B cardinality=8.33K
-|  |
-|  16:HASH JOIN [INNER JOIN]
-|  |  hash predicates: cs_sold_date_sk = d_date_sk
-|  |  runtime filters: RF014 <- d_date_sk
-|  |  row-size=32B cardinality=85.31K
-|  |
-|  |--12:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 1998, d_moy = 5
-|  |     row-size=12B cardinality=108
-|  |
-|  11:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF014 -> cs_sold_date_sk, RF012 -> cs_bill_addr_sk, RF010 -> cs_item_sk
-|     row-size=20B cardinality=1.44M
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_manufact_id
-|  row-size=20B cardinality=944
-|
-09:HASH JOIN [LEFT SEMI JOIN]
-|  hash predicates: i_manufact_id = i_manufact_id
-|  runtime filters: RF000 <- i_manufact_id
-|  row-size=52B cardinality=28.50K
-|
-|--05:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_category IN ('Electronics')
-|     row-size=22B cardinality=1.80K
-|
-08:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=52B cardinality=28.50K
-|
-|--04:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     runtime filters: RF000 -> i_manufact_id
-|     row-size=12B cardinality=18.00K
-|
-07:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_addr_sk = ca_address_sk
-|  runtime filters: RF004 <- ca_address_sk
-|  row-size=40B cardinality=28.50K
-|
-|--03:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     predicates: ca_gmt_offset = -5
-|     row-size=8B cardinality=8.33K
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=32B cardinality=170.55K
-|
-|--02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998, d_moy = 5
-|     row-size=12B cardinality=108
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF006 -> ss_sold_date_sk, RF004 -> ss_addr_sk, RF002 -> ss_item_sk
-   row-size=20B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=168.12MB Threads=35
-Per-Host Resource Estimates: Memory=994MB
-PLAN-ROOT SINK
-|
-55:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: sum(total_sales) ASC
-|  limit: 100
-|
-32:TOP-N [LIMIT=100]
-|  order by: sum(total_sales) ASC
-|  row-size=20B cardinality=100
-|
-54:AGGREGATE [FINALIZE]
-|  output: sum:merge(total_sales)
-|  group by: i_manufact_id
-|  row-size=20B cardinality=2.83K
-|
-53:EXCHANGE [HASH(i_manufact_id)]
-|
-31:AGGREGATE [STREAMING]
-|  output: sum(total_sales)
-|  group by: i_manufact_id
-|  row-size=20B cardinality=2.83K
-|
-00:UNION
-|  row-size=20B cardinality=2.83K
-|
-|--52:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ws_ext_sales_price)
-|  |  group by: i_manufact_id
-|  |  row-size=20B cardinality=944
-|  |
-|  51:EXCHANGE [HASH(i_manufact_id)]
-|  |
-|  30:AGGREGATE [STREAMING]
-|  |  output: sum(ws_ext_sales_price)
-|  |  group by: i_manufact_id
-|  |  row-size=20B cardinality=944
-|  |
-|  29:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  |  hash predicates: i_manufact_id = i_manufact_id
-|  |  row-size=52B cardinality=9.81K
-|  |
-|  |--50:EXCHANGE [BROADCAST]
-|  |  |
-|  |  25:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_category IN ('Electronics')
-|  |     row-size=22B cardinality=1.80K
-|  |
-|  28:HASH JOIN [INNER JOIN, PARTITIONED]
-|  |  hash predicates: ws_item_sk = i_item_sk
-|  |  row-size=52B cardinality=9.81K
-|  |
-|  |--49:EXCHANGE [HASH(i_item_sk)]
-|  |  |
-|  |  24:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     row-size=12B cardinality=18.00K
-|  |
-|  48:EXCHANGE [HASH(ws_item_sk)]
-|  |
-|  27:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
-|  |  runtime filters: RF020 <- ca_address_sk
-|  |  row-size=40B cardinality=9.81K
-|  |
-|  |--47:EXCHANGE [BROADCAST]
-|  |  |
-|  |  23:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     predicates: ca_gmt_offset = -5
-|  |     row-size=8B cardinality=8.33K
-|  |
-|  26:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ws_sold_date_sk = d_date_sk
-|  |  runtime filters: RF022 <- d_date_sk
-|  |  row-size=32B cardinality=42.85K
-|  |
-|  |--46:EXCHANGE [BROADCAST]
-|  |  |
-|  |  22:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 1998, d_moy = 5
-|  |     row-size=12B cardinality=108
-|  |
-|  21:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF022 -> ws_sold_date_sk, RF020 -> ws_bill_addr_sk
-|     row-size=20B cardinality=719.38K
-|
-|--45:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(cs_ext_sales_price)
-|  |  group by: i_manufact_id
-|  |  row-size=20B cardinality=944
-|  |
-|  44:EXCHANGE [HASH(i_manufact_id)]
-|  |
-|  20:AGGREGATE [STREAMING]
-|  |  output: sum(cs_ext_sales_price)
-|  |  group by: i_manufact_id
-|  |  row-size=20B cardinality=944
-|  |
-|  19:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  |  hash predicates: i_manufact_id = i_manufact_id
-|  |  runtime filters: RF008 <- i_manufact_id
-|  |  row-size=52B cardinality=14.81K
-|  |
-|  |--43:EXCHANGE [BROADCAST]
-|  |  |
-|  |  15:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_category IN ('Electronics')
-|  |     row-size=22B cardinality=1.80K
-|  |
-|  18:HASH JOIN [INNER JOIN, PARTITIONED]
-|  |  hash predicates: cs_item_sk = i_item_sk
-|  |  runtime filters: RF010 <- i_item_sk
-|  |  row-size=52B cardinality=14.81K
-|  |
-|  |--42:EXCHANGE [HASH(i_item_sk)]
-|  |  |
-|  |  14:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     runtime filters: RF008 -> i_manufact_id
-|  |     row-size=12B cardinality=18.00K
-|  |
-|  41:EXCHANGE [HASH(cs_item_sk)]
-|  |
-|  17:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: cs_bill_addr_sk = ca_address_sk
-|  |  runtime filters: RF012 <- ca_address_sk
-|  |  row-size=40B cardinality=14.81K
-|  |
-|  |--40:EXCHANGE [BROADCAST]
-|  |  |
-|  |  13:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     predicates: ca_gmt_offset = -5
-|  |     row-size=8B cardinality=8.33K
-|  |
-|  16:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: cs_sold_date_sk = d_date_sk
-|  |  runtime filters: RF014 <- d_date_sk
-|  |  row-size=32B cardinality=85.31K
-|  |
-|  |--39:EXCHANGE [BROADCAST]
-|  |  |
-|  |  12:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 1998, d_moy = 5
-|  |     row-size=12B cardinality=108
-|  |
-|  11:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF014 -> cs_sold_date_sk, RF012 -> cs_bill_addr_sk, RF010 -> cs_item_sk
-|     row-size=20B cardinality=1.44M
-|
-38:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: i_manufact_id
-|  row-size=20B cardinality=944
-|
-37:EXCHANGE [HASH(i_manufact_id)]
-|
-10:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_manufact_id
-|  row-size=20B cardinality=944
-|
-09:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  hash predicates: i_manufact_id = i_manufact_id
-|  runtime filters: RF000 <- i_manufact_id
-|  row-size=52B cardinality=28.50K
-|
-|--36:EXCHANGE [BROADCAST]
-|  |
-|  05:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_category IN ('Electronics')
-|     row-size=22B cardinality=1.80K
-|
-08:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=52B cardinality=28.50K
-|
-|--35:EXCHANGE [BROADCAST]
-|  |
-|  04:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     runtime filters: RF000 -> i_manufact_id
-|     row-size=12B cardinality=18.00K
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_addr_sk = ca_address_sk
-|  runtime filters: RF004 <- ca_address_sk
-|  row-size=40B cardinality=28.50K
-|
-|--34:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     predicates: ca_gmt_offset = -5
-|     row-size=8B cardinality=8.33K
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=32B cardinality=170.55K
-|
-|--33:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998, d_moy = 5
-|     row-size=12B cardinality=108
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF006 -> ss_sold_date_sk, RF004 -> ss_addr_sk, RF002 -> ss_item_sk
-   row-size=20B cardinality=2.88M
-====
-# TPCDS-Q60
-with ss as (
- select
-          i_item_id,sum(ss_ext_sales_price) total_sales
- from
-  store_sales,
-  date_dim,
-         customer_address,
-         item
- where
-         i_item_id in (select
-  i_item_id
-from
- item
-where i_category in ('Music'))
- and     ss_item_sk              = i_item_sk
- and     ss_sold_date_sk         = d_date_sk
- and     d_year                  = 1998
- and     d_moy                   = 9
- and     ss_addr_sk              = ca_address_sk
- and     ca_gmt_offset           = -5
- group by i_item_id),
- cs as (
- select
-          i_item_id,sum(cs_ext_sales_price) total_sales
- from
-  catalog_sales,
-  date_dim,
-         customer_address,
-         item
- where
-         i_item_id               in (select
-  i_item_id
-from
- item
-where i_category in ('Music'))
- and     cs_item_sk              = i_item_sk
- and     cs_sold_date_sk         = d_date_sk
- and     d_year                  = 1998
- and     d_moy                   = 9
- and     cs_bill_addr_sk         = ca_address_sk
- and     ca_gmt_offset           = -5
- group by i_item_id),
- ws as (
- select
-          i_item_id,sum(ws_ext_sales_price) total_sales
- from
-  web_sales,
-  date_dim,
-         customer_address,
-         item
- where
-         i_item_id               in (select
-  i_item_id
-from
- item
-where i_category in ('Music'))
- and     ws_item_sk              = i_item_sk
- and     ws_sold_date_sk         = d_date_sk
- and     d_year                  = 1998
- and     d_moy                   = 9
- and     ws_bill_addr_sk         = ca_address_sk
- and     ca_gmt_offset           = -5
- group by i_item_id)
-  select
-  i_item_id
-,sum(total_sales) total_sales
- from  (select * from ss
-        union all
-        select * from cs
-        union all
-        select * from ws) tmp1
- group by i_item_id
- order by i_item_id
-      ,total_sales
- limit 100;
----- PLAN
-Max Per-Host Resource Reservation: Memory=59.69MB Threads=6
-Per-Host Resource Estimates: Memory=346MB
-PLAN-ROOT SINK
-|
-32:TOP-N [LIMIT=100]
-|  order by: i_item_id ASC, sum(total_sales) ASC
-|  row-size=44B cardinality=100
-|
-31:AGGREGATE [FINALIZE]
-|  output: sum(total_sales)
-|  group by: i_item_id
-|  row-size=44B cardinality=10.80K
-|
-00:UNION
-|  row-size=44B cardinality=10.80K
-|
-|--30:AGGREGATE [FINALIZE]
-|  |  output: sum(ws_ext_sales_price)
-|  |  group by: i_item_id
-|  |  row-size=44B cardinality=2.00K
-|  |
-|  29:HASH JOIN [LEFT SEMI JOIN]
-|  |  hash predicates: i_item_id = i_item_id
-|  |  runtime filters: RF016 <- i_item_id
-|  |  row-size=76B cardinality=2.00K
-|  |
-|  |--25:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_category IN ('Music')
-|  |     row-size=46B cardinality=1.80K
-|  |
-|  28:HASH JOIN [INNER JOIN]
-|  |  hash predicates: i_item_sk = ws_item_sk
-|  |  runtime filters: RF018 <- ws_item_sk
-|  |  row-size=76B cardinality=9.81K
-|  |
-|  |--27:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ws_bill_addr_sk = ca_address_sk
-|  |  |  runtime filters: RF020 <- ca_address_sk
-|  |  |  row-size=40B cardinality=9.81K
-|  |  |
-|  |  |--23:SCAN HDFS [tpcds.customer_address]
-|  |  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |  |     predicates: ca_gmt_offset = -5
-|  |  |     row-size=8B cardinality=8.33K
-|  |  |
-|  |  26:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
-|  |  |  runtime filters: RF022 <- d_date_sk
-|  |  |  row-size=32B cardinality=42.85K
-|  |  |
-|  |  |--22:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_year = 1998, d_moy = 9
-|  |  |     row-size=12B cardinality=108
-|  |  |
-|  |  21:SCAN HDFS [tpcds.web_sales]
-|  |     HDFS partitions=1/1 files=1 size=140.07MB
-|  |     runtime filters: RF022 -> ws_sold_date_sk, RF020 -> ws_bill_addr_sk
-|  |     row-size=20B cardinality=719.38K
-|  |
-|  24:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     runtime filters: RF016 -> i_item_id, RF018 -> i_item_sk
-|     row-size=36B cardinality=18.00K
-|
-|--20:AGGREGATE [FINALIZE]
-|  |  output: sum(cs_ext_sales_price)
-|  |  group by: i_item_id
-|  |  row-size=44B cardinality=3.01K
-|  |
-|  19:HASH JOIN [LEFT SEMI JOIN]
-|  |  hash predicates: i_item_id = i_item_id
-|  |  runtime filters: RF008 <- i_item_id
-|  |  row-size=76B cardinality=3.01K
-|  |
-|  |--15:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_category IN ('Music')
-|  |     row-size=46B cardinality=1.80K
-|  |
-|  18:HASH JOIN [INNER JOIN]
-|  |  hash predicates: i_item_sk = cs_item_sk
-|  |  row-size=76B cardinality=14.81K
-|  |
-|  |--17:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: cs_bill_addr_sk = ca_address_sk
-|  |  |  runtime filters: RF012 <- ca_address_sk
-|  |  |  row-size=40B cardinality=14.81K
-|  |  |
-|  |  |--13:SCAN HDFS [tpcds.customer_address]
-|  |  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |  |     predicates: ca_gmt_offset = -5
-|  |  |     row-size=8B cardinality=8.33K
-|  |  |
-|  |  16:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
-|  |  |  runtime filters: RF014 <- d_date_sk
-|  |  |  row-size=32B cardinality=85.31K
-|  |  |
-|  |  |--12:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: d_year = 1998, d_moy = 9
-|  |  |     row-size=12B cardinality=108
-|  |  |
-|  |  11:SCAN HDFS [tpcds.catalog_sales]
-|  |     HDFS partitions=1/1 files=1 size=282.20MB
-|  |     runtime filters: RF014 -> cs_sold_date_sk, RF012 -> cs_bill_addr_sk
-|  |     row-size=20B cardinality=1.44M
-|  |
-|  14:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     runtime filters: RF008 -> i_item_id
-|     row-size=36B cardinality=18.00K
-|
-10:AGGREGATE [FINALIZE]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_item_id
-|  row-size=44B cardinality=5.79K
-|
-09:HASH JOIN [LEFT SEMI JOIN]
-|  hash predicates: i_item_id = i_item_id
-|  runtime filters: RF000 <- i_item_id
-|  row-size=76B cardinality=5.79K
-|
-|--05:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_category IN ('Music')
-|     row-size=46B cardinality=1.80K
-|
-08:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_item_sk = i_item_sk
-|  row-size=76B cardinality=28.50K
-|
-|--04:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     runtime filters: RF000 -> i_item_id
-|     row-size=36B cardinality=18.00K
-|
-07:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_addr_sk = ca_address_sk
-|  runtime filters: RF004 <- ca_address_sk
-|  row-size=40B cardinality=28.50K
-|
-|--03:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     predicates: ca_gmt_offset = -5
-|     row-size=8B cardinality=8.33K
-|
-06:HASH JOIN [INNER JOIN]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=32B cardinality=170.55K
-|
-|--02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998, d_moy = 9
-|     row-size=12B cardinality=108
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF006 -> ss_sold_date_sk, RF004 -> ss_addr_sk
-   row-size=20B cardinality=2.88M
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=169.12MB Threads=36
-Per-Host Resource Estimates: Memory=998MB
-PLAN-ROOT SINK
-|
-56:MERGING-EXCHANGE [UNPARTITIONED]
-|  order by: i_item_id ASC, sum(total_sales) ASC
-|  limit: 100
-|
-32:TOP-N [LIMIT=100]
-|  order by: i_item_id ASC, sum(total_sales) ASC
-|  row-size=44B cardinality=100
-|
-55:AGGREGATE [FINALIZE]
-|  output: sum:merge(total_sales)
-|  group by: i_item_id
-|  row-size=44B cardinality=10.80K
-|
-54:EXCHANGE [HASH(i_item_id)]
-|
-31:AGGREGATE [STREAMING]
-|  output: sum(total_sales)
-|  group by: i_item_id
-|  row-size=44B cardinality=10.80K
-|
-00:UNION
-|  row-size=44B cardinality=10.80K
-|
-|--53:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(ws_ext_sales_price)
-|  |  group by: i_item_id
-|  |  row-size=44B cardinality=2.00K
-|  |
-|  52:EXCHANGE [HASH(i_item_id)]
-|  |
-|  30:AGGREGATE [STREAMING]
-|  |  output: sum(ws_ext_sales_price)
-|  |  group by: i_item_id
-|  |  row-size=44B cardinality=2.00K
-|  |
-|  29:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  |  hash predicates: i_item_id = i_item_id
-|  |  runtime filters: RF016 <- i_item_id
-|  |  row-size=76B cardinality=2.00K
-|  |
-|  |--51:EXCHANGE [BROADCAST]
-|  |  |
-|  |  25:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_category IN ('Music')
-|  |     row-size=46B cardinality=1.80K
-|  |
-|  28:HASH JOIN [INNER JOIN, PARTITIONED]
-|  |  hash predicates: ws_item_sk = i_item_sk
-|  |  row-size=76B cardinality=9.81K
-|  |
-|  |--50:EXCHANGE [HASH(i_item_sk)]
-|  |  |
-|  |  24:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     runtime filters: RF016 -> i_item_id
-|  |     row-size=36B cardinality=18.00K
-|  |
-|  49:EXCHANGE [HASH(ws_item_sk)]
-|  |
-|  27:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
-|  |  runtime filters: RF020 <- ca_address_sk
-|  |  row-size=40B cardinality=9.81K
-|  |
-|  |--48:EXCHANGE [BROADCAST]
-|  |  |
-|  |  23:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     predicates: ca_gmt_offset = -5
-|  |     row-size=8B cardinality=8.33K
-|  |
-|  26:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: ws_sold_date_sk = d_date_sk
-|  |  runtime filters: RF022 <- d_date_sk
-|  |  row-size=32B cardinality=42.85K
-|  |
-|  |--47:EXCHANGE [BROADCAST]
-|  |  |
-|  |  22:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 1998, d_moy = 9
-|  |     row-size=12B cardinality=108
-|  |
-|  21:SCAN HDFS [tpcds.web_sales]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF022 -> ws_sold_date_sk, RF020 -> ws_bill_addr_sk
-|     row-size=20B cardinality=719.38K
-|
-|--46:AGGREGATE [FINALIZE]
-|  |  output: sum:merge(cs_ext_sales_price)
-|  |  group by: i_item_id
-|  |  row-size=44B cardinality=3.01K
-|  |
-|  45:EXCHANGE [HASH(i_item_id)]
-|  |
-|  20:AGGREGATE [STREAMING]
-|  |  output: sum(cs_ext_sales_price)
-|  |  group by: i_item_id
-|  |  row-size=44B cardinality=3.01K
-|  |
-|  19:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  |  hash predicates: i_item_id = i_item_id
-|  |  runtime filters: RF008 <- i_item_id
-|  |  row-size=76B cardinality=3.01K
-|  |
-|  |--44:EXCHANGE [BROADCAST]
-|  |  |
-|  |  15:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     predicates: i_category IN ('Music')
-|  |     row-size=46B cardinality=1.80K
-|  |
-|  18:HASH JOIN [INNER JOIN, PARTITIONED]
-|  |  hash predicates: cs_item_sk = i_item_sk
-|  |  row-size=76B cardinality=14.81K
-|  |
-|  |--43:EXCHANGE [HASH(i_item_sk)]
-|  |  |
-|  |  14:SCAN HDFS [tpcds.item]
-|  |     HDFS partitions=1/1 files=1 size=4.82MB
-|  |     runtime filters: RF008 -> i_item_id
-|  |     row-size=36B cardinality=18.00K
-|  |
-|  42:EXCHANGE [HASH(cs_item_sk)]
-|  |
-|  17:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: cs_bill_addr_sk = ca_address_sk
-|  |  runtime filters: RF012 <- ca_address_sk
-|  |  row-size=40B cardinality=14.81K
-|  |
-|  |--41:EXCHANGE [BROADCAST]
-|  |  |
-|  |  13:SCAN HDFS [tpcds.customer_address]
-|  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |     predicates: ca_gmt_offset = -5
-|  |     row-size=8B cardinality=8.33K
-|  |
-|  16:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  hash predicates: cs_sold_date_sk = d_date_sk
-|  |  runtime filters: RF014 <- d_date_sk
-|  |  row-size=32B cardinality=85.31K
-|  |
-|  |--40:EXCHANGE [BROADCAST]
-|  |  |
-|  |  12:SCAN HDFS [tpcds.date_dim]
-|  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |     predicates: d_year = 1998, d_moy = 9
-|  |     row-size=12B cardinality=108
-|  |
-|  11:SCAN HDFS [tpcds.catalog_sales]
-|     HDFS partitions=1/1 files=1 size=282.20MB
-|     runtime filters: RF014 -> cs_sold_date_sk, RF012 -> cs_bill_addr_sk
-|     row-size=20B cardinality=1.44M
-|
-39:AGGREGATE [FINALIZE]
-|  output: sum:merge(ss_ext_sales_price)
-|  group by: i_item_id
-|  row-size=44B cardinality=5.79K
-|
-38:EXCHANGE [HASH(i_item_id)]
-|
-10:AGGREGATE [STREAMING]
-|  output: sum(ss_ext_sales_price)
-|  group by: i_item_id
-|  row-size=44B cardinality=5.79K
-|
-09:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
-|  hash predicates: i_item_id = i_item_id
-|  runtime filters: RF000 <- i_item_id
-|  row-size=76B cardinality=5.79K
-|
-|--37:EXCHANGE [BROADCAST]
-|  |
-|  05:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     predicates: i_category IN ('Music')
-|     row-size=46B cardinality=1.80K
-|
-08:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ss_item_sk = i_item_sk
-|  runtime filters: RF002 <- i_item_sk
-|  row-size=76B cardinality=28.50K
-|
-|--36:EXCHANGE [HASH(i_item_sk)]
-|  |
-|  04:SCAN HDFS [tpcds.item]
-|     HDFS partitions=1/1 files=1 size=4.82MB
-|     runtime filters: RF000 -> i_item_id
-|     row-size=36B cardinality=18.00K
-|
-35:EXCHANGE [HASH(ss_item_sk)]
-|
-07:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_addr_sk = ca_address_sk
-|  runtime filters: RF004 <- ca_address_sk
-|  row-size=40B cardinality=28.50K
-|
-|--34:EXCHANGE [BROADCAST]
-|  |
-|  03:SCAN HDFS [tpcds.customer_address]
-|     HDFS partitions=1/1 files=1 size=5.25MB
-|     predicates: ca_gmt_offset = -5
-|     row-size=8B cardinality=8.33K
-|
-06:HASH JOIN [INNER JOIN, BROADCAST]
-|  hash predicates: ss_sold_date_sk = d_date_sk
-|  runtime filters: RF006 <- d_date_sk
-|  row-size=32B cardinality=170.55K
-|
-|--33:EXCHANGE [BROADCAST]
-|  |
-|  02:SCAN HDFS [tpcds.date_dim]
-|     HDFS partitions=1/1 files=1 size=9.84MB
-|     predicates: d_year = 1998, d_moy = 9
-|     row-size=12B cardinality=108
-|
-01:SCAN HDFS [tpcds.store_sales]
-   HDFS partitions=1824/1824 files=1824 size=346.60MB
-   runtime filters: RF006 -> ss_sold_date_sk, RF004 -> ss_addr_sk, RF002 -> ss_item_sk
-   row-size=20B cardinality=2.88M
-====
-# TPCDS-Q95
-with ws_wh as
-(select ws1.ws_order_number,ws1.ws_warehouse_sk wh1,ws2.ws_warehouse_sk wh2
- from web_sales ws1,web_sales ws2
- where ws1.ws_order_number = ws2.ws_order_number
-   and ws1.ws_warehouse_sk <> ws2.ws_warehouse_sk)
- select
-   count(distinct ws_order_number) as "order count"
-  ,sum(ws_ext_ship_cost) as "total shipping cost"
-  ,sum(ws_net_profit) as "total net profit"
-from
-   web_sales ws1
-  ,date_dim
-  ,customer_address
-  ,web_site
-where
-    cast(d_date as timestamp) between cast('1999-02-01' as timestamp) and
-           (cast('1999-02-01' as timestamp) + interval 60 days)
-and ws1.ws_ship_date_sk = d_date_sk
-and ws1.ws_ship_addr_sk = ca_address_sk
-and ca_state = 'IL'
-and ws1.ws_web_site_sk = web_site_sk
-and web_company_name = 'pri'
-and ws1.ws_order_number in (select ws_order_number
-                            from ws_wh)
-and ws1.ws_order_number in (select wr_order_number
-                            from web_returns,ws_wh
-                            where wr_order_number = ws_wh.ws_order_number)
-order by count(distinct ws_order_number)
-limit 100;
----- PLAN
-Max Per-Host Resource Reservation: Memory=113.77MB Threads=10
-Per-Host Resource Estimates: Memory=1010MB
-PLAN-ROOT SINK
-|
-21:TOP-N [LIMIT=100]
-|  order by: count(ws_order_number) ASC
-|  row-size=40B cardinality=1
-|
-20:AGGREGATE [FINALIZE]
-|  output: count(ws_order_number), sum:merge(ws_ext_ship_cost), sum:merge(ws_net_profit)
-|  row-size=40B cardinality=1
-|
-19:AGGREGATE
-|  output: sum(ws_ext_ship_cost), sum(ws_net_profit)
-|  group by: ws_order_number
-|  row-size=40B cardinality=3.25K
-|
-18:HASH JOIN [RIGHT SEMI JOIN]
-|  hash predicates: tpcds.web_returns.wr_order_number = ws1.ws_order_number
-|  runtime filters: RF000 <- ws1.ws_order_number
-|  row-size=92B cardinality=3.25K
-|
-|--16:HASH JOIN [RIGHT SEMI JOIN]
-|  |  hash predicates: ws1.ws_order_number = ws1.ws_order_number
-|  |  runtime filters: RF006 <- ws1.ws_order_number
-|  |  row-size=92B cardinality=3.25K
-|  |
-|  |--14:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ws1.ws_ship_date_sk = d_date_sk
-|  |  |  runtime filters: RF010 <- d_date_sk
-|  |  |  row-size=92B cardinality=3.25K
-|  |  |
-|  |  |--01:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-04-02 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-01 00:00:00'
-|  |  |     row-size=26B cardinality=7.30K
-|  |  |
-|  |  13:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ws1.ws_web_site_sk = web_site_sk
-|  |  |  runtime filters: RF012 <- web_site_sk
-|  |  |  row-size=66B cardinality=3.25K
-|  |  |
-|  |  |--03:SCAN HDFS [tpcds.web_site]
-|  |  |     HDFS partitions=1/1 files=1 size=8.57KB
-|  |  |     predicates: web_company_name = 'pri'
-|  |  |     row-size=20B cardinality=5
-|  |  |
-|  |  12:HASH JOIN [INNER JOIN]
-|  |  |  hash predicates: ws1.ws_ship_addr_sk = ca_address_sk
-|  |  |  runtime filters: RF014 <- ca_address_sk
-|  |  |  row-size=46B cardinality=19.52K
-|  |  |
-|  |  |--02:SCAN HDFS [tpcds.customer_address]
-|  |  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |  |     predicates: ca_state = 'IL'
-|  |  |     row-size=18B cardinality=980
-|  |  |
-|  |  00:SCAN HDFS [tpcds.web_sales ws1]
-|  |     HDFS partitions=1/1 files=1 size=140.07MB
-|  |     runtime filters: RF010 -> ws1.ws_ship_date_sk, RF012 -> ws1.ws_web_site_sk, RF014 -> ws1.ws_ship_addr_sk
-|  |     row-size=28B cardinality=719.38K
-|  |
-|  15:AGGREGATE [FINALIZE]
-|  |  group by: ws1.ws_order_number
-|  |  row-size=8B cardinality=59.77K
-|  |
-|  06:HASH JOIN [INNER JOIN]
-|  |  hash predicates: ws1.ws_order_number = ws2.ws_order_number
-|  |  other predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
-|  |  runtime filters: RF008 <- ws2.ws_order_number
-|  |  row-size=24B cardinality=8.66M
-|  |
-|  |--05:SCAN HDFS [tpcds.web_sales ws2]
-|  |     HDFS partitions=1/1 files=1 size=140.07MB
-|  |     runtime filters: RF006 -> ws2.ws_order_number
-|  |     row-size=12B cardinality=719.38K
-|  |
-|  04:SCAN HDFS [tpcds.web_sales ws1]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF006 -> ws1.ws_order_number, RF008 -> ws1.ws_order_number
-|     row-size=12B cardinality=719.38K
-|
-17:AGGREGATE [FINALIZE]
-|  group by: tpcds.web_returns.wr_order_number
-|  row-size=8B cardinality=43.44K
-|
-11:HASH JOIN [INNER JOIN]
-|  hash predicates: ws1.ws_order_number = wr_order_number
-|  runtime filters: RF002 <- wr_order_number
-|  row-size=32B cardinality=10.39M
-|
-|--07:SCAN HDFS [tpcds.web_returns]
-|     HDFS partitions=1/1 files=1 size=9.35MB
-|     runtime filters: RF000 -> tpcds.web_returns.wr_order_number
-|     row-size=8B cardinality=71.76K
-|
-10:HASH JOIN [INNER JOIN]
-|  hash predicates: ws1.ws_order_number = ws2.ws_order_number
-|  other predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
-|  runtime filters: RF004 <- ws2.ws_order_number
-|  row-size=24B cardinality=8.66M
-|
-|--09:SCAN HDFS [tpcds.web_sales ws2]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF000 -> ws2.ws_order_number, RF002 -> ws2.ws_order_number
-|     row-size=12B cardinality=719.38K
-|
-08:SCAN HDFS [tpcds.web_sales ws1]
-   HDFS partitions=1/1 files=1 size=140.07MB
-   runtime filters: RF000 -> ws1.ws_order_number, RF002 -> ws1.ws_order_number, RF004 -> ws1.ws_order_number
-   row-size=12B cardinality=719.38K
----- DISTRIBUTEDPLAN
-Max Per-Host Resource Reservation: Memory=112.58MB Threads=21
-Per-Host Resource Estimates: Memory=1.02GB
-PLAN-ROOT SINK
-|
-21:TOP-N [LIMIT=100]
-|  order by: count(ws_order_number) ASC
-|  row-size=40B cardinality=1
-|
-33:AGGREGATE [FINALIZE]
-|  output: count:merge(ws_order_number), sum:merge(ws_ext_ship_cost), sum:merge(ws_net_profit)
-|  row-size=40B cardinality=1
-|
-32:EXCHANGE [UNPARTITIONED]
-|
-20:AGGREGATE
-|  output: count(ws_order_number), sum:merge(ws_ext_ship_cost), sum:merge(ws_net_profit)
-|  row-size=40B cardinality=1
-|
-19:AGGREGATE
-|  output: sum(ws_ext_ship_cost), sum(ws_net_profit)
-|  group by: ws_order_number
-|  row-size=40B cardinality=3.25K
-|
-18:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
-|  hash predicates: tpcds.web_returns.wr_order_number = ws1.ws_order_number
-|  runtime filters: RF000 <- ws1.ws_order_number
-|  row-size=92B cardinality=3.25K
-|
-|--16:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
-|  |  hash predicates: ws1.ws_order_number = ws1.ws_order_number
-|  |  runtime filters: RF006 <- ws1.ws_order_number
-|  |  row-size=92B cardinality=3.25K
-|  |
-|  |--31:EXCHANGE [HASH(ws1.ws_order_number)]
-|  |  |
-|  |  14:HASH JOIN [INNER JOIN, PARTITIONED]
-|  |  |  hash predicates: ws1.ws_ship_date_sk = d_date_sk
-|  |  |  runtime filters: RF010 <- d_date_sk
-|  |  |  row-size=92B cardinality=3.25K
-|  |  |
-|  |  |--30:EXCHANGE [HASH(d_date_sk)]
-|  |  |  |
-|  |  |  01:SCAN HDFS [tpcds.date_dim]
-|  |  |     HDFS partitions=1/1 files=1 size=9.84MB
-|  |  |     predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-04-02 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-01 00:00:00'
-|  |  |     row-size=26B cardinality=7.30K
-|  |  |
-|  |  29:EXCHANGE [HASH(ws1.ws_ship_date_sk)]
-|  |  |
-|  |  13:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: ws1.ws_web_site_sk = web_site_sk
-|  |  |  runtime filters: RF012 <- web_site_sk
-|  |  |  row-size=66B cardinality=3.25K
-|  |  |
-|  |  |--28:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  03:SCAN HDFS [tpcds.web_site]
-|  |  |     HDFS partitions=1/1 files=1 size=8.57KB
-|  |  |     predicates: web_company_name = 'pri'
-|  |  |     row-size=20B cardinality=5
-|  |  |
-|  |  12:HASH JOIN [INNER JOIN, BROADCAST]
-|  |  |  hash predicates: ws1.ws_ship_addr_sk = ca_address_sk
-|  |  |  runtime filters: RF014 <- ca_address_sk
-|  |  |  row-size=46B cardinality=19.52K
-|  |  |
-|  |  |--27:EXCHANGE [BROADCAST]
-|  |  |  |
-|  |  |  02:SCAN HDFS [tpcds.customer_address]
-|  |  |     HDFS partitions=1/1 files=1 size=5.25MB
-|  |  |     predicates: ca_state = 'IL'
-|  |  |     row-size=18B cardinality=980
-|  |  |
-|  |  00:SCAN HDFS [tpcds.web_sales ws1]
-|  |     HDFS partitions=1/1 files=1 size=140.07MB
-|  |     runtime filters: RF010 -> ws1.ws_ship_date_sk, RF012 -> ws1.ws_web_site_sk, RF014 -> ws1.ws_ship_addr_sk
-|  |     row-size=28B cardinality=719.38K
-|  |
-|  15:AGGREGATE [FINALIZE]
-|  |  group by: ws1.ws_order_number
-|  |  row-size=8B cardinality=59.77K
-|  |
-|  06:HASH JOIN [INNER JOIN, PARTITIONED]
-|  |  hash predicates: ws1.ws_order_number = ws2.ws_order_number
-|  |  other predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
-|  |  runtime filters: RF008 <- ws2.ws_order_number
-|  |  row-size=24B cardinality=8.66M
-|  |
-|  |--26:EXCHANGE [HASH(ws2.ws_order_number)]
-|  |  |
-|  |  05:SCAN HDFS [tpcds.web_sales ws2]
-|  |     HDFS partitions=1/1 files=1 size=140.07MB
-|  |     runtime filters: RF006 -> ws2.ws_order_number
-|  |     row-size=12B cardinality=719.38K
-|  |
-|  25:EXCHANGE [HASH(ws1.ws_order_number)]
-|  |
-|  04:SCAN HDFS [tpcds.web_sales ws1]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF006 -> ws1.ws_order_number, RF008 -> ws1.ws_order_number
-|     row-size=12B cardinality=719.38K
-|
-17:AGGREGATE [FINALIZE]
-|  group by: tpcds.web_returns.wr_order_number
-|  row-size=8B cardinality=43.44K
-|
-11:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ws1.ws_order_number = wr_order_number
-|  runtime filters: RF002 <- wr_order_number
-|  row-size=32B cardinality=10.39M
-|
-|--24:EXCHANGE [HASH(wr_order_number)]
-|  |
-|  07:SCAN HDFS [tpcds.web_returns]
-|     HDFS partitions=1/1 files=1 size=9.35MB
-|     runtime filters: RF000 -> tpcds.web_returns.wr_order_number
-|     row-size=8B cardinality=71.76K
-|
-10:HASH JOIN [INNER JOIN, PARTITIONED]
-|  hash predicates: ws1.ws_order_number = ws2.ws_order_number
-|  other predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
-|  runtime filters: RF004 <- ws2.ws_order_number
-|  row-size=24B cardinality=8.66M
-|
-|--23:EXCHANGE [HASH(ws2.ws_order_number)]
-|  |
-|  09:SCAN HDFS [tpcds.web_sales ws2]
-|     HDFS partitions=1/1 files=1 size=140.07MB
-|     runtime filters: RF000 -> ws2.ws_order_number, RF002 -> ws2.ws_order_number
-|     row-size=12B cardinality=719.38K
-|
-22:EXCHANGE [HASH(ws1.ws_order_number)]
-|
-08:SCAN HDFS [tpcds.web_sales ws1]
-   HDFS partitions=1/1 files=1 size=140.07MB
-   runtime filters: RF000 -> ws1.ws_order_number, RF002 -> ws1.ws_order_number, RF004 -> ws1.ws_order_number
-   row-size=12B cardinality=719.38K
-====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q01.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q01.test
new file mode 100644
index 0000000..d7c846e
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q01.test
@@ -0,0 +1,685 @@
+# TPCDS-Q01
+WITH customer_total_return AS
+  (SELECT sr_customer_sk AS ctr_customer_sk,
+          sr_store_sk AS ctr_store_sk,
+          sum(sr_return_amt) AS ctr_total_return
+   FROM store_returns,
+        date_dim
+   WHERE sr_returned_date_sk = d_date_sk
+     AND d_year = 2000
+   GROUP BY sr_customer_sk,
+            sr_store_sk)
+SELECT c_customer_id
+FROM customer_total_return ctr1,
+     store,
+     customer
+WHERE ctr1.ctr_total_return >
+    (SELECT avg(ctr_total_return)*1.2
+     FROM customer_total_return ctr2
+     WHERE ctr1.ctr_store_sk = ctr2.ctr_store_sk)
+  AND s_store_sk = ctr1.ctr_store_sk
+  AND s_state = 'TN'
+  AND ctr1.ctr_customer_sk = c_customer_sk
+ORDER BY c_customer_id
+LIMIT 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=26.58MB Threads=7
+Per-Host Resource Estimates: Memory=331MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=330.81MB mem-reservation=26.58MB thread-reservation=7 runtime-filters-memory=5.00MB
+PLAN-ROOT SINK
+|  output exprs: c_customer_id
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC
+|  mem-estimate=2.73KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=28B cardinality=100
+|  in pipelines: 14(GETNEXT), 05(OPEN)
+|
+13:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: sr_store_sk = ctr2.ctr_store_sk
+|  other join predicates: sum(sr_return_amt) > avg(ctr_total_return) * CAST(1.2 AS DECIMAL(2,1))
+|  runtime filters: RF000[bloom] <- ctr2.ctr_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5,2,4 row-size=74B cardinality=53.81K
+|  in pipelines: 05(GETNEXT), 10(OPEN)
+|
+|--10:AGGREGATE [FINALIZE]
+|  |  output: avg(sum(sr_return_amt))
+|  |  group by: sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11 row-size=20B cardinality=6
+|  |  in pipelines: 10(GETNEXT), 09(OPEN)
+|  |
+|  09:AGGREGATE [FINALIZE]
+|  |  output: sum(sr_return_amt)
+|  |  group by: sr_customer_sk, sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=24B cardinality=53.81K
+|  |  in pipelines: 09(GETNEXT), 06(OPEN)
+|  |
+|  08:HASH JOIN [INNER JOIN]
+|  |  hash predicates: sr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7 row-size=24B cardinality=53.81K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--07:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=8B cardinality=373
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.store_returns]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF008[bloom] -> sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=6 row-size=16B cardinality=287.51K
+|     in pipelines: 06(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: sr_store_sk = s_store_sk
+|  fk/pk conjuncts: sr_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5,2,4 row-size=74B cardinality=53.81K
+|  in pipelines: 05(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_state = 'TN'
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store.s_store_sk
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_state = 'TN'
+|     parquet dictionary predicates: s_state = 'TN'
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=4 row-size=18B cardinality=12
+|     in pipelines: 04(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: c_customer_sk = sr_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF004[bloom] <- sr_customer_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,2 row-size=56B cardinality=53.81K
+|  in pipelines: 05(GETNEXT), 03(OPEN)
+|
+|--03:AGGREGATE [FINALIZE]
+|  |  output: sum(sr_return_amt)
+|  |  group by: sr_customer_sk, sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=2 row-size=24B cardinality=53.81K
+|  |  in pipelines: 03(GETNEXT), 00(OPEN)
+|  |
+|  02:HASH JOIN [INNER JOIN]
+|  |  hash predicates: sr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=24B cardinality=53.81K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--01:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=1 row-size=8B cardinality=373
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_returns]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store_returns.sr_store_sk, RF002[bloom] -> tpcds_parquet.store_returns.sr_store_sk, RF006[bloom] -> sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=0 row-size=16B cardinality=287.51K
+|     in pipelines: 00(GETNEXT)
+|
+05:SCAN HDFS [tpcds_parquet.customer]
+   HDFS partitions=1/1 files=1 size=5.49MB
+   runtime filters: RF004[bloom] -> c_customer_sk
+   stored statistics:
+     table: rows=100.00K size=5.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=100.00K
+   mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=5 row-size=32B cardinality=100.00K
+   in pipelines: 05(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=45.33MB Threads=16
+Per-Host Resource Estimates: Memory=402MB
+F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_customer_id
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+26:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_customer_id ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=28B cardinality=100
+|  in pipelines: 14(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Resources: mem-estimate=43.04MB mem-reservation=11.75MB thread-reservation=2 runtime-filters-memory=3.00MB
+14:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC
+|  mem-estimate=2.73KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=28B cardinality=100
+|  in pipelines: 14(GETNEXT), 05(OPEN)
+|
+13:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: sr_store_sk = ctr2.ctr_store_sk
+|  other join predicates: sum(sr_return_amt) > avg(ctr_total_return) * CAST(1.2 AS DECIMAL(2,1))
+|  runtime filters: RF000[bloom] <- ctr2.ctr_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5,2,4 row-size=74B cardinality=53.81K
+|  in pipelines: 05(GETNEXT), 24(OPEN)
+|
+|--25:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=20B cardinality=6
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [HASH(ctr2.ctr_store_sk)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  24:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ctr_total_return)
+|  |  group by: ctr2.ctr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11 row-size=20B cardinality=6
+|  |  in pipelines: 24(GETNEXT), 22(OPEN)
+|  |
+|  23:EXCHANGE [HASH(ctr2.ctr_store_sk)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=20B cardinality=6
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(sr_customer_sk,sr_store_sk)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=21.26MB mem-reservation=4.88MB thread-reservation=1
+|  10:AGGREGATE [STREAMING]
+|  |  output: avg(sum(sr_return_amt))
+|  |  group by: sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=20B cardinality=6
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  22:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(sr_return_amt)
+|  |  group by: sr_customer_sk, sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=24B cardinality=53.81K
+|  |  in pipelines: 22(GETNEXT), 06(OPEN)
+|  |
+|  21:EXCHANGE [HASH(sr_customer_sk,sr_store_sk)]
+|  |  mem-estimate=1.26MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=24B cardinality=53.81K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=108.95MB mem-reservation=9.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  09:AGGREGATE [STREAMING]
+|  |  output: sum(sr_return_amt)
+|  |  group by: sr_customer_sk, sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=24B cardinality=53.81K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: sr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7 row-size=24B cardinality=53.81K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=8B cardinality=373
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=8B cardinality=373
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF008[bloom] -> sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=6 row-size=16B cardinality=287.51K
+|     in pipelines: 06(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: sr_store_sk = s_store_sk
+|  fk/pk conjuncts: sr_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5,2,4 row-size=74B cardinality=53.81K
+|  in pipelines: 05(GETNEXT), 04(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=18B cardinality=12
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.02MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  04:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_state = 'TN'
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store.s_store_sk
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_state = 'TN'
+|     parquet dictionary predicates: s_state = 'TN'
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=4 row-size=18B cardinality=12
+|     in pipelines: 04(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: c_customer_sk = sr_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF004[bloom] <- sr_customer_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,2 row-size=56B cardinality=53.81K
+|  in pipelines: 05(GETNEXT), 17(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.26MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=24B cardinality=53.81K
+|  |  in pipelines: 17(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [HASH(sr_customer_sk,sr_store_sk)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=11.26MB mem-reservation=2.88MB thread-reservation=1
+|  17:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(sr_return_amt)
+|  |  group by: sr_customer_sk, sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=2 row-size=24B cardinality=53.81K
+|  |  in pipelines: 17(GETNEXT), 00(OPEN)
+|  |
+|  16:EXCHANGE [HASH(sr_customer_sk,sr_store_sk)]
+|  |  mem-estimate=1.26MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=24B cardinality=53.81K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=110.95MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  03:AGGREGATE [STREAMING]
+|  |  output: sum(sr_return_amt)
+|  |  group by: sr_customer_sk, sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=2 row-size=24B cardinality=53.81K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  02:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: sr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=24B cardinality=53.81K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--15:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=8B cardinality=373
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=1 row-size=8B cardinality=373
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store_returns.sr_store_sk, RF002[bloom] -> tpcds_parquet.store_returns.sr_store_sk, RF006[bloom] -> sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=0 row-size=16B cardinality=287.51K
+|     in pipelines: 00(GETNEXT)
+|
+05:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+   HDFS partitions=1/1 files=1 size=5.49MB
+   runtime filters: RF004[bloom] -> c_customer_sk
+   stored statistics:
+     table: rows=100.00K size=5.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=100.00K
+   mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=5 row-size=32B cardinality=100.00K
+   in pipelines: 05(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=58.95MB Threads=15
+Per-Host Resource Estimates: Memory=208MB
+F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_customer_id
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+26:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_customer_id ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=28B cardinality=100
+|  in pipelines: 14(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+14:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC
+|  mem-estimate=2.73KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=28B cardinality=100
+|  in pipelines: 14(GETNEXT), 05(OPEN)
+|
+13:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: sr_store_sk = ctr2.ctr_store_sk
+|  other join predicates: sum(sr_return_amt) > avg(ctr_total_return) * CAST(1.2 AS DECIMAL(2,1))
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5,2,4 row-size=74B cardinality=53.81K
+|  in pipelines: 05(GETNEXT), 24(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: ctr2.ctr_store_sk
+|  |  runtime filters: RF000[bloom] <- ctr2.ctr_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  25:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=20B cardinality=6
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [HASH(ctr2.ctr_store_sk)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  24:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ctr_total_return)
+|  |  group by: ctr2.ctr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11 row-size=20B cardinality=6
+|  |  in pipelines: 24(GETNEXT), 22(OPEN)
+|  |
+|  23:EXCHANGE [HASH(ctr2.ctr_store_sk)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=20B cardinality=6
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(sr_customer_sk,sr_store_sk)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=21.26MB mem-reservation=4.88MB thread-reservation=1
+|  10:AGGREGATE [STREAMING]
+|  |  output: avg(sum(sr_return_amt))
+|  |  group by: sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=20B cardinality=6
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  22:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(sr_return_amt)
+|  |  group by: sr_customer_sk, sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=24B cardinality=53.81K
+|  |  in pipelines: 22(GETNEXT), 06(OPEN)
+|  |
+|  21:EXCHANGE [HASH(sr_customer_sk,sr_store_sk)]
+|  |  mem-estimate=1.26MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=24B cardinality=53.81K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=34.00MB mem-reservation=7.00MB thread-reservation=1
+|  09:AGGREGATE [STREAMING]
+|  |  output: sum(sr_return_amt)
+|  |  group by: sr_customer_sk, sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=24B cardinality=53.81K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: sr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7 row-size=24B cardinality=53.81K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=8B cardinality=373
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=7 row-size=8B cardinality=373
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF008[bloom] -> sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=6 row-size=16B cardinality=287.51K
+|     in pipelines: 06(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: sr_store_sk = s_store_sk
+|  fk/pk conjuncts: sr_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5,2,4 row-size=74B cardinality=53.81K
+|  in pipelines: 05(GETNEXT), 04(OPEN)
+|
+|--F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF002[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=18B cardinality=12
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_state = 'TN'
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store.s_store_sk
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_state = 'TN'
+|     parquet dictionary predicates: s_state = 'TN'
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=4 row-size=18B cardinality=12
+|     in pipelines: 04(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: c_customer_sk = sr_customer_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,2 row-size=56B cardinality=53.81K
+|  in pipelines: 05(GETNEXT), 17(OPEN)
+|
+|--F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=8.01MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: sr_customer_sk
+|  |  runtime filters: RF004[bloom] <- sr_customer_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.26MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=24B cardinality=53.81K
+|  |  in pipelines: 17(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [HASH(sr_customer_sk,sr_store_sk)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=11.26MB mem-reservation=2.88MB thread-reservation=1
+|  17:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(sr_return_amt)
+|  |  group by: sr_customer_sk, sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=2 row-size=24B cardinality=53.81K
+|  |  in pipelines: 17(GETNEXT), 00(OPEN)
+|  |
+|  16:EXCHANGE [HASH(sr_customer_sk,sr_store_sk)]
+|  |  mem-estimate=1.26MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=24B cardinality=53.81K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=34.00MB mem-reservation=7.00MB thread-reservation=1
+|  03:AGGREGATE [STREAMING]
+|  |  output: sum(sr_return_amt)
+|  |  group by: sr_customer_sk, sr_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=2 row-size=24B cardinality=53.81K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  02:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: sr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=24B cardinality=53.81K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=03
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  15:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=8B cardinality=373
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=1 row-size=8B cardinality=373
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store_returns.sr_store_sk, RF002[bloom] -> tpcds_parquet.store_returns.sr_store_sk, RF006[bloom] -> sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=0 row-size=16B cardinality=287.51K
+|     in pipelines: 00(GETNEXT)
+|
+05:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+   HDFS partitions=1/1 files=1 size=5.49MB
+   runtime filters: RF004[bloom] -> c_customer_sk
+   stored statistics:
+     table: rows=100.00K size=5.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=100.00K
+   mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=5 row-size=32B cardinality=100.00K
+   in pipelines: 05(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q02.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q02.test
new file mode 100644
index 0000000..3f02194
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q02.test
@@ -0,0 +1,787 @@
+# TPCDS-Q02
+WITH wscs AS
+  (SELECT sold_date_sk,
+          sales_price
+   FROM
+     (SELECT ws_sold_date_sk sold_date_sk,
+             ws_ext_sales_price sales_price
+      FROM web_sales
+      UNION ALL SELECT cs_sold_date_sk sold_date_sk,
+                       cs_ext_sales_price sales_price
+      FROM catalog_sales) sq1),
+     wswscs AS
+  (SELECT d_week_seq,
+          sum(CASE
+                  WHEN (d_day_name='Sunday') THEN sales_price
+                  ELSE NULL
+              END) sun_sales,
+          sum(CASE
+                  WHEN (d_day_name='Monday') THEN sales_price
+                  ELSE NULL
+              END) mon_sales,
+          sum(CASE
+                  WHEN (d_day_name='Tuesday') THEN sales_price
+                  ELSE NULL
+              END) tue_sales,
+          sum(CASE
+                  WHEN (d_day_name='Wednesday') THEN sales_price
+                  ELSE NULL
+              END) wed_sales,
+          sum(CASE
+                  WHEN (d_day_name='Thursday') THEN sales_price
+                  ELSE NULL
+              END) thu_sales,
+          sum(CASE
+                  WHEN (d_day_name='Friday') THEN sales_price
+                  ELSE NULL
+              END) fri_sales,
+          sum(CASE
+                  WHEN (d_day_name='Saturday') THEN sales_price
+                  ELSE NULL
+              END) sat_sales
+   FROM wscs,
+        date_dim
+   WHERE d_date_sk = sold_date_sk
+   GROUP BY d_week_seq)
+SELECT d_week_seq1,
+       round(sun_sales1/sun_sales2, 2),
+       round(mon_sales1/mon_sales2, 2),
+       round(tue_sales1/tue_sales2, 2),
+       round(wed_sales1/wed_sales2, 2),
+       round(thu_sales1/thu_sales2, 2),
+       round(fri_sales1/fri_sales2, 2),
+       round(sat_sales1/sat_sales2, 2)
+FROM
+  (SELECT wswscs.d_week_seq d_week_seq1,
+          sun_sales sun_sales1,
+          mon_sales mon_sales1,
+          tue_sales tue_sales1,
+          wed_sales wed_sales1,
+          thu_sales thu_sales1,
+          fri_sales fri_sales1,
+          sat_sales sat_sales1
+   FROM wswscs,
+        date_dim
+   WHERE date_dim.d_week_seq = wswscs.d_week_seq
+     AND d_year = 2001) y,
+  (SELECT wswscs.d_week_seq d_week_seq2,
+          sun_sales sun_sales2,
+          mon_sales mon_sales2,
+          tue_sales tue_sales2,
+          wed_sales wed_sales2,
+          thu_sales thu_sales2,
+          fri_sales fri_sales2,
+          sat_sales sat_sales2
+   FROM wswscs,
+        date_dim
+   WHERE date_dim.d_week_seq = wswscs.d_week_seq
+     AND d_year = 2001+1) z
+WHERE d_week_seq1 = d_week_seq2-53
+ORDER BY d_week_seq1;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=28.88MB Threads=7
+Per-Host Resource Estimates: Memory=367MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=366.62MB mem-reservation=28.88MB thread-reservation=7 runtime-filters-memory=5.00MB
+PLAN-ROOT SINK
+|  output exprs: d_week_seq1, round(sun_sales1 / sun_sales2, CAST(2 AS TINYINT)), round(mon_sales1 / mon_sales2, CAST(2 AS TINYINT)), round(tue_sales1 / tue_sales2, CAST(2 AS TINYINT)), round(wed_sales1 / wed_sales2, CAST(2 AS TINYINT)), round(thu_sales1 / thu_sales2, CAST(2 AS TINYINT)), round(fri_sales1 / fri_sales2, CAST(2 AS TINYINT)), round(sat_sales1 / sat_sales2, CAST(2 AS TINYINT))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:SORT
+|  order by: d_week_seq1 ASC
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=20 row-size=228B cardinality=2.56K
+|  in pipelines: 17(GETNEXT), 05(OPEN)
+|
+16:HASH JOIN [INNER JOIN]
+|  hash predicates: d_week_seq = d_week_seq - 53
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF000[bloom] <- d_week_seq - 53
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,8,16,18 row-size=248B cardinality=2.56K
+|  in pipelines: 05(GETNEXT), 13(OPEN)
+|
+|--15:HASH JOIN [INNER JOIN]
+|  |  hash predicates: d_week_seq = date_dim.d_week_seq
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF006[bloom] <- date_dim.d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,18 row-size=124B cardinality=2.56K
+|  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |
+|  |--14:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=8B cardinality=373
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  13:AGGREGATE [FINALIZE]
+|  |  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN sales_price ELSE NULL END)
+|  |  group by: d_week_seq
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=116B cardinality=10.64K
+|  |  in pipelines: 13(GETNEXT), 09(OPEN), 10(OPEN)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=12,15 row-size=35B cardinality=2.16M
+|  |  in pipelines: 09(GETNEXT), 10(GETNEXT), 11(OPEN)
+|  |
+|  |--11:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF006[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=15 row-size=27B cardinality=73.05K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  08:UNION
+|  |  pass-through-operands: all
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=8B cardinality=2.16M
+|  |  in pipelines: 09(GETNEXT), 10(GETNEXT)
+|  |
+|  |--10:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF008[bloom] -> tpcds_parquet.catalog_sales.cs_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=8B cardinality=1.44M
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF008[bloom] -> tpcds_parquet.web_sales.ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=8B cardinality=719.38K
+|     in pipelines: 09(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: d_week_seq = date_dim.d_week_seq
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- date_dim.d_week_seq
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,8 row-size=124B cardinality=2.56K
+|  in pipelines: 05(GETNEXT), 06(OPEN)
+|
+|--06:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT)
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT)
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=8 row-size=8B cardinality=373
+|     in pipelines: 06(GETNEXT)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN sales_price ELSE NULL END)
+|  group by: d_week_seq
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=6 row-size=116B cardinality=10.64K
+|  in pipelines: 05(GETNEXT), 01(OPEN), 02(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: sold_date_sk = d_date_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=2,5 row-size=35B cardinality=2.16M
+|  in pipelines: 01(GETNEXT), 02(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_week_seq, RF002[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=27B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+00:UNION
+|  pass-through-operands: all
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2 row-size=8B cardinality=2.16M
+|  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|
+|--02:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> tpcds_parquet.catalog_sales.cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=1.44M
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.web_sales]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF004[bloom] -> tpcds_parquet.web_sales.ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=8B cardinality=719.38K
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=45.94MB Threads=15
+Per-Host Resource Estimates: Memory=424MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=886.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: d_week_seq1, round(sun_sales1 / sun_sales2, CAST(2 AS TINYINT)), round(mon_sales1 / mon_sales2, CAST(2 AS TINYINT)), round(tue_sales1 / tue_sales2, CAST(2 AS TINYINT)), round(wed_sales1 / wed_sales2, CAST(2 AS TINYINT)), round(thu_sales1 / thu_sales2, CAST(2 AS TINYINT)), round(fri_sales1 / fri_sales2, CAST(2 AS TINYINT)), round(sat_sales1 / sat_sales2, CAST(2 AS TINYINT))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: d_week_seq1 ASC
+|  mem-estimate=886.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=20 row-size=228B cardinality=2.56K
+|  in pipelines: 17(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(d_week_seq)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=21.88MB mem-reservation=13.81MB thread-reservation=1 runtime-filters-memory=2.00MB
+17:SORT
+|  order by: d_week_seq1 ASC
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=20 row-size=228B cardinality=2.56K
+|  in pipelines: 17(GETNEXT), 20(OPEN)
+|
+16:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: d_week_seq = d_week_seq - 53
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF000[bloom] <- d_week_seq - 53
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,8,16,18 row-size=248B cardinality=2.56K
+|  in pipelines: 20(GETNEXT), 24(OPEN)
+|
+|--26:EXCHANGE [HASH(d_week_seq - 53)]
+|  |  mem-estimate=499.33KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16,18 row-size=124B cardinality=2.56K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [HASH(d_week_seq)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=13.70MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  15:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: d_week_seq = date_dim.d_week_seq
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF006[bloom] <- date_dim.d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,18 row-size=124B cardinality=2.56K
+|  |  in pipelines: 24(GETNEXT), 14(OPEN)
+|  |
+|  |--25:EXCHANGE [HASH(date_dim.d_week_seq)]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=8B cardinality=373
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=8B cardinality=373
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  24:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN sales_price ELSE NULL END)
+|  |  group by: d_week_seq
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=116B cardinality=10.64K
+|  |  in pipelines: 24(GETNEXT), 09(OPEN), 10(OPEN)
+|  |
+|  23:EXCHANGE [HASH(d_week_seq)]
+|  |  mem-estimate=761.85KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=116B cardinality=10.64K
+|  |  in pipelines: 09(GETNEXT), 10(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=111.80MB mem-reservation=10.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  13:AGGREGATE [STREAMING]
+|  |  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN sales_price ELSE NULL END)
+|  |  group by: d_week_seq
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=116B cardinality=10.64K
+|  |  in pipelines: 09(GETNEXT), 10(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=12,15 row-size=35B cardinality=2.16M
+|  |  in pipelines: 09(GETNEXT), 10(GETNEXT), 11(OPEN)
+|  |
+|  |--22:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.92MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=15 row-size=27B cardinality=73.05K
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=49.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  11:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF006[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=15 row-size=27B cardinality=73.05K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  08:UNION
+|  |  pass-through-operands: all
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=8B cardinality=2.16M
+|  |  in pipelines: 09(GETNEXT), 10(GETNEXT)
+|  |
+|  |--10:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF008[bloom] -> tpcds_parquet.catalog_sales.cs_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=8B cardinality=1.44M
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF008[bloom] -> tpcds_parquet.web_sales.ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=8B cardinality=719.38K
+|     in pipelines: 09(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: d_week_seq = date_dim.d_week_seq
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- date_dim.d_week_seq
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,8 row-size=124B cardinality=2.56K
+|  in pipelines: 20(GETNEXT), 06(OPEN)
+|
+|--21:EXCHANGE [HASH(date_dim.d_week_seq)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=8B cardinality=373
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.25MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  06:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT)
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT)
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=8 row-size=8B cardinality=373
+|     in pipelines: 06(GETNEXT)
+|
+20:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN sales_price ELSE NULL END)
+|  group by: d_week_seq
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=116B cardinality=10.64K
+|  in pipelines: 20(GETNEXT), 01(OPEN), 02(OPEN)
+|
+19:EXCHANGE [HASH(d_week_seq)]
+|  mem-estimate=761.85KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=116B cardinality=10.64K
+|  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|
+F02:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=111.80MB mem-reservation=10.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN sales_price ELSE NULL END)
+|  group by: d_week_seq
+|  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=6 row-size=116B cardinality=10.64K
+|  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: sold_date_sk = d_date_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=2,5 row-size=35B cardinality=2.16M
+|  in pipelines: 01(GETNEXT), 02(GETNEXT), 03(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.92MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=27B cardinality=73.05K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=50.00MB mem-reservation=2.50MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_week_seq, RF002[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=27B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+00:UNION
+|  pass-through-operands: all
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2 row-size=8B cardinality=2.16M
+|  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|
+|--02:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> tpcds_parquet.catalog_sales.cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=1.44M
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF004[bloom] -> tpcds_parquet.web_sales.ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=8B cardinality=719.38K
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=53.69MB Threads=14
+Per-Host Resource Estimates: Memory=240MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=886.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: d_week_seq1, round(sun_sales1 / sun_sales2, CAST(2 AS TINYINT)), round(mon_sales1 / mon_sales2, CAST(2 AS TINYINT)), round(tue_sales1 / tue_sales2, CAST(2 AS TINYINT)), round(wed_sales1 / wed_sales2, CAST(2 AS TINYINT)), round(thu_sales1 / thu_sales2, CAST(2 AS TINYINT)), round(fri_sales1 / fri_sales2, CAST(2 AS TINYINT)), round(sat_sales1 / sat_sales2, CAST(2 AS TINYINT))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: d_week_seq1 ASC
+|  mem-estimate=886.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=20 row-size=228B cardinality=2.56K
+|  in pipelines: 17(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(d_week_seq)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=7.94MB thread-reservation=1
+17:SORT
+|  order by: d_week_seq1 ASC
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=20 row-size=228B cardinality=2.56K
+|  in pipelines: 17(GETNEXT), 20(OPEN)
+|
+16:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: d_week_seq = d_week_seq - 53
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,8,16,18 row-size=248B cardinality=2.56K
+|  in pipelines: 20(GETNEXT), 24(OPEN)
+|
+|--F13:PLAN FRAGMENT [HASH(d_week_seq)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.43MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_week_seq - 53
+|  |  runtime filters: RF000[bloom] <- d_week_seq - 53
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  26:EXCHANGE [HASH(d_week_seq - 53)]
+|  |  mem-estimate=499.33KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16,18 row-size=124B cardinality=2.56K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [HASH(d_week_seq)] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=10.74MB mem-reservation=1.94MB thread-reservation=1
+|  15:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: d_week_seq = date_dim.d_week_seq
+|  |  fk/pk conjuncts: none
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,18 row-size=124B cardinality=2.56K
+|  |  in pipelines: 24(GETNEXT), 14(OPEN)
+|  |
+|  |--F14:PLAN FRAGMENT [HASH(d_week_seq)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=2.95MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: date_dim.d_week_seq
+|  |  |  runtime filters: RF006[bloom] <- date_dim.d_week_seq
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  25:EXCHANGE [HASH(date_dim.d_week_seq)]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=8B cardinality=373
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=18 row-size=8B cardinality=373
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  24:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN sales_price ELSE NULL END)
+|  |  group by: d_week_seq
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=116B cardinality=10.64K
+|  |  in pipelines: 24(GETNEXT), 09(OPEN), 10(OPEN)
+|  |
+|  23:EXCHANGE [HASH(d_week_seq)]
+|  |  mem-estimate=761.85KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=116B cardinality=10.64K
+|  |  in pipelines: 09(GETNEXT), 10(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=7.00MB thread-reservation=1
+|  13:AGGREGATE [STREAMING]
+|  |  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN sales_price ELSE NULL END)
+|  |  group by: d_week_seq
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=116B cardinality=10.64K
+|  |  in pipelines: 09(GETNEXT), 10(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=12,15 row-size=35B cardinality=2.16M
+|  |  in pipelines: 09(GETNEXT), 10(GETNEXT), 11(OPEN)
+|  |
+|  |--F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=8.67MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  22:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.92MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=15 row-size=27B cardinality=73.05K
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  11:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF006[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=15 row-size=27B cardinality=73.05K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  08:UNION
+|  |  pass-through-operands: all
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=8B cardinality=2.16M
+|  |  in pipelines: 09(GETNEXT), 10(GETNEXT)
+|  |
+|  |--10:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF008[bloom] -> tpcds_parquet.catalog_sales.cs_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=11 row-size=8B cardinality=1.44M
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF008[bloom] -> tpcds_parquet.web_sales.ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=10 row-size=8B cardinality=719.38K
+|     in pipelines: 09(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=03
+|  hash predicates: d_week_seq = date_dim.d_week_seq
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,8 row-size=124B cardinality=2.56K
+|  in pipelines: 20(GETNEXT), 06(OPEN)
+|
+|--F16:PLAN FRAGMENT [HASH(d_week_seq)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=2.95MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: date_dim.d_week_seq
+|  |  runtime filters: RF002[bloom] <- date_dim.d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  21:EXCHANGE [HASH(date_dim.d_week_seq)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=8B cardinality=373
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  06:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT)
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT)
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=8 row-size=8B cardinality=373
+|     in pipelines: 06(GETNEXT)
+|
+20:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN sales_price ELSE NULL END)
+|  group by: d_week_seq
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=116B cardinality=10.64K
+|  in pipelines: 20(GETNEXT), 01(OPEN), 02(OPEN)
+|
+19:EXCHANGE [HASH(d_week_seq)]
+|  mem-estimate=761.85KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=116B cardinality=10.64K
+|  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|
+F02:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+Per-Instance Resources: mem-estimate=58.00MB mem-reservation=7.00MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN sales_price ELSE NULL END)
+|  group by: d_week_seq
+|  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=6 row-size=116B cardinality=10.64K
+|  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: sold_date_sk = d_date_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=2,5 row-size=35B cardinality=2.16M
+|  in pipelines: 01(GETNEXT), 02(GETNEXT), 03(OPEN)
+|
+|--F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=8.67MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.92MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=27B cardinality=73.05K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_week_seq, RF002[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=5 row-size=27B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+00:UNION
+|  pass-through-operands: all
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2 row-size=8B cardinality=2.16M
+|  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|
+|--02:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> tpcds_parquet.catalog_sales.cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=1 row-size=8B cardinality=1.44M
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF004[bloom] -> tpcds_parquet.web_sales.ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=8B cardinality=719.38K
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q03.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q03.test
new file mode 100644
index 0000000..d0cbe0a
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q03.test
@@ -0,0 +1,355 @@
+# TPCDS-Q3
+select
+  dt.d_year,
+  item.i_brand_id brand_id,
+  item.i_brand brand,
+  sum(ss_ext_sales_price) sum_agg
+from
+  date_dim dt,
+  store_sales,
+  item
+where
+  dt.d_date_sk = store_sales.ss_sold_date_sk
+  and store_sales.ss_item_sk = item.i_item_sk
+  and item.i_manufact_id = 436
+  and dt.d_moy = 12
+group by
+  dt.d_year,
+  item.i_brand,
+  item.i_brand_id
+order by
+  dt.d_year,
+  sum_agg desc,
+  brand_id
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=8.81MB Threads=4
+Per-Host Resource Estimates: Memory=150MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=149.88MB mem-reservation=8.81MB thread-reservation=4 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: dt.d_year, item.i_brand_id, item.i_brand, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+06:TOP-N [LIMIT=100]
+|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
+|  mem-estimate=5.10KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=52B cardinality=100
+|  in pipelines: 06(GETNEXT), 05(OPEN)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_brand, item.i_brand_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=3.04K
+|  in pipelines: 05(GETNEXT), 01(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  runtime filters: RF000[bloom] <- dt.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=72B cardinality=3.04K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.date_dim dt]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: dt.d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: dt.d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: dt.d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=0 row-size=12B cardinality=6.09K
+|     in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
+|  fk/pk conjuncts: store_sales.ss_item_sk = item.i_item_sk
+|  runtime filters: RF002[bloom] <- item.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=60B cardinality=3.04K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: item.i_manufact_id = CAST(436 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: item.i_manufact_id = CAST(436 AS INT)
+|     parquet dictionary predicates: item.i_manufact_id = CAST(436 AS INT)
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=44B cardinality=19
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> store_sales.ss_sold_date_sk, RF002[bloom] -> store_sales.ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=12.56MB Threads=9
+Per-Host Resource Estimates: Memory=171MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=18.16KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: dt.d_year, item.i_brand_id, item.i_brand, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+12:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
+|  limit: 100
+|  mem-estimate=18.16KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=52B cardinality=100
+|  in pipelines: 06(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(dt.d_year,item.i_brand,item.i_brand_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.22MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
+|  mem-estimate=5.10KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=52B cardinality=100
+|  in pipelines: 06(GETNEXT), 11(OPEN)
+|
+11:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_brand, item.i_brand_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=3.04K
+|  in pipelines: 11(GETNEXT), 01(OPEN)
+|
+10:EXCHANGE [HASH(dt.d_year,item.i_brand,item.i_brand_id)]
+|  mem-estimate=220.26KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=3.04K
+|  in pipelines: 01(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(store_sales.ss_sold_date_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=13.28MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_brand, item.i_brand_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=3.04K
+|  in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  runtime filters: RF000[bloom] <- dt.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=72B cardinality=3.04K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--09:EXCHANGE [HASH(dt.d_date_sk)]
+|  |  mem-estimate=87.33KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=12B cardinality=6.09K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.date_dim dt, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: dt.d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: dt.d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: dt.d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=0 row-size=12B cardinality=6.09K
+|     in pipelines: 00(GETNEXT)
+|
+08:EXCHANGE [HASH(store_sales.ss_sold_date_sk)]
+|  mem-estimate=264.18KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1,2 row-size=60B cardinality=3.04K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=35.95MB mem-reservation=4.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
+|  fk/pk conjuncts: store_sales.ss_item_sk = item.i_item_sk
+|  runtime filters: RF002[bloom] <- item.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=60B cardinality=3.04K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=44B cardinality=19
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: item.i_manufact_id = CAST(436 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: item.i_manufact_id = CAST(436 AS INT)
+|     parquet dictionary predicates: item.i_manufact_id = CAST(436 AS INT)
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=44B cardinality=19
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> store_sales.ss_sold_date_sk, RF002[bloom] -> store_sales.ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=23.38MB Threads=12
+Per-Host Resource Estimates: Memory=119MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=34.63KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: dt.d_year, item.i_brand_id, item.i_brand, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+12:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
+|  limit: 100
+|  mem-estimate=34.63KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=52B cardinality=100
+|  in pipelines: 06(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(dt.d_year,item.i_brand,item.i_brand_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.38MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
+|  mem-estimate=5.10KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=52B cardinality=100
+|  in pipelines: 06(GETNEXT), 11(OPEN)
+|
+11:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_brand, item.i_brand_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=3.04K
+|  in pipelines: 11(GETNEXT), 01(OPEN)
+|
+10:EXCHANGE [HASH(dt.d_year,item.i_brand,item.i_brand_id)]
+|  mem-estimate=388.85KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=3.04K
+|  in pipelines: 01(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(store_sales.ss_sold_date_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.46MB mem-reservation=2.00MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_brand, item.i_brand_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=3.04K
+|  in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=72B cardinality=3.04K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--F06:PLAN FRAGMENT [HASH(store_sales.ss_sold_date_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=3.02MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: dt.d_date_sk
+|  |  runtime filters: RF000[bloom] <- dt.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  09:EXCHANGE [HASH(dt.d_date_sk)]
+|  |  mem-estimate=87.33KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=12B cardinality=6.09K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.date_dim dt, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: dt.d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: dt.d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: dt.d_moy = CAST(12 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=0 row-size=12B cardinality=6.09K
+|     in pipelines: 00(GETNEXT)
+|
+08:EXCHANGE [HASH(store_sales.ss_sold_date_sk)]
+|  mem-estimate=468.77KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1,2 row-size=60B cardinality=3.04K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
+|  fk/pk conjuncts: store_sales.ss_item_sk = item.i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=60B cardinality=3.04K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: item.i_item_sk
+|  |  runtime filters: RF002[bloom] <- item.i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=44B cardinality=19
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: item.i_manufact_id = CAST(436 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: item.i_manufact_id = CAST(436 AS INT)
+|     parquet dictionary predicates: item.i_manufact_id = CAST(436 AS INT)
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=2 row-size=44B cardinality=19
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> store_sales.ss_sold_date_sk, RF002[bloom] -> store_sales.ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q04.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q04.test
new file mode 100644
index 0000000..9ba5cad
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q04.test
@@ -0,0 +1,2051 @@
+# TPCDS-Q04
+WITH year_total AS
+  (SELECT c_customer_id customer_id,
+          c_first_name customer_first_name,
+          c_last_name customer_last_name,
+          c_preferred_cust_flag customer_preferred_cust_flag,
+          c_birth_country customer_birth_country,
+          c_login customer_login,
+          c_email_address customer_email_address,
+          d_year dyear,
+          sum(((ss_ext_list_price-ss_ext_wholesale_cost-ss_ext_discount_amt)+ss_ext_sales_price)/2) year_total,
+          's' sale_type
+   FROM customer,
+        store_sales,
+        date_dim
+   WHERE c_customer_sk = ss_customer_sk
+     AND ss_sold_date_sk = d_date_sk
+   GROUP BY c_customer_id,
+            c_first_name,
+            c_last_name,
+            c_preferred_cust_flag,
+            c_birth_country,
+            c_login,
+            c_email_address,
+            d_year
+   UNION ALL SELECT c_customer_id customer_id,
+                    c_first_name customer_first_name,
+                    c_last_name customer_last_name,
+                    c_preferred_cust_flag customer_preferred_cust_flag,
+                    c_birth_country customer_birth_country,
+                    c_login customer_login,
+                    c_email_address customer_email_address,
+                    d_year dyear,
+                    sum((((cs_ext_list_price-cs_ext_wholesale_cost-cs_ext_discount_amt)+cs_ext_sales_price)/2)) year_total,
+                    'c' sale_type
+   FROM customer,
+        catalog_sales,
+        date_dim
+   WHERE c_customer_sk = cs_bill_customer_sk
+     AND cs_sold_date_sk = d_date_sk
+   GROUP BY c_customer_id,
+            c_first_name,
+            c_last_name,
+            c_preferred_cust_flag,
+            c_birth_country,
+            c_login,
+            c_email_address,
+            d_year
+   UNION ALL SELECT c_customer_id customer_id,
+                    c_first_name customer_first_name,
+                    c_last_name customer_last_name,
+                    c_preferred_cust_flag customer_preferred_cust_flag,
+                    c_birth_country customer_birth_country,
+                    c_login customer_login,
+                    c_email_address customer_email_address,
+                    d_year dyear,
+                    sum((((ws_ext_list_price-ws_ext_wholesale_cost-ws_ext_discount_amt)+ws_ext_sales_price)/2)) year_total,
+                    'w' sale_type
+   FROM customer,
+        web_sales,
+        date_dim
+   WHERE c_customer_sk = ws_bill_customer_sk
+     AND ws_sold_date_sk = d_date_sk
+   GROUP BY c_customer_id,
+            c_first_name,
+            c_last_name,
+            c_preferred_cust_flag,
+            c_birth_country,
+            c_login,
+            c_email_address,
+            d_year)
+SELECT t_s_secyear.customer_id,
+       t_s_secyear.customer_first_name,
+       t_s_secyear.customer_last_name,
+       t_s_secyear.customer_preferred_cust_flag
+FROM year_total t_s_firstyear,
+     year_total t_s_secyear,
+     year_total t_c_firstyear,
+     year_total t_c_secyear,
+     year_total t_w_firstyear,
+     year_total t_w_secyear
+WHERE t_s_secyear.customer_id = t_s_firstyear.customer_id
+  AND t_s_firstyear.customer_id = t_c_secyear.customer_id
+  AND t_s_firstyear.customer_id = t_c_firstyear.customer_id
+  AND t_s_firstyear.customer_id = t_w_firstyear.customer_id
+  AND t_s_firstyear.customer_id = t_w_secyear.customer_id
+  AND t_s_firstyear.sale_type = 's'
+  AND t_c_firstyear.sale_type = 'c'
+  AND t_w_firstyear.sale_type = 'w'
+  AND t_s_secyear.sale_type = 's'
+  AND t_c_secyear.sale_type = 'c'
+  AND t_w_secyear.sale_type = 'w'
+  AND t_s_firstyear.dyear = 2001
+  AND t_s_secyear.dyear = 2001+1
+  AND t_c_firstyear.dyear = 2001
+  AND t_c_secyear.dyear = 2001+1
+  AND t_w_firstyear.dyear = 2001
+  AND t_w_secyear.dyear = 2001+1
+  AND t_s_firstyear.year_total > 0
+  AND t_c_firstyear.year_total > 0
+  AND t_w_firstyear.year_total > 0
+  AND CASE
+          WHEN t_c_firstyear.year_total > 0 THEN t_c_secyear.year_total / t_c_firstyear.year_total
+          ELSE NULL
+      END > CASE
+                WHEN t_s_firstyear.year_total > 0 THEN t_s_secyear.year_total / t_s_firstyear.year_total
+                ELSE NULL
+            END
+  AND CASE
+          WHEN t_c_firstyear.year_total > 0 THEN t_c_secyear.year_total / t_c_firstyear.year_total
+          ELSE NULL
+      END > CASE
+                WHEN t_w_firstyear.year_total > 0 THEN t_w_secyear.year_total / t_w_firstyear.year_total
+                ELSE NULL
+            END
+ORDER BY t_s_secyear.customer_id,
+         t_s_secyear.customer_first_name,
+         t_s_secyear.customer_last_name,
+         t_s_secyear.customer_preferred_cust_flag
+LIMIT 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=237.31MB Threads=19
+Per-Host Resource Estimates: Memory=2.10GB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=2.10GB mem-reservation=237.31MB thread-reservation=19 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: customer_id, customer_first_name, customer_last_name, customer_preferred_cust_flag
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+47:TOP-N [LIMIT=100]
+|  order by: customer_id ASC, customer_first_name ASC, customer_last_name ASC, customer_preferred_cust_flag ASC
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=84 row-size=77B cardinality=0
+|  in pipelines: 47(GETNEXT), 06(OPEN)
+|
+46:HASH JOIN [INNER JOIN]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40,54,68,82 row-size=313B cardinality=0
+|  in pipelines: 06(GETNEXT), 41(OPEN)
+|
+|--35:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=82 row-size=44B cardinality=0
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  41:AGGREGATE [FINALIZE]
+|  |  output: sum((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=81 row-size=169B cardinality=0
+|  |  in pipelines: 41(GETNEXT), 36(OPEN)
+|  |
+|  40:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = ws_bill_customer_sk
+|  |  fk/pk conjuncts: c_customer_sk = ws_bill_customer_sk
+|  |  runtime filters: RF030[bloom] <- ws_bill_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=78,79,80 row-size=185B cardinality=148.00K
+|  |  in pipelines: 36(GETNEXT), 37(OPEN)
+|  |
+|  |--39:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF032[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=79,80 row-size=32B cardinality=148.00K
+|  |  |  in pipelines: 37(GETNEXT), 38(OPEN)
+|  |  |
+|  |  |--38:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=80 row-size=8B cardinality=373
+|  |  |     in pipelines: 38(GETNEXT)
+|  |  |
+|  |  37:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF032[bloom] -> ws_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=192.00MB mem-reservation=16.00MB thread-reservation=1
+|  |     tuple-ids=79 row-size=24B cardinality=719.38K
+|  |     in pipelines: 37(GETNEXT)
+|  |
+|  36:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF030[bloom] -> c_customer_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=78 row-size=153B cardinality=100.00K
+|     in pipelines: 36(GETNEXT)
+|
+45:HASH JOIN [INNER JOIN]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40,54,68 row-size=269B cardinality=0
+|  in pipelines: 06(GETNEXT), 34(OPEN)
+|
+|--28:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=68 row-size=44B cardinality=0
+|  |  in pipelines: 34(GETNEXT)
+|  |
+|  34:AGGREGATE [FINALIZE]
+|  |  output: sum((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  having: sum((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / 2)) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=67 row-size=169B cardinality=0
+|  |  in pipelines: 34(GETNEXT), 29(OPEN)
+|  |
+|  33:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = ws_bill_customer_sk
+|  |  fk/pk conjuncts: c_customer_sk = ws_bill_customer_sk
+|  |  runtime filters: RF026[bloom] <- ws_bill_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=64,65,66 row-size=185B cardinality=148.00K
+|  |  in pipelines: 29(GETNEXT), 30(OPEN)
+|  |
+|  |--32:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF028[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=65,66 row-size=32B cardinality=148.00K
+|  |  |  in pipelines: 30(GETNEXT), 31(OPEN)
+|  |  |
+|  |  |--31:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=66 row-size=8B cardinality=373
+|  |  |     in pipelines: 31(GETNEXT)
+|  |  |
+|  |  30:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF028[bloom] -> ws_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=192.00MB mem-reservation=16.00MB thread-reservation=1
+|  |     tuple-ids=65 row-size=24B cardinality=719.38K
+|  |     in pipelines: 30(GETNEXT)
+|  |
+|  29:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF026[bloom] -> c_customer_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=64 row-size=153B cardinality=100.00K
+|     in pipelines: 29(GETNEXT)
+|
+44:HASH JOIN [INNER JOIN]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40,54 row-size=225B cardinality=0
+|  in pipelines: 06(GETNEXT), 27(OPEN)
+|
+|--21:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54 row-size=44B cardinality=0
+|  |  in pipelines: 27(GETNEXT)
+|  |
+|  27:AGGREGATE [FINALIZE]
+|  |  output: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=49 row-size=169B cardinality=0
+|  |  in pipelines: 27(GETNEXT), 22(OPEN)
+|  |
+|  26:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = cs_bill_customer_sk
+|  |  fk/pk conjuncts: c_customer_sk = cs_bill_customer_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=46,47,48 row-size=185B cardinality=294.63K
+|  |  in pipelines: 22(GETNEXT), 23(OPEN)
+|  |
+|  |--25:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF024[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=47,48 row-size=32B cardinality=294.63K
+|  |  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |  |
+|  |  |--24:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=48 row-size=8B cardinality=373
+|  |  |     in pipelines: 24(GETNEXT)
+|  |  |
+|  |  23:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF024[bloom] -> cs_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=288.00MB mem-reservation=16.00MB thread-reservation=1
+|  |     tuple-ids=47 row-size=24B cardinality=1.44M
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  22:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=46 row-size=153B cardinality=100.00K
+|     in pipelines: 22(GETNEXT)
+|
+43:HASH JOIN [INNER JOIN]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40 row-size=181B cardinality=0
+|  in pipelines: 06(GETNEXT), 20(OPEN)
+|
+|--14:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=40 row-size=44B cardinality=0
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  20:AGGREGATE [FINALIZE]
+|  |  output: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  having: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / 2)) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=35 row-size=169B cardinality=0
+|  |  in pipelines: 20(GETNEXT), 15(OPEN)
+|  |
+|  19:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = cs_bill_customer_sk
+|  |  fk/pk conjuncts: c_customer_sk = cs_bill_customer_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=32,33,34 row-size=185B cardinality=294.63K
+|  |  in pipelines: 15(GETNEXT), 16(OPEN)
+|  |
+|  |--18:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=33,34 row-size=32B cardinality=294.63K
+|  |  |  in pipelines: 16(GETNEXT), 17(OPEN)
+|  |  |
+|  |  |--17:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=34 row-size=8B cardinality=373
+|  |  |     in pipelines: 17(GETNEXT)
+|  |  |
+|  |  16:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF020[bloom] -> cs_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=288.00MB mem-reservation=16.00MB thread-reservation=1
+|  |     tuple-ids=33 row-size=24B cardinality=1.44M
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  15:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=32 row-size=153B cardinality=100.00K
+|     in pipelines: 15(GETNEXT)
+|
+42:HASH JOIN [INNER JOIN]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26 row-size=137B cardinality=0
+|  in pipelines: 06(GETNEXT), 13(OPEN)
+|
+|--07:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=26 row-size=93B cardinality=0
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  13:AGGREGATE [FINALIZE]
+|  |  output: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / CAST(2 AS DECIMAL(3,0)))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17 row-size=169B cardinality=0
+|  |  in pipelines: 13(GETNEXT), 09(OPEN)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  runtime filters: RF014[bloom] <- c_customer_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=15,16,14 row-size=185B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT), 08(OPEN)
+|  |
+|  |--08:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=14 row-size=153B cardinality=100.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  11:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=15,16 row-size=32B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT), 10(OPEN)
+|  |
+|  |--10:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=16 row-size=8B cardinality=373
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF016[bloom] -> ss_sold_date_sk, RF014[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=15 row-size=24B cardinality=2.88M
+|     in pipelines: 09(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=44B cardinality=0
+|  in pipelines: 06(GETNEXT)
+|
+06:AGGREGATE [FINALIZE]
+|  output: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / CAST(2 AS DECIMAL(3,0)))
+|  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  having: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) > CAST(0 AS DECIMAL(3,0))
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 06(GETNEXT), 02(OPEN)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF010[bloom] <- c_customer_sk
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=185B cardinality=589.03K
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=0 row-size=153B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF012[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=32B cardinality=589.03K
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 03(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> ss_sold_date_sk, RF010[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=1 row-size=24B cardinality=2.88M
+   in pipelines: 02(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=232.94MB Threads=49
+Per-Host Resource Estimates: Memory=2.32GB
+F36:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=242.89KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: customer_id, customer_first_name, customer_last_name, customer_preferred_cust_flag
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+83:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: customer_id ASC, customer_first_name ASC, customer_last_name ASC, customer_preferred_cust_flag ASC
+|  limit: 100
+|  mem-estimate=242.89KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=84 row-size=77B cardinality=0
+|  in pipelines: 47(GETNEXT)
+|
+F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=20.95MB mem-reservation=11.62MB thread-reservation=1
+47:TOP-N [LIMIT=100]
+|  order by: customer_id ASC, customer_first_name ASC, customer_last_name ASC, customer_preferred_cust_flag ASC
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=84 row-size=77B cardinality=0
+|  in pipelines: 47(GETNEXT), 52(OPEN)
+|
+46:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40,54,68,82 row-size=313B cardinality=0
+|  in pipelines: 52(GETNEXT), 81(OPEN)
+|
+|--82:EXCHANGE [BROADCAST]
+|  |  mem-estimate=96.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=82 row-size=44B cardinality=0
+|  |  in pipelines: 81(GETNEXT)
+|  |
+|  F35:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservation=1
+|  35:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=82 row-size=44B cardinality=0
+|  |  in pipelines: 81(GETNEXT)
+|  |
+|  81:AGGREGATE [FINALIZE]
+|  |  output: sum:merge((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / 2))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=81 row-size=169B cardinality=0
+|  |  in pipelines: 81(GETNEXT), 37(OPEN)
+|  |
+|  80:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=346.23KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=81 row-size=169B cardinality=0
+|  |  in pipelines: 37(GETNEXT)
+|  |
+|  F33:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=30.99MB mem-reservation=10.50MB thread-reservation=1
+|  41:AGGREGATE [STREAMING]
+|  |  output: sum((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=81 row-size=169B cardinality=0
+|  |  in pipelines: 37(GETNEXT)
+|  |
+|  40:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=79,80,78 row-size=185B cardinality=148.00K
+|  |  in pipelines: 37(GETNEXT), 36(OPEN)
+|  |
+|  |--79:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=78 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 36(GETNEXT)
+|  |  |
+|  |  F32:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=2
+|  |  36:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=78 row-size=153B cardinality=100.00K
+|  |     in pipelines: 36(GETNEXT)
+|  |
+|  78:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=2.34MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=79,80 row-size=32B cardinality=148.00K
+|  |  in pipelines: 37(GETNEXT)
+|  |
+|  F30:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=194.95MB mem-reservation=18.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  39:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF032[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=79,80 row-size=32B cardinality=148.00K
+|  |  in pipelines: 37(GETNEXT), 38(OPEN)
+|  |
+|  |--77:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=80 row-size=8B cardinality=373
+|  |  |  in pipelines: 38(GETNEXT)
+|  |  |
+|  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  38:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=80 row-size=8B cardinality=373
+|  |     in pipelines: 38(GETNEXT)
+|  |
+|  37:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF032[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=192.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=79 row-size=24B cardinality=719.38K
+|     in pipelines: 37(GETNEXT)
+|
+45:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40,54,68 row-size=269B cardinality=0
+|  in pipelines: 52(GETNEXT), 75(OPEN)
+|
+|--76:EXCHANGE [BROADCAST]
+|  |  mem-estimate=96.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=68 row-size=44B cardinality=0
+|  |  in pipelines: 75(GETNEXT)
+|  |
+|  F29:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservation=1
+|  28:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=68 row-size=44B cardinality=0
+|  |  in pipelines: 75(GETNEXT)
+|  |
+|  75:AGGREGATE [FINALIZE]
+|  |  output: sum:merge((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / 2))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  having: sum((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / 2)) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=67 row-size=169B cardinality=0
+|  |  in pipelines: 75(GETNEXT), 30(OPEN)
+|  |
+|  74:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=346.23KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=67 row-size=169B cardinality=0
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F27:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=30.99MB mem-reservation=10.50MB thread-reservation=1
+|  34:AGGREGATE [STREAMING]
+|  |  output: sum((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=67 row-size=169B cardinality=0
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  33:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=65,66,64 row-size=185B cardinality=148.00K
+|  |  in pipelines: 30(GETNEXT), 29(OPEN)
+|  |
+|  |--73:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=64 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 29(GETNEXT)
+|  |  |
+|  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=2
+|  |  29:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=64 row-size=153B cardinality=100.00K
+|  |     in pipelines: 29(GETNEXT)
+|  |
+|  72:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=2.34MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=65,66 row-size=32B cardinality=148.00K
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=194.95MB mem-reservation=18.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  32:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF028[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=65,66 row-size=32B cardinality=148.00K
+|  |  in pipelines: 30(GETNEXT), 31(OPEN)
+|  |
+|  |--71:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=66 row-size=8B cardinality=373
+|  |  |  in pipelines: 31(GETNEXT)
+|  |  |
+|  |  F25:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  31:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=66 row-size=8B cardinality=373
+|  |     in pipelines: 31(GETNEXT)
+|  |
+|  30:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF028[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=192.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=65 row-size=24B cardinality=719.38K
+|     in pipelines: 30(GETNEXT)
+|
+44:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40,54 row-size=225B cardinality=0
+|  in pipelines: 52(GETNEXT), 69(OPEN)
+|
+|--70:EXCHANGE [BROADCAST]
+|  |  mem-estimate=144.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54 row-size=44B cardinality=0
+|  |  in pipelines: 69(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=10.51MB mem-reservation=1.94MB thread-reservation=1
+|  21:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54 row-size=44B cardinality=0
+|  |  in pipelines: 69(GETNEXT)
+|  |
+|  69:AGGREGATE [FINALIZE]
+|  |  output: sum:merge((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / 2))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=49 row-size=169B cardinality=0
+|  |  in pipelines: 69(GETNEXT), 23(OPEN)
+|  |
+|  68:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=519.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=49 row-size=169B cardinality=0
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F21:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=32.77MB mem-reservation=11.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  27:AGGREGATE [STREAMING]
+|  |  output: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=49 row-size=169B cardinality=0
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  |  runtime filters: RF022[bloom] <- c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=47,48,46 row-size=185B cardinality=294.63K
+|  |  in pipelines: 23(GETNEXT), 22(OPEN)
+|  |
+|  |--67:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=46 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 22(GETNEXT)
+|  |  |
+|  |  F20:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=2
+|  |  22:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=46 row-size=153B cardinality=100.00K
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  66:EXCHANGE [HASH(cs_bill_customer_sk)]
+|  |  mem-estimate=3.11MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=47,48 row-size=32B cardinality=294.63K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=291.95MB mem-reservation=19.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  25:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF024[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=47,48 row-size=32B cardinality=294.63K
+|  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |
+|  |--65:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=48 row-size=8B cardinality=373
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  24:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=48 row-size=8B cardinality=373
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF024[bloom] -> cs_sold_date_sk, RF022[bloom] -> cs_bill_customer_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=288.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=47 row-size=24B cardinality=1.44M
+|     in pipelines: 23(GETNEXT)
+|
+43:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40 row-size=181B cardinality=0
+|  in pipelines: 52(GETNEXT), 63(OPEN)
+|
+|--64:EXCHANGE [BROADCAST]
+|  |  mem-estimate=144.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=40 row-size=44B cardinality=0
+|  |  in pipelines: 63(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=10.51MB mem-reservation=1.94MB thread-reservation=1
+|  14:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=40 row-size=44B cardinality=0
+|  |  in pipelines: 63(GETNEXT)
+|  |
+|  63:AGGREGATE [FINALIZE]
+|  |  output: sum:merge((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / 2))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  having: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / 2)) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=35 row-size=169B cardinality=0
+|  |  in pipelines: 63(GETNEXT), 16(OPEN)
+|  |
+|  62:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=519.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=35 row-size=169B cardinality=0
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=32.77MB mem-reservation=11.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  20:AGGREGATE [STREAMING]
+|  |  output: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=35 row-size=169B cardinality=0
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  |  runtime filters: RF018[bloom] <- c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=33,34,32 row-size=185B cardinality=294.63K
+|  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |
+|  |--61:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=32 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=2
+|  |  15:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=32 row-size=153B cardinality=100.00K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  60:EXCHANGE [HASH(cs_bill_customer_sk)]
+|  |  mem-estimate=3.11MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=33,34 row-size=32B cardinality=294.63K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=291.95MB mem-reservation=19.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  18:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=33,34 row-size=32B cardinality=294.63K
+|  |  in pipelines: 16(GETNEXT), 17(OPEN)
+|  |
+|  |--59:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=34 row-size=8B cardinality=373
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  17:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=34 row-size=8B cardinality=373
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  16:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF020[bloom] -> cs_sold_date_sk, RF018[bloom] -> cs_bill_customer_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=288.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=33 row-size=24B cardinality=1.44M
+|     in pipelines: 16(GETNEXT)
+|
+42:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26 row-size=137B cardinality=0
+|  in pipelines: 52(GETNEXT), 57(OPEN)
+|
+|--58:EXCHANGE [BROADCAST]
+|  |  mem-estimate=290.89KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=26 row-size=93B cardinality=0
+|  |  in pipelines: 57(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=10.51MB mem-reservation=1.94MB thread-reservation=1
+|  07:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=26 row-size=93B cardinality=0
+|  |  in pipelines: 57(GETNEXT)
+|  |
+|  57:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17 row-size=169B cardinality=0
+|  |  in pipelines: 57(GETNEXT), 09(OPEN)
+|  |
+|  56:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=519.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=169B cardinality=0
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=35.76MB mem-reservation=11.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  13:AGGREGATE [STREAMING]
+|  |  output: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / CAST(2 AS DECIMAL(3,0)))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17 row-size=169B cardinality=0
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  runtime filters: RF014[bloom] <- c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=15,16,14 row-size=185B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT), 08(OPEN)
+|  |
+|  |--55:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=2
+|  |  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=14 row-size=153B cardinality=100.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  54:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=6.11MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15,16 row-size=32B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=83.95MB mem-reservation=7.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=15,16 row-size=32B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT), 10(OPEN)
+|  |
+|  |--53:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=16 row-size=8B cardinality=373
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  10:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=16 row-size=8B cardinality=373
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF016[bloom] -> ss_sold_date_sk, RF014[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=15 row-size=24B cardinality=2.88M
+|     in pipelines: 09(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=44B cardinality=0
+|  in pipelines: 52(GETNEXT)
+|
+52:AGGREGATE [FINALIZE]
+|  output: sum:merge(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2)
+|  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  having: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) > CAST(0 AS DECIMAL(3,0))
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 52(GETNEXT), 02(OPEN)
+|
+51:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  mem-estimate=519.35KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 02(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=35.76MB mem-reservation=11.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+06:AGGREGATE [STREAMING]
+|  output: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / CAST(2 AS DECIMAL(3,0)))
+|  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF010[bloom] <- c_customer_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=185B cardinality=589.03K
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--50:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=153B cardinality=100.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=0 row-size=153B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+49:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=6.11MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1,2 row-size=32B cardinality=589.03K
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=83.95MB mem-reservation=7.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF012[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=32B cardinality=589.03K
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--48:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 03(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> ss_sold_date_sk, RF010[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=1 row-size=24B cardinality=2.88M
+   in pipelines: 02(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=280.12MB Threads=56
+Per-Host Resource Estimates: Memory=818MB
+F36:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=485.79KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: customer_id, customer_first_name, customer_last_name, customer_preferred_cust_flag
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+83:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: customer_id ASC, customer_first_name ASC, customer_last_name ASC, customer_preferred_cust_flag ASC
+|  limit: 100
+|  mem-estimate=485.79KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=84 row-size=77B cardinality=0
+|  in pipelines: 47(GETNEXT)
+|
+F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.01MB mem-reservation=1.94MB thread-reservation=1
+47:TOP-N [LIMIT=100]
+|  order by: customer_id ASC, customer_first_name ASC, customer_last_name ASC, customer_preferred_cust_flag ASC
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=84 row-size=77B cardinality=0
+|  in pipelines: 47(GETNEXT), 52(OPEN)
+|
+46:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40,54,68,82 row-size=313B cardinality=0
+|  in pipelines: 52(GETNEXT), 81(OPEN)
+|
+|--F37:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.97MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: customer_id
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  82:EXCHANGE [BROADCAST]
+|  |  mem-estimate=96.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=82 row-size=44B cardinality=0
+|  |  in pipelines: 81(GETNEXT)
+|  |
+|  F35:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservation=1
+|  35:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=82 row-size=44B cardinality=0
+|  |  in pipelines: 81(GETNEXT)
+|  |
+|  81:AGGREGATE [FINALIZE]
+|  |  output: sum:merge((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / 2))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=81 row-size=169B cardinality=0
+|  |  in pipelines: 81(GETNEXT), 37(OPEN)
+|  |
+|  80:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=346.23KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=81 row-size=169B cardinality=0
+|  |  in pipelines: 37(GETNEXT)
+|  |
+|  F33:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=12.34MB mem-reservation=2.00MB thread-reservation=1
+|  41:AGGREGATE [STREAMING]
+|  |  output: sum((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=81 row-size=169B cardinality=0
+|  |  in pipelines: 37(GETNEXT)
+|  |
+|  40:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=79,80,78 row-size=185B cardinality=148.00K
+|  |  in pipelines: 37(GETNEXT), 36(OPEN)
+|  |
+|  |--F38:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=18.65MB mem-reservation=8.50MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: c_customer_sk
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |
+|  |  79:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=78 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 36(GETNEXT)
+|  |  |
+|  |  F32:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  36:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=78 row-size=153B cardinality=100.00K
+|  |     in pipelines: 36(GETNEXT)
+|  |
+|  78:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=2.34MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=79,80 row-size=32B cardinality=148.00K
+|  |  in pipelines: 37(GETNEXT)
+|  |
+|  F30:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=1
+|  39:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=79,80 row-size=32B cardinality=148.00K
+|  |  in pipelines: 37(GETNEXT), 38(OPEN)
+|  |
+|  |--F39:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF032[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  77:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=80 row-size=8B cardinality=373
+|  |  |  in pipelines: 38(GETNEXT)
+|  |  |
+|  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  38:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=80 row-size=8B cardinality=373
+|  |     in pipelines: 38(GETNEXT)
+|  |
+|  37:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF032[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=79 row-size=24B cardinality=719.38K
+|     in pipelines: 37(GETNEXT)
+|
+45:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40,54,68 row-size=269B cardinality=0
+|  in pipelines: 52(GETNEXT), 75(OPEN)
+|
+|--F40:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.97MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: customer_id
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  76:EXCHANGE [BROADCAST]
+|  |  mem-estimate=96.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=68 row-size=44B cardinality=0
+|  |  in pipelines: 75(GETNEXT)
+|  |
+|  F29:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservation=1
+|  28:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=68 row-size=44B cardinality=0
+|  |  in pipelines: 75(GETNEXT)
+|  |
+|  75:AGGREGATE [FINALIZE]
+|  |  output: sum:merge((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / 2))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  having: sum((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / 2)) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=67 row-size=169B cardinality=0
+|  |  in pipelines: 75(GETNEXT), 30(OPEN)
+|  |
+|  74:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=346.23KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=67 row-size=169B cardinality=0
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F27:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=12.34MB mem-reservation=2.00MB thread-reservation=1
+|  34:AGGREGATE [STREAMING]
+|  |  output: sum((((ws_ext_list_price - ws_ext_wholesale_cost - ws_ext_discount_amt) + ws_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=67 row-size=169B cardinality=0
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  33:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=04
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=65,66,64 row-size=185B cardinality=148.00K
+|  |  in pipelines: 30(GETNEXT), 29(OPEN)
+|  |
+|  |--F41:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=18.65MB mem-reservation=8.50MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=03
+|  |  |  build expressions: c_customer_sk
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |
+|  |  73:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=64 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 29(GETNEXT)
+|  |  |
+|  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  29:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=64 row-size=153B cardinality=100.00K
+|  |     in pipelines: 29(GETNEXT)
+|  |
+|  72:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=2.34MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=65,66 row-size=32B cardinality=148.00K
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=1
+|  32:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=65,66 row-size=32B cardinality=148.00K
+|  |  in pipelines: 30(GETNEXT), 31(OPEN)
+|  |
+|  |--F42:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF028[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  71:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=66 row-size=8B cardinality=373
+|  |  |  in pipelines: 31(GETNEXT)
+|  |  |
+|  |  F25:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  31:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=66 row-size=8B cardinality=373
+|  |     in pipelines: 31(GETNEXT)
+|  |
+|  30:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF028[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=65 row-size=24B cardinality=719.38K
+|     in pipelines: 30(GETNEXT)
+|
+44:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=06
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40,54 row-size=225B cardinality=0
+|  in pipelines: 52(GETNEXT), 69(OPEN)
+|
+|--F43:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.02MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: customer_id
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  70:EXCHANGE [BROADCAST]
+|  |  mem-estimate=144.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54 row-size=44B cardinality=0
+|  |  in pipelines: 69(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=10.51MB mem-reservation=1.94MB thread-reservation=1
+|  21:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54 row-size=44B cardinality=0
+|  |  in pipelines: 69(GETNEXT)
+|  |
+|  69:AGGREGATE [FINALIZE]
+|  |  output: sum:merge((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / 2))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=49 row-size=169B cardinality=0
+|  |  in pipelines: 69(GETNEXT), 23(OPEN)
+|  |
+|  68:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=519.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=49 row-size=169B cardinality=0
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F21:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=13.11MB mem-reservation=2.00MB thread-reservation=1
+|  27:AGGREGATE [STREAMING]
+|  |  output: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=49 row-size=169B cardinality=0
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=07
+|  |  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=47,48,46 row-size=185B cardinality=294.63K
+|  |  in pipelines: 23(GETNEXT), 22(OPEN)
+|  |
+|  |--F44:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=19.65MB mem-reservation=9.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=04
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF022[bloom] <- c_customer_sk
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |
+|  |  67:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=46 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 22(GETNEXT)
+|  |  |
+|  |  F20:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  22:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=46 row-size=153B cardinality=100.00K
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  66:EXCHANGE [HASH(cs_bill_customer_sk)]
+|  |  mem-estimate=3.11MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=47,48 row-size=32B cardinality=294.63K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=1
+|  25:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=08
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=47,48 row-size=32B cardinality=294.63K
+|  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |
+|  |--F45:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=08 plan-id=09 cohort-id=04
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF024[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  65:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=48 row-size=8B cardinality=373
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  24:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=48 row-size=8B cardinality=373
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF024[bloom] -> cs_sold_date_sk, RF022[bloom] -> cs_bill_customer_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=47 row-size=24B cardinality=1.44M
+|     in pipelines: 23(GETNEXT)
+|
+43:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=09
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26,40 row-size=181B cardinality=0
+|  in pipelines: 52(GETNEXT), 63(OPEN)
+|
+|--F46:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.02MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  build expressions: customer_id
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  64:EXCHANGE [BROADCAST]
+|  |  mem-estimate=144.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=40 row-size=44B cardinality=0
+|  |  in pipelines: 63(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=10.51MB mem-reservation=1.94MB thread-reservation=1
+|  14:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=40 row-size=44B cardinality=0
+|  |  in pipelines: 63(GETNEXT)
+|  |
+|  63:AGGREGATE [FINALIZE]
+|  |  output: sum:merge((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / 2))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  having: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / 2)) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=35 row-size=169B cardinality=0
+|  |  in pipelines: 63(GETNEXT), 16(OPEN)
+|  |
+|  62:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=519.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=35 row-size=169B cardinality=0
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=13.11MB mem-reservation=2.00MB thread-reservation=1
+|  20:AGGREGATE [STREAMING]
+|  |  output: sum((((cs_ext_list_price - cs_ext_wholesale_cost - cs_ext_discount_amt) + cs_ext_sales_price) / CAST(2 AS DECIMAL(3,0))))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=35 row-size=169B cardinality=0
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=10
+|  |  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=33,34,32 row-size=185B cardinality=294.63K
+|  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |
+|  |--F47:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=19.65MB mem-reservation=9.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=10 plan-id=11 cohort-id=05
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF018[bloom] <- c_customer_sk
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |
+|  |  61:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=32 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  15:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=32 row-size=153B cardinality=100.00K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  60:EXCHANGE [HASH(cs_bill_customer_sk)]
+|  |  mem-estimate=3.11MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=33,34 row-size=32B cardinality=294.63K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=1
+|  18:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=11
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=33,34 row-size=32B cardinality=294.63K
+|  |  in pipelines: 16(GETNEXT), 17(OPEN)
+|  |
+|  |--F48:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=11 plan-id=12 cohort-id=05
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  59:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=34 row-size=8B cardinality=373
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  17:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=34 row-size=8B cardinality=373
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  16:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF020[bloom] -> cs_sold_date_sk, RF018[bloom] -> cs_bill_customer_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=33 row-size=24B cardinality=1.44M
+|     in pipelines: 16(GETNEXT)
+|
+42:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=12
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12,26 row-size=137B cardinality=0
+|  in pipelines: 52(GETNEXT), 57(OPEN)
+|
+|--F49:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.44MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=12 plan-id=13 cohort-id=01
+|  |  build expressions: customer_id
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  58:EXCHANGE [BROADCAST]
+|  |  mem-estimate=581.79KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=26 row-size=93B cardinality=0
+|  |  in pipelines: 57(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=11.01MB mem-reservation=1.94MB thread-reservation=1
+|  07:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=26 row-size=93B cardinality=0
+|  |  in pipelines: 57(GETNEXT)
+|  |
+|  57:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17 row-size=169B cardinality=0
+|  |  in pipelines: 57(GETNEXT), 09(OPEN)
+|  |
+|  56:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=1.01MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=169B cardinality=0
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=16.23MB mem-reservation=2.00MB thread-reservation=1
+|  13:AGGREGATE [STREAMING]
+|  |  output: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / CAST(2 AS DECIMAL(3,0)))
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17 row-size=169B cardinality=0
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=13
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=15,16,14 row-size=185B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT), 08(OPEN)
+|  |
+|  |--F50:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=15.90MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=13 plan-id=14 cohort-id=06
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF014[bloom] <- c_customer_sk
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |
+|  |  55:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=14 row-size=153B cardinality=100.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  54:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=6.23MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15,16 row-size=32B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=14
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=15,16 row-size=32B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT), 10(OPEN)
+|  |
+|  |--F51:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=14 plan-id=15 cohort-id=06
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  53:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=16 row-size=8B cardinality=373
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  10:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=16 row-size=8B cardinality=373
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF016[bloom] -> ss_sold_date_sk, RF014[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=15 row-size=24B cardinality=2.88M
+|     in pipelines: 09(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=44B cardinality=0
+|  in pipelines: 52(GETNEXT)
+|
+52:AGGREGATE [FINALIZE]
+|  output: sum:merge(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2)
+|  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  having: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / 2) > CAST(0 AS DECIMAL(3,0))
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 52(GETNEXT), 02(OPEN)
+|
+51:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  mem-estimate=1.01MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 02(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=16.23MB mem-reservation=2.00MB thread-reservation=1
+06:AGGREGATE [STREAMING]
+|  output: sum(((ss_ext_list_price - ss_ext_wholesale_cost - ss_ext_discount_amt) + ss_ext_sales_price) / CAST(2 AS DECIMAL(3,0)))
+|  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=15
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=185B cardinality=589.03K
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--F52:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=15.90MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=15 plan-id=16 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF010[bloom] <- c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  50:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=153B cardinality=100.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=0 row-size=153B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+49:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=6.23MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1,2 row-size=32B cardinality=589.03K
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=16
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=32B cardinality=589.03K
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--F53:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=16 plan-id=17 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  48:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 03(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> ss_sold_date_sk, RF010[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=1 row-size=24B cardinality=2.88M
+   in pipelines: 02(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q05.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q05.test
new file mode 100644
index 0000000..2158dfc
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q05.test
@@ -0,0 +1,813 @@
+# TPCDS-Q5
+with ssr as
+ (select s_store_id,
+        sum(sales_price) as sales,
+        sum(profit) as profit,
+        sum(return_amt) as `returns`,
+        sum(net_loss) as profit_loss
+ from
+  ( select  ss_store_sk as store_sk,
+            ss_sold_date_sk  as date_sk,
+            ss_ext_sales_price as sales_price,
+            ss_net_profit as profit,
+            cast(0 as decimal(7,2)) as return_amt,
+            cast(0 as decimal(7,2)) as net_loss
+    from store_sales
+    union all
+    select sr_store_sk as store_sk,
+           sr_returned_date_sk as date_sk,
+           cast(0 as decimal(7,2)) as sales_price,
+           cast(0 as decimal(7,2)) as profit,
+           sr_return_amt as return_amt,
+           sr_net_loss as net_loss
+    from store_returns
+   ) salesreturns,
+     date_dim,
+     store
+ where date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  INTERVAL 14 days)
+       and store_sk = s_store_sk
+ group by s_store_id)
+ ,
+ csr as
+ (select cp_catalog_page_id,
+        sum(sales_price) as sales,
+        sum(profit) as profit,
+        sum(return_amt) as `returns`,
+        sum(net_loss) as profit_loss
+ from
+  ( select  cs_catalog_page_sk as page_sk,
+            cs_sold_date_sk  as date_sk,
+            cs_ext_sales_price as sales_price,
+            cs_net_profit as profit,
+            cast(0 as decimal(7,2)) as return_amt,
+            cast(0 as decimal(7,2)) as net_loss
+    from catalog_sales
+    union all
+    select cr_catalog_page_sk as page_sk,
+           cr_returned_date_sk as date_sk,
+           cast(0 as decimal(7,2)) as sales_price,
+           cast(0 as decimal(7,2)) as profit,
+           cr_return_amount as return_amt,
+           cr_net_loss as net_loss
+    from catalog_returns
+   ) salesreturns,
+     date_dim,
+     catalog_page
+ where date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  INTERVAL 14 days)
+       and page_sk = cp_catalog_page_sk
+ group by cp_catalog_page_id)
+ ,
+ wsr as
+ (select web_site_id,
+        sum(sales_price) as sales,
+        sum(profit) as profit,
+        sum(return_amt) as `returns`,
+        sum(net_loss) as profit_loss
+ from
+  ( select  ws_web_site_sk as wsr_web_site_sk,
+            ws_sold_date_sk  as date_sk,
+            ws_ext_sales_price as sales_price,
+            ws_net_profit as profit,
+            cast(0 as decimal(7,2)) as return_amt,
+            cast(0 as decimal(7,2)) as net_loss
+    from web_sales
+    union all
+    select ws_web_site_sk as wsr_web_site_sk,
+           wr_returned_date_sk as date_sk,
+           cast(0 as decimal(7,2)) as sales_price,
+           cast(0 as decimal(7,2)) as profit,
+           wr_return_amt as return_amt,
+           wr_net_loss as net_loss
+    from web_returns left outer join web_sales on
+         ( wr_item_sk = ws_item_sk
+           and wr_order_number = ws_order_number)
+   ) salesreturns,
+     date_dim,
+     web_site
+ where date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  INTERVAL 14 days)
+       and wsr_web_site_sk = web_site_sk
+ group by web_site_id)
+  select  channel
+        , id
+        , sum(sales) as sales
+        , sum(`returns`) as `returns`
+        , sum(profit) as profit
+ from
+ (select 'store channel' as channel
+        , 'store' || s_store_id as id
+        , sales
+        , `returns`
+        , (profit - profit_loss) as profit
+ from   ssr
+ union all
+ select 'catalog channel' as channel
+        , 'catalog_page' || cp_catalog_page_id as id
+        , sales
+        , `returns`
+        , (profit - profit_loss) as profit
+ from  csr
+ union all
+ select 'web channel' as channel
+        , 'web_site' || web_site_id as id
+        , sales
+        , `returns`
+        , (profit - profit_loss) as profit
+ from   wsr
+ ) x
+ group by rollup (channel, id)
+ order by channel
+         ,id
+ limit 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=31.38MB Threads=5
+Per-Host Resource Estimates: Memory=298MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=297.88MB mem-reservation=31.38MB thread-reservation=5 runtime-filters-memory=8.00MB
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(27,28,29) WHEN 27 THEN channel WHEN 28 THEN channel WHEN 29 THEN NULL END, CASE valid_tid(27,28,29) WHEN 27 THEN id WHEN 28 THEN NULL WHEN 29 THEN NULL END, aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(sales) WHEN 28 THEN sum(sales) WHEN 29 THEN sum(sales) END), aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(`returns`) WHEN 28 THEN sum(`returns`) WHEN 29 THEN sum(`returns`) END), aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(profit) WHEN 28 THEN sum(profit) WHEN 29 THEN sum(profit) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+29:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(27,28,29) WHEN 27 THEN channel WHEN 28 THEN channel WHEN 29 THEN NULL END ASC, CASE valid_tid(27,28,29) WHEN 27 THEN id WHEN 28 THEN NULL WHEN 29 THEN NULL END ASC
+|  mem-estimate=7.03KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=31 row-size=72B cardinality=100
+|  in pipelines: 29(GETNEXT), 28(OPEN)
+|
+28:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(27,28,29) IN (CAST(27 AS INT), CAST(28 AS INT), CAST(29 AS INT)), CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN sum(sales) WHEN CAST(28 AS INT) THEN sum(sales) WHEN CAST(29 AS INT) THEN sum(sales) END), aggif(valid_tid(27,28,29) IN (CAST(27 AS INT), CAST(28 AS INT), CAST(29 AS INT)), CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN sum(`returns`) WHEN CAST(28 AS INT) THEN sum(`returns`) WHEN CAST(29 AS INT) THEN sum(`returns`) END), aggif(valid_tid(27,28,29) IN (CAST(27 AS INT), CAST(28 AS INT), CAST(29 AS INT)), CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN sum(profit) WHEN CAST(28 AS INT) THEN sum(profit) WHEN CAST(29 AS INT) THEN sum(profit) END)
+|  group by: CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN channel WHEN CAST(28 AS INT) THEN channel WHEN CAST(29 AS INT) THEN NULL END, CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN id WHEN CAST(28 AS INT) THEN NULL WHEN CAST(29 AS INT) THEN NULL END, CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN CAST(27 AS INT) WHEN CAST(28 AS INT) THEN CAST(28 AS INT) WHEN CAST(29 AS INT) THEN CAST(29 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=30 row-size=76B cardinality=11.56K
+|  in pipelines: 28(GETNEXT), 27(OPEN)
+|
+27:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, id
+|  Class 1
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, NULL
+|  Class 2
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=8.62MB thread-reservation=0
+|  tuple-ids=27N,28N,29N row-size=216B cardinality=11.56K
+|  in pipelines: 27(GETNEXT), 08(OPEN), 16(OPEN), 26(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=72B cardinality=11.56K
+|  in pipelines: 08(GETNEXT), 16(GETNEXT), 26(GETNEXT)
+|
+|--26:AGGREGATE [FINALIZE]
+|  |  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
+|  |  group by: web_site_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23 row-size=92B cardinality=15
+|  |  in pipelines: 26(GETNEXT), 18(OPEN), 20(OPEN)
+|  |
+|  25:HASH JOIN [INNER JOIN]
+|  |  hash predicates: wsr_web_site_sk = web_site_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF008[bloom] <- web_site_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19,21,22 row-size=82B cardinality=791.15K
+|  |  in pipelines: 18(GETNEXT), 20(GETNEXT), 23(OPEN)
+|  |
+|  |--23:SCAN HDFS [tpcds_parquet.web_site]
+|  |     HDFS partitions=1/1 files=1 size=11.91KB
+|  |     stored statistics:
+|  |       table: rows=30 size=11.91KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=30
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=22 row-size=32B cardinality=30
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  24:HASH JOIN [INNER JOIN]
+|  |  hash predicates: date_sk = d_date_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19,21 row-size=50B cardinality=791.15K
+|  |  in pipelines: 18(GETNEXT), 20(GETNEXT), 22(OPEN)
+|  |
+|  |--22:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=21 row-size=26B cardinality=7.30K
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  17:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=24B cardinality=791.15K
+|  |  in pipelines: 18(GETNEXT), 20(GETNEXT)
+|  |
+|  |--21:HASH JOIN [RIGHT OUTER JOIN]
+|  |  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  runtime filters: RF012[bloom] <- wr_item_sk, RF013[bloom] <- wr_order_number
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=18N,17 row-size=48B cardinality=71.76K
+|  |  |  in pipelines: 20(GETNEXT), 19(OPEN)
+|  |  |
+|  |  |--19:SCAN HDFS [tpcds_parquet.web_returns]
+|  |  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |  |     runtime filters: RF010[bloom] -> tpcds_parquet.web_returns.wr_returned_date_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=71.76K size=5.66MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |  |     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=17 row-size=28B cardinality=71.76K
+|  |  |     in pipelines: 19(GETNEXT)
+|  |  |
+|  |  20:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF008[bloom] -> tpcds_parquet.web_sales.ws_web_site_sk, RF012[bloom] -> ws_item_sk, RF013[bloom] -> ws_order_number
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=18 row-size=20B cardinality=719.38K
+|  |     in pipelines: 20(GETNEXT)
+|  |
+|  18:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF008[bloom] -> tpcds_parquet.web_sales.ws_web_site_sk, RF010[bloom] -> tpcds_parquet.web_sales.ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=16 row-size=16B cardinality=719.38K
+|     in pipelines: 18(GETNEXT)
+|
+|--16:AGGREGATE [FINALIZE]
+|  |  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
+|  |  group by: cp_catalog_page_id
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=92B cardinality=11.54K
+|  |  in pipelines: 16(GETNEXT), 10(OPEN), 11(OPEN)
+|  |
+|  15:HASH JOIN [INNER JOIN]
+|  |  hash predicates: page_sk = cp_catalog_page_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF004[bloom] <- cp_catalog_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,12,13 row-size=82B cardinality=1.59M
+|  |  in pipelines: 10(GETNEXT), 11(GETNEXT), 13(OPEN)
+|  |
+|  |--13:SCAN HDFS [tpcds_parquet.catalog_page]
+|  |     HDFS partitions=1/1 files=1 size=739.17KB
+|  |     stored statistics:
+|  |       table: rows=11.72K size=739.17KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=11.72K
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=32B cardinality=11.72K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  14:HASH JOIN [INNER JOIN]
+|  |  hash predicates: date_sk = d_date_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,12 row-size=50B cardinality=1.59M
+|  |  in pipelines: 10(GETNEXT), 11(GETNEXT), 12(OPEN)
+|  |
+|  |--12:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=26B cardinality=7.30K
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  09:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=24B cardinality=1.59M
+|  |  in pipelines: 10(GETNEXT), 11(GETNEXT)
+|  |
+|  |--11:SCAN HDFS [tpcds_parquet.catalog_returns]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     runtime filters: RF004[bloom] -> tpcds_parquet.catalog_returns.cr_catalog_page_sk, RF006[bloom] -> tpcds_parquet.catalog_returns.cr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=9 row-size=16B cardinality=144.07K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> tpcds_parquet.catalog_sales.cs_catalog_page_sk, RF006[bloom] -> tpcds_parquet.catalog_sales.cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=8 row-size=16B cardinality=1.44M
+|     in pipelines: 10(GETNEXT)
+|
+08:AGGREGATE [FINALIZE]
+|  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
+|  group by: s_store_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=92B cardinality=6
+|  in pipelines: 08(GETNEXT), 02(OPEN), 03(OPEN)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sk = s_store_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,4,5 row-size=82B cardinality=3.17M
+|  in pipelines: 02(GETNEXT), 03(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=5 row-size=32B cardinality=12
+|     in pipelines: 05(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: date_sk = d_date_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,4 row-size=50B cardinality=3.17M
+|  in pipelines: 02(GETNEXT), 03(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=26B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+01:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2 row-size=24B cardinality=3.17M
+|  in pipelines: 02(GETNEXT), 03(GETNEXT)
+|
+|--03:SCAN HDFS [tpcds_parquet.store_returns]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store_returns.sr_store_sk, RF002[bloom] -> tpcds_parquet.store_returns.sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=16B cardinality=287.51K
+|     in pipelines: 03(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF002[bloom] -> tpcds_parquet.store_sales.ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 02(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=77.53MB Threads=25
+Per-Host Resource Estimates: Memory=919MB
+F22:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=24.61KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(27,28,29) WHEN 27 THEN channel WHEN 28 THEN channel WHEN 29 THEN NULL END, CASE valid_tid(27,28,29) WHEN 27 THEN id WHEN 28 THEN NULL WHEN 29 THEN NULL END, aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(sales) WHEN 28 THEN sum(sales) WHEN 29 THEN sum(sales) END), aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(`returns`) WHEN 28 THEN sum(`returns`) WHEN 29 THEN sum(`returns`) END), aggif(valid_tid(27,28,29) IN (27, 28, 29), CASE valid_tid(27,28,29) WHEN 27 THEN sum(profit) WHEN 28 THEN sum(profit) WHEN 29 THEN sum(profit) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+46:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: CASE valid_tid(27,28,29) WHEN 27 THEN channel WHEN 28 THEN channel WHEN 29 THEN NULL END ASC, CASE valid_tid(27,28,29) WHEN 27 THEN id WHEN 28 THEN NULL WHEN 29 THEN NULL END ASC
+|  limit: 100
+|  mem-estimate=24.61KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=31 row-size=72B cardinality=100
+|  in pipelines: 29(GETNEXT)
+|
+F21:PLAN FRAGMENT [HASH(CASE valid_tid(27,28,29) WHEN 27 THEN murmur_hash(channel) WHEN 28 THEN murmur_hash(channel) WHEN 29 THEN murmur_hash(NULL) END,CASE valid_tid(27,28,29) WHEN 27 THEN murmur_hash(id) WHEN 28 THEN murmur_hash(NULL) WHEN 29 THEN murmur_hash(NULL) END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=40.00MB mem-reservation=8.69MB thread-reservation=1
+29:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(27,28,29) WHEN 27 THEN channel WHEN 28 THEN channel WHEN 29 THEN NULL END ASC, CASE valid_tid(27,28,29) WHEN 27 THEN id WHEN 28 THEN NULL WHEN 29 THEN NULL END ASC
+|  mem-estimate=7.03KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=31 row-size=72B cardinality=100
+|  in pipelines: 29(GETNEXT), 28(OPEN)
+|
+28:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(27,28,29) IN (CAST(27 AS INT), CAST(28 AS INT), CAST(29 AS INT)), CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN sum(sales) WHEN CAST(28 AS INT) THEN sum(sales) WHEN CAST(29 AS INT) THEN sum(sales) END), aggif(valid_tid(27,28,29) IN (CAST(27 AS INT), CAST(28 AS INT), CAST(29 AS INT)), CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN sum(`returns`) WHEN CAST(28 AS INT) THEN sum(`returns`) WHEN CAST(29 AS INT) THEN sum(`returns`) END), aggif(valid_tid(27,28,29) IN (CAST(27 AS INT), CAST(28 AS INT), CAST(29 AS INT)), CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN sum(profit) WHEN CAST(28 AS INT) THEN sum(profit) WHEN CAST(29 AS INT) THEN sum(profit) END)
+|  group by: CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN channel WHEN CAST(28 AS INT) THEN channel WHEN CAST(29 AS INT) THEN NULL END, CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN id WHEN CAST(28 AS INT) THEN NULL WHEN CAST(29 AS INT) THEN NULL END, CASE valid_tid(27,28,29) WHEN CAST(27 AS INT) THEN CAST(27 AS INT) WHEN CAST(28 AS INT) THEN CAST(28 AS INT) WHEN CAST(29 AS INT) THEN CAST(29 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=30 row-size=76B cardinality=11.56K
+|  in pipelines: 28(GETNEXT), 45(OPEN)
+|
+45:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
+|    group by: channel, id
+|  Class 1
+|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
+|    group by: channel, NULL
+|  Class 2
+|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=6.75MB thread-reservation=0
+|  tuple-ids=27N,28N,29N row-size=216B cardinality=11.56K
+|  in pipelines: 45(GETNEXT), 33(OPEN), 37(OPEN), 43(OPEN)
+|
+44:EXCHANGE [HASH(CASE valid_tid(27,28,29) WHEN 27 THEN murmur_hash(channel) WHEN 28 THEN murmur_hash(channel) WHEN 29 THEN murmur_hash(NULL) END,CASE valid_tid(27,28,29) WHEN 27 THEN murmur_hash(id) WHEN 28 THEN murmur_hash(NULL) WHEN 29 THEN murmur_hash(NULL) END)]
+|  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27N,28N,29N row-size=216B cardinality=11.56K
+|  in pipelines: 33(GETNEXT), 37(GETNEXT), 43(GETNEXT)
+|
+F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=40.62MB mem-reservation=8.94MB thread-reservation=1
+27:AGGREGATE [STREAMING]
+|  Class 0
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, id
+|  Class 1
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, NULL
+|  Class 2
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=7.00MB thread-reservation=0
+|  tuple-ids=27N,28N,29N row-size=216B cardinality=11.56K
+|  in pipelines: 33(GETNEXT), 37(GETNEXT), 43(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=72B cardinality=11.56K
+|  in pipelines: 33(GETNEXT), 37(GETNEXT), 43(GETNEXT)
+|
+|--43:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(sales_price), sum:merge(profit), sum:merge(return_amt), sum:merge(net_loss)
+|  |  group by: web_site_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23 row-size=92B cardinality=15
+|  |  in pipelines: 43(GETNEXT), 18(OPEN), 20(OPEN)
+|  |
+|  42:EXCHANGE [HASH(web_site_id)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23 row-size=92B cardinality=15
+|  |  in pipelines: 18(GETNEXT), 20(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=146.10MB mem-reservation=17.88MB thread-reservation=2 runtime-filters-memory=4.00MB
+|  26:AGGREGATE [STREAMING]
+|  |  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
+|  |  group by: web_site_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23 row-size=92B cardinality=15
+|  |  in pipelines: 18(GETNEXT), 20(GETNEXT)
+|  |
+|  25:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: wsr_web_site_sk = web_site_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF008[bloom] <- web_site_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19,21,22 row-size=82B cardinality=791.15K
+|  |  in pipelines: 18(GETNEXT), 20(GETNEXT), 23(OPEN)
+|  |
+|  |--41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=22 row-size=32B cardinality=30
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  23:SCAN HDFS [tpcds_parquet.web_site, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=11.91KB
+|  |     stored statistics:
+|  |       table: rows=30 size=11.91KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=30
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=22 row-size=32B cardinality=30
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  24:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: date_sk = d_date_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19,21 row-size=50B cardinality=791.15K
+|  |  in pipelines: 18(GETNEXT), 20(GETNEXT), 22(OPEN)
+|  |
+|  |--40:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 22(GETNEXT)
+|  |  |
+|  |  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  22:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=21 row-size=26B cardinality=7.30K
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  17:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=24B cardinality=791.15K
+|  |  in pipelines: 18(GETNEXT), 20(GETNEXT)
+|  |
+|  |--21:HASH JOIN [RIGHT OUTER JOIN, PARTITIONED]
+|  |  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  runtime filters: RF012[bloom] <- wr_item_sk, RF013[bloom] <- wr_order_number
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=18N,17 row-size=48B cardinality=71.76K
+|  |  |  in pipelines: 20(GETNEXT), 19(OPEN)
+|  |  |
+|  |  |--39:EXCHANGE [HASH(wr_item_sk,wr_order_number)]
+|  |  |  |  mem-estimate=1.95MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=17 row-size=28B cardinality=71.76K
+|  |  |  |  in pipelines: 19(GETNEXT)
+|  |  |  |
+|  |  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=81.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  |  19:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |  |     runtime filters: RF010[bloom] -> tpcds_parquet.web_returns.wr_returned_date_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=71.76K size=5.66MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |  |     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=17 row-size=28B cardinality=71.76K
+|  |  |     in pipelines: 19(GETNEXT)
+|  |  |
+|  |  38:EXCHANGE [HASH(ws_item_sk,ws_order_number)]
+|  |  |  mem-estimate=6.91MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=20B cardinality=719.38K
+|  |  |  in pipelines: 20(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=99.00MB mem-reservation=7.00MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  |  20:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF008[bloom] -> tpcds_parquet.web_sales.ws_web_site_sk, RF012[bloom] -> ws_item_sk, RF013[bloom] -> ws_order_number
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=18 row-size=20B cardinality=719.38K
+|  |     in pipelines: 20(GETNEXT)
+|  |
+|  18:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF008[bloom] -> tpcds_parquet.web_sales.ws_web_site_sk, RF010[bloom] -> tpcds_parquet.web_sales.ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=16 row-size=16B cardinality=719.38K
+|     in pipelines: 18(GETNEXT)
+|
+|--37:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(sales_price), sum:merge(profit), sum:merge(return_amt), sum:merge(net_loss)
+|  |  group by: cp_catalog_page_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=92B cardinality=11.54K
+|  |  in pipelines: 37(GETNEXT), 10(OPEN), 11(OPEN)
+|  |
+|  36:EXCHANGE [HASH(cp_catalog_page_id)]
+|  |  mem-estimate=633.57KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=92B cardinality=11.54K
+|  |  in pipelines: 10(GETNEXT), 11(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=208.48MB mem-reservation=16.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  16:AGGREGATE [STREAMING]
+|  |  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
+|  |  group by: cp_catalog_page_id
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=92B cardinality=11.54K
+|  |  in pipelines: 10(GETNEXT), 11(GETNEXT)
+|  |
+|  15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: page_sk = cp_catalog_page_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF004[bloom] <- cp_catalog_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,12,13 row-size=82B cardinality=1.59M
+|  |  in pipelines: 10(GETNEXT), 11(GETNEXT), 13(OPEN)
+|  |
+|  |--35:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=402.19KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=32B cardinality=11.72K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  13:SCAN HDFS [tpcds_parquet.catalog_page, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=739.17KB
+|  |     stored statistics:
+|  |       table: rows=11.72K size=739.17KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=11.72K
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=32B cardinality=11.72K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: date_sk = d_date_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,12 row-size=50B cardinality=1.59M
+|  |  in pipelines: 10(GETNEXT), 11(GETNEXT), 12(OPEN)
+|  |
+|  |--34:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 12(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  12:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=26B cardinality=7.30K
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  09:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=24B cardinality=1.59M
+|  |  in pipelines: 10(GETNEXT), 11(GETNEXT)
+|  |
+|  |--11:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     runtime filters: RF004[bloom] -> tpcds_parquet.catalog_returns.cr_catalog_page_sk, RF006[bloom] -> tpcds_parquet.catalog_returns.cr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=9 row-size=16B cardinality=144.07K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> tpcds_parquet.catalog_sales.cs_catalog_page_sk, RF006[bloom] -> tpcds_parquet.catalog_sales.cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=8 row-size=16B cardinality=1.44M
+|     in pipelines: 10(GETNEXT)
+|
+33:AGGREGATE [FINALIZE]
+|  output: sum:merge(sales_price), sum:merge(profit), sum:merge(return_amt), sum:merge(net_loss)
+|  group by: s_store_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=92B cardinality=6
+|  in pipelines: 33(GETNEXT), 02(OPEN), 03(OPEN)
+|
+32:EXCHANGE [HASH(s_store_id)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=92B cardinality=6
+|  in pipelines: 02(GETNEXT), 03(GETNEXT)
+|
+F02:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=112.10MB mem-reservation=11.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+08:AGGREGATE [STREAMING]
+|  output: sum(sales_price), sum(profit), sum(return_amt), sum(net_loss)
+|  group by: s_store_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=92B cardinality=6
+|  in pipelines: 02(GETNEXT), 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sk = s_store_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,4,5 row-size=82B cardinality=3.17M
+|  in pipelines: 02(GETNEXT), 03(GETNEXT), 05(OPEN)
+|
+|--31:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=32B cardinality=12
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=5 row-size=32B cardinality=12
+|     in pipelines: 05(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: date_sk = d_date_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,4 row-size=50B cardinality=3.17M
+|  in pipelines: 02(GETNEXT), 03(GETNEXT), 04(OPEN)
+|
+|--30:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=26B cardinality=7.30K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-08-18', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=26B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+01:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2 row-size=24B cardinality=3.17M
+|  in pipelines: 02(GETNEXT), 03(GETNEXT)
+|
+|--03:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store_returns.sr_store_sk, RF002[bloom] -> tpcds_parquet.store_returns.sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=16B cardinality=287.51K
+|     in pipelines: 03(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF002[bloom] -> tpcds_parquet.store_sales.ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 02(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q06.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q06.test
new file mode 100644
index 0000000..e0a0d1f
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q06.test
@@ -0,0 +1,762 @@
+# TPCDS-Q6
+select * from (
+ select  a.ca_state state, count(*) cnt
+ from customer_address a
+     ,customer c
+     ,store_sales s
+     ,date_dim d
+     ,item i
+ where
+        a.ca_address_sk = c.c_current_addr_sk
+        and c.c_customer_sk = s.ss_customer_sk
+        and s.ss_sold_date_sk = d.d_date_sk
+        and s.ss_item_sk = i.i_item_sk
+        and d.d_month_seq =
+             (select distinct (d_month_seq)
+              from date_dim
+               where d_year = 1999
+                and d_moy = 1
+               limit 1)
+        and i.i_current_price > 1.2 *
+             (select avg(j.i_current_price)
+             from item j
+             where j.i_category = i.i_category)
+ group by a.ca_state
+ having count(*) >= 10
+ order by cnt limit 100) as t
+---- PLAN
+Max Per-Host Resource Reservation: Memory=24.50MB Threads=8
+Per-Host Resource Estimates: Memory=290MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=289.75MB mem-reservation=24.50MB thread-reservation=8 runtime-filters-memory=6.00MB
+PLAN-ROOT SINK
+|  output exprs: a.ca_state, count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+16:TOP-N [LIMIT=100]
+|  order by: count(*) ASC
+|  mem-estimate=110B mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=22B cardinality=5
+|  in pipelines: 16(GETNEXT), 15(OPEN)
+|
+15:AGGREGATE [FINALIZE]
+|  output: count(*)
+|  group by: a.ca_state
+|  having: count(*) >= CAST(10 AS BIGINT)
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=22B cardinality=5
+|  in pipelines: 15(GETNEXT), 02(OPEN)
+|
+14:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: i.i_category = j.i_category
+|  other join predicates: i.i_current_price > CAST(1.2 AS DECIMAL(2,1)) * avg(j.i_current_price)
+|  runtime filters: RF000[bloom] <- j.i_category
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3,4 row-size=80B cardinality=1.19K
+|  in pipelines: 02(GETNEXT), 08(OPEN)
+|
+|--08:AGGREGATE [FINALIZE]
+|  |  output: avg(j.i_current_price)
+|  |  group by: j.i_category
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=26B cardinality=10
+|  |  in pipelines: 08(GETNEXT), 07(OPEN)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.item j]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=8 row-size=22B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+13:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: d.d_month_seq = (d_month_seq)
+|  runtime filters: RF002[bloom] <- (d_month_seq)
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3,4 row-size=80B cardinality=1.19K
+|  in pipelines: 02(GETNEXT), 06(OPEN)
+|
+|--06:AGGREGATE [FINALIZE]
+|  |  group by: (d_month_seq)
+|  |  limit: 1
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=4B cardinality=1
+|  |  in pipelines: 06(GETNEXT), 05(OPEN)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(1 AS INT)
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=5 row-size=12B cardinality=108
+|     in pipelines: 05(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: s.ss_item_sk = i.i_item_sk
+|  fk/pk conjuncts: s.ss_item_sk = i.i_item_sk
+|  runtime filters: RF004[bloom] <- i.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3,4 row-size=80B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.item i]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> i.i_category
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=4 row-size=30B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: s.ss_sold_date_sk = d.d_date_sk
+|  fk/pk conjuncts: s.ss_sold_date_sk = d.d_date_sk
+|  runtime filters: RF006[bloom] <- d.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3 row-size=50B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim d]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF002[bloom] -> d.d_month_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: c.c_current_addr_sk = a.ca_address_sk
+|  fk/pk conjuncts: c.c_current_addr_sk = a.ca_address_sk
+|  runtime filters: RF008[bloom] <- a.ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0 row-size=42B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.customer_address a]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=0 row-size=18B cardinality=50.00K
+|     in pipelines: 00(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: s.ss_customer_sk = c.c_customer_sk
+|  fk/pk conjuncts: s.ss_customer_sk = c.c_customer_sk
+|  runtime filters: RF010[bloom] <- c.c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1 row-size=24B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.customer c]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF008[bloom] -> c.c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.store_sales s]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> s.ss_item_sk, RF006[bloom] -> s.ss_sold_date_sk, RF010[bloom] -> s.ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=2 row-size=16B cardinality=2.88M
+   in pipelines: 02(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=35.81MB Threads=19
+Per-Host Resource Estimates: Memory=340MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: a.ca_state, count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+30:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: count(*) ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=22B cardinality=5
+|  in pipelines: 16(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(a.ca_state)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: count(*) ASC
+|  mem-estimate=110B mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=22B cardinality=5
+|  in pipelines: 16(GETNEXT), 29(OPEN)
+|
+29:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: a.ca_state
+|  having: count(*) >= CAST(10 AS BIGINT)
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=22B cardinality=5
+|  in pipelines: 29(GETNEXT), 02(OPEN)
+|
+28:EXCHANGE [HASH(a.ca_state)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=22B cardinality=51
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=62.43MB mem-reservation=20.62MB thread-reservation=2 runtime-filters-memory=6.00MB
+15:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: a.ca_state
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=22B cardinality=51
+|  in pipelines: 02(GETNEXT)
+|
+14:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: i.i_category = j.i_category
+|  other join predicates: i.i_current_price > CAST(1.2 AS DECIMAL(2,1)) * avg(j.i_current_price)
+|  runtime filters: RF000[bloom] <- j.i_category
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3,4 row-size=80B cardinality=1.19K
+|  in pipelines: 02(GETNEXT), 26(OPEN)
+|
+|--27:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=26B cardinality=10
+|  |  in pipelines: 26(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(j.i_category)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  26:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(j.i_current_price)
+|  |  group by: j.i_category
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=26B cardinality=10
+|  |  in pipelines: 26(GETNEXT), 07(OPEN)
+|  |
+|  25:EXCHANGE [HASH(j.i_category)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=26B cardinality=10
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=2.12MB thread-reservation=2
+|  08:AGGREGATE [STREAMING]
+|  |  output: avg(j.i_current_price)
+|  |  group by: j.i_category
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9 row-size=26B cardinality=10
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.item j, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=8 row-size=22B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+13:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: d.d_month_seq = (d_month_seq)
+|  runtime filters: RF002[bloom] <- (d_month_seq)
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3,4 row-size=80B cardinality=1.19K
+|  in pipelines: 02(GETNEXT), 22(OPEN)
+|
+|--24:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=4B cardinality=1
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  23:EXCHANGE [UNPARTITIONED]
+|  |  limit: 1
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=4B cardinality=1
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [HASH((d_month_seq))] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  22:AGGREGATE [FINALIZE]
+|  |  group by: (d_month_seq)
+|  |  limit: 1
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=4B cardinality=1
+|  |  in pipelines: 22(GETNEXT), 05(OPEN)
+|  |
+|  21:EXCHANGE [HASH((d_month_seq))]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=4B cardinality=108
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=58.00MB mem-reservation=2.25MB thread-reservation=2
+|  06:AGGREGATE [STREAMING]
+|  |  group by: (d_month_seq)
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=4B cardinality=108
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(1 AS INT)
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=5 row-size=12B cardinality=108
+|     in pipelines: 05(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: s.ss_item_sk = i.i_item_sk
+|  fk/pk conjuncts: s.ss_item_sk = i.i_item_sk
+|  runtime filters: RF004[bloom] <- i.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3,4 row-size=80B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 04(OPEN)
+|
+|--20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=559.39KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=30B cardinality=18.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=49.00MB mem-reservation=1.25MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  04:SCAN HDFS [tpcds_parquet.item i, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> i.i_category
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=4 row-size=30B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: s.ss_sold_date_sk = d.d_date_sk
+|  fk/pk conjuncts: s.ss_sold_date_sk = d.d_date_sk
+|  runtime filters: RF006[bloom] <- d.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3 row-size=50B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=8B cardinality=73.05K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  03:SCAN HDFS [tpcds_parquet.date_dim d, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF002[bloom] -> d.d_month_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: c.c_current_addr_sk = a.ca_address_sk
+|  fk/pk conjuncts: c.c_current_addr_sk = a.ca_address_sk
+|  runtime filters: RF008[bloom] <- a.ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0 row-size=42B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=900.91KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=18B cardinality=50.00K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.customer_address a, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=0 row-size=18B cardinality=50.00K
+|     in pipelines: 00(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: s.ss_customer_sk = c.c_customer_sk
+|  fk/pk conjuncts: s.ss_customer_sk = c.c_customer_sk
+|  runtime filters: RF010[bloom] <- c.c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1 row-size=24B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--17:EXCHANGE [BROADCAST]
+|  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=100.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  01:SCAN HDFS [tpcds_parquet.customer c, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF008[bloom] -> c.c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.store_sales s, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> s.ss_item_sk, RF006[bloom] -> s.ss_sold_date_sk, RF010[bloom] -> s.ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=2 row-size=16B cardinality=2.88M
+   in pipelines: 02(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=55.38MB Threads=20
+Per-Host Resource Estimates: Memory=246MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: a.ca_state, count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+30:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: count(*) ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=22B cardinality=5
+|  in pipelines: 16(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(a.ca_state)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: count(*) ASC
+|  mem-estimate=110B mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=22B cardinality=5
+|  in pipelines: 16(GETNEXT), 29(OPEN)
+|
+29:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: a.ca_state
+|  having: count(*) >= CAST(10 AS BIGINT)
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=22B cardinality=5
+|  in pipelines: 29(GETNEXT), 02(OPEN)
+|
+28:EXCHANGE [HASH(a.ca_state)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=22B cardinality=51
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+15:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: a.ca_state
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=22B cardinality=51
+|  in pipelines: 02(GETNEXT)
+|
+14:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: i.i_category = j.i_category
+|  other join predicates: i.i_current_price > CAST(1.2 AS DECIMAL(2,1)) * avg(j.i_current_price)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3,4 row-size=80B cardinality=1.19K
+|  in pipelines: 02(GETNEXT), 26(OPEN)
+|
+|--F12:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: j.i_category
+|  |  runtime filters: RF000[bloom] <- j.i_category
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  27:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=26B cardinality=10
+|  |  in pipelines: 26(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(j.i_category)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  26:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(j.i_current_price)
+|  |  group by: j.i_category
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=26B cardinality=10
+|  |  in pipelines: 26(GETNEXT), 07(OPEN)
+|  |
+|  25:EXCHANGE [HASH(j.i_category)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=26B cardinality=10
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.12MB thread-reservation=1
+|  08:AGGREGATE [STREAMING]
+|  |  output: avg(j.i_current_price)
+|  |  group by: j.i_category
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9 row-size=26B cardinality=10
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.item j, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=0
+|     tuple-ids=8 row-size=22B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+13:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: d.d_month_seq = (d_month_seq)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3,4 row-size=80B cardinality=1.19K
+|  in pipelines: 02(GETNEXT), 22(OPEN)
+|
+|--F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: (d_month_seq)
+|  |  runtime filters: RF002[bloom] <- (d_month_seq)
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  24:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=4B cardinality=1
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  23:EXCHANGE [UNPARTITIONED]
+|  |  limit: 1
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=4B cardinality=1
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [HASH((d_month_seq))] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  22:AGGREGATE [FINALIZE]
+|  |  group by: (d_month_seq)
+|  |  limit: 1
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=4B cardinality=1
+|  |  in pipelines: 22(GETNEXT), 05(OPEN)
+|  |
+|  21:EXCHANGE [HASH((d_month_seq))]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=4B cardinality=108
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.25MB thread-reservation=1
+|  06:AGGREGATE [STREAMING]
+|  |  group by: (d_month_seq)
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=4B cardinality=108
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=5 row-size=12B cardinality=108
+|     in pipelines: 05(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: s.ss_item_sk = i.i_item_sk
+|  fk/pk conjuncts: s.ss_item_sk = i.i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3,4 row-size=80B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 04(OPEN)
+|
+|--F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.42MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: i.i_item_sk
+|  |  runtime filters: RF004[bloom] <- i.i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=559.39KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=30B cardinality=18.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.item i, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> i.i_category
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=4 row-size=30B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: s.ss_sold_date_sk = d.d_date_sk
+|  fk/pk conjuncts: s.ss_sold_date_sk = d.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,3 row-size=50B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.44MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: d.d_date_sk
+|  |  runtime filters: RF006[bloom] <- d.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=8B cardinality=73.05K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim d, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF002[bloom] -> d.d_month_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=8B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: c.c_current_addr_sk = a.ca_address_sk
+|  fk/pk conjuncts: c.c_current_addr_sk = a.ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0 row-size=42B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--F16:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.75MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: a.ca_address_sk
+|  |  runtime filters: RF008[bloom] <- a.ca_address_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=900.91KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=18B cardinality=50.00K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.customer_address a, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=0 row-size=18B cardinality=50.00K
+|     in pipelines: 00(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=05
+|  hash predicates: s.ss_customer_sk = c.c_customer_sk
+|  fk/pk conjuncts: s.ss_customer_sk = c.c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1 row-size=24B cardinality=2.88M
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.65MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: c.c_customer_sk
+|  |  runtime filters: RF010[bloom] <- c.c_customer_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  17:EXCHANGE [BROADCAST]
+|  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=100.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.customer c, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF008[bloom] -> c.c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=1 row-size=8B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.store_sales s, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> s.ss_item_sk, RF006[bloom] -> s.ss_sold_date_sk, RF010[bloom] -> s.ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=2 row-size=16B cardinality=2.88M
+   in pipelines: 02(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q07.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q07.test
new file mode 100644
index 0000000..618a666
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q07.test
@@ -0,0 +1,501 @@
+# TPCDS-Q7
+select
+  i_item_id,
+  avg(ss_quantity) agg1,
+  avg(ss_list_price) agg2,
+  avg(ss_coupon_amt) agg3,
+  avg(ss_sales_price) agg4
+from
+  store_sales,
+  customer_demographics,
+  date_dim,
+  item,
+  promotion
+where
+  ss_sold_date_sk = d_date_sk
+  and ss_item_sk = i_item_sk
+  and ss_cdemo_sk = cd_demo_sk
+  and ss_promo_sk = p_promo_sk
+  and cd_gender = 'F'
+  and cd_marital_status = 'W'
+  and cd_education_status = 'Primary'
+  and (p_channel_email = 'N'
+    or p_channel_event = 'N')
+  and d_year = 1998
+group by
+  i_item_id
+order by
+  i_item_id
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=31.34MB Threads=6
+Per-Host Resource Estimates: Memory=306MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=306.31MB mem-reservation=31.34MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_id, avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+10:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=5.86KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=60B cardinality=100
+|  in pipelines: 10(GETNEXT), 09(OPEN)
+|
+09:AGGREGATE [FINALIZE]
+|  output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=60B cardinality=8.85K
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4,3 row-size=162B cardinality=261.60K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=36B cardinality=18.00K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  runtime filters: RF002[bloom] <- p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4 row-size=126B cardinality=261.60K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.promotion]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_email = 'N' OR p_channel_event = 'N')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=48.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=4 row-size=30B cardinality=300
+|     in pipelines: 04(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
+|  runtime filters: RF004[bloom] <- cd_demo_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=96B cardinality=263.34K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.customer_demographics]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
+|     parquet dictionary predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
+|     mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=1 row-size=52B cardinality=97.40K
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=44B cardinality=589.03K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_promo_sk, RF004[bloom] -> ss_cdemo_sk, RF006[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=112.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=35.28MB Threads=12
+Per-Host Resource Estimates: Memory=332MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=20.70KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC
+|  limit: 100
+|  mem-estimate=20.70KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=60B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(i_item_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.36MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=5.86KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=60B cardinality=100
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=60B cardinality=8.85K
+|  in pipelines: 16(GETNEXT), 00(OPEN)
+|
+15:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=364.93KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=60B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=145.85MB mem-reservation=24.31MB thread-reservation=2 runtime-filters-memory=4.00MB
+09:AGGREGATE [STREAMING]
+|  output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=60B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4,3 row-size=162B cardinality=261.60K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=36B cardinality=18.00K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=36B cardinality=18.00K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  runtime filters: RF002[bloom] <- p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4 row-size=126B cardinality=261.60K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=18.75KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=30B cardinality=300
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=32.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_email = 'N' OR p_channel_event = 'N')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=48.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=4 row-size=30B cardinality=300
+|     in pipelines: 04(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
+|  runtime filters: RF004[bloom] <- cd_demo_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=96B cardinality=263.34K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=4.84MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=52B cardinality=97.40K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
+|     parquet dictionary predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
+|     mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=1 row-size=52B cardinality=97.40K
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=44B cardinality=589.03K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_promo_sk, RF004[bloom] -> ss_cdemo_sk, RF006[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=112.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=61.53MB Threads=13
+Per-Host Resource Estimates: Memory=179MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=39.45KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, avg(ss_quantity), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC
+|  limit: 100
+|  mem-estimate=39.45KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=60B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(i_item_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.54MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=5.86KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=60B cardinality=100
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=60B cardinality=8.85K
+|  in pipelines: 16(GETNEXT), 00(OPEN)
+|
+15:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=556.93KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=60B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+09:AGGREGATE [STREAMING]
+|  output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=60B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4,3 row-size=162B cardinality=261.60K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.53MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF000[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=36B cardinality=18.00K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=36B cardinality=18.00K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4 row-size=126B cardinality=261.60K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: p_promo_sk
+|  |  runtime filters: RF002[bloom] <- p_promo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=18.75KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=30B cardinality=300
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_email = 'N' OR p_channel_event = 'N')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=0
+|     tuple-ids=4 row-size=30B cardinality=300
+|     in pipelines: 04(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: ss_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=96B cardinality=263.34K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=22.84MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: cd_demo_sk
+|  |  runtime filters: RF004[bloom] <- cd_demo_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=4.84MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=52B cardinality=97.40K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
+|     parquet dictionary predicates: cd_marital_status = 'W', cd_gender = 'F', cd_education_status = 'Primary'
+|     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=1 row-size=52B cardinality=97.40K
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=44B cardinality=589.03K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_promo_sk, RF004[bloom] -> ss_cdemo_sk, RF006[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q08.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q08.test
new file mode 100644
index 0000000..96ecc7e
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q08.test
@@ -0,0 +1,735 @@
+# TPCDS-Q8
+SELECT s_store_name,
+       sum(ss_net_profit)
+FROM store_sales,
+     date_dim,
+     store,
+  (SELECT ca_zip
+   FROM
+     (SELECT SUBSTRING(ca_zip, 1, 5) ca_zip
+      FROM customer_address
+      WHERE SUBSTRING(ca_zip, 1, 5) IN ('24128', '76232', '65084', '87816', '83926', '77556', '20548',
+                                     '26231', '43848', '15126', '91137', '61265', '98294', '25782', '17920',
+                                     '18426', '98235', '40081', '84093', '28577', '55565', '17183', '54601',
+                                     '67897', '22752', '86284', '18376', '38607', '45200', '21756', '29741',
+                                     '96765', '23932', '89360', '29839', '25989', '28898', '91068', '72550',
+                                     '10390', '18845', '47770', '82636', '41367', '76638', '86198', '81312',
+                                     '37126', '39192', '88424', '72175', '81426', '53672', '10445', '42666',
+                                     '66864', '66708', '41248', '48583', '82276', '18842', '78890', '49448',
+                                     '14089', '38122', '34425', '79077', '19849', '43285', '39861', '66162',
+                                     '77610', '13695', '99543', '83444', '83041', '12305', '57665', '68341',
+                                     '25003', '57834', '62878', '49130', '81096', '18840', '27700', '23470',
+                                     '50412', '21195', '16021', '76107', '71954', '68309', '18119', '98359',
+                                     '64544', '10336', '86379', '27068', '39736', '98569', '28915', '24206',
+                                     '56529', '57647', '54917', '42961', '91110', '63981', '14922', '36420',
+                                     '23006', '67467', '32754', '30903', '20260', '31671', '51798', '72325',
+                                     '85816', '68621', '13955', '36446', '41766', '68806', '16725', '15146',
+                                     '22744', '35850', '88086', '51649', '18270', '52867', '39972', '96976',
+                                     '63792', '11376', '94898', '13595', '10516', '90225', '58943', '39371',
+                                     '94945', '28587', '96576', '57855', '28488', '26105', '83933', '25858',
+                                     '34322', '44438', '73171', '30122', '34102', '22685', '71256', '78451',
+                                     '54364', '13354', '45375', '40558', '56458', '28286', '45266', '47305',
+                                     '69399', '83921', '26233', '11101', '15371', '69913', '35942', '15882',
+                                     '25631', '24610', '44165', '99076', '33786', '70738', '26653', '14328',
+                                     '72305', '62496', '22152', '10144', '64147', '48425', '14663', '21076',
+                                     '18799', '30450', '63089', '81019', '68893', '24996', '51200', '51211',
+                                     '45692', '92712', '70466', '79994', '22437', '25280', '38935', '71791',
+                                     '73134', '56571', '14060', '19505', '72425', '56575', '74351', '68786',
+                                     '51650', '20004', '18383', '76614', '11634', '18906', '15765', '41368',
+                                     '73241', '76698', '78567', '97189', '28545', '76231', '75691', '22246',
+                                     '51061', '90578', '56691', '68014', '51103', '94167', '57047', '14867',
+                                     '73520', '15734', '63435', '25733', '35474', '24676', '94627', '53535',
+                                     '17879', '15559', '53268', '59166', '11928', '59402', '33282', '45721',
+                                     '43933', '68101', '33515', '36634', '71286', '19736', '58058', '55253',
+                                     '67473', '41918', '19515', '36495', '19430', '22351', '77191', '91393',
+                                     '49156', '50298', '87501', '18652', '53179', '18767', '63193', '23968',
+                                     '65164', '68880', '21286', '72823', '58470', '67301', '13394', '31016',
+                                     '70372', '67030', '40604', '24317', '45748', '39127', '26065', '77721',
+                                     '31029', '31880', '60576', '24671', '45549', '13376', '50016', '33123',
+                                     '19769', '22927', '97789', '46081', '72151', '15723', '46136', '51949',
+                                     '68100', '96888', '64528', '14171', '79777', '28709', '11489', '25103',
+                                     '32213', '78668', '22245', '15798', '27156', '37930', '62971', '21337',
+                                     '51622', '67853', '10567', '38415', '15455', '58263', '42029', '60279',
+                                     '37125', '56240', '88190', '50308', '26859', '64457', '89091', '82136',
+                                     '62377', '36233', '63837', '58078', '17043', '30010', '60099', '28810',
+                                     '98025', '29178', '87343', '73273', '30469', '64034', '39516', '86057',
+                                     '21309', '90257', '67875', '40162', '11356', '73650', '61810', '72013',
+                                     '30431', '22461', '19512', '13375', '55307', '30625', '83849', '68908',
+                                     '26689', '96451', '38193', '46820', '88885', '84935', '69035', '83144',
+                                     '47537', '56616', '94983', '48033', '69952', '25486', '61547', '27385',
+                                     '61860', '58048', '56910', '16807', '17871', '35258', '31387', '35458',
+                                     '35576') INTERSECT
+        SELECT ca_zip
+        FROM
+          (SELECT SUBSTRING(ca_zip, 1, 5) ca_zip,
+                  count(*) cnt
+           FROM customer_address,
+                customer
+           WHERE ca_address_sk = c_current_addr_sk
+             AND c_preferred_cust_flag='Y'
+           GROUP BY ca_zip
+           HAVING count(*) > 10)A1)A2) V1
+WHERE ss_store_sk = s_store_sk
+  AND ss_sold_date_sk = d_date_sk
+  AND d_qoy = 2
+  AND d_year = 1998
+  AND (SUBSTRING(s_zip, 1, 2) = SUBSTRING(V1.ca_zip, 1, 2))
+GROUP BY s_store_name
+ORDER BY s_store_name
+LIMIT 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=14.90MB Threads=7
+Per-Host Resource Estimates: Memory=219MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=218.81MB mem-reservation=14.90MB thread-reservation=7 runtime-filters-memory=5.00MB
+PLAN-ROOT SINK
+|  output exprs: s_store_name, sum(ss_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC
+|  mem-estimate=258B mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=32B cardinality=8
+|  in pipelines: 14(GETNEXT), 13(OPEN)
+|
+13:AGGREGATE [FINALIZE]
+|  output: sum(ss_net_profit)
+|  group by: s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=32B cardinality=8
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: substring(s_zip, 1, 2) = substring($a$1.ca_zip, 1, 2)
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF000[bloom] <- substring($a$1.ca_zip, 1, 2)
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,10 row-size=73B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 09(OPEN)
+|
+|--09:AGGREGATE [FINALIZE]
+|  |  group by: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT))
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=3.96K
+|  |  in pipelines: 09(GETNEXT), 03(OPEN)
+|  |
+|  08:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: substring(ca_zip, 1, 5) IS NOT DISTINCT FROM substring(ca_zip, 1, 5)
+|  |  runtime filters: RF006[bloom] <- substring(ca_zip, 1, 5)
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=17B cardinality=5.00K
+|  |  in pipelines: 03(GETNEXT), 07(OPEN)
+|  |
+|  |--07:AGGREGATE [FINALIZE]
+|  |  |  output: count(*)
+|  |  |  group by: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT))
+|  |  |  having: count(*) > CAST(10 AS BIGINT)
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=7 row-size=20B cardinality=396
+|  |  |  in pipelines: 07(GETNEXT), 04(OPEN)
+|  |  |
+|  |  06:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ca_address_sk = c_current_addr_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  runtime filters: RF008[bloom] <- c_current_addr_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=5,6 row-size=38B cardinality=51.30K
+|  |  |  in pipelines: 04(GETNEXT), 05(OPEN)
+|  |  |
+|  |  |--05:SCAN HDFS [tpcds_parquet.customer]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     predicates: c_preferred_cust_flag = 'Y'
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     parquet statistics predicates: c_preferred_cust_flag = 'Y'
+|  |  |     parquet dictionary predicates: c_preferred_cust_flag = 'Y'
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=6 row-size=17B cardinality=50.00K
+|  |  |     in pipelines: 05(GETNEXT)
+|  |  |
+|  |  04:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     runtime filters: RF008[bloom] -> ca_address_sk
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=21B cardinality=50.00K
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) IN ('24128', '76232', '65084', '87816', '83926', '77556', '20548', '26231', '43848', '15126', '91137', '61265', '98294', '25782', '17920', '18426', '98235', '40081', '84093', '28577', '55565', '17183', '54601', '67897', '22752', '86284', '18376', '38607', '45200', '21756', '29741', '96765', '23932', '89360', '29839', '25989', '28898', '91068', '72550', '10390', '18845', '47770', '82636', '41367', '76638', '86198', '81312', '37126', '39192', '88424', '72175', '81426', '53672', '10445', '42666', '66864', '66708', '41248', '48583', '82276', '18842', '78890', '49448', '14089', '38122', '34425', '79077', '19849', '43285', '39861', '66162', '77610', '13695', '99543', '83444', '83041', '12305', '57665', '68341', '25003', '57834', '62878', '49130', '81096', '18840', '27700', '23470', '50412', '21195', '16021', '76107', '71954', '68309', '18119', '98359', '64544', '10336', '86379', '27068', '39736', '98569', '28915', '24206', '56529', '57647', '54917', '42961', '91110', '63981', '14922', '36420', '23006', '67467', '32754', '30903', '20260', '31671', '51798', '72325', '85816', '68621', '13955', '36446', '41766', '68806', '16725', '15146', '22744', '35850', '88086', '51649', '18270', '52867', '39972', '96976', '63792', '11376', '94898', '13595', '10516', '90225', '58943', '39371', '94945', '28587', '96576', '57855', '28488', '26105', '83933', '25858', '34322', '44438', '73171', '30122', '34102', '22685', '71256', '78451', '54364', '13354', '45375', '40558', '56458', '28286', '45266', '47305', '69399', '83921', '26233', '11101', '15371', '69913', '35942', '15882', '25631', '24610', '44165', '99076', '33786', '70738', '26653', '14328', '72305', '62496', '22152', '10144', '64147', '48425', '14663', '21076', '18799', '30450', '63089', '81019', '68893', '24996', '51200', '51211', '45692', '92712', '70466', '79994', '22437', '25280', '38935', '71791', '73134', '56571', '14060', '19505', '72425', '56575', '74351', '68786', '51650', '20004', '18383', '76614', '11634', '18906', '15765', '41368', '73241', '76698', '78567', '97189', '28545', '76231', '75691', '22246', '51061', '90578', '56691', '68014', '51103', '94167', '57047', '14867', '73520', '15734', '63435', '25733', '35474', '24676', '94627', '53535', '17879', '15559', '53268', '59166', '11928', '59402', '33282', '45721', '43933', '68101', '33515', '36634', '71286', '19736', '58058', '55253', '67473', '41918', '19515', '36495', '19430', '22351', '77191', '91393', '49156', '50298', '87501', '18652', '53179', '18767', '63193', '23968', '65164', '68880', '21286', '72823', '58470', '67301', '13394', '31016', '70372', '67030', '40604', '24317', '45748', '39127', '26065', '77721', '31029', '31880', '60576', '24671', '45549', '13376', '50016', '33123', '19769', '22927', '97789', '46081', '72151', '15723', '46136', '51949', '68100', '96888', '64528', '14171', '79777', '28709', '11489', '25103', '32213', '78668', '22245', '15798', '27156', '37930', '62971', '21337', '51622', '67853', '10567', '38415', '15455', '58263', '42029', '60279', '37125', '56240', '88190', '50308', '26859', '64457', '89091', '82136', '62377', '36233', '63837', '58078', '17043', '30010', '60099', '28810', '98025', '29178', '87343', '73273', '30469', '64034', '39516', '86057', '21309', '90257', '67875', '40162', '11356', '73650', '61810', '72013', '30431', '22461', '19512', '13375', '55307', '30625', '83849', '68908', '26689', '96451', '38193', '46820', '88885', '84935', '69035', '83144', '47537', '56616', '94983', '48033', '69952', '25486', '61547', '27385', '61860', '58048', '56910', '16807', '17871', '35258', '31387', '35458', '35576')
+|     runtime filters: RF006[bloom] -> substring(ca_zip, 1, 5)
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet dictionary predicates: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) IN ('24128', '76232', '65084', '87816', '83926', '77556', '20548', '26231', '43848', '15126', '91137', '61265', '98294', '25782', '17920', '18426', '98235', '40081', '84093', '28577', '55565', '17183', '54601', '67897', '22752', '86284', '18376', '38607', '45200', '21756', '29741', '96765', '23932', '89360', '29839', '25989', '28898', '91068', '72550', '10390', '18845', '47770', '82636', '41367', '76638', '86198', '81312', '37126', '39192', '88424', '72175', '81426', '53672', '10445', '42666', '66864', '66708', '41248', '48583', '82276', '18842', '78890', '49448', '14089', '38122', '34425', '79077', '19849', '43285', '39861', '66162', '77610', '13695', '99543', '83444', '83041', '12305', '57665', '68341', '25003', '57834', '62878', '49130', '81096', '18840', '27700', '23470', '50412', '21195', '16021', '76107', '71954', '68309', '18119', '98359', '64544', '10336', '86379', '27068', '39736', '98569', '28915', '24206', '56529', '57647', '54917', '42961', '91110', '63981', '14922', '36420', '23006', '67467', '32754', '30903', '20260', '31671', '51798', '72325', '85816', '68621', '13955', '36446', '41766', '68806', '16725', '15146', '22744', '35850', '88086', '51649', '18270', '52867', '39972', '96976', '63792', '11376', '94898', '13595', '10516', '90225', '58943', '39371', '94945', '28587', '96576', '57855', '28488', '26105', '83933', '25858', '34322', '44438', '73171', '30122', '34102', '22685', '71256', '78451', '54364', '13354', '45375', '40558', '56458', '28286', '45266', '47305', '69399', '83921', '26233', '11101', '15371', '69913', '35942', '15882', '25631', '24610', '44165', '99076', '33786', '70738', '26653', '14328', '72305', '62496', '22152', '10144', '64147', '48425', '14663', '21076', '18799', '30450', '63089', '81019', '68893', '24996', '51200', '51211', '45692', '92712', '70466', '79994', '22437', '25280', '38935', '71791', '73134', '56571', '14060', '19505', '72425', '56575', '74351', '68786', '51650', '20004', '18383', '76614', '11634', '18906', '15765', '41368', '73241', '76698', '78567', '97189', '28545', '76231', '75691', '22246', '51061', '90578', '56691', '68014', '51103', '94167', '57047', '14867', '73520', '15734', '63435', '25733', '35474', '24676', '94627', '53535', '17879', '15559', '53268', '59166', '11928', '59402', '33282', '45721', '43933', '68101', '33515', '36634', '71286', '19736', '58058', '55253', '67473', '41918', '19515', '36495', '19430', '22351', '77191', '91393', '49156', '50298', '87501', '18652', '53179', '18767', '63193', '23968', '65164', '68880', '21286', '72823', '58470', '67301', '13394', '31016', '70372', '67030', '40604', '24317', '45748', '39127', '26065', '77721', '31029', '31880', '60576', '24671', '45549', '13376', '50016', '33123', '19769', '22927', '97789', '46081', '72151', '15723', '46136', '51949', '68100', '96888', '64528', '14171', '79777', '28709', '11489', '25103', '32213', '78668', '22245', '15798', '27156', '37930', '62971', '21337', '51622', '67853', '10567', '38415', '15455', '58263', '42029', '60279', '37125', '56240', '88190', '50308', '26859', '64457', '89091', '82136', '62377', '36233', '63837', '58078', '17043', '30010', '60099', '28810', '98025', '29178', '87343', '73273', '30469', '64034', '39516', '86057', '21309', '90257', '67875', '40162', '11356', '73650', '61810', '72013', '30431', '22461', '19512', '13375', '55307', '30625', '83849', '68908', '26689', '96451', '38193', '46820', '88885', '84935', '69035', '83144', '47537', '56616', '94983', '48033', '69952', '25486', '61547', '27385', '61860', '58048', '56910', '16807', '17871', '35258', '31387', '35458', '35576')
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=3 row-size=17B cardinality=5.00K
+|     in pipelines: 03(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=61B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     runtime filters: RF000[bloom] -> substring(s_zip, 1, 2)
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=2 row-size=37B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_qoy = CAST(2 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_qoy = CAST(2 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_qoy = CAST(2 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=186
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF002[bloom] -> ss_store_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=30.15MB Threads=16
+Per-Host Resource Estimates: Memory=285MB
+F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: s_store_name, sum(ss_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+26:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: s_store_name ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=32B cardinality=8
+|  in pipelines: 14(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(s_store_name)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+14:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC
+|  mem-estimate=258B mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=32B cardinality=8
+|  in pipelines: 14(GETNEXT), 25(OPEN)
+|
+25:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_net_profit)
+|  group by: s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=32B cardinality=8
+|  in pipelines: 25(GETNEXT), 00(OPEN)
+|
+24:EXCHANGE [HASH(s_store_name)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=32B cardinality=8
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=50.90MB mem-reservation=11.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+13:AGGREGATE [STREAMING]
+|  output: sum(ss_net_profit)
+|  group by: s_store_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=32B cardinality=8
+|  in pipelines: 00(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: substring(s_zip, 1, 2) = substring($a$1.ca_zip, 1, 2)
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF000[bloom] <- substring($a$1.ca_zip, 1, 2)
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,10 row-size=73B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 22(OPEN)
+|
+|--23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=62.42KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=3.96K
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH($a$1.ca_zip)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.06MB mem-reservation=1.94MB thread-reservation=1
+|  22:AGGREGATE [FINALIZE]
+|  |  group by: $a$1.ca_zip
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=3.96K
+|  |  in pipelines: 22(GETNEXT), 03(OPEN)
+|  |
+|  21:EXCHANGE [HASH($a$1.ca_zip)]
+|  |  mem-estimate=62.42KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=3.96K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=28.95MB mem-reservation=5.06MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  09:AGGREGATE [STREAMING]
+|  |  group by: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT))
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=3.96K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  08:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: substring(ca_zip, 1, 5) IS NOT DISTINCT FROM substring(ca_zip, 1, 5)
+|  |  runtime filters: RF006[bloom] <- substring(ca_zip, 1, 5)
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=17B cardinality=5.00K
+|  |  in pipelines: 03(GETNEXT), 19(OPEN)
+|  |
+|  |--20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=17.02KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=20B cardinality=396
+|  |  |  in pipelines: 19(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [HASH(substring(ca_zip, 1, 5))] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=10.10MB mem-reservation=1.94MB thread-reservation=1
+|  |  19:AGGREGATE [FINALIZE]
+|  |  |  output: count:merge(*)
+|  |  |  group by: substring(ca_zip, 1, 5)
+|  |  |  having: count(*) > CAST(10 AS BIGINT)
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=7 row-size=20B cardinality=396
+|  |  |  in pipelines: 19(GETNEXT), 04(OPEN)
+|  |  |
+|  |  18:EXCHANGE [HASH(substring(ca_zip, 1, 5))]
+|  |  |  mem-estimate=101.36KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=20B cardinality=3.96K
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=45.77MB mem-reservation=5.44MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  07:AGGREGATE [STREAMING]
+|  |  |  output: count(*)
+|  |  |  group by: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT))
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=7 row-size=20B cardinality=3.96K
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ca_address_sk = c_current_addr_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  runtime filters: RF008[bloom] <- c_current_addr_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=5,6 row-size=38B cardinality=51.30K
+|  |  |  in pipelines: 04(GETNEXT), 05(OPEN)
+|  |  |
+|  |  |--17:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=851.08KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=17B cardinality=50.00K
+|  |  |  |  in pipelines: 05(GETNEXT)
+|  |  |  |
+|  |  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  05:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     predicates: c_preferred_cust_flag = 'Y'
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     parquet statistics predicates: c_preferred_cust_flag = 'Y'
+|  |  |     parquet dictionary predicates: c_preferred_cust_flag = 'Y'
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=6 row-size=17B cardinality=50.00K
+|  |  |     in pipelines: 05(GETNEXT)
+|  |  |
+|  |  04:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     runtime filters: RF008[bloom] -> ca_address_sk
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=21B cardinality=50.00K
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) IN ('24128', '76232', '65084', '87816', '83926', '77556', '20548', '26231', '43848', '15126', '91137', '61265', '98294', '25782', '17920', '18426', '98235', '40081', '84093', '28577', '55565', '17183', '54601', '67897', '22752', '86284', '18376', '38607', '45200', '21756', '29741', '96765', '23932', '89360', '29839', '25989', '28898', '91068', '72550', '10390', '18845', '47770', '82636', '41367', '76638', '86198', '81312', '37126', '39192', '88424', '72175', '81426', '53672', '10445', '42666', '66864', '66708', '41248', '48583', '82276', '18842', '78890', '49448', '14089', '38122', '34425', '79077', '19849', '43285', '39861', '66162', '77610', '13695', '99543', '83444', '83041', '12305', '57665', '68341', '25003', '57834', '62878', '49130', '81096', '18840', '27700', '23470', '50412', '21195', '16021', '76107', '71954', '68309', '18119', '98359', '64544', '10336', '86379', '27068', '39736', '98569', '28915', '24206', '56529', '57647', '54917', '42961', '91110', '63981', '14922', '36420', '23006', '67467', '32754', '30903', '20260', '31671', '51798', '72325', '85816', '68621', '13955', '36446', '41766', '68806', '16725', '15146', '22744', '35850', '88086', '51649', '18270', '52867', '39972', '96976', '63792', '11376', '94898', '13595', '10516', '90225', '58943', '39371', '94945', '28587', '96576', '57855', '28488', '26105', '83933', '25858', '34322', '44438', '73171', '30122', '34102', '22685', '71256', '78451', '54364', '13354', '45375', '40558', '56458', '28286', '45266', '47305', '69399', '83921', '26233', '11101', '15371', '69913', '35942', '15882', '25631', '24610', '44165', '99076', '33786', '70738', '26653', '14328', '72305', '62496', '22152', '10144', '64147', '48425', '14663', '21076', '18799', '30450', '63089', '81019', '68893', '24996', '51200', '51211', '45692', '92712', '70466', '79994', '22437', '25280', '38935', '71791', '73134', '56571', '14060', '19505', '72425', '56575', '74351', '68786', '51650', '20004', '18383', '76614', '11634', '18906', '15765', '41368', '73241', '76698', '78567', '97189', '28545', '76231', '75691', '22246', '51061', '90578', '56691', '68014', '51103', '94167', '57047', '14867', '73520', '15734', '63435', '25733', '35474', '24676', '94627', '53535', '17879', '15559', '53268', '59166', '11928', '59402', '33282', '45721', '43933', '68101', '33515', '36634', '71286', '19736', '58058', '55253', '67473', '41918', '19515', '36495', '19430', '22351', '77191', '91393', '49156', '50298', '87501', '18652', '53179', '18767', '63193', '23968', '65164', '68880', '21286', '72823', '58470', '67301', '13394', '31016', '70372', '67030', '40604', '24317', '45748', '39127', '26065', '77721', '31029', '31880', '60576', '24671', '45549', '13376', '50016', '33123', '19769', '22927', '97789', '46081', '72151', '15723', '46136', '51949', '68100', '96888', '64528', '14171', '79777', '28709', '11489', '25103', '32213', '78668', '22245', '15798', '27156', '37930', '62971', '21337', '51622', '67853', '10567', '38415', '15455', '58263', '42029', '60279', '37125', '56240', '88190', '50308', '26859', '64457', '89091', '82136', '62377', '36233', '63837', '58078', '17043', '30010', '60099', '28810', '98025', '29178', '87343', '73273', '30469', '64034', '39516', '86057', '21309', '90257', '67875', '40162', '11356', '73650', '61810', '72013', '30431', '22461', '19512', '13375', '55307', '30625', '83849', '68908', '26689', '96451', '38193', '46820', '88885', '84935', '69035', '83144', '47537', '56616', '94983', '48033', '69952', '25486', '61547', '27385', '61860', '58048', '56910', '16807', '17871', '35258', '31387', '35458', '35576')
+|     runtime filters: RF006[bloom] -> substring(ca_zip, 1, 5)
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet dictionary predicates: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) IN ('24128', '76232', '65084', '87816', '83926', '77556', '20548', '26231', '43848', '15126', '91137', '61265', '98294', '25782', '17920', '18426', '98235', '40081', '84093', '28577', '55565', '17183', '54601', '67897', '22752', '86284', '18376', '38607', '45200', '21756', '29741', '96765', '23932', '89360', '29839', '25989', '28898', '91068', '72550', '10390', '18845', '47770', '82636', '41367', '76638', '86198', '81312', '37126', '39192', '88424', '72175', '81426', '53672', '10445', '42666', '66864', '66708', '41248', '48583', '82276', '18842', '78890', '49448', '14089', '38122', '34425', '79077', '19849', '43285', '39861', '66162', '77610', '13695', '99543', '83444', '83041', '12305', '57665', '68341', '25003', '57834', '62878', '49130', '81096', '18840', '27700', '23470', '50412', '21195', '16021', '76107', '71954', '68309', '18119', '98359', '64544', '10336', '86379', '27068', '39736', '98569', '28915', '24206', '56529', '57647', '54917', '42961', '91110', '63981', '14922', '36420', '23006', '67467', '32754', '30903', '20260', '31671', '51798', '72325', '85816', '68621', '13955', '36446', '41766', '68806', '16725', '15146', '22744', '35850', '88086', '51649', '18270', '52867', '39972', '96976', '63792', '11376', '94898', '13595', '10516', '90225', '58943', '39371', '94945', '28587', '96576', '57855', '28488', '26105', '83933', '25858', '34322', '44438', '73171', '30122', '34102', '22685', '71256', '78451', '54364', '13354', '45375', '40558', '56458', '28286', '45266', '47305', '69399', '83921', '26233', '11101', '15371', '69913', '35942', '15882', '25631', '24610', '44165', '99076', '33786', '70738', '26653', '14328', '72305', '62496', '22152', '10144', '64147', '48425', '14663', '21076', '18799', '30450', '63089', '81019', '68893', '24996', '51200', '51211', '45692', '92712', '70466', '79994', '22437', '25280', '38935', '71791', '73134', '56571', '14060', '19505', '72425', '56575', '74351', '68786', '51650', '20004', '18383', '76614', '11634', '18906', '15765', '41368', '73241', '76698', '78567', '97189', '28545', '76231', '75691', '22246', '51061', '90578', '56691', '68014', '51103', '94167', '57047', '14867', '73520', '15734', '63435', '25733', '35474', '24676', '94627', '53535', '17879', '15559', '53268', '59166', '11928', '59402', '33282', '45721', '43933', '68101', '33515', '36634', '71286', '19736', '58058', '55253', '67473', '41918', '19515', '36495', '19430', '22351', '77191', '91393', '49156', '50298', '87501', '18652', '53179', '18767', '63193', '23968', '65164', '68880', '21286', '72823', '58470', '67301', '13394', '31016', '70372', '67030', '40604', '24317', '45748', '39127', '26065', '77721', '31029', '31880', '60576', '24671', '45549', '13376', '50016', '33123', '19769', '22927', '97789', '46081', '72151', '15723', '46136', '51949', '68100', '96888', '64528', '14171', '79777', '28709', '11489', '25103', '32213', '78668', '22245', '15798', '27156', '37930', '62971', '21337', '51622', '67853', '10567', '38415', '15455', '58263', '42029', '60279', '37125', '56240', '88190', '50308', '26859', '64457', '89091', '82136', '62377', '36233', '63837', '58078', '17043', '30010', '60099', '28810', '98025', '29178', '87343', '73273', '30469', '64034', '39516', '86057', '21309', '90257', '67875', '40162', '11356', '73650', '61810', '72013', '30431', '22461', '19512', '13375', '55307', '30625', '83849', '68908', '26689', '96451', '38193', '46820', '88885', '84935', '69035', '83144', '47537', '56616', '94983', '48033', '69952', '25486', '61547', '27385', '61860', '58048', '56910', '16807', '17871', '35258', '31387', '35458', '35576')
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=3 row-size=17B cardinality=5.00K
+|     in pipelines: 03(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=61B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--16:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=37B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=49.00MB mem-reservation=1.02MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     runtime filters: RF000[bloom] -> substring(s_zip, 1, 2)
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=2 row-size=37B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=186
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_qoy = CAST(2 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_qoy = CAST(2 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_qoy = CAST(2 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=186
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF002[bloom] -> ss_store_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=48.77MB Threads=17
+Per-Host Resource Estimates: Memory=223MB
+F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: s_store_name, sum(ss_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+26:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: s_store_name ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=32B cardinality=8
+|  in pipelines: 14(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(s_store_name)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+14:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC
+|  mem-estimate=258B mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=32B cardinality=8
+|  in pipelines: 14(GETNEXT), 25(OPEN)
+|
+25:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_net_profit)
+|  group by: s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=32B cardinality=8
+|  in pipelines: 25(GETNEXT), 00(OPEN)
+|
+24:EXCHANGE [HASH(s_store_name)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=32B cardinality=8
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+13:AGGREGATE [STREAMING]
+|  output: sum(ss_net_profit)
+|  group by: s_store_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=32B cardinality=8
+|  in pipelines: 00(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: substring(s_zip, 1, 2) = substring($a$1.ca_zip, 1, 2)
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,10 row-size=73B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 22(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: substring($a$1.ca_zip, 1, 2)
+|  |  runtime filters: RF000[bloom] <- substring($a$1.ca_zip, 1, 2)
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=62.42KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=3.96K
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH($a$1.ca_zip)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.06MB mem-reservation=1.94MB thread-reservation=1
+|  22:AGGREGATE [FINALIZE]
+|  |  group by: $a$1.ca_zip
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=3.96K
+|  |  in pipelines: 22(GETNEXT), 03(OPEN)
+|  |
+|  21:EXCHANGE [HASH($a$1.ca_zip)]
+|  |  mem-estimate=62.42KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=3.96K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.12MB thread-reservation=1
+|  09:AGGREGATE [STREAMING]
+|  |  group by: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT))
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=3.96K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  08:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: substring(ca_zip, 1, 5) IS NOT DISTINCT FROM substring(ca_zip, 1, 5)
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=17B cardinality=5.00K
+|  |  in pipelines: 03(GETNEXT), 19(OPEN)
+|  |
+|  |--F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: substring(ca_zip, 1, 5)
+|  |  |  runtime filters: RF006[bloom] <- substring(ca_zip, 1, 5)
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=17.02KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=20B cardinality=396
+|  |  |  in pipelines: 19(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [HASH(substring(ca_zip, 1, 5))] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=10.10MB mem-reservation=1.94MB thread-reservation=1
+|  |  19:AGGREGATE [FINALIZE]
+|  |  |  output: count:merge(*)
+|  |  |  group by: substring(ca_zip, 1, 5)
+|  |  |  having: count(*) > CAST(10 AS BIGINT)
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=7 row-size=20B cardinality=396
+|  |  |  in pipelines: 19(GETNEXT), 04(OPEN)
+|  |  |
+|  |  18:EXCHANGE [HASH(substring(ca_zip, 1, 5))]
+|  |  |  mem-estimate=101.36KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=20B cardinality=3.96K
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.50MB thread-reservation=1
+|  |  07:AGGREGATE [STREAMING]
+|  |  |  output: count(*)
+|  |  |  group by: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT))
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=7 row-size=20B cardinality=3.96K
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: ca_address_sk = c_current_addr_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=5,6 row-size=38B cardinality=51.30K
+|  |  |  in pipelines: 04(GETNEXT), 05(OPEN)
+|  |  |
+|  |  |--F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=5.71MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: c_current_addr_sk
+|  |  |  |  runtime filters: RF008[bloom] <- c_current_addr_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  17:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=851.08KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=17B cardinality=50.00K
+|  |  |  |  in pipelines: 05(GETNEXT)
+|  |  |  |
+|  |  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  05:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     predicates: c_preferred_cust_flag = 'Y'
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     parquet statistics predicates: c_preferred_cust_flag = 'Y'
+|  |  |     parquet dictionary predicates: c_preferred_cust_flag = 'Y'
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=6 row-size=17B cardinality=50.00K
+|  |  |     in pipelines: 05(GETNEXT)
+|  |  |
+|  |  04:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     runtime filters: RF008[bloom] -> ca_address_sk
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=5 row-size=21B cardinality=50.00K
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) IN ('24128', '76232', '65084', '87816', '83926', '77556', '20548', '26231', '43848', '15126', '91137', '61265', '98294', '25782', '17920', '18426', '98235', '40081', '84093', '28577', '55565', '17183', '54601', '67897', '22752', '86284', '18376', '38607', '45200', '21756', '29741', '96765', '23932', '89360', '29839', '25989', '28898', '91068', '72550', '10390', '18845', '47770', '82636', '41367', '76638', '86198', '81312', '37126', '39192', '88424', '72175', '81426', '53672', '10445', '42666', '66864', '66708', '41248', '48583', '82276', '18842', '78890', '49448', '14089', '38122', '34425', '79077', '19849', '43285', '39861', '66162', '77610', '13695', '99543', '83444', '83041', '12305', '57665', '68341', '25003', '57834', '62878', '49130', '81096', '18840', '27700', '23470', '50412', '21195', '16021', '76107', '71954', '68309', '18119', '98359', '64544', '10336', '86379', '27068', '39736', '98569', '28915', '24206', '56529', '57647', '54917', '42961', '91110', '63981', '14922', '36420', '23006', '67467', '32754', '30903', '20260', '31671', '51798', '72325', '85816', '68621', '13955', '36446', '41766', '68806', '16725', '15146', '22744', '35850', '88086', '51649', '18270', '52867', '39972', '96976', '63792', '11376', '94898', '13595', '10516', '90225', '58943', '39371', '94945', '28587', '96576', '57855', '28488', '26105', '83933', '25858', '34322', '44438', '73171', '30122', '34102', '22685', '71256', '78451', '54364', '13354', '45375', '40558', '56458', '28286', '45266', '47305', '69399', '83921', '26233', '11101', '15371', '69913', '35942', '15882', '25631', '24610', '44165', '99076', '33786', '70738', '26653', '14328', '72305', '62496', '22152', '10144', '64147', '48425', '14663', '21076', '18799', '30450', '63089', '81019', '68893', '24996', '51200', '51211', '45692', '92712', '70466', '79994', '22437', '25280', '38935', '71791', '73134', '56571', '14060', '19505', '72425', '56575', '74351', '68786', '51650', '20004', '18383', '76614', '11634', '18906', '15765', '41368', '73241', '76698', '78567', '97189', '28545', '76231', '75691', '22246', '51061', '90578', '56691', '68014', '51103', '94167', '57047', '14867', '73520', '15734', '63435', '25733', '35474', '24676', '94627', '53535', '17879', '15559', '53268', '59166', '11928', '59402', '33282', '45721', '43933', '68101', '33515', '36634', '71286', '19736', '58058', '55253', '67473', '41918', '19515', '36495', '19430', '22351', '77191', '91393', '49156', '50298', '87501', '18652', '53179', '18767', '63193', '23968', '65164', '68880', '21286', '72823', '58470', '67301', '13394', '31016', '70372', '67030', '40604', '24317', '45748', '39127', '26065', '77721', '31029', '31880', '60576', '24671', '45549', '13376', '50016', '33123', '19769', '22927', '97789', '46081', '72151', '15723', '46136', '51949', '68100', '96888', '64528', '14171', '79777', '28709', '11489', '25103', '32213', '78668', '22245', '15798', '27156', '37930', '62971', '21337', '51622', '67853', '10567', '38415', '15455', '58263', '42029', '60279', '37125', '56240', '88190', '50308', '26859', '64457', '89091', '82136', '62377', '36233', '63837', '58078', '17043', '30010', '60099', '28810', '98025', '29178', '87343', '73273', '30469', '64034', '39516', '86057', '21309', '90257', '67875', '40162', '11356', '73650', '61810', '72013', '30431', '22461', '19512', '13375', '55307', '30625', '83849', '68908', '26689', '96451', '38193', '46820', '88885', '84935', '69035', '83144', '47537', '56616', '94983', '48033', '69952', '25486', '61547', '27385', '61860', '58048', '56910', '16807', '17871', '35258', '31387', '35458', '35576')
+|     runtime filters: RF006[bloom] -> substring(ca_zip, 1, 5)
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet dictionary predicates: substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) IN ('24128', '76232', '65084', '87816', '83926', '77556', '20548', '26231', '43848', '15126', '91137', '61265', '98294', '25782', '17920', '18426', '98235', '40081', '84093', '28577', '55565', '17183', '54601', '67897', '22752', '86284', '18376', '38607', '45200', '21756', '29741', '96765', '23932', '89360', '29839', '25989', '28898', '91068', '72550', '10390', '18845', '47770', '82636', '41367', '76638', '86198', '81312', '37126', '39192', '88424', '72175', '81426', '53672', '10445', '42666', '66864', '66708', '41248', '48583', '82276', '18842', '78890', '49448', '14089', '38122', '34425', '79077', '19849', '43285', '39861', '66162', '77610', '13695', '99543', '83444', '83041', '12305', '57665', '68341', '25003', '57834', '62878', '49130', '81096', '18840', '27700', '23470', '50412', '21195', '16021', '76107', '71954', '68309', '18119', '98359', '64544', '10336', '86379', '27068', '39736', '98569', '28915', '24206', '56529', '57647', '54917', '42961', '91110', '63981', '14922', '36420', '23006', '67467', '32754', '30903', '20260', '31671', '51798', '72325', '85816', '68621', '13955', '36446', '41766', '68806', '16725', '15146', '22744', '35850', '88086', '51649', '18270', '52867', '39972', '96976', '63792', '11376', '94898', '13595', '10516', '90225', '58943', '39371', '94945', '28587', '96576', '57855', '28488', '26105', '83933', '25858', '34322', '44438', '73171', '30122', '34102', '22685', '71256', '78451', '54364', '13354', '45375', '40558', '56458', '28286', '45266', '47305', '69399', '83921', '26233', '11101', '15371', '69913', '35942', '15882', '25631', '24610', '44165', '99076', '33786', '70738', '26653', '14328', '72305', '62496', '22152', '10144', '64147', '48425', '14663', '21076', '18799', '30450', '63089', '81019', '68893', '24996', '51200', '51211', '45692', '92712', '70466', '79994', '22437', '25280', '38935', '71791', '73134', '56571', '14060', '19505', '72425', '56575', '74351', '68786', '51650', '20004', '18383', '76614', '11634', '18906', '15765', '41368', '73241', '76698', '78567', '97189', '28545', '76231', '75691', '22246', '51061', '90578', '56691', '68014', '51103', '94167', '57047', '14867', '73520', '15734', '63435', '25733', '35474', '24676', '94627', '53535', '17879', '15559', '53268', '59166', '11928', '59402', '33282', '45721', '43933', '68101', '33515', '36634', '71286', '19736', '58058', '55253', '67473', '41918', '19515', '36495', '19430', '22351', '77191', '91393', '49156', '50298', '87501', '18652', '53179', '18767', '63193', '23968', '65164', '68880', '21286', '72823', '58470', '67301', '13394', '31016', '70372', '67030', '40604', '24317', '45748', '39127', '26065', '77721', '31029', '31880', '60576', '24671', '45549', '13376', '50016', '33123', '19769', '22927', '97789', '46081', '72151', '15723', '46136', '51949', '68100', '96888', '64528', '14171', '79777', '28709', '11489', '25103', '32213', '78668', '22245', '15798', '27156', '37930', '62971', '21337', '51622', '67853', '10567', '38415', '15455', '58263', '42029', '60279', '37125', '56240', '88190', '50308', '26859', '64457', '89091', '82136', '62377', '36233', '63837', '58078', '17043', '30010', '60099', '28810', '98025', '29178', '87343', '73273', '30469', '64034', '39516', '86057', '21309', '90257', '67875', '40162', '11356', '73650', '61810', '72013', '30431', '22461', '19512', '13375', '55307', '30625', '83849', '68908', '26689', '96451', '38193', '46820', '88885', '84935', '69035', '83144', '47537', '56616', '94983', '48033', '69952', '25486', '61547', '27385', '61860', '58048', '56910', '16807', '17871', '35258', '31387', '35458', '35576')
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=0
+|     tuple-ids=3 row-size=17B cardinality=5.00K
+|     in pipelines: 03(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=61B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF002[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  16:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=37B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     runtime filters: RF000[bloom] -> substring(s_zip, 1, 2)
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|     tuple-ids=2 row-size=37B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=186
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_qoy = CAST(2 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_qoy = CAST(2 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_qoy = CAST(2 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=1 row-size=12B cardinality=186
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF002[bloom] -> ss_store_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q09.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q09.test
new file mode 100644
index 0000000..598c9c1
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q09.test
@@ -0,0 +1,1942 @@
+# TPCDS-Q9
+select case when (select count(*)
+                  from store_sales
+                  where ss_quantity between 1 and 20) > 74129
+            then (select avg(ss_ext_discount_amt)
+                  from store_sales
+                  where ss_quantity between 1 and 20)
+            else (select avg(ss_net_profit)
+                  from store_sales
+                  where ss_quantity between 1 and 20) end bucket1,
+       case when (select count(*)
+                  from store_sales
+                  where ss_quantity between 21 and 40) > 122840
+            then (select avg(ss_ext_discount_amt)
+                  from store_sales
+                  where ss_quantity between 21 and 40)
+            else (select avg(ss_net_profit)
+                  from store_sales
+                  where ss_quantity between 21 and 40) end bucket2,
+       case when (select count(*)
+                  from store_sales
+                  where ss_quantity between 41 and 60) > 56580
+            then (select avg(ss_ext_discount_amt)
+                  from store_sales
+                  where ss_quantity between 41 and 60)
+            else (select avg(ss_net_profit)
+                  from store_sales
+                  where ss_quantity between 41 and 60) end bucket3,
+       case when (select count(*)
+                  from store_sales
+                  where ss_quantity between 61 and 80) > 10097
+            then (select avg(ss_ext_discount_amt)
+                  from store_sales
+                  where ss_quantity between 61 and 80)
+            else (select avg(ss_net_profit)
+                  from store_sales
+                  where ss_quantity between 61 and 80) end bucket4,
+       case when (select count(*)
+                  from store_sales
+                  where ss_quantity between 81 and 100) > 165306
+            then (select avg(ss_ext_discount_amt)
+                  from store_sales
+                  where ss_quantity between 81 and 100)
+            else (select avg(ss_net_profit)
+                  from store_sales
+                  where ss_quantity between 81 and 100) end bucket5
+from reason
+where r_reason_sk = 1
+---- PLAN
+Max Per-Host Resource Reservation: Memory=10.63MB Threads=17
+Per-Host Resource Estimates: Memory=566MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=566.00MB mem-reservation=10.63MB thread-reservation=17
+PLAN-ROOT SINK
+|  output exprs: CASE WHEN count(*) > CAST(74129 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(122840 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(56580 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(10097 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(165306 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+45:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43,46,50,54 row-size=124B cardinality=1
+|  in pipelines: 02(GETNEXT), 30(OPEN)
+|
+|--30:AGGREGATE [FINALIZE]
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=54 row-size=8B cardinality=1
+|  |  in pipelines: 30(GETNEXT), 29(OPEN)
+|  |
+|  29:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=52 row-size=8B cardinality=288.04K
+|     in pipelines: 29(GETNEXT)
+|
+44:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43,46,50 row-size=116B cardinality=1
+|  in pipelines: 02(GETNEXT), 28(OPEN)
+|
+|--28:AGGREGATE [FINALIZE]
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=50 row-size=8B cardinality=1
+|  |  in pipelines: 28(GETNEXT), 27(OPEN)
+|  |
+|  27:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=48 row-size=8B cardinality=288.04K
+|     in pipelines: 27(GETNEXT)
+|
+43:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43,46 row-size=108B cardinality=1
+|  in pipelines: 02(GETNEXT), 26(OPEN)
+|
+|--26:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 26(GETNEXT), 25(OPEN)
+|  |
+|  25:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=45 row-size=4B cardinality=288.04K
+|     in pipelines: 25(GETNEXT)
+|
+42:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43 row-size=100B cardinality=1
+|  in pipelines: 02(GETNEXT), 24(OPEN)
+|
+|--24:AGGREGATE [FINALIZE]
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=43 row-size=8B cardinality=1
+|  |  in pipelines: 24(GETNEXT), 23(OPEN)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=41 row-size=8B cardinality=288.04K
+|     in pipelines: 23(GETNEXT)
+|
+41:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39 row-size=92B cardinality=1
+|  in pipelines: 02(GETNEXT), 22(OPEN)
+|
+|--22:AGGREGATE [FINALIZE]
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=39 row-size=8B cardinality=1
+|  |  in pipelines: 22(GETNEXT), 21(OPEN)
+|  |
+|  21:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=37 row-size=8B cardinality=288.04K
+|     in pipelines: 21(GETNEXT)
+|
+40:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35 row-size=84B cardinality=1
+|  in pipelines: 02(GETNEXT), 20(OPEN)
+|
+|--20:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=35 row-size=8B cardinality=1
+|  |  in pipelines: 20(GETNEXT), 19(OPEN)
+|  |
+|  19:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=34 row-size=4B cardinality=288.04K
+|     in pipelines: 19(GETNEXT)
+|
+39:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32 row-size=76B cardinality=1
+|  in pipelines: 02(GETNEXT), 18(OPEN)
+|
+|--18:AGGREGATE [FINALIZE]
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=32 row-size=8B cardinality=1
+|  |  in pipelines: 18(GETNEXT), 17(OPEN)
+|  |
+|  17:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=30 row-size=8B cardinality=288.04K
+|     in pipelines: 17(GETNEXT)
+|
+38:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28 row-size=68B cardinality=1
+|  in pipelines: 02(GETNEXT), 16(OPEN)
+|
+|--16:AGGREGATE [FINALIZE]
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |
+|  15:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=26 row-size=8B cardinality=288.04K
+|     in pipelines: 15(GETNEXT)
+|
+37:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24 row-size=60B cardinality=1
+|  in pipelines: 02(GETNEXT), 14(OPEN)
+|
+|--14:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=24 row-size=8B cardinality=1
+|  |  in pipelines: 14(GETNEXT), 13(OPEN)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=23 row-size=4B cardinality=288.04K
+|     in pipelines: 13(GETNEXT)
+|
+36:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21 row-size=52B cardinality=1
+|  in pipelines: 02(GETNEXT), 12(OPEN)
+|
+|--12:AGGREGATE [FINALIZE]
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=21 row-size=8B cardinality=1
+|  |  in pipelines: 12(GETNEXT), 11(OPEN)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=19 row-size=8B cardinality=288.04K
+|     in pipelines: 11(GETNEXT)
+|
+35:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17 row-size=44B cardinality=1
+|  in pipelines: 02(GETNEXT), 10(OPEN)
+|
+|--10:AGGREGATE [FINALIZE]
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=1
+|  |  in pipelines: 10(GETNEXT), 09(OPEN)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=15 row-size=8B cardinality=288.04K
+|     in pipelines: 09(GETNEXT)
+|
+34:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13 row-size=36B cardinality=1
+|  in pipelines: 02(GETNEXT), 08(OPEN)
+|
+|--08:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=8B cardinality=1
+|  |  in pipelines: 08(GETNEXT), 07(OPEN)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=12 row-size=4B cardinality=288.04K
+|     in pipelines: 07(GETNEXT)
+|
+33:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10 row-size=28B cardinality=1
+|  in pipelines: 02(GETNEXT), 06(OPEN)
+|
+|--06:AGGREGATE [FINALIZE]
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 06(GETNEXT), 05(OPEN)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=8 row-size=8B cardinality=288.04K
+|     in pipelines: 05(GETNEXT)
+|
+32:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6 row-size=20B cardinality=1
+|  in pipelines: 02(GETNEXT), 04(OPEN)
+|
+|--04:AGGREGATE [FINALIZE]
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=6 row-size=8B cardinality=1
+|  |  in pipelines: 04(GETNEXT), 03(OPEN)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=8B cardinality=288.04K
+|     in pipelines: 03(GETNEXT)
+|
+31:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=4B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0 row-size=12B cardinality=1
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.reason]
+|     HDFS partitions=1/1 files=1 size=1.92KB
+|     predicates: r_reason_sk = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=35 size=1.92KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=35
+|     parquet statistics predicates: r_reason_sk = CAST(1 AS INT)
+|     parquet dictionary predicates: r_reason_sk = CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|     tuple-ids=0 row-size=4B cardinality=1
+|     in pipelines: 00(GETNEXT)
+|
+02:AGGREGATE [FINALIZE]
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=2 row-size=8B cardinality=1
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+   parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+   mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+   tuple-ids=1 row-size=4B cardinality=288.04K
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=10.63MB Threads=47
+Per-Host Resource Estimates: Memory=716MB
+F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.25MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CASE WHEN count(*) > CAST(74129 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(122840 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(56580 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(10097 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(165306 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+45:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43,46,50,54 row-size=124B cardinality=1
+|  in pipelines: 47(GETNEXT), 89(OPEN)
+|
+|--90:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54 row-size=8B cardinality=1
+|  |  in pipelines: 89(GETNEXT)
+|  |
+|  F30:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  89:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=54 row-size=8B cardinality=1
+|  |  in pipelines: 89(GETNEXT), 30(OPEN)
+|  |
+|  88:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=53 row-size=8B cardinality=1
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F29:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=1.00MB thread-reservation=2
+|  30:AGGREGATE
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=53 row-size=8B cardinality=1
+|  |  in pipelines: 30(GETNEXT), 29(OPEN)
+|  |
+|  29:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=52 row-size=8B cardinality=288.04K
+|     in pipelines: 29(GETNEXT)
+|
+44:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43,46,50 row-size=116B cardinality=1
+|  in pipelines: 47(GETNEXT), 86(OPEN)
+|
+|--87:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=50 row-size=8B cardinality=1
+|  |  in pipelines: 86(GETNEXT)
+|  |
+|  F28:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  86:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=50 row-size=8B cardinality=1
+|  |  in pipelines: 86(GETNEXT), 28(OPEN)
+|  |
+|  85:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=49 row-size=8B cardinality=1
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  F27:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=1.00MB thread-reservation=2
+|  28:AGGREGATE
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=49 row-size=8B cardinality=1
+|  |  in pipelines: 28(GETNEXT), 27(OPEN)
+|  |
+|  27:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=48 row-size=8B cardinality=288.04K
+|     in pipelines: 27(GETNEXT)
+|
+43:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43,46 row-size=108B cardinality=1
+|  in pipelines: 47(GETNEXT), 83(OPEN)
+|
+|--84:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 83(GETNEXT)
+|  |
+|  F26:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  83:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 83(GETNEXT), 26(OPEN)
+|  |
+|  82:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 26(GETNEXT)
+|  |
+|  F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=26.00MB mem-reservation=128.00KB thread-reservation=2
+|  26:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 26(GETNEXT), 25(OPEN)
+|  |
+|  25:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=45 row-size=4B cardinality=288.04K
+|     in pipelines: 25(GETNEXT)
+|
+42:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43 row-size=100B cardinality=1
+|  in pipelines: 47(GETNEXT), 80(OPEN)
+|
+|--81:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=43 row-size=8B cardinality=1
+|  |  in pipelines: 80(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  80:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=43 row-size=8B cardinality=1
+|  |  in pipelines: 80(GETNEXT), 24(OPEN)
+|  |
+|  79:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=42 row-size=8B cardinality=1
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=1.00MB thread-reservation=2
+|  24:AGGREGATE
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=42 row-size=8B cardinality=1
+|  |  in pipelines: 24(GETNEXT), 23(OPEN)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=41 row-size=8B cardinality=288.04K
+|     in pipelines: 23(GETNEXT)
+|
+41:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39 row-size=92B cardinality=1
+|  in pipelines: 47(GETNEXT), 77(OPEN)
+|
+|--78:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=39 row-size=8B cardinality=1
+|  |  in pipelines: 77(GETNEXT)
+|  |
+|  F22:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  77:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=39 row-size=8B cardinality=1
+|  |  in pipelines: 77(GETNEXT), 22(OPEN)
+|  |
+|  76:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=8B cardinality=1
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F21:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=1.00MB thread-reservation=2
+|  22:AGGREGATE
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=38 row-size=8B cardinality=1
+|  |  in pipelines: 22(GETNEXT), 21(OPEN)
+|  |
+|  21:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=37 row-size=8B cardinality=288.04K
+|     in pipelines: 21(GETNEXT)
+|
+40:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35 row-size=84B cardinality=1
+|  in pipelines: 47(GETNEXT), 74(OPEN)
+|
+|--75:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=35 row-size=8B cardinality=1
+|  |  in pipelines: 74(GETNEXT)
+|  |
+|  F20:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  74:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=35 row-size=8B cardinality=1
+|  |  in pipelines: 74(GETNEXT), 20(OPEN)
+|  |
+|  73:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=35 row-size=8B cardinality=1
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  F19:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=26.00MB mem-reservation=128.00KB thread-reservation=2
+|  20:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=35 row-size=8B cardinality=1
+|  |  in pipelines: 20(GETNEXT), 19(OPEN)
+|  |
+|  19:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=34 row-size=4B cardinality=288.04K
+|     in pipelines: 19(GETNEXT)
+|
+39:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32 row-size=76B cardinality=1
+|  in pipelines: 47(GETNEXT), 71(OPEN)
+|
+|--72:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=32 row-size=8B cardinality=1
+|  |  in pipelines: 71(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  71:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=32 row-size=8B cardinality=1
+|  |  in pipelines: 71(GETNEXT), 18(OPEN)
+|  |
+|  70:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=31 row-size=8B cardinality=1
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=1.00MB thread-reservation=2
+|  18:AGGREGATE
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=31 row-size=8B cardinality=1
+|  |  in pipelines: 18(GETNEXT), 17(OPEN)
+|  |
+|  17:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=30 row-size=8B cardinality=288.04K
+|     in pipelines: 17(GETNEXT)
+|
+38:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28 row-size=68B cardinality=1
+|  in pipelines: 47(GETNEXT), 68(OPEN)
+|
+|--69:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 68(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  68:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 68(GETNEXT), 16(OPEN)
+|  |
+|  67:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=27 row-size=8B cardinality=1
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=1.00MB thread-reservation=2
+|  16:AGGREGATE
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=27 row-size=8B cardinality=1
+|  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |
+|  15:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=26 row-size=8B cardinality=288.04K
+|     in pipelines: 15(GETNEXT)
+|
+37:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24 row-size=60B cardinality=1
+|  in pipelines: 47(GETNEXT), 65(OPEN)
+|
+|--66:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=24 row-size=8B cardinality=1
+|  |  in pipelines: 65(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  65:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=24 row-size=8B cardinality=1
+|  |  in pipelines: 65(GETNEXT), 14(OPEN)
+|  |
+|  64:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=24 row-size=8B cardinality=1
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=26.00MB mem-reservation=128.00KB thread-reservation=2
+|  14:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=24 row-size=8B cardinality=1
+|  |  in pipelines: 14(GETNEXT), 13(OPEN)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=23 row-size=4B cardinality=288.04K
+|     in pipelines: 13(GETNEXT)
+|
+36:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21 row-size=52B cardinality=1
+|  in pipelines: 47(GETNEXT), 62(OPEN)
+|
+|--63:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=21 row-size=8B cardinality=1
+|  |  in pipelines: 62(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  62:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=21 row-size=8B cardinality=1
+|  |  in pipelines: 62(GETNEXT), 12(OPEN)
+|  |
+|  61:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=8B cardinality=1
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=1.00MB thread-reservation=2
+|  12:AGGREGATE
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=8B cardinality=1
+|  |  in pipelines: 12(GETNEXT), 11(OPEN)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=19 row-size=8B cardinality=288.04K
+|     in pipelines: 11(GETNEXT)
+|
+35:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17 row-size=44B cardinality=1
+|  in pipelines: 47(GETNEXT), 59(OPEN)
+|
+|--60:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=1
+|  |  in pipelines: 59(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  59:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=1
+|  |  in pipelines: 59(GETNEXT), 10(OPEN)
+|  |
+|  58:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=1.00MB thread-reservation=2
+|  10:AGGREGATE
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 10(GETNEXT), 09(OPEN)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=15 row-size=8B cardinality=288.04K
+|     in pipelines: 09(GETNEXT)
+|
+34:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13 row-size=36B cardinality=1
+|  in pipelines: 47(GETNEXT), 56(OPEN)
+|
+|--57:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=8B cardinality=1
+|  |  in pipelines: 56(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  56:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=8B cardinality=1
+|  |  in pipelines: 56(GETNEXT), 08(OPEN)
+|  |
+|  55:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=8B cardinality=1
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=26.00MB mem-reservation=128.00KB thread-reservation=2
+|  08:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=8B cardinality=1
+|  |  in pipelines: 08(GETNEXT), 07(OPEN)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=12 row-size=4B cardinality=288.04K
+|     in pipelines: 07(GETNEXT)
+|
+33:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10 row-size=28B cardinality=1
+|  in pipelines: 47(GETNEXT), 53(OPEN)
+|
+|--54:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 53(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  53:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 53(GETNEXT), 06(OPEN)
+|  |
+|  52:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=8B cardinality=1
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=1.00MB thread-reservation=2
+|  06:AGGREGATE
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=9 row-size=8B cardinality=1
+|  |  in pipelines: 06(GETNEXT), 05(OPEN)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=8 row-size=8B cardinality=288.04K
+|     in pipelines: 05(GETNEXT)
+|
+32:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6 row-size=20B cardinality=1
+|  in pipelines: 47(GETNEXT), 50(OPEN)
+|
+|--51:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=8B cardinality=1
+|  |  in pipelines: 50(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  50:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=6 row-size=8B cardinality=1
+|  |  in pipelines: 50(GETNEXT), 04(OPEN)
+|  |
+|  49:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=1
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=1.00MB thread-reservation=2
+|  04:AGGREGATE
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=1
+|  |  in pipelines: 04(GETNEXT), 03(OPEN)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=8B cardinality=288.04K
+|     in pipelines: 03(GETNEXT)
+|
+31:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=4B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0 row-size=12B cardinality=1
+|  in pipelines: 47(GETNEXT), 00(OPEN)
+|
+|--48:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=4B cardinality=1
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.reason, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.92KB
+|     predicates: r_reason_sk = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=35 size=1.92KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=35
+|     parquet statistics predicates: r_reason_sk = CAST(1 AS INT)
+|     parquet dictionary predicates: r_reason_sk = CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|     tuple-ids=0 row-size=4B cardinality=1
+|     in pipelines: 00(GETNEXT)
+|
+47:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=2 row-size=8B cardinality=1
+|  in pipelines: 47(GETNEXT), 02(OPEN)
+|
+46:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2 row-size=8B cardinality=1
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=26.00MB mem-reservation=128.00KB thread-reservation=2
+02:AGGREGATE
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=2 row-size=8B cardinality=1
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+   parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+   mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=1
+   tuple-ids=1 row-size=4B cardinality=288.04K
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=21.26MB Threads=61
+Per-Host Resource Estimates: Memory=946MB
+F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CASE WHEN count(*) > CAST(74129 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(122840 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(56580 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(10097 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END, CASE WHEN count(*) > CAST(165306 AS BIGINT) THEN avg(ss_ext_discount_amt) ELSE avg(ss_net_profit) END
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+45:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 00
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43,46,50,54 row-size=124B cardinality=1
+|  in pipelines: 47(GETNEXT), 89(OPEN)
+|
+|--F31:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  90:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54 row-size=8B cardinality=1
+|  |  in pipelines: 89(GETNEXT)
+|  |
+|  F30:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  89:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=54 row-size=8B cardinality=1
+|  |  in pipelines: 89(GETNEXT), 30(OPEN)
+|  |
+|  88:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=53 row-size=8B cardinality=1
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F29:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  30:AGGREGATE
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=53 row-size=8B cardinality=1
+|  |  in pipelines: 30(GETNEXT), 29(OPEN)
+|  |
+|  29:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=52 row-size=8B cardinality=288.04K
+|     in pipelines: 29(GETNEXT)
+|
+44:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 01
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43,46,50 row-size=116B cardinality=1
+|  in pipelines: 47(GETNEXT), 86(OPEN)
+|
+|--F32:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  87:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=50 row-size=8B cardinality=1
+|  |  in pipelines: 86(GETNEXT)
+|  |
+|  F28:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  86:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=50 row-size=8B cardinality=1
+|  |  in pipelines: 86(GETNEXT), 28(OPEN)
+|  |
+|  85:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=49 row-size=8B cardinality=1
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  F27:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  28:AGGREGATE
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=49 row-size=8B cardinality=1
+|  |  in pipelines: 28(GETNEXT), 27(OPEN)
+|  |
+|  27:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=48 row-size=8B cardinality=288.04K
+|     in pipelines: 27(GETNEXT)
+|
+43:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 02
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43,46 row-size=108B cardinality=1
+|  in pipelines: 47(GETNEXT), 83(OPEN)
+|
+|--F33:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  84:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 83(GETNEXT)
+|  |
+|  F26:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  83:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 83(GETNEXT), 26(OPEN)
+|  |
+|  82:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 26(GETNEXT)
+|  |
+|  F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=128.00KB thread-reservation=1
+|  26:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 26(GETNEXT), 25(OPEN)
+|  |
+|  25:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(100 AS INT), ss_quantity >= CAST(81 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=0
+|     tuple-ids=45 row-size=4B cardinality=288.04K
+|     in pipelines: 25(GETNEXT)
+|
+42:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 03
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39,43 row-size=100B cardinality=1
+|  in pipelines: 47(GETNEXT), 80(OPEN)
+|
+|--F34:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  81:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=43 row-size=8B cardinality=1
+|  |  in pipelines: 80(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  80:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=43 row-size=8B cardinality=1
+|  |  in pipelines: 80(GETNEXT), 24(OPEN)
+|  |
+|  79:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=42 row-size=8B cardinality=1
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  24:AGGREGATE
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=42 row-size=8B cardinality=1
+|  |  in pipelines: 24(GETNEXT), 23(OPEN)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=41 row-size=8B cardinality=288.04K
+|     in pipelines: 23(GETNEXT)
+|
+41:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 04
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35,39 row-size=92B cardinality=1
+|  in pipelines: 47(GETNEXT), 77(OPEN)
+|
+|--F35:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  78:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=39 row-size=8B cardinality=1
+|  |  in pipelines: 77(GETNEXT)
+|  |
+|  F22:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  77:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=39 row-size=8B cardinality=1
+|  |  in pipelines: 77(GETNEXT), 22(OPEN)
+|  |
+|  76:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=8B cardinality=1
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F21:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  22:AGGREGATE
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=38 row-size=8B cardinality=1
+|  |  in pipelines: 22(GETNEXT), 21(OPEN)
+|  |
+|  21:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=37 row-size=8B cardinality=288.04K
+|     in pipelines: 21(GETNEXT)
+|
+40:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 05
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32,35 row-size=84B cardinality=1
+|  in pipelines: 47(GETNEXT), 74(OPEN)
+|
+|--F36:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  75:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=35 row-size=8B cardinality=1
+|  |  in pipelines: 74(GETNEXT)
+|  |
+|  F20:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  74:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=35 row-size=8B cardinality=1
+|  |  in pipelines: 74(GETNEXT), 20(OPEN)
+|  |
+|  73:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=35 row-size=8B cardinality=1
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  F19:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=128.00KB thread-reservation=1
+|  20:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=35 row-size=8B cardinality=1
+|  |  in pipelines: 20(GETNEXT), 19(OPEN)
+|  |
+|  19:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(80 AS INT), ss_quantity >= CAST(61 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=0
+|     tuple-ids=34 row-size=4B cardinality=288.04K
+|     in pipelines: 19(GETNEXT)
+|
+39:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 06
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28,32 row-size=76B cardinality=1
+|  in pipelines: 47(GETNEXT), 71(OPEN)
+|
+|--F37:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  72:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=32 row-size=8B cardinality=1
+|  |  in pipelines: 71(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  71:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=32 row-size=8B cardinality=1
+|  |  in pipelines: 71(GETNEXT), 18(OPEN)
+|  |
+|  70:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=31 row-size=8B cardinality=1
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  18:AGGREGATE
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=31 row-size=8B cardinality=1
+|  |  in pipelines: 18(GETNEXT), 17(OPEN)
+|  |
+|  17:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=30 row-size=8B cardinality=288.04K
+|     in pipelines: 17(GETNEXT)
+|
+38:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 07
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24,28 row-size=68B cardinality=1
+|  in pipelines: 47(GETNEXT), 68(OPEN)
+|
+|--F38:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=07 plan-id=08 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  69:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 68(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  68:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 68(GETNEXT), 16(OPEN)
+|  |
+|  67:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=27 row-size=8B cardinality=1
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  16:AGGREGATE
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=27 row-size=8B cardinality=1
+|  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |
+|  15:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=26 row-size=8B cardinality=288.04K
+|     in pipelines: 15(GETNEXT)
+|
+37:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 08
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21,24 row-size=60B cardinality=1
+|  in pipelines: 47(GETNEXT), 65(OPEN)
+|
+|--F39:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=08 plan-id=09 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  66:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=24 row-size=8B cardinality=1
+|  |  in pipelines: 65(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  65:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=24 row-size=8B cardinality=1
+|  |  in pipelines: 65(GETNEXT), 14(OPEN)
+|  |
+|  64:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=24 row-size=8B cardinality=1
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=128.00KB thread-reservation=1
+|  14:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=24 row-size=8B cardinality=1
+|  |  in pipelines: 14(GETNEXT), 13(OPEN)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(60 AS INT), ss_quantity >= CAST(41 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=0
+|     tuple-ids=23 row-size=4B cardinality=288.04K
+|     in pipelines: 13(GETNEXT)
+|
+36:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 09
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17,21 row-size=52B cardinality=1
+|  in pipelines: 47(GETNEXT), 62(OPEN)
+|
+|--F40:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  63:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=21 row-size=8B cardinality=1
+|  |  in pipelines: 62(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  62:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=21 row-size=8B cardinality=1
+|  |  in pipelines: 62(GETNEXT), 12(OPEN)
+|  |
+|  61:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=8B cardinality=1
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  12:AGGREGATE
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=8B cardinality=1
+|  |  in pipelines: 12(GETNEXT), 11(OPEN)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=19 row-size=8B cardinality=288.04K
+|     in pipelines: 11(GETNEXT)
+|
+35:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 10
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13,17 row-size=44B cardinality=1
+|  in pipelines: 47(GETNEXT), 59(OPEN)
+|
+|--F41:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  60:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=1
+|  |  in pipelines: 59(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  59:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=1
+|  |  in pipelines: 59(GETNEXT), 10(OPEN)
+|  |
+|  58:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  10:AGGREGATE
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 10(GETNEXT), 09(OPEN)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=15 row-size=8B cardinality=288.04K
+|     in pipelines: 09(GETNEXT)
+|
+34:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 11
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10,13 row-size=36B cardinality=1
+|  in pipelines: 47(GETNEXT), 56(OPEN)
+|
+|--F42:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=11 plan-id=12 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  57:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=8B cardinality=1
+|  |  in pipelines: 56(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  56:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=8B cardinality=1
+|  |  in pipelines: 56(GETNEXT), 08(OPEN)
+|  |
+|  55:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=8B cardinality=1
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=128.00KB thread-reservation=1
+|  08:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=8B cardinality=1
+|  |  in pipelines: 08(GETNEXT), 07(OPEN)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(40 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=0
+|     tuple-ids=12 row-size=4B cardinality=288.04K
+|     in pipelines: 07(GETNEXT)
+|
+33:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 12
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6,10 row-size=28B cardinality=1
+|  in pipelines: 47(GETNEXT), 53(OPEN)
+|
+|--F43:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=12 plan-id=13 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  54:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 53(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  53:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 53(GETNEXT), 06(OPEN)
+|  |
+|  52:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=8B cardinality=1
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  06:AGGREGATE
+|  |  output: avg(ss_net_profit)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=9 row-size=8B cardinality=1
+|  |  in pipelines: 06(GETNEXT), 05(OPEN)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=8 row-size=8B cardinality=288.04K
+|     in pipelines: 05(GETNEXT)
+|
+32:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 13
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,6 row-size=20B cardinality=1
+|  in pipelines: 47(GETNEXT), 50(OPEN)
+|
+|--F44:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=13 plan-id=14 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  51:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=8B cardinality=1
+|  |  in pipelines: 50(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  50:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=6 row-size=8B cardinality=1
+|  |  in pipelines: 50(GETNEXT), 04(OPEN)
+|  |
+|  49:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=1
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  04:AGGREGATE
+|  |  output: avg(ss_ext_discount_amt)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=1
+|  |  in pipelines: 04(GETNEXT), 03(OPEN)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=4 row-size=8B cardinality=288.04K
+|     in pipelines: 03(GETNEXT)
+|
+31:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 14
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0 row-size=12B cardinality=1
+|  in pipelines: 47(GETNEXT), 00(OPEN)
+|
+|--F45:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=14 plan-id=15 cohort-id=01
+|  |  mem-estimate=4B mem-reservation=0B thread-reservation=0
+|  |
+|  48:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=4B cardinality=1
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.reason, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.92KB
+|     predicates: r_reason_sk = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=35 size=1.92KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=35
+|     parquet statistics predicates: r_reason_sk = CAST(1 AS INT)
+|     parquet dictionary predicates: r_reason_sk = CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=0
+|     tuple-ids=0 row-size=4B cardinality=1
+|     in pipelines: 00(GETNEXT)
+|
+47:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=2 row-size=8B cardinality=1
+|  in pipelines: 47(GETNEXT), 02(OPEN)
+|
+46:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2 row-size=8B cardinality=1
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=128.00KB thread-reservation=1
+02:AGGREGATE
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=2 row-size=8B cardinality=1
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+   parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(1 AS INT)
+   mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=0
+   tuple-ids=1 row-size=4B cardinality=288.04K
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q10a.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q10a.test
new file mode 100644
index 0000000..a55b4cc
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q10a.test
@@ -0,0 +1,843 @@
+# TPCDS-Q10a Variant for multiple subqueries in OR predicate
+select
+  cd_gender,
+  cd_marital_status,
+  cd_education_status,
+  count(*) cnt1,
+  cd_purchase_estimate,
+  count(*) cnt2,
+  cd_credit_rating,
+  count(*) cnt3,
+  cd_dep_count,
+  count(*) cnt4,
+  cd_dep_employed_count,
+  count(*) cnt5,
+  cd_dep_college_count,
+  count(*) cnt6
+ from
+  customer c,customer_address ca,customer_demographics
+ where
+  c.c_current_addr_sk = ca.ca_address_sk and
+  ca_county in ('Rush County','Toole County','Jefferson County','Dona Ana County','La Porte County') and
+  cd_demo_sk = c.c_current_cdemo_sk and
+  exists (select *
+          from store_sales,date_dim
+          where c.c_customer_sk = ss_customer_sk and
+                ss_sold_date_sk = d_date_sk and
+                d_year = 2002 and
+                d_moy between 1 and 1+3) and
+   exists (select *
+          from (
+             select ws_bill_customer_sk as customer_sk, d_year,d_moy
+             from web_sales, date_dim
+             where ws_sold_date_sk = d_date_sk and
+             d_year = 2002 and
+             d_moy between 1 and 1+3
+             union all
+             select cs_ship_customer_sk as customer_sk, d_year, d_moy
+             from catalog_sales, date_dim
+             where cs_sold_date_sk = d_date_sk and
+             d_year = 2002 and
+             d_moy between 1 and 1+3
+       ) x
+            where c.c_customer_sk = customer_sk)
+ group by cd_gender,
+          cd_marital_status,
+          cd_education_status,
+          cd_purchase_estimate,
+          cd_credit_rating,
+          cd_dep_count,
+          cd_dep_employed_count,
+          cd_dep_college_count
+ order by cd_gender,
+          cd_marital_status,
+          cd_education_status,
+          cd_purchase_estimate,
+          cd_credit_rating,
+          cd_dep_count,
+          cd_dep_employed_count,
+          cd_dep_college_count
+limit 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=31.69MB Threads=8
+Per-Host Resource Estimates: Memory=432MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=431.69MB mem-reservation=31.69MB thread-reservation=8 runtime-filters-memory=7.00MB
+PLAN-ROOT SINK
+|  output exprs: cd_gender, cd_marital_status, cd_education_status, count(*), cd_purchase_estimate, count(*), cd_credit_rating, count(*), cd_dep_count, count(*), cd_dep_employed_count, count(*), cd_dep_college_count, count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:TOP-N [LIMIT=100]
+|  order by: cd_gender ASC, cd_marital_status ASC, cd_education_status ASC, cd_purchase_estimate ASC, cd_credit_rating ASC, cd_dep_count ASC, cd_dep_employed_count ASC, cd_dep_college_count ASC
+|  mem-estimate=8.85KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=91B cardinality=100
+|  in pipelines: 18(GETNEXT), 17(OPEN)
+|
+17:AGGREGATE [FINALIZE]
+|  output: count(*)
+|  group by: cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating, cd_dep_count, cd_dep_employed_count, cd_dep_college_count
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=91B cardinality=318
+|  in pipelines: 17(GETNEXT), 07(OPEN), 10(OPEN)
+|
+16:HASH JOIN [RIGHT SEMI JOIN]
+|  hash predicates: customer_sk = c.c_customer_sk
+|  runtime filters: RF000[bloom] <- c.c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=129B cardinality=318
+|  in pipelines: 07(GETNEXT), 10(GETNEXT), 03(OPEN)
+|
+|--15:HASH JOIN [RIGHT SEMI JOIN]
+|  |  hash predicates: ss_customer_sk = c.c_customer_sk
+|  |  runtime filters: RF006[bloom] <- c.c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=129B cardinality=318
+|  |  in pipelines: 03(GETNEXT), 02(OPEN)
+|  |
+|  |--14:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  fk/pk conjuncts: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  runtime filters: RF010[bloom] <- ca.ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=129B cardinality=318
+|  |  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--01:SCAN HDFS [tpcds_parquet.customer_address ca]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_county IN ('Rush County', 'Toole County', 'Jefferson County', 'Dona Ana County', 'La Porte County')
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_county IN ('Rush County', 'Toole County', 'Jefferson County', 'Dona Ana County', 'La Porte County')
+|  |  |     parquet dictionary predicates: ca_county IN ('Rush County', 'Toole County', 'Jefferson County', 'Dona Ana County', 'La Porte County')
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=30B cardinality=137
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cd_demo_sk = c.c_current_cdemo_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  runtime filters: RF012[bloom] <- c.c_current_cdemo_sk
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0 row-size=99B cardinality=100.00K
+|  |  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--00:SCAN HDFS [tpcds_parquet.customer c]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     runtime filters: RF010[bloom] -> c.c_current_addr_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  02:SCAN HDFS [tpcds_parquet.customer_demographics]
+|  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |     runtime filters: RF012[bloom] -> cd_demo_sk
+|  |     stored statistics:
+|  |       table: rows=1.92M size=7.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=2 row-size=87B cardinality=1.92M
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |
+|  |--04:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=12B cardinality=118
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_customer_sk, RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=2.88M
+|     in pipelines: 03(GETNEXT)
+|
+06:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=4B cardinality=140.03K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+|--12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=20B cardinality=93.21K
+|  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |
+|  |--11:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=12B cardinality=118
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_ship_customer_sk, RF004[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=8 row-size=8B cardinality=1.44M
+|     in pipelines: 10(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,7 row-size=20B cardinality=46.82K
+|  in pipelines: 07(GETNEXT), 08(OPEN)
+|
+|--08:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=7 row-size=12B cardinality=118
+|     in pipelines: 08(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.web_sales]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.web_sales.ws_bill_customer_sk, RF002[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=6 row-size=8B cardinality=719.38K
+   in pipelines: 07(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=43.00MB Threads=19
+Per-Host Resource Estimates: Memory=509MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=18.08KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: cd_gender, cd_marital_status, cd_education_status, count(*), cd_purchase_estimate, count(*), cd_credit_rating, count(*), cd_dep_count, count(*), cd_dep_employed_count, count(*), cd_dep_college_count, count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+29:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: cd_gender ASC, cd_marital_status ASC, cd_education_status ASC, cd_purchase_estimate ASC, cd_credit_rating ASC, cd_dep_count ASC, cd_dep_employed_count ASC, cd_dep_college_count ASC
+|  limit: 100
+|  mem-estimate=18.08KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=91B cardinality=100
+|  in pipelines: 18(GETNEXT)
+|
+F11:PLAN FRAGMENT [HASH(cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=10.06MB mem-reservation=1.94MB thread-reservation=1
+18:TOP-N [LIMIT=100]
+|  order by: cd_gender ASC, cd_marital_status ASC, cd_education_status ASC, cd_purchase_estimate ASC, cd_credit_rating ASC, cd_dep_count ASC, cd_dep_employed_count ASC, cd_dep_college_count ASC
+|  mem-estimate=8.85KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=91B cardinality=100
+|  in pipelines: 18(GETNEXT), 28(OPEN)
+|
+28:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating, cd_dep_count, cd_dep_employed_count, cd_dep_college_count
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=91B cardinality=318
+|  in pipelines: 28(GETNEXT), 07(OPEN), 10(OPEN)
+|
+27:EXCHANGE [HASH(cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count)]
+|  mem-estimate=57.50KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=91B cardinality=318
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=17.34MB mem-reservation=7.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+17:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating, cd_dep_count, cd_dep_employed_count, cd_dep_college_count
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=91B cardinality=318
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+16:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash predicates: customer_sk = c.c_customer_sk
+|  runtime filters: RF000[bloom] <- c.c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=129B cardinality=318
+|  in pipelines: 07(GETNEXT), 10(GETNEXT), 03(OPEN)
+|
+|--15:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  |  hash predicates: ss_customer_sk = c.c_customer_sk
+|  |  runtime filters: RF006[bloom] <- c.c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=129B cardinality=318
+|  |  in pipelines: 03(GETNEXT), 02(OPEN)
+|  |
+|  |--25:EXCHANGE [HASH(c.c_customer_sk)]
+|  |  |  mem-estimate=83.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=129B cardinality=318
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=135.99MB mem-reservation=14.81MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  fk/pk conjuncts: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  runtime filters: RF010[bloom] <- ca.ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=129B cardinality=318
+|  |  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--23:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=1 row-size=30B cardinality=137
+|  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  01:SCAN HDFS [tpcds_parquet.customer_address ca, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_county IN ('Rush County', 'Toole County', 'Jefferson County', 'Dona Ana County', 'La Porte County')
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_county IN ('Rush County', 'Toole County', 'Jefferson County', 'Dona Ana County', 'La Porte County')
+|  |  |     parquet dictionary predicates: ca_county IN ('Rush County', 'Toole County', 'Jefferson County', 'Dona Ana County', 'La Porte County')
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=30B cardinality=137
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: cd_demo_sk = c.c_current_cdemo_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  runtime filters: RF012[bloom] <- c.c_current_cdemo_sk
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0 row-size=99B cardinality=100.00K
+|  |  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--22:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.16MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |  |  in pipelines: 00(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=49.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  |  00:SCAN HDFS [tpcds_parquet.customer c, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     runtime filters: RF010[bloom] -> c.c_current_addr_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  02:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |     runtime filters: RF012[bloom] -> cd_demo_sk
+|  |     stored statistics:
+|  |       table: rows=1.92M size=7.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=2 row-size=87B cardinality=1.92M
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  24:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=1.27MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=19.95MB mem-reservation=4.44MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |
+|  |--21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=12B cardinality=118
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=12B cardinality=118
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_customer_sk, RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=2.88M
+|     in pipelines: 03(GETNEXT)
+|
+26:EXCHANGE [HASH(customer_sk)]
+|  mem-estimate=206.33KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=4B cardinality=140.03K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+F04:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=100.95MB mem-reservation=8.94MB thread-reservation=2 runtime-filters-memory=3.00MB
+06:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=4B cardinality=140.03K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+|--12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=20B cardinality=93.21K
+|  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |
+|  |--20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=12B cardinality=118
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  11:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=12B cardinality=118
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_ship_customer_sk, RF004[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=8 row-size=8B cardinality=1.44M
+|     in pipelines: 10(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,7 row-size=20B cardinality=46.82K
+|  in pipelines: 07(GETNEXT), 08(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=12B cardinality=118
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  08:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=7 row-size=12B cardinality=118
+|     in pipelines: 08(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.web_sales.ws_bill_customer_sk, RF002[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=6 row-size=8B cardinality=719.38K
+   in pipelines: 07(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=60.06MB Threads=19
+Per-Host Resource Estimates: Memory=238MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=18.08KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: cd_gender, cd_marital_status, cd_education_status, count(*), cd_purchase_estimate, count(*), cd_credit_rating, count(*), cd_dep_count, count(*), cd_dep_employed_count, count(*), cd_dep_college_count, count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+29:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: cd_gender ASC, cd_marital_status ASC, cd_education_status ASC, cd_purchase_estimate ASC, cd_credit_rating ASC, cd_dep_count ASC, cd_dep_employed_count ASC, cd_dep_college_count ASC
+|  limit: 100
+|  mem-estimate=18.08KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=91B cardinality=100
+|  in pipelines: 18(GETNEXT)
+|
+F11:PLAN FRAGMENT [HASH(cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=10.06MB mem-reservation=1.94MB thread-reservation=1
+18:TOP-N [LIMIT=100]
+|  order by: cd_gender ASC, cd_marital_status ASC, cd_education_status ASC, cd_purchase_estimate ASC, cd_credit_rating ASC, cd_dep_count ASC, cd_dep_employed_count ASC, cd_dep_college_count ASC
+|  mem-estimate=8.85KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=91B cardinality=100
+|  in pipelines: 18(GETNEXT), 28(OPEN)
+|
+28:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating, cd_dep_count, cd_dep_employed_count, cd_dep_college_count
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=91B cardinality=318
+|  in pipelines: 28(GETNEXT), 07(OPEN), 10(OPEN)
+|
+27:EXCHANGE [HASH(cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count)]
+|  mem-estimate=57.50KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=91B cardinality=318
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=10.20MB mem-reservation=2.00MB thread-reservation=1
+17:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating, cd_dep_count, cd_dep_employed_count, cd_dep_college_count
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=91B cardinality=318
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+16:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: customer_sk = c.c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=129B cardinality=318
+|  in pipelines: 07(GETNEXT), 10(GETNEXT), 03(OPEN)
+|
+|--F13:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.29MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: c.c_customer_sk
+|  |  runtime filters: RF000[bloom] <- c.c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  15:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: ss_customer_sk = c.c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=129B cardinality=318
+|  |  in pipelines: 03(GETNEXT), 02(OPEN)
+|  |
+|  |--F14:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=3.02MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: c.c_customer_sk
+|  |  |  runtime filters: RF006[bloom] <- c.c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  25:EXCHANGE [HASH(c.c_customer_sk)]
+|  |  |  mem-estimate=83.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=129B cardinality=318
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  fk/pk conjuncts: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=129B cardinality=318
+|  |  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: ca.ca_address_sk
+|  |  |  |  runtime filters: RF010[bloom] <- ca.ca_address_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  23:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=1 row-size=30B cardinality=137
+|  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  01:SCAN HDFS [tpcds_parquet.customer_address ca, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_county IN ('Rush County', 'Toole County', 'Jefferson County', 'Dona Ana County', 'La Porte County')
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_county IN ('Rush County', 'Toole County', 'Jefferson County', 'Dona Ana County', 'La Porte County')
+|  |  |     parquet dictionary predicates: ca_county IN ('Rush County', 'Toole County', 'Jefferson County', 'Dona Ana County', 'La Porte County')
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=1 row-size=30B cardinality=137
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=03
+|  |  |  hash predicates: cd_demo_sk = c.c_current_cdemo_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0 row-size=99B cardinality=100.00K
+|  |  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=7.91MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=03 plan-id=04 cohort-id=03
+|  |  |  |  build expressions: c.c_current_cdemo_sk
+|  |  |  |  runtime filters: RF012[bloom] <- c.c_current_cdemo_sk
+|  |  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |
+|  |  |  22:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.16MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |  |  in pipelines: 00(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  00:SCAN HDFS [tpcds_parquet.customer c, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     runtime filters: RF010[bloom] -> c.c_current_addr_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |  |     tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  02:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |     runtime filters: RF012[bloom] -> cd_demo_sk
+|  |     stored statistics:
+|  |       table: rows=1.92M size=7.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=2 row-size=87B cardinality=1.92M
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  24:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=1.35MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |
+|  |--F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=12B cardinality=118
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=4 row-size=12B cardinality=118
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_customer_sk, RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=8B cardinality=2.88M
+|     in pipelines: 03(GETNEXT)
+|
+26:EXCHANGE [HASH(customer_sk)]
+|  mem-estimate=206.33KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=4B cardinality=140.03K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+F04:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+06:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=4B cardinality=140.03K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+|--12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=20B cardinality=93.21K
+|  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |
+|  |--F19:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=12B cardinality=118
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  11:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=9 row-size=12B cardinality=118
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_ship_customer_sk, RF004[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=8 row-size=8B cardinality=1.44M
+|     in pipelines: 10(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=05
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,7 row-size=20B cardinality=46.82K
+|  in pipelines: 07(GETNEXT), 08(OPEN)
+|
+|--F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=12B cardinality=118
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  08:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_moy <= CAST(4 AS INT), d_moy >= CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=7 row-size=12B cardinality=118
+|     in pipelines: 08(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.web_sales.ws_bill_customer_sk, RF002[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=6 row-size=8B cardinality=719.38K
+   in pipelines: 07(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q11.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q11.test
new file mode 100644
index 0000000..5f6e18d
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q11.test
@@ -0,0 +1,1399 @@
+# TPCDS-Q11
+WITH year_total AS
+
+  (SELECT c_customer_id customer_id,
+          c_first_name customer_first_name,
+          c_last_name customer_last_name,
+          c_preferred_cust_flag customer_preferred_cust_flag,
+          c_birth_country customer_birth_country,
+          c_login customer_login,
+          c_email_address customer_email_address,
+          d_year dyear,
+          sum(ss_ext_list_price-ss_ext_discount_amt) year_total,
+          's' sale_type
+   FROM customer,
+        store_sales,
+        date_dim
+   WHERE c_customer_sk = ss_customer_sk
+     AND ss_sold_date_sk = d_date_sk
+   GROUP BY c_customer_id,
+            c_first_name,
+            c_last_name,
+            c_preferred_cust_flag,
+            c_birth_country,
+            c_login,
+            c_email_address,
+            d_year
+   UNION ALL SELECT c_customer_id customer_id,
+                    c_first_name customer_first_name,
+                    c_last_name customer_last_name,
+                    c_preferred_cust_flag customer_preferred_cust_flag,
+                    c_birth_country customer_birth_country,
+                    c_login customer_login,
+                    c_email_address customer_email_address,
+                    d_year dyear,
+                    sum(ws_ext_list_price-ws_ext_discount_amt) year_total,
+                    'w' sale_type
+   FROM customer,
+        web_sales,
+        date_dim
+   WHERE c_customer_sk = ws_bill_customer_sk
+     AND ws_sold_date_sk = d_date_sk
+   GROUP BY c_customer_id,
+            c_first_name,
+            c_last_name,
+            c_preferred_cust_flag,
+            c_birth_country,
+            c_login,
+            c_email_address,
+            d_year)
+SELECT t_s_secyear.customer_id,
+       t_s_secyear.customer_first_name,
+       t_s_secyear.customer_last_name,
+       t_s_secyear.customer_preferred_cust_flag
+FROM year_total t_s_firstyear,
+     year_total t_s_secyear,
+     year_total t_w_firstyear,
+     year_total t_w_secyear
+WHERE t_s_secyear.customer_id = t_s_firstyear.customer_id
+  AND t_s_firstyear.customer_id = t_w_secyear.customer_id
+  AND t_s_firstyear.customer_id = t_w_firstyear.customer_id
+  AND t_s_firstyear.sale_type = 's'
+  AND t_w_firstyear.sale_type = 'w'
+  AND t_s_secyear.sale_type = 's'
+  AND t_w_secyear.sale_type = 'w'
+  AND t_s_firstyear.dyear = 2001
+  AND t_s_secyear.dyear = 2001+1
+  AND t_w_firstyear.dyear = 2001
+  AND t_w_secyear.dyear = 2001+1
+  AND t_s_firstyear.year_total > 0
+  AND t_w_firstyear.year_total > 0
+  AND CASE
+          WHEN t_w_firstyear.year_total > 0 THEN (t_w_secyear.year_total*1.0000) / t_w_firstyear.year_total
+          ELSE 0.0
+      END > CASE
+                WHEN t_s_firstyear.year_total > 0 THEN (t_s_secyear.year_total*1.0000) / t_s_firstyear.year_total
+                ELSE 0.0
+            END
+ORDER BY t_s_secyear.customer_id,
+         t_s_secyear.customer_first_name,
+         t_s_secyear.customer_last_name,
+         t_s_secyear.customer_preferred_cust_flag
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=144.56MB Threads=13
+Per-Host Resource Estimates: Memory=1.02GB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=1.02GB mem-reservation=144.56MB thread-reservation=13 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: customer_id, customer_first_name, customer_last_name, customer_preferred_cust_flag
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+31:TOP-N [LIMIT=100]
+|  order by: customer_id ASC, customer_first_name ASC, customer_last_name ASC, customer_preferred_cust_flag ASC
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=40 row-size=77B cardinality=0
+|  in pipelines: 31(GETNEXT), 06(OPEN)
+|
+30:HASH JOIN [INNER JOIN]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN (year_total * CAST(1.0000 AS DECIMAL(5,4))) / year_total ELSE CAST(0 AS DECIMAL(38,6)) END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN (year_total * CAST(1.0000 AS DECIMAL(5,4))) / year_total ELSE CAST(0 AS DECIMAL(38,6)) END
+|  runtime filters: RF000[bloom] <- customer_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8,18,28,38 row-size=225B cardinality=0
+|  in pipelines: 06(GETNEXT), 27(OPEN)
+|
+|--21:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=44B cardinality=0
+|  |  in pipelines: 27(GETNEXT)
+|  |
+|  27:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_ext_list_price - ws_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37 row-size=169B cardinality=0
+|  |  in pipelines: 27(GETNEXT), 22(OPEN)
+|  |
+|  26:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF018[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=34,35,36 row-size=177B cardinality=148.00K
+|  |  in pipelines: 22(GETNEXT), 24(OPEN)
+|  |
+|  |--24:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=36 row-size=8B cardinality=373
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  25:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = ws_bill_customer_sk
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF020[bloom] <- ws_bill_customer_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=34,35 row-size=169B cardinality=719.38K
+|  |  in pipelines: 22(GETNEXT), 23(OPEN)
+|  |
+|  |--23:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF018[bloom] -> ws_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=35 row-size=16B cardinality=719.38K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  22:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF020[bloom] -> c_customer_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=34 row-size=153B cardinality=100.00K
+|     in pipelines: 22(GETNEXT)
+|
+29:HASH JOIN [INNER JOIN]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF002[bloom] <- customer_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8,18,28 row-size=181B cardinality=0
+|  in pipelines: 06(GETNEXT), 20(OPEN)
+|
+|--14:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=44B cardinality=0
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  20:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_ext_list_price - ws_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  having: sum(ws_ext_list_price - ws_ext_discount_amt) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=27 row-size=169B cardinality=0
+|  |  in pipelines: 20(GETNEXT), 15(OPEN)
+|  |
+|  19:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,25,26 row-size=177B cardinality=148.00K
+|  |  in pipelines: 15(GETNEXT), 17(OPEN)
+|  |
+|  |--17:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=26 row-size=8B cardinality=373
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = ws_bill_customer_sk
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF016[bloom] <- ws_bill_customer_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=24,25 row-size=169B cardinality=719.38K
+|  |  in pipelines: 15(GETNEXT), 16(OPEN)
+|  |
+|  |--16:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF014[bloom] -> ws_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=25 row-size=16B cardinality=719.38K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  15:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF016[bloom] -> c_customer_sk, RF000[bloom] -> tpcds_parquet.customer.c_customer_id
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=24 row-size=153B cardinality=100.00K
+|     in pipelines: 15(GETNEXT)
+|
+28:HASH JOIN [INNER JOIN]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8,18 row-size=137B cardinality=0
+|  in pipelines: 06(GETNEXT), 13(OPEN)
+|
+|--07:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=93B cardinality=0
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  13:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_ext_list_price - ss_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=169B cardinality=0
+|  |  in pipelines: 13(GETNEXT), 08(OPEN)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = ss_customer_sk
+|  |  fk/pk conjuncts: c_customer_sk = ss_customer_sk
+|  |  runtime filters: RF010[bloom] <- ss_customer_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=10,11,12 row-size=177B cardinality=589.03K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--11:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=11,12 row-size=24B cardinality=589.03K
+|  |  |  in pipelines: 09(GETNEXT), 10(OPEN)
+|  |  |
+|  |  |--10:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=12 row-size=8B cardinality=373
+|  |  |     in pipelines: 10(GETNEXT)
+|  |  |
+|  |  09:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF012[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=16B cardinality=2.88M
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF010[bloom] -> c_customer_sk, RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=10 row-size=153B cardinality=100.00K
+|     in pipelines: 08(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=44B cardinality=0
+|  in pipelines: 06(GETNEXT)
+|
+06:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_list_price - ss_ext_discount_amt)
+|  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  having: sum(ss_ext_list_price - ss_ext_discount_amt) > CAST(0 AS DECIMAL(3,0))
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 06(GETNEXT), 01(OPEN)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: c_customer_sk = ss_customer_sk
+|  fk/pk conjuncts: c_customer_sk = ss_customer_sk
+|  runtime filters: RF006[bloom] <- ss_customer_sk
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=177B cardinality=589.03K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=24B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=8B cardinality=373
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=16B cardinality=2.88M
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.customer]
+   HDFS partitions=1/1 files=1 size=5.49MB
+   runtime filters: RF006[bloom] -> c_customer_sk, RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id
+   stored statistics:
+     table: rows=100.00K size=5.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=100.00K
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=153B cardinality=100.00K
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=155.31MB Threads=33
+Per-Host Resource Estimates: Memory=1.19GB
+F24:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=242.89KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: customer_id, customer_first_name, customer_last_name, customer_preferred_cust_flag
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+55:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: customer_id ASC, customer_first_name ASC, customer_last_name ASC, customer_preferred_cust_flag ASC
+|  limit: 100
+|  mem-estimate=242.89KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=40 row-size=77B cardinality=0
+|  in pipelines: 31(GETNEXT)
+|
+F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=18.70MB mem-reservation=9.75MB thread-reservation=1 runtime-filters-memory=2.00MB
+31:TOP-N [LIMIT=100]
+|  order by: customer_id ASC, customer_first_name ASC, customer_last_name ASC, customer_preferred_cust_flag ASC
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=40 row-size=77B cardinality=0
+|  in pipelines: 31(GETNEXT), 36(OPEN)
+|
+30:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN (year_total * CAST(1.0000 AS DECIMAL(5,4))) / year_total ELSE CAST(0 AS DECIMAL(38,6)) END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN (year_total * CAST(1.0000 AS DECIMAL(5,4))) / year_total ELSE CAST(0 AS DECIMAL(38,6)) END
+|  runtime filters: RF000[bloom] <- customer_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8,18,28,38 row-size=225B cardinality=0
+|  in pipelines: 36(GETNEXT), 53(OPEN)
+|
+|--54:EXCHANGE [BROADCAST]
+|  |  mem-estimate=48.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=44B cardinality=0
+|  |  in pipelines: 53(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.17MB mem-reservation=1.94MB thread-reservation=1
+|  21:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=44B cardinality=0
+|  |  in pipelines: 53(GETNEXT)
+|  |
+|  53:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_list_price - ws_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37 row-size=169B cardinality=0
+|  |  in pipelines: 53(GETNEXT), 23(OPEN)
+|  |
+|  52:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=173.12KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=37 row-size=169B cardinality=0
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F20:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=46.63MB mem-reservation=22.94MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  27:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_list_price - ws_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37 row-size=169B cardinality=0
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF018[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=35,34,36 row-size=177B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |
+|  |--51:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=36 row-size=8B cardinality=373
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  24:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=36 row-size=8B cardinality=373
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  25:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF020[bloom] <- c_customer_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=35,34 row-size=169B cardinality=719.38K
+|  |  in pipelines: 23(GETNEXT), 22(OPEN)
+|  |
+|  |--50:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=34 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 22(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=2
+|  |  22:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=34 row-size=153B cardinality=100.00K
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  49:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=5.53MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=35 row-size=16B cardinality=719.38K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=130.00MB mem-reservation=10.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  23:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF018[bloom] -> ws_sold_date_sk, RF020[bloom] -> ws_bill_customer_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=35 row-size=16B cardinality=719.38K
+|     in pipelines: 23(GETNEXT)
+|
+29:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF002[bloom] <- customer_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8,18,28 row-size=181B cardinality=0
+|  in pipelines: 36(GETNEXT), 47(OPEN)
+|
+|--48:EXCHANGE [BROADCAST]
+|  |  mem-estimate=48.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=44B cardinality=0
+|  |  in pipelines: 47(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.17MB mem-reservation=1.94MB thread-reservation=1
+|  14:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=44B cardinality=0
+|  |  in pipelines: 47(GETNEXT)
+|  |
+|  47:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_list_price - ws_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  having: sum(ws_ext_list_price - ws_ext_discount_amt) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=27 row-size=169B cardinality=0
+|  |  in pipelines: 47(GETNEXT), 16(OPEN)
+|  |
+|  46:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=173.12KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=27 row-size=169B cardinality=0
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=46.63MB mem-reservation=22.94MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  20:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_list_price - ws_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=27 row-size=169B cardinality=0
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25,24,26 row-size=177B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT), 17(OPEN)
+|  |
+|  |--45:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=26 row-size=8B cardinality=373
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  17:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=26 row-size=8B cardinality=373
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF016[bloom] <- c_customer_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=25,24 row-size=169B cardinality=719.38K
+|  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |
+|  |--44:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=24 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=129.00MB mem-reservation=9.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  15:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=24 row-size=153B cardinality=100.00K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  43:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=5.53MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25 row-size=16B cardinality=719.38K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=130.00MB mem-reservation=10.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  16:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF014[bloom] -> ws_sold_date_sk, RF016[bloom] -> ws_bill_customer_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=25 row-size=16B cardinality=719.38K
+|     in pipelines: 16(GETNEXT)
+|
+28:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8,18 row-size=137B cardinality=0
+|  in pipelines: 36(GETNEXT), 41(OPEN)
+|
+|--42:EXCHANGE [BROADCAST]
+|  |  mem-estimate=290.89KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=93B cardinality=0
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=10.51MB mem-reservation=1.94MB thread-reservation=1
+|  07:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=93B cardinality=0
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  41:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_ext_list_price - ss_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=169B cardinality=0
+|  |  in pipelines: 41(GETNEXT), 09(OPEN)
+|  |
+|  40:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=519.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=169B cardinality=0
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=34.24MB mem-reservation=11.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  13:AGGREGATE [STREAMING]
+|  |  output: sum(ss_ext_list_price - ss_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=169B cardinality=0
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  runtime filters: RF010[bloom] <- c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=11,12,10 row-size=177B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT), 08(OPEN)
+|  |
+|  |--39:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=130.00MB mem-reservation=10.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=10 row-size=153B cardinality=100.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  38:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=4.59MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11,12 row-size=24B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=51.95MB mem-reservation=5.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11,12 row-size=24B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT), 10(OPEN)
+|  |
+|  |--37:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=8B cardinality=373
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  10:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=8B cardinality=373
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF012[bloom] -> ss_sold_date_sk, RF010[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=11 row-size=16B cardinality=2.88M
+|     in pipelines: 09(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=44B cardinality=0
+|  in pipelines: 36(GETNEXT)
+|
+36:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_list_price - ss_ext_discount_amt)
+|  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  having: sum(ss_ext_list_price - ss_ext_discount_amt) > CAST(0 AS DECIMAL(3,0))
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 36(GETNEXT), 02(OPEN)
+|
+35:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  mem-estimate=519.35KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 02(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=34.24MB mem-reservation=11.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+06:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_list_price - ss_ext_discount_amt)
+|  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF006[bloom] <- c_customer_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=177B cardinality=589.03K
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--34:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=153B cardinality=100.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=130.00MB mem-reservation=10.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  01:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=0 row-size=153B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+33:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=4.59MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1,2 row-size=24B cardinality=589.03K
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=51.95MB mem-reservation=5.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF008[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=24B cardinality=589.03K
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--32:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 03(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF008[bloom] -> ss_sold_date_sk, RF006[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 02(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=186.75MB Threads=40
+Per-Host Resource Estimates: Memory=577MB
+F24:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=485.79KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: customer_id, customer_first_name, customer_last_name, customer_preferred_cust_flag
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+55:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: customer_id ASC, customer_first_name ASC, customer_last_name ASC, customer_preferred_cust_flag ASC
+|  limit: 100
+|  mem-estimate=485.79KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=40 row-size=77B cardinality=0
+|  in pipelines: 31(GETNEXT)
+|
+F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.01MB mem-reservation=1.94MB thread-reservation=1
+31:TOP-N [LIMIT=100]
+|  order by: customer_id ASC, customer_first_name ASC, customer_last_name ASC, customer_preferred_cust_flag ASC
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=40 row-size=77B cardinality=0
+|  in pipelines: 31(GETNEXT), 36(OPEN)
+|
+30:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN (year_total * CAST(1.0000 AS DECIMAL(5,4))) / year_total ELSE CAST(0 AS DECIMAL(38,6)) END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN (year_total * CAST(1.0000 AS DECIMAL(5,4))) / year_total ELSE CAST(0 AS DECIMAL(38,6)) END
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8,18,28,38 row-size=225B cardinality=0
+|  in pipelines: 36(GETNEXT), 53(OPEN)
+|
+|--F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.92MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: customer_id
+|  |  runtime filters: RF000[bloom] <- customer_id
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  54:EXCHANGE [BROADCAST]
+|  |  mem-estimate=48.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=44B cardinality=0
+|  |  in pipelines: 53(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.17MB mem-reservation=1.94MB thread-reservation=1
+|  21:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=44B cardinality=0
+|  |  in pipelines: 53(GETNEXT)
+|  |
+|  53:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_list_price - ws_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37 row-size=169B cardinality=0
+|  |  in pipelines: 53(GETNEXT), 23(OPEN)
+|  |
+|  52:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=173.12KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=37 row-size=169B cardinality=0
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F20:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=15.53MB mem-reservation=2.00MB thread-reservation=1
+|  27:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_list_price - ws_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37 row-size=169B cardinality=0
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=35,34,36 row-size=177B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |
+|  |--F26:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF018[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  51:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=36 row-size=8B cardinality=373
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  24:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=36 row-size=8B cardinality=373
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  25:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=02
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: none
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=35,34 row-size=169B cardinality=719.38K
+|  |  in pipelines: 23(GETNEXT), 22(OPEN)
+|  |
+|  |--F27:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=28.15MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF020[bloom] <- c_customer_sk
+|  |  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  |
+|  |  50:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=34 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 22(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  22:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=34 row-size=153B cardinality=100.00K
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  49:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=5.53MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=35 row-size=16B cardinality=719.38K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  23:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF018[bloom] -> ws_sold_date_sk, RF020[bloom] -> ws_bill_customer_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=35 row-size=16B cardinality=719.38K
+|     in pipelines: 23(GETNEXT)
+|
+29:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8,18,28 row-size=181B cardinality=0
+|  in pipelines: 36(GETNEXT), 47(OPEN)
+|
+|--F28:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.92MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: customer_id
+|  |  runtime filters: RF002[bloom] <- customer_id
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  48:EXCHANGE [BROADCAST]
+|  |  mem-estimate=48.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=44B cardinality=0
+|  |  in pipelines: 47(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.17MB mem-reservation=1.94MB thread-reservation=1
+|  14:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=44B cardinality=0
+|  |  in pipelines: 47(GETNEXT)
+|  |
+|  47:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_list_price - ws_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  having: sum(ws_ext_list_price - ws_ext_discount_amt) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=27 row-size=169B cardinality=0
+|  |  in pipelines: 47(GETNEXT), 16(OPEN)
+|  |
+|  46:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=173.12KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=27 row-size=169B cardinality=0
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=15.53MB mem-reservation=2.00MB thread-reservation=1
+|  20:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_list_price - ws_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=27 row-size=169B cardinality=0
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25,24,26 row-size=177B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT), 17(OPEN)
+|  |
+|  |--F29:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=03
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  45:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=26 row-size=8B cardinality=373
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  17:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=26 row-size=8B cardinality=373
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=05
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: none
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=25,24 row-size=169B cardinality=719.38K
+|  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |
+|  |--F30:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=28.15MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF016[bloom] <- c_customer_sk
+|  |  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  |
+|  |  44:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=24 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  15:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=24 row-size=153B cardinality=100.00K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  43:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=5.53MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25 row-size=16B cardinality=719.38K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  16:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF014[bloom] -> ws_sold_date_sk, RF016[bloom] -> ws_bill_customer_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=25 row-size=16B cardinality=719.38K
+|     in pipelines: 16(GETNEXT)
+|
+28:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=06
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8,18 row-size=137B cardinality=0
+|  in pipelines: 36(GETNEXT), 41(OPEN)
+|
+|--F31:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.44MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: customer_id
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  42:EXCHANGE [BROADCAST]
+|  |  mem-estimate=581.79KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=93B cardinality=0
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=11.01MB mem-reservation=1.94MB thread-reservation=1
+|  07:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=93B cardinality=0
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  41:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_ext_list_price - ss_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=169B cardinality=0
+|  |  in pipelines: 41(GETNEXT), 09(OPEN)
+|  |
+|  40:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  |  mem-estimate=1.01MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=169B cardinality=0
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=14.68MB mem-reservation=2.00MB thread-reservation=1
+|  13:AGGREGATE [STREAMING]
+|  |  output: sum(ss_ext_list_price - ss_ext_discount_amt)
+|  |  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=169B cardinality=0
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=07
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=11,12,10 row-size=177B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT), 08(OPEN)
+|  |
+|  |--F32:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=15.90MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=04
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF010[bloom] <- c_customer_sk
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |
+|  |  39:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=153B cardinality=100.00K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=10 row-size=153B cardinality=100.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  38:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=4.68MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11,12 row-size=24B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=08
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11,12 row-size=24B cardinality=589.03K
+|  |  in pipelines: 09(GETNEXT), 10(OPEN)
+|  |
+|  |--F33:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=08 plan-id=09 cohort-id=04
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  37:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=8B cardinality=373
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  10:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=12 row-size=8B cardinality=373
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF012[bloom] -> ss_sold_date_sk, RF010[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=11 row-size=16B cardinality=2.88M
+|     in pipelines: 09(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=44B cardinality=0
+|  in pipelines: 36(GETNEXT)
+|
+36:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_list_price - ss_ext_discount_amt)
+|  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  having: sum(ss_ext_list_price - ss_ext_discount_amt) > CAST(0 AS DECIMAL(3,0))
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 36(GETNEXT), 02(OPEN)
+|
+35:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year)]
+|  mem-estimate=1.01MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 02(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=14.68MB mem-reservation=2.00MB thread-reservation=1
+06:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_list_price - ss_ext_discount_amt)
+|  group by: c_customer_id, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_country, c_login, c_email_address, d_year
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=169B cardinality=0
+|  in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=09
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=177B cardinality=589.03K
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--F34:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=15.90MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF006[bloom] <- c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  34:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=153B cardinality=100.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=0 row-size=153B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+33:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=4.68MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1,2 row-size=24B cardinality=589.03K
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=10
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=24B cardinality=589.03K
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--F35:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  32:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 03(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF008[bloom] -> ss_sold_date_sk, RF006[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 02(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q12.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q12.test
new file mode 100644
index 0000000..15e0b18
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q12.test
@@ -0,0 +1,381 @@
+# TPCDS-Q12
+SELECT i_item_id,
+       i_item_desc,
+       i_category,
+       i_class,
+       i_current_price,
+       sum(ws_ext_sales_price) AS itemrevenue,
+       sum(ws_ext_sales_price)*100.0000/sum(sum(ws_ext_sales_price)) OVER (PARTITION BY i_class) AS revenueratio
+FROM web_sales,
+     item,
+     date_dim
+WHERE ws_item_sk = i_item_sk
+  AND i_category IN ('Sports',
+                     'Books',
+                     'Home')
+  AND ws_sold_date_sk = d_date_sk
+  AND d_date BETWEEN cast('1999-02-22' AS date) AND cast('1999-03-24' AS date)
+GROUP BY i_item_id,
+         i_item_desc,
+         i_category,
+         i_class,
+         i_current_price
+ORDER BY i_category,
+         i_class,
+         i_item_id,
+         i_item_desc,
+         revenueratio
+LIMIT 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=52.00MB Threads=4
+Per-Host Resource Estimates: Memory=234MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=233.88MB mem-reservation=52.00MB thread-reservation=4 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_category, i_class, i_current_price, sum(ws_ext_sales_price), sum(ws_ext_sales_price) * CAST(100.0000 AS DECIMAL(7,4)) / sum(sum(ws_ext_sales_price))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+08:TOP-N [LIMIT=100]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ws_ext_sales_price) * 100.0000 / sum(sum(ws_ext_sales_price)) ASC
+|  mem-estimate=20.91KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=100
+|  in pipelines: 08(GETNEXT), 06(OPEN)
+|
+07:ANALYTIC
+|  functions: sum(sum(ws_ext_sales_price))
+|  partition by: i_class
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10,9 row-size=214B cardinality=215.82K
+|  in pipelines: 06(GETNEXT)
+|
+06:SORT
+|  order by: i_class ASC NULLS LAST
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10 row-size=198B cardinality=215.82K
+|  in pipelines: 06(GETNEXT), 05(OPEN)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(ws_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=44.85MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=215.82K
+|  in pipelines: 05(GETNEXT), 00(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=232B cardinality=215.82K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_item_sk = i_item_sk
+|  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=206B cardinality=215.82K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Sports', 'Books', 'Home')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Sports', 'Books', 'Home')
+|     parquet dictionary predicates: i_category IN ('Sports', 'Books', 'Home')
+|     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=190B cardinality=5.40K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_sold_date_sk, RF002[bloom] -> ws_item_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=100.88MB Threads=8
+Per-Host Resource Estimates: Memory=315MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=53.05KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_category, i_class, i_current_price, sum(ws_ext_sales_price), sum(ws_ext_sales_price) * CAST(100.0000 AS DECIMAL(7,4)) / sum(sum(ws_ext_sales_price))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ws_ext_sales_price) * 100.0000 / sum(sum(ws_ext_sales_price)) ASC
+|  limit: 100
+|  mem-estimate=53.05KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(i_class)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=50.00MB mem-reservation=50.00MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ws_ext_sales_price) * 100.0000 / sum(sum(ws_ext_sales_price)) ASC
+|  mem-estimate=20.91KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=100
+|  in pipelines: 08(GETNEXT), 06(OPEN)
+|
+07:ANALYTIC
+|  functions: sum(sum(ws_ext_sales_price))
+|  partition by: i_class
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10,9 row-size=214B cardinality=215.82K
+|  in pipelines: 06(GETNEXT)
+|
+06:SORT
+|  order by: i_class ASC NULLS LAST
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10 row-size=198B cardinality=215.82K
+|  in pipelines: 06(GETNEXT), 12(OPEN)
+|
+12:AGGREGATE [FINALIZE]
+|  output: sum:merge(ws_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=215.82K
+|  in pipelines: 12(GETNEXT), 00(OPEN)
+|
+11:EXCHANGE [HASH(i_class)]
+|  mem-estimate=10.39MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=215.82K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=137.25MB mem-reservation=47.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(ws_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=215.82K
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=232B cardinality=215.82K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_item_sk = i_item_sk
+|  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=206B cardinality=215.82K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.17MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=190B cardinality=5.40K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Sports', 'Books', 'Home')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Sports', 'Books', 'Home')
+|     parquet dictionary predicates: i_category IN ('Sports', 'Books', 'Home')
+|     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=190B cardinality=5.40K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_sold_date_sk, RF002[bloom] -> ws_item_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=106.75MB Threads=7
+Per-Host Resource Estimates: Memory=161MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=53.05KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_category, i_class, i_current_price, sum(ws_ext_sales_price), sum(ws_ext_sales_price) * CAST(100.0000 AS DECIMAL(7,4)) / sum(sum(ws_ext_sales_price))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ws_ext_sales_price) * 100.0000 / sum(sum(ws_ext_sales_price)) ASC
+|  limit: 100
+|  mem-estimate=53.05KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(i_class)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=50.00MB mem-reservation=50.00MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ws_ext_sales_price) * 100.0000 / sum(sum(ws_ext_sales_price)) ASC
+|  mem-estimate=20.91KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=100
+|  in pipelines: 08(GETNEXT), 06(OPEN)
+|
+07:ANALYTIC
+|  functions: sum(sum(ws_ext_sales_price))
+|  partition by: i_class
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10,9 row-size=214B cardinality=215.82K
+|  in pipelines: 06(GETNEXT)
+|
+06:SORT
+|  order by: i_class ASC NULLS LAST
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10 row-size=198B cardinality=215.82K
+|  in pipelines: 06(GETNEXT), 12(OPEN)
+|
+12:AGGREGATE [FINALIZE]
+|  output: sum:merge(ws_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=215.82K
+|  in pipelines: 12(GETNEXT), 00(OPEN)
+|
+11:EXCHANGE [HASH(i_class)]
+|  mem-estimate=10.39MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=215.82K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=66.00MB mem-reservation=42.00MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(ws_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=215.82K
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=232B cardinality=215.82K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=5.09MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ws_item_sk = i_item_sk
+|  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=206B cardinality=215.82K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=6.04MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.17MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=190B cardinality=5.40K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Sports', 'Books', 'Home')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Sports', 'Books', 'Home')
+|     parquet dictionary predicates: i_category IN ('Sports', 'Books', 'Home')
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=1 row-size=190B cardinality=5.40K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_sold_date_sk, RF002[bloom] -> ws_item_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=0 row-size=16B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q13.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q13.test
new file mode 100644
index 0000000..78d3933
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q13.test
@@ -0,0 +1,182 @@
+# TPCDS-Q13
+select avg(ss_quantity)
+       ,avg(ss_ext_sales_price)
+       ,avg(ss_ext_wholesale_cost)
+       ,sum(ss_ext_wholesale_cost)
+ from store_sales
+     ,store
+     ,customer_demographics
+     ,household_demographics
+     ,customer_address
+     ,date_dim
+ where s_store_sk = ss_store_sk
+ and  ss_sold_date_sk = d_date_sk and d_year = 2001
+ and((ss_hdemo_sk=hd_demo_sk
+  and cd_demo_sk = ss_cdemo_sk
+  and cd_marital_status = 'M'
+  and cd_education_status = 'Advanced Degree'
+  and ss_sales_price between 100.00 and 150.00
+  and hd_dep_count = 3
+     )or
+     (ss_hdemo_sk=hd_demo_sk
+  and cd_demo_sk = ss_cdemo_sk
+  and cd_marital_status = 'S'
+  and cd_education_status = 'College'
+  and ss_sales_price between 50.00 and 100.00
+  and hd_dep_count = 1
+     ) or
+     (ss_hdemo_sk=hd_demo_sk
+  and cd_demo_sk = ss_cdemo_sk
+  and cd_marital_status = 'W'
+  and cd_education_status = '2 yr Degree'
+  and ss_sales_price between 150.00 and 200.00
+  and hd_dep_count = 1
+     ))
+ and((ss_addr_sk = ca_address_sk
+  and ca_country = 'United States'
+  and ca_state in ('TX', 'OH', 'TX')
+  and ss_net_profit between 100 and 200
+     ) or
+     (ss_addr_sk = ca_address_sk
+  and ca_country = 'United States'
+  and ca_state in ('OR', 'NM', 'KY')
+  and ss_net_profit between 150 and 300
+     ) or
+     (ss_addr_sk = ca_address_sk
+  and ca_country = 'United States'
+  and ca_state in ('VA', 'TX', 'MS')
+  and ss_net_profit between 50 and 250
+     ))
+---- PLAN
+Max Per-Host Resource Reservation: Memory=26.70MB Threads=7
+Per-Host Resource Estimates: Memory=317MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=316.75MB mem-reservation=26.70MB thread-reservation=7 runtime-filters-memory=5.00MB
+PLAN-ROOT SINK
+|  output exprs: avg(ss_quantity), avg(ss_ext_sales_price), avg(ss_ext_wholesale_cost), sum(ss_ext_wholesale_cost)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:AGGREGATE [FINALIZE]
+|  output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_ext_sales_price), avg(ss_ext_wholesale_cost), sum(ss_ext_wholesale_cost)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=40B cardinality=1
+|  in pipelines: 11(GETNEXT), 02(OPEN)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,4,5,3,1 row-size=142B cardinality=2.55K
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=4B cardinality=12
+|     in pipelines: 01(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: cd_demo_sk = ss_cdemo_sk
+|  fk/pk conjuncts: cd_demo_sk = ss_cdemo_sk
+|  other predicates: cd_education_status = 'Advanced Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR hd_dep_count = CAST(1 AS INT), cd_marital_status = 'M' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR hd_dep_count = CAST(1 AS INT), hd_dep_count = CAST(3 AS INT) OR cd_education_status = 'College' OR hd_dep_count = CAST(1 AS INT), cd_education_status = 'Advanced Degree' OR hd_dep_count = CAST(1 AS INT) OR hd_dep_count = CAST(1 AS INT), hd_dep_count IN (CAST(3 AS INT), CAST(1 AS INT)) OR cd_education_status = '2 yr Degree', hd_dep_count = CAST(3 AS INT) OR cd_education_status = 'College' OR cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR hd_dep_count = CAST(1 AS INT) OR cd_education_status = '2 yr Degree', cd_marital_status = 'M' OR hd_dep_count = CAST(1 AS INT) OR hd_dep_count = CAST(1 AS INT), hd_dep_count = CAST(3 AS INT) OR cd_marital_status = 'S' OR hd_dep_count = CAST(1 AS INT), hd_dep_count IN (CAST(3 AS INT), CAST(1 AS INT)) OR cd_marital_status = 'W', hd_dep_count = CAST(3 AS INT) OR cd_education_status = 'College' OR cd_marital_status = 'W', cd_marital_status = 'M' OR hd_dep_count = CAST(1 AS INT) OR cd_education_status = '2 yr Degree', hd_dep_count = CAST(3 AS INT) OR cd_marital_status = 'S' OR cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR hd_dep_count = CAST(1 AS INT) OR cd_marital_status = 'W', cd_marital_status = 'M' OR hd_dep_count = CAST(1 AS INT) OR cd_marital_status = 'W', hd_dep_count = CAST(3 AS INT) OR cd_marital_status = 'S' OR cd_marital_status = 'W', cd_marital_status = 'M' OR hd_dep_count = CAST(1 AS INT) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR hd_dep_count = CAST(1 AS INT) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT), cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR hd_dep_count = CAST(1 AS INT), cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), hd_dep_count = CAST(3 AS INT) OR cd_marital_status = 'S' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), hd_dep_count = CAST(3 AS INT) OR cd_marital_status = 'S' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), hd_dep_count = CAST(3 AS INT) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'W', hd_dep_count = CAST(3 AS INT) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'W', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S' OR hd_dep_count = CAST(1 AS INT), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT) OR cd_marital_status = 'W', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'W', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'W', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S' OR hd_dep_count = CAST(1 AS INT), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT) OR cd_marital_status = 'W', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'W', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'W', cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'W', cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'W', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S' OR cd_marital_status = 'W', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S' OR cd_marital_status = 'W', hd_dep_count = CAST(3 AS INT) OR cd_education_status = 'College' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), hd_dep_count = CAST(3 AS INT) OR cd_education_status = 'College' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = 'College' OR hd_dep_count = CAST(1 AS INT), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = 'College' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = 'College' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College' OR hd_dep_count = CAST(1 AS INT), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = 'College' OR cd_marital_status = 'W', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College' OR cd_marital_status = 'W', hd_dep_count = CAST(3 AS INT) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree', hd_dep_count = CAST(3 AS INT) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = '2 yr Degree', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT) OR cd_education_status = '2 yr Degree', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = '2 yr Degree', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT) OR cd_education_status = '2 yr Degree', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = '2 yr Degree', cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree', cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = '2 yr Degree', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S' OR cd_education_status = '2 yr Degree', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S' OR cd_education_status = '2 yr Degree', cd_marital_status = 'M' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = 'Advanced Degree' OR hd_dep_count = CAST(1 AS INT) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = 'Advanced Degree' OR hd_dep_count = CAST(1 AS INT) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = 'Advanced Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT), cd_education_status = 'Advanced Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = 'Advanced Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = 'Advanced Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR hd_dep_count = CAST(1 AS INT), cd_education_status = 'Advanced Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = 'Advanced Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = 'Advanced Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'W', cd_education_status = 'Advanced Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'W', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = 'College' OR cd_education_status = '2 yr Degree', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College' OR cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = 'Advanced Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  runtime filters: RF002[bloom] <- ss_cdemo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,4,5,3 row-size=138B cardinality=2.55K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--08:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_hdemo_sk = hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = hd_demo_sk
+|  |  other predicates: hd_dep_count IN (CAST(3 AS INT), CAST(1 AS INT)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), hd_dep_count IN (CAST(3 AS INT), CAST(1 AS INT)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), hd_dep_count = CAST(3 AS INT) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT), hd_dep_count = CAST(3 AS INT) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), hd_dep_count = CAST(3 AS INT) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), hd_dep_count = CAST(3 AS INT) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR hd_dep_count = CAST(1 AS INT), hd_dep_count = CAST(3 AS INT) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), hd_dep_count = CAST(3 AS INT) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT) OR hd_dep_count = CAST(1 AS INT), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR hd_dep_count = CAST(1 AS INT), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT) OR hd_dep_count = CAST(1 AS INT), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR hd_dep_count = CAST(1 AS INT), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR hd_dep_count = CAST(1 AS INT)
+|  |  runtime filters: RF004[bloom] <- hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,4,5,3 row-size=99B cardinality=3.05K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: hd_dep_count IN (CAST(3 AS INT), CAST(1 AS INT), CAST(1 AS INT))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     parquet statistics predicates: hd_dep_count IN (CAST(3 AS INT), CAST(1 AS INT), CAST(1 AS INT))
+|  |     parquet dictionary predicates: hd_dep_count IN (CAST(3 AS INT), CAST(1 AS INT), CAST(1 AS INT))
+|  |     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=8B cardinality=2.16K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,4,5 row-size=91B cardinality=10.43K
+|  |  in pipelines: 00(GETNEXT), 05(OPEN)
+|  |
+|  |--05:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=8B cardinality=373
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  |  other predicates: ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'NM', 'KY') OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'NM', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'TX', 'MS'), ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'TX', 'MS'), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'NM', 'KY') OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'NM', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'TX', 'MS'), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'TX', 'MS'), ca_state IN ('TX', 'OH', 'TX', 'OR', 'NM', 'KY') OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('TX', 'OH', 'TX', 'OR', 'NM', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'TX', 'MS'), ca_state IN ('TX', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'TX', 'MS'), ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'NM', 'KY') OR ca_state IN ('VA', 'TX', 'MS'), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'NM', 'KY') OR ca_state IN ('VA', 'TX', 'MS')
+|  |  runtime filters: RF008[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,4 row-size=83B cardinality=50.98K
+|  |  in pipelines: 00(GETNEXT), 04(OPEN)
+|  |
+|  |--04:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_state IN ('TX', 'OH', 'TX', 'OR', 'NM', 'KY', 'VA', 'TX', 'MS'), ca_country = 'United States'
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_state IN ('TX', 'OH', 'TX', 'OR', 'NM', 'KY', 'VA', 'TX', 'MS'), ca_country = 'United States'
+|  |     parquet dictionary predicates: ca_state IN ('TX', 'OH', 'TX', 'OR', 'NM', 'KY', 'VA', 'TX', 'MS'), ca_country = 'United States'
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=43B cardinality=8.82K
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|     runtime filters: RF000[bloom] -> ss_store_sk, RF004[bloom] -> ss_hdemo_sk, RF006[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_addr_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet dictionary predicates: ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ss_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(250 AS DECIMAL(5,0)), ss_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|     mem-estimate=128.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=0 row-size=40B cardinality=288.04K
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.customer_demographics]
+   HDFS partitions=1/1 files=1 size=7.49MB
+   predicates: cd_marital_status = 'M' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR cd_marital_status = 'W' AND cd_education_status = '2 yr Degree', cd_education_status = 'Advanced Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College' OR cd_marital_status = 'W' AND cd_education_status = '2 yr Degree'
+   runtime filters: RF002[bloom] -> cd_demo_sk
+   stored statistics:
+     table: rows=1.92M size=7.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=1.92M
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=2 row-size=39B cardinality=181.75K
+   in pipelines: 02(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q14a.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q14a.test
new file mode 100644
index 0000000..53de25f
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q14a.test
@@ -0,0 +1,5151 @@
+# TPCDS-Q14a first of two
+with  cross_items as
+ (select i_item_sk ss_item_sk
+ from item,
+ (select iss.i_brand_id brand_id
+     ,iss.i_class_id class_id
+     ,iss.i_category_id category_id
+ from store_sales
+     ,item iss
+     ,date_dim d1
+ where ss_item_sk = iss.i_item_sk
+   and ss_sold_date_sk = d1.d_date_sk
+   and d1.d_year between 1999 AND 1999 + 2
+ intersect 
+ select ics.i_brand_id
+     ,ics.i_class_id
+     ,ics.i_category_id
+ from catalog_sales
+     ,item ics
+     ,date_dim d2
+ where cs_item_sk = ics.i_item_sk
+   and cs_sold_date_sk = d2.d_date_sk
+   and d2.d_year between 1999 AND 1999 + 2
+ intersect
+ select iws.i_brand_id
+     ,iws.i_class_id
+     ,iws.i_category_id
+ from web_sales
+     ,item iws
+     ,date_dim d3
+ where ws_item_sk = iws.i_item_sk
+   and ws_sold_date_sk = d3.d_date_sk
+   and d3.d_year between 1999 AND 1999 + 2) t1
+ where i_brand_id = brand_id
+      and i_class_id = class_id
+      and i_category_id = category_id
+),
+ avg_sales as
+ (select avg(quantity*list_price) average_sales
+  from (select ss_quantity quantity
+             ,ss_list_price list_price
+       from store_sales
+           ,date_dim
+       where ss_sold_date_sk = d_date_sk
+         and d_year between 1999 and 1999 + 2
+       union all 
+       select cs_quantity quantity 
+             ,cs_list_price list_price
+       from catalog_sales
+           ,date_dim
+       where cs_sold_date_sk = d_date_sk
+         and d_year between 1999 and 1999 + 2 
+       union all
+       select ws_quantity quantity
+             ,ws_list_price list_price
+       from web_sales
+           ,date_dim
+       where ws_sold_date_sk = d_date_sk
+         and d_year between 1999 and 1999 + 2) x)
+ select channel, i_brand_id,i_class_id,i_category_id,sum(sales), sum(number_sales)
+ from(
+       select 'store' channel, i_brand_id,i_class_id
+             ,i_category_id,sum(ss_quantity*ss_list_price) sales
+             , count(*) number_sales
+       from store_sales
+           ,item
+           ,date_dim
+       where ss_item_sk in (select ss_item_sk from cross_items)
+         and ss_item_sk = i_item_sk
+         and ss_sold_date_sk = d_date_sk
+         and d_year = 1999+2 
+         and d_moy = 11
+       group by i_brand_id,i_class_id,i_category_id
+       having sum(ss_quantity*ss_list_price) > (select average_sales from avg_sales)
+       union all
+       select 'catalog' channel, i_brand_id,i_class_id,i_category_id, sum(cs_quantity*cs_list_price) sales, count(*) number_sales
+       from catalog_sales
+           ,item
+           ,date_dim
+       where cs_item_sk in (select ss_item_sk from cross_items)
+         and cs_item_sk = i_item_sk
+         and cs_sold_date_sk = d_date_sk
+         and d_year = 1999+2 
+         and d_moy = 11
+       group by i_brand_id,i_class_id,i_category_id
+       having sum(cs_quantity*cs_list_price) > (select average_sales from avg_sales)
+       union all
+       select 'web' channel, i_brand_id,i_class_id,i_category_id, sum(ws_quantity*ws_list_price) sales , count(*) number_sales
+       from web_sales
+           ,item
+           ,date_dim
+       where ws_item_sk in (select ss_item_sk from cross_items)
+         and ws_item_sk = i_item_sk
+         and ws_sold_date_sk = d_date_sk
+         and d_year = 1999+2
+         and d_moy = 11
+       group by i_brand_id,i_class_id,i_category_id
+       having sum(ws_quantity*ws_list_price) > (select average_sales from avg_sales)
+ ) y
+ group by rollup (channel, i_brand_id,i_class_id,i_category_id)
+ order by channel,i_brand_id,i_class_id,i_category_id
+LIMIT 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=128.62MB Threads=16
+Per-Host Resource Estimates: Memory=1.19GB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=1.19GB mem-reservation=128.62MB thread-reservation=16 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(104,105,106,107,108) WHEN 104 THEN channel WHEN 105 THEN channel WHEN 106 THEN channel WHEN 107 THEN channel WHEN 108 THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_brand_id WHEN 105 THEN i_brand_id WHEN 106 THEN i_brand_id WHEN 107 THEN NULL WHEN 108 THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_class_id WHEN 105 THEN i_class_id WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_category_id WHEN 105 THEN NULL WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END, aggif(valid_tid(104,105,106,107,108) IN (104, 105, 106, 107, 108), CASE valid_tid(104,105,106,107,108) WHEN 104 THEN sum(sales) WHEN 105 THEN sum(sales) WHEN 106 THEN sum(sales) WHEN 107 THEN sum(sales) WHEN 108 THEN sum(sales) END), aggif(valid_tid(104,105,106,107,108) IN (104, 105, 106, 107, 108), CASE valid_tid(104,105,106,107,108) WHEN 104 THEN sum(number_sales) WHEN 105 THEN sum(number_sales) WHEN 106 THEN sum(number_sales) WHEN 107 THEN sum(number_sales) WHEN 108 THEN sum(number_sales) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+129:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(104,105,106,107,108) WHEN 104 THEN channel WHEN 105 THEN channel WHEN 106 THEN channel WHEN 107 THEN channel WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_brand_id WHEN 105 THEN i_brand_id WHEN 106 THEN i_brand_id WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_class_id WHEN 105 THEN i_class_id WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_category_id WHEN 105 THEN NULL WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC
+|  mem-estimate=4.69KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=110 row-size=48B cardinality=100
+|  in pipelines: 129(GETNEXT), 128(OPEN)
+|
+128:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(104,105,106,107,108) IN (CAST(104 AS INT), CAST(105 AS INT), CAST(106 AS INT), CAST(107 AS INT), CAST(108 AS INT)), CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN sum(sales) WHEN CAST(105 AS INT) THEN sum(sales) WHEN CAST(106 AS INT) THEN sum(sales) WHEN CAST(107 AS INT) THEN sum(sales) WHEN CAST(108 AS INT) THEN sum(sales) END), aggif(valid_tid(104,105,106,107,108) IN (CAST(104 AS INT), CAST(105 AS INT), CAST(106 AS INT), CAST(107 AS INT), CAST(108 AS INT)), CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN sum(number_sales) WHEN CAST(105 AS INT) THEN sum(number_sales) WHEN CAST(106 AS INT) THEN sum(number_sales) WHEN CAST(107 AS INT) THEN sum(number_sales) WHEN CAST(108 AS INT) THEN sum(number_sales) END)
+|  group by: CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN channel WHEN CAST(105 AS INT) THEN channel WHEN CAST(106 AS INT) THEN channel WHEN CAST(107 AS INT) THEN channel WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN i_brand_id WHEN CAST(105 AS INT) THEN i_brand_id WHEN CAST(106 AS INT) THEN i_brand_id WHEN CAST(107 AS INT) THEN NULL WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN i_class_id WHEN CAST(105 AS INT) THEN i_class_id WHEN CAST(106 AS INT) THEN NULL WHEN CAST(107 AS INT) THEN NULL WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN i_category_id WHEN CAST(105 AS INT) THEN NULL WHEN CAST(106 AS INT) THEN NULL WHEN CAST(107 AS INT) THEN NULL WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN CAST(104 AS INT) WHEN CAST(105 AS INT) THEN CAST(105 AS INT) WHEN CAST(106 AS INT) THEN CAST(106 AS INT) WHEN CAST(107 AS INT) THEN CAST(107 AS INT) WHEN CAST(108 AS INT) THEN CAST(108 AS INT) END
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=109 row-size=52B cardinality=562.30K
+|  in pipelines: 128(GETNEXT), 127(OPEN)
+|
+127:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, i_brand_id, i_class_id, i_category_id
+|  Class 1
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, i_brand_id, i_class_id, NULL
+|  Class 2
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, i_brand_id, NULL, NULL
+|  Class 3
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, NULL, NULL, NULL
+|  Class 4
+|    output: sum(sales), sum(number_sales)
+|    group by: NULL, NULL, NULL, NULL
+|  mem-estimate=169.46MB mem-reservation=74.75MB thread-reservation=0
+|  tuple-ids=104N,105N,106N,107N,108N row-size=240B cardinality=562.30K
+|  in pipelines: 127(GETNEXT), 30(OPEN), 72(OPEN), 114(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=102 row-size=48B cardinality=276.96K
+|  in pipelines: 30(GETNEXT), 72(GETNEXT), 114(GETNEXT)
+|
+|--126:NESTED LOOP JOIN [INNER JOIN]
+|  |  predicates: sum(ws_quantity * ws_list_price) > avg(quantity * list_price)
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=88,99 row-size=52B cardinality=42.85K
+|  |  in pipelines: 114(GETNEXT), 125(OPEN)
+|  |
+|  |--125:AGGREGATE [FINALIZE]
+|  |  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=99 row-size=16B cardinality=1
+|  |  |  in pipelines: 125(GETNEXT), 116(OPEN), 119(OPEN), 122(OPEN)
+|  |  |
+|  |  115:UNION
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=96 row-size=8B cardinality=5.04M
+|  |  |  in pipelines: 116(GETNEXT), 119(GETNEXT), 122(GETNEXT)
+|  |  |
+|  |  |--124:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=94,95 row-size=20B cardinality=719.38K
+|  |  |  |  in pipelines: 122(GETNEXT), 123(OPEN)
+|  |  |  |
+|  |  |  |--123:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=95 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 123(GETNEXT)
+|  |  |  |
+|  |  |  122:SCAN HDFS [tpcds_parquet.web_sales]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=94 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 122(GETNEXT)
+|  |  |
+|  |  |--121:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=92,93 row-size=20B cardinality=1.44M
+|  |  |  |  in pipelines: 119(GETNEXT), 120(OPEN)
+|  |  |  |
+|  |  |  |--120:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=93 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 120(GETNEXT)
+|  |  |  |
+|  |  |  119:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=92 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 119(GETNEXT)
+|  |  |
+|  |  118:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=90,91 row-size=20B cardinality=2.88M
+|  |  |  in pipelines: 116(GETNEXT), 117(OPEN)
+|  |  |
+|  |  |--117:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=91 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 117(GETNEXT)
+|  |  |
+|  |  116:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=90 row-size=12B cardinality=2.88M
+|  |     in pipelines: 116(GETNEXT)
+|  |
+|  114:AGGREGATE [FINALIZE]
+|  |  output: sum(CAST(ws_quantity AS DECIMAL(10,0)) * ws_list_price), count(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=88 row-size=36B cardinality=42.85K
+|  |  in pipelines: 114(GETNEXT), 85(OPEN)
+|  |
+|  113:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: ws_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=68,70,69 row-size=52B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT), 112(OPEN)
+|  |
+|  |--112:AGGREGATE [FINALIZE]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=170 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 112(GETNEXT), 108(OPEN)
+|  |  |
+|  |  109:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=84,71 row-size=32B cardinality=148.80K
+|  |  |  in pipelines: 108(GETNEXT), 88(OPEN)
+|  |  |
+|  |  |--88:SCAN HDFS [tpcds_parquet.item]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=71 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 88(GETNEXT)
+|  |  |
+|  |  108:AGGREGATE [FINALIZE]
+|  |  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=84 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 108(GETNEXT), 89(OPEN)
+|  |  |
+|  |  107:HASH JOIN [LEFT SEMI JOIN]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73,74 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 106(OPEN)
+|  |  |
+|  |  |--106:AGGREGATE [FINALIZE]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=169 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 106(GETNEXT), 99(OPEN)
+|  |  |  |
+|  |  |  103:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=80,81,82 row-size=40B cardinality=719.38K
+|  |  |  |  in pipelines: 99(GETNEXT), 101(OPEN)
+|  |  |  |
+|  |  |  |--101:SCAN HDFS [tpcds_parquet.date_dim d3]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=82 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 101(GETNEXT)
+|  |  |  |
+|  |  |  102:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=80,81 row-size=32B cardinality=719.38K
+|  |  |  |  in pipelines: 99(GETNEXT), 100(OPEN)
+|  |  |  |
+|  |  |  |--100:SCAN HDFS [tpcds_parquet.item iws]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=81 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 100(GETNEXT)
+|  |  |  |
+|  |  |  99:SCAN HDFS [tpcds_parquet.web_sales]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=80 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 99(GETNEXT)
+|  |  |
+|  |  105:HASH JOIN [LEFT SEMI JOIN]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73,74 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 104(OPEN)
+|  |  |
+|  |  |--104:AGGREGATE [FINALIZE]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=168 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 104(GETNEXT), 94(OPEN)
+|  |  |  |
+|  |  |  98:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=76,77,78 row-size=40B cardinality=1.44M
+|  |  |  |  in pipelines: 94(GETNEXT), 96(OPEN)
+|  |  |  |
+|  |  |  |--96:SCAN HDFS [tpcds_parquet.date_dim d2]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=78 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 96(GETNEXT)
+|  |  |  |
+|  |  |  97:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=76,77 row-size=32B cardinality=1.44M
+|  |  |  |  in pipelines: 94(GETNEXT), 95(OPEN)
+|  |  |  |
+|  |  |  |--95:SCAN HDFS [tpcds_parquet.item ics]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=77 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 95(GETNEXT)
+|  |  |  |
+|  |  |  94:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=76 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 94(GETNEXT)
+|  |  |
+|  |  93:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73,74 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 91(OPEN)
+|  |  |
+|  |  |--91:SCAN HDFS [tpcds_parquet.date_dim d1]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=74 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 91(GETNEXT)
+|  |  |
+|  |  92:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73 row-size=32B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 90(OPEN)
+|  |  |
+|  |  |--90:SCAN HDFS [tpcds_parquet.item iss]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=73 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 90(GETNEXT)
+|  |  |
+|  |  89:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=72 row-size=12B cardinality=2.88M
+|  |     in pipelines: 89(GETNEXT)
+|  |
+|  111:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=68,70,69 row-size=52B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT), 86(OPEN)
+|  |
+|  |--86:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=69 row-size=20B cardinality=18.00K
+|  |     in pipelines: 86(GETNEXT)
+|  |
+|  110:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF088[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=68,70 row-size=32B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT), 87(OPEN)
+|  |
+|  |--87:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=70 row-size=12B cardinality=108
+|  |     in pipelines: 87(GETNEXT)
+|  |
+|  85:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF088[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=68 row-size=20B cardinality=719.38K
+|     in pipelines: 85(GETNEXT)
+|
+|--84:NESTED LOOP JOIN [INNER JOIN]
+|  |  predicates: sum(cs_quantity * cs_list_price) > avg(quantity * list_price)
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54,65 row-size=52B cardinality=85.31K
+|  |  in pipelines: 72(GETNEXT), 83(OPEN)
+|  |
+|  |--83:AGGREGATE [FINALIZE]
+|  |  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=65 row-size=16B cardinality=1
+|  |  |  in pipelines: 83(GETNEXT), 74(OPEN), 77(OPEN), 80(OPEN)
+|  |  |
+|  |  73:UNION
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=62 row-size=8B cardinality=5.04M
+|  |  |  in pipelines: 74(GETNEXT), 77(GETNEXT), 80(GETNEXT)
+|  |  |
+|  |  |--82:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=60,61 row-size=20B cardinality=719.38K
+|  |  |  |  in pipelines: 80(GETNEXT), 81(OPEN)
+|  |  |  |
+|  |  |  |--81:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=61 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 81(GETNEXT)
+|  |  |  |
+|  |  |  80:SCAN HDFS [tpcds_parquet.web_sales]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=60 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 80(GETNEXT)
+|  |  |
+|  |  |--79:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=58,59 row-size=20B cardinality=1.44M
+|  |  |  |  in pipelines: 77(GETNEXT), 78(OPEN)
+|  |  |  |
+|  |  |  |--78:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=59 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 78(GETNEXT)
+|  |  |  |
+|  |  |  77:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=58 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 77(GETNEXT)
+|  |  |
+|  |  76:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=56,57 row-size=20B cardinality=2.88M
+|  |  |  in pipelines: 74(GETNEXT), 75(OPEN)
+|  |  |
+|  |  |--75:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=57 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 75(GETNEXT)
+|  |  |
+|  |  74:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=56 row-size=12B cardinality=2.88M
+|  |     in pipelines: 74(GETNEXT)
+|  |
+|  72:AGGREGATE [FINALIZE]
+|  |  output: sum(CAST(cs_quantity AS DECIMAL(10,0)) * cs_list_price), count(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=54 row-size=36B cardinality=85.31K
+|  |  in pipelines: 72(GETNEXT), 43(OPEN)
+|  |
+|  71:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: cs_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=34,36,35 row-size=52B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT), 70(OPEN)
+|  |
+|  |--70:AGGREGATE [FINALIZE]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=148 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 70(GETNEXT), 66(OPEN)
+|  |  |
+|  |  67:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=50,37 row-size=32B cardinality=148.80K
+|  |  |  in pipelines: 66(GETNEXT), 46(OPEN)
+|  |  |
+|  |  |--46:SCAN HDFS [tpcds_parquet.item]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=37 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 46(GETNEXT)
+|  |  |
+|  |  66:AGGREGATE [FINALIZE]
+|  |  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=50 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 66(GETNEXT), 47(OPEN)
+|  |  |
+|  |  65:HASH JOIN [LEFT SEMI JOIN]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39,40 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 64(OPEN)
+|  |  |
+|  |  |--64:AGGREGATE [FINALIZE]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=147 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 64(GETNEXT), 57(OPEN)
+|  |  |  |
+|  |  |  61:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=46,47,48 row-size=40B cardinality=719.38K
+|  |  |  |  in pipelines: 57(GETNEXT), 59(OPEN)
+|  |  |  |
+|  |  |  |--59:SCAN HDFS [tpcds_parquet.date_dim d3]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=48 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 59(GETNEXT)
+|  |  |  |
+|  |  |  60:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=46,47 row-size=32B cardinality=719.38K
+|  |  |  |  in pipelines: 57(GETNEXT), 58(OPEN)
+|  |  |  |
+|  |  |  |--58:SCAN HDFS [tpcds_parquet.item iws]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=47 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 58(GETNEXT)
+|  |  |  |
+|  |  |  57:SCAN HDFS [tpcds_parquet.web_sales]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=46 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 57(GETNEXT)
+|  |  |
+|  |  63:HASH JOIN [LEFT SEMI JOIN]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39,40 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 62(OPEN)
+|  |  |
+|  |  |--62:AGGREGATE [FINALIZE]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=146 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 62(GETNEXT), 52(OPEN)
+|  |  |  |
+|  |  |  56:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=42,43,44 row-size=40B cardinality=1.44M
+|  |  |  |  in pipelines: 52(GETNEXT), 54(OPEN)
+|  |  |  |
+|  |  |  |--54:SCAN HDFS [tpcds_parquet.date_dim d2]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=44 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 54(GETNEXT)
+|  |  |  |
+|  |  |  55:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=42,43 row-size=32B cardinality=1.44M
+|  |  |  |  in pipelines: 52(GETNEXT), 53(OPEN)
+|  |  |  |
+|  |  |  |--53:SCAN HDFS [tpcds_parquet.item ics]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=43 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 53(GETNEXT)
+|  |  |  |
+|  |  |  52:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=42 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 52(GETNEXT)
+|  |  |
+|  |  51:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39,40 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 49(OPEN)
+|  |  |
+|  |  |--49:SCAN HDFS [tpcds_parquet.date_dim d1]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=40 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 49(GETNEXT)
+|  |  |
+|  |  50:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39 row-size=32B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 48(OPEN)
+|  |  |
+|  |  |--48:SCAN HDFS [tpcds_parquet.item iss]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=39 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 48(GETNEXT)
+|  |  |
+|  |  47:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=38 row-size=12B cardinality=2.88M
+|  |     in pipelines: 47(GETNEXT)
+|  |
+|  69:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=34,36,35 row-size=52B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT), 44(OPEN)
+|  |
+|  |--44:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=35 row-size=20B cardinality=18.00K
+|  |     in pipelines: 44(GETNEXT)
+|  |
+|  68:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF046[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=34,36 row-size=32B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT), 45(OPEN)
+|  |
+|  |--45:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=36 row-size=12B cardinality=108
+|  |     in pipelines: 45(GETNEXT)
+|  |
+|  43:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF046[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=34 row-size=20B cardinality=1.44M
+|     in pipelines: 43(GETNEXT)
+|
+42:NESTED LOOP JOIN [INNER JOIN]
+|  predicates: sum(ss_quantity * ss_list_price) > avg(quantity * list_price)
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=20,31 row-size=52B cardinality=148.80K
+|  in pipelines: 30(GETNEXT), 41(OPEN)
+|
+|--41:AGGREGATE [FINALIZE]
+|  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=31 row-size=16B cardinality=1
+|  |  in pipelines: 41(GETNEXT), 32(OPEN), 35(OPEN), 38(OPEN)
+|  |
+|  31:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=5.04M
+|  |  in pipelines: 32(GETNEXT), 35(GETNEXT), 38(GETNEXT)
+|  |
+|  |--40:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=26,27 row-size=20B cardinality=719.38K
+|  |  |  in pipelines: 38(GETNEXT), 39(OPEN)
+|  |  |
+|  |  |--39:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=27 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 39(GETNEXT)
+|  |  |
+|  |  38:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=26 row-size=12B cardinality=719.38K
+|  |     in pipelines: 38(GETNEXT)
+|  |
+|  |--37:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=24,25 row-size=20B cardinality=1.44M
+|  |  |  in pipelines: 35(GETNEXT), 36(OPEN)
+|  |  |
+|  |  |--36:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=25 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 36(GETNEXT)
+|  |  |
+|  |  35:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=24 row-size=12B cardinality=1.44M
+|  |     in pipelines: 35(GETNEXT)
+|  |
+|  34:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22,23 row-size=20B cardinality=2.88M
+|  |  in pipelines: 32(GETNEXT), 33(OPEN)
+|  |
+|  |--33:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=23 row-size=8B cardinality=7.30K
+|  |     in pipelines: 33(GETNEXT)
+|  |
+|  32:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=22 row-size=12B cardinality=2.88M
+|     in pipelines: 32(GETNEXT)
+|
+30:AGGREGATE [FINALIZE]
+|  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_list_price), count(*)
+|  group by: i_brand_id, i_class_id, i_category_id
+|  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=20 row-size=36B cardinality=148.80K
+|  in pipelines: 30(GETNEXT), 01(OPEN)
+|
+29:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  runtime filters: RF000[bloom] <- tpcds_parquet.item.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=52B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 28(OPEN)
+|
+|--28:AGGREGATE [FINALIZE]
+|  |  group by: tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=126 row-size=8B cardinality=17.98K
+|  |  in pipelines: 28(GETNEXT), 24(OPEN)
+|  |
+|  25:HASH JOIN [INNER JOIN]
+|  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  runtime filters: RF006[bloom] <- i_brand_id, RF007[bloom] <- i_category_id, RF008[bloom] <- i_class_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,3 row-size=32B cardinality=148.80K
+|  |  in pipelines: 24(GETNEXT), 04(OPEN)
+|  |
+|  |--04:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=20B cardinality=18.00K
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  24:AGGREGATE [FINALIZE]
+|  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 24(GETNEXT), 05(OPEN)
+|  |
+|  23:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  runtime filters: RF012[bloom] <- iws.i_brand_id, RF013[bloom] <- iws.i_category_id
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 22(OPEN)
+|  |
+|  |--22:AGGREGATE [FINALIZE]
+|  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=125 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 22(GETNEXT), 15(OPEN)
+|  |  |
+|  |  19:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13,14 row-size=40B cardinality=719.38K
+|  |  |  in pipelines: 15(GETNEXT), 17(OPEN)
+|  |  |
+|  |  |--17:SCAN HDFS [tpcds_parquet.date_dim d3]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=14 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 17(GETNEXT)
+|  |  |
+|  |  18:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13 row-size=32B cardinality=719.38K
+|  |  |  in pipelines: 15(GETNEXT), 16(OPEN)
+|  |  |
+|  |  |--16:SCAN HDFS [tpcds_parquet.item iws]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=13 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 16(GETNEXT)
+|  |  |
+|  |  15:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=12B cardinality=719.38K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  21:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 20(OPEN)
+|  |
+|  |--20:AGGREGATE [FINALIZE]
+|  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=124 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 20(GETNEXT), 10(OPEN)
+|  |  |
+|  |  14:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9,10 row-size=40B cardinality=1.44M
+|  |  |  in pipelines: 10(GETNEXT), 12(OPEN)
+|  |  |
+|  |  |--12:SCAN HDFS [tpcds_parquet.date_dim d2]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 12(GETNEXT)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9 row-size=32B cardinality=1.44M
+|  |  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |  |
+|  |  |--11:SCAN HDFS [tpcds_parquet.item ics]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=9 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  10:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=8 row-size=12B cardinality=1.44M
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 07(OPEN)
+|  |
+|  |--07:SCAN HDFS [tpcds_parquet.date_dim d1]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=8B cardinality=7.30K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=32B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 06(OPEN)
+|  |
+|  |--06:SCAN HDFS [tpcds_parquet.item iss]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF006[bloom] -> iss.i_brand_id, RF007[bloom] -> iss.i_category_id, RF008[bloom] -> iss.i_class_id, RF012[bloom] -> iss.i_brand_id, RF013[bloom] -> iss.i_category_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=20B cardinality=18.00K
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=12B cardinality=2.88M
+|     in pipelines: 05(GETNEXT)
+|
+27:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=52B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+26:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=32B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> ss_sold_date_sk, RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=396.69MB Threads=120
+Per-Host Resource Estimates: Memory=3.67GB
+F80:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.80KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(104,105,106,107,108) WHEN 104 THEN channel WHEN 105 THEN channel WHEN 106 THEN channel WHEN 107 THEN channel WHEN 108 THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_brand_id WHEN 105 THEN i_brand_id WHEN 106 THEN i_brand_id WHEN 107 THEN NULL WHEN 108 THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_class_id WHEN 105 THEN i_class_id WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_category_id WHEN 105 THEN NULL WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END, aggif(valid_tid(104,105,106,107,108) IN (104, 105, 106, 107, 108), CASE valid_tid(104,105,106,107,108) WHEN 104 THEN sum(sales) WHEN 105 THEN sum(sales) WHEN 106 THEN sum(sales) WHEN 107 THEN sum(sales) WHEN 108 THEN sum(sales) END), aggif(valid_tid(104,105,106,107,108) IN (104, 105, 106, 107, 108), CASE valid_tid(104,105,106,107,108) WHEN 104 THEN sum(number_sales) WHEN 105 THEN sum(number_sales) WHEN 106 THEN sum(number_sales) WHEN 107 THEN sum(number_sales) WHEN 108 THEN sum(number_sales) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+216:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: CASE valid_tid(104,105,106,107,108) WHEN 104 THEN channel WHEN 105 THEN channel WHEN 106 THEN channel WHEN 107 THEN channel WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_brand_id WHEN 105 THEN i_brand_id WHEN 106 THEN i_brand_id WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_class_id WHEN 105 THEN i_class_id WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_category_id WHEN 105 THEN NULL WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC
+|  limit: 100
+|  mem-estimate=16.80KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=110 row-size=48B cardinality=100
+|  in pipelines: 129(GETNEXT)
+|
+F79:PLAN FRAGMENT [HASH(CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(channel) WHEN 105 THEN murmur_hash(channel) WHEN 106 THEN murmur_hash(channel) WHEN 107 THEN murmur_hash(channel) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_brand_id) WHEN 105 THEN murmur_hash(i_brand_id) WHEN 106 THEN murmur_hash(i_brand_id) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_class_id) WHEN 105 THEN murmur_hash(i_class_id) WHEN 106 THEN murmur_hash(NULL) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_category_id) WHEN 105 THEN murmur_hash(NULL) WHEN 106 THEN murmur_hash(NULL) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=188.57MB mem-reservation=91.75MB thread-reservation=1
+129:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(104,105,106,107,108) WHEN 104 THEN channel WHEN 105 THEN channel WHEN 106 THEN channel WHEN 107 THEN channel WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_brand_id WHEN 105 THEN i_brand_id WHEN 106 THEN i_brand_id WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_class_id WHEN 105 THEN i_class_id WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_category_id WHEN 105 THEN NULL WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC
+|  mem-estimate=4.69KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=110 row-size=48B cardinality=100
+|  in pipelines: 129(GETNEXT), 128(OPEN)
+|
+128:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(104,105,106,107,108) IN (CAST(104 AS INT), CAST(105 AS INT), CAST(106 AS INT), CAST(107 AS INT), CAST(108 AS INT)), CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN sum(sales) WHEN CAST(105 AS INT) THEN sum(sales) WHEN CAST(106 AS INT) THEN sum(sales) WHEN CAST(107 AS INT) THEN sum(sales) WHEN CAST(108 AS INT) THEN sum(sales) END), aggif(valid_tid(104,105,106,107,108) IN (CAST(104 AS INT), CAST(105 AS INT), CAST(106 AS INT), CAST(107 AS INT), CAST(108 AS INT)), CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN sum(number_sales) WHEN CAST(105 AS INT) THEN sum(number_sales) WHEN CAST(106 AS INT) THEN sum(number_sales) WHEN CAST(107 AS INT) THEN sum(number_sales) WHEN CAST(108 AS INT) THEN sum(number_sales) END)
+|  group by: CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN channel WHEN CAST(105 AS INT) THEN channel WHEN CAST(106 AS INT) THEN channel WHEN CAST(107 AS INT) THEN channel WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN i_brand_id WHEN CAST(105 AS INT) THEN i_brand_id WHEN CAST(106 AS INT) THEN i_brand_id WHEN CAST(107 AS INT) THEN NULL WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN i_class_id WHEN CAST(105 AS INT) THEN i_class_id WHEN CAST(106 AS INT) THEN NULL WHEN CAST(107 AS INT) THEN NULL WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN i_category_id WHEN CAST(105 AS INT) THEN NULL WHEN CAST(106 AS INT) THEN NULL WHEN CAST(107 AS INT) THEN NULL WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN CAST(104 AS INT) WHEN CAST(105 AS INT) THEN CAST(105 AS INT) WHEN CAST(106 AS INT) THEN CAST(106 AS INT) WHEN CAST(107 AS INT) THEN CAST(107 AS INT) WHEN CAST(108 AS INT) THEN CAST(108 AS INT) END
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=109 row-size=52B cardinality=562.30K
+|  in pipelines: 128(GETNEXT), 215(OPEN)
+|
+215:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum:merge(sales), sum:merge(number_sales)
+|    group by: channel, i_brand_id, i_class_id, i_category_id
+|  Class 1
+|    output: sum:merge(sales), sum:merge(number_sales)
+|    group by: channel, i_brand_id, i_class_id, NULL
+|  Class 2
+|    output: sum:merge(sales), sum:merge(number_sales)
+|    group by: channel, i_brand_id, NULL, NULL
+|  Class 3
+|    output: sum:merge(sales), sum:merge(number_sales)
+|    group by: channel, NULL, NULL, NULL
+|  Class 4
+|    output: sum:merge(sales), sum:merge(number_sales)
+|    group by: NULL, NULL, NULL, NULL
+|  mem-estimate=171.57MB mem-reservation=74.75MB thread-reservation=0
+|  tuple-ids=104N,105N,106N,107N,108N row-size=240B cardinality=562.30K
+|  in pipelines: 215(GETNEXT), 151(OPEN), 179(OPEN), 207(OPEN)
+|
+214:EXCHANGE [HASH(CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(channel) WHEN 105 THEN murmur_hash(channel) WHEN 106 THEN murmur_hash(channel) WHEN 107 THEN murmur_hash(channel) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_brand_id) WHEN 105 THEN murmur_hash(i_brand_id) WHEN 106 THEN murmur_hash(i_brand_id) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_class_id) WHEN 105 THEN murmur_hash(i_class_id) WHEN 106 THEN murmur_hash(NULL) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_category_id) WHEN 105 THEN murmur_hash(NULL) WHEN 106 THEN murmur_hash(NULL) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END)]
+|  mem-estimate=10.76MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=104N,105N,106N,107N,108N row-size=240B cardinality=562.30K
+|  in pipelines: 151(GETNEXT), 179(GETNEXT), 207(GETNEXT)
+|
+F78:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=111.57MB mem-reservation=79.75MB thread-reservation=1
+127:AGGREGATE [STREAMING]
+|  Class 0
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, i_brand_id, i_class_id, i_category_id
+|  Class 1
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, i_brand_id, i_class_id, NULL
+|  Class 2
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, i_brand_id, NULL, NULL
+|  Class 3
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, NULL, NULL, NULL
+|  Class 4
+|    output: sum(sales), sum(number_sales)
+|    group by: NULL, NULL, NULL, NULL
+|  mem-estimate=99.73MB mem-reservation=75.00MB thread-reservation=0
+|  tuple-ids=104N,105N,106N,107N,108N row-size=240B cardinality=562.30K
+|  in pipelines: 151(GETNEXT), 179(GETNEXT), 207(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=102 row-size=48B cardinality=276.96K
+|  in pipelines: 151(GETNEXT), 179(GETNEXT), 207(GETNEXT)
+|
+|--126:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  |  predicates: sum(ws_quantity * ws_list_price) > avg(quantity * list_price)
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=88,99 row-size=52B cardinality=42.85K
+|  |  in pipelines: 207(GETNEXT), 212(OPEN)
+|  |
+|  |--213:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=99 row-size=16B cardinality=1
+|  |  |  in pipelines: 212(GETNEXT)
+|  |  |
+|  |  F77:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  212:AGGREGATE [FINALIZE]
+|  |  |  output: avg:merge(quantity * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=99 row-size=16B cardinality=1
+|  |  |  in pipelines: 212(GETNEXT), 125(OPEN)
+|  |  |
+|  |  211:EXCHANGE [UNPARTITIONED]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=98 row-size=16B cardinality=1
+|  |  |  in pipelines: 125(GETNEXT)
+|  |  |
+|  |  F76:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=156.00MB mem-reservation=5.94MB thread-reservation=2
+|  |  125:AGGREGATE
+|  |  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=98 row-size=16B cardinality=1
+|  |  |  in pipelines: 125(GETNEXT), 116(OPEN), 119(OPEN), 122(OPEN)
+|  |  |
+|  |  115:UNION
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=96 row-size=8B cardinality=5.04M
+|  |  |  in pipelines: 116(GETNEXT), 119(GETNEXT), 122(GETNEXT)
+|  |  |
+|  |  |--124:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=94,95 row-size=20B cardinality=719.38K
+|  |  |  |  in pipelines: 122(GETNEXT), 123(OPEN)
+|  |  |  |
+|  |  |  |--210:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=95 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 123(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F75:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  123:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=95 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 123(GETNEXT)
+|  |  |  |
+|  |  |  122:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=94 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 122(GETNEXT)
+|  |  |
+|  |  |--121:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=92,93 row-size=20B cardinality=1.44M
+|  |  |  |  in pipelines: 119(GETNEXT), 120(OPEN)
+|  |  |  |
+|  |  |  |--209:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=93 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 120(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F73:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  120:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=93 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 120(GETNEXT)
+|  |  |  |
+|  |  |  119:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=92 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 119(GETNEXT)
+|  |  |
+|  |  118:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=90,91 row-size=20B cardinality=2.88M
+|  |  |  in pipelines: 116(GETNEXT), 117(OPEN)
+|  |  |
+|  |  |--208:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=91 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 117(GETNEXT)
+|  |  |  |
+|  |  |  F71:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  117:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=91 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 117(GETNEXT)
+|  |  |
+|  |  116:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=90 row-size=12B cardinality=2.88M
+|  |     in pipelines: 116(GETNEXT)
+|  |
+|  207:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_quantity * ws_list_price), count:merge(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=88 row-size=36B cardinality=42.85K
+|  |  in pipelines: 207(GETNEXT), 85(OPEN)
+|  |
+|  206:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  mem-estimate=833.29KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=88 row-size=36B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT)
+|  |
+|  F52:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=145.37MB mem-reservation=13.81MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  114:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(ws_quantity AS DECIMAL(10,0)) * ws_list_price), count(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=88 row-size=36B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT)
+|  |
+|  113:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: ws_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=68,70,69 row-size=52B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT), 204(OPEN)
+|  |
+|  |--205:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=176.43KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=170 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 204(GETNEXT)
+|  |  |
+|  |  F68:PLAN FRAGMENT [HASH(tpcds_parquet.item.i_item_sk)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reservation=1
+|  |  204:AGGREGATE [FINALIZE]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=170 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 204(GETNEXT), 201(OPEN)
+|  |  |
+|  |  203:EXCHANGE [HASH(tpcds_parquet.item.i_item_sk)]
+|  |  |  mem-estimate=82.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=170 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 201(GETNEXT)
+|  |  |
+|  |  F66:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=22.92MB mem-reservation=5.88MB thread-reservation=1
+|  |  112:AGGREGATE [STREAMING]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=170 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 201(GETNEXT)
+|  |  |
+|  |  109:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=84,71 row-size=32B cardinality=148.80K
+|  |  |  in pipelines: 201(GETNEXT), 88(OPEN)
+|  |  |
+|  |  |--202:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=71 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 88(GETNEXT)
+|  |  |  |
+|  |  |  F67:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  88:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=71 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 88(GETNEXT)
+|  |  |
+|  |  201:AGGREGATE [FINALIZE]
+|  |  |  group by: $a$2.brand_id, $a$2.class_id, $a$2.category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=84 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 201(GETNEXT), 89(OPEN)
+|  |  |
+|  |  200:EXCHANGE [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)]
+|  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=84 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 89(GETNEXT)
+|  |  |
+|  |  F55:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=39.54MB mem-reservation=13.12MB thread-reservation=2
+|  |  108:AGGREGATE [STREAMING]
+|  |  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=84 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 89(GETNEXT)
+|  |  |
+|  |  107:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73,74 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 198(OPEN)
+|  |  |
+|  |  |--199:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=169 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 198(GETNEXT)
+|  |  |  |
+|  |  |  F65:PLAN FRAGMENT [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)] hosts=2 instances=2
+|  |  |  Per-Host Resources: mem-estimate=10.88MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  198:AGGREGATE [FINALIZE]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=169 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 198(GETNEXT), 99(OPEN)
+|  |  |  |
+|  |  |  197:EXCHANGE [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)]
+|  |  |  |  mem-estimate=903.88KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=169 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 99(GETNEXT)
+|  |  |  |
+|  |  |  F62:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Host Resources: mem-estimate=78.31MB mem-reservation=10.88MB thread-reservation=2
+|  |  |  106:AGGREGATE [STREAMING]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=169 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 99(GETNEXT)
+|  |  |  |
+|  |  |  103:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=80,81,82 row-size=40B cardinality=719.38K
+|  |  |  |  in pipelines: 99(GETNEXT), 101(OPEN)
+|  |  |  |
+|  |  |  |--196:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=82 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 101(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F64:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  101:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=82 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 101(GETNEXT)
+|  |  |  |
+|  |  |  102:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=80,81 row-size=32B cardinality=719.38K
+|  |  |  |  in pipelines: 99(GETNEXT), 100(OPEN)
+|  |  |  |
+|  |  |  |--195:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=81 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 100(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F63:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  |  100:SCAN HDFS [tpcds_parquet.item iws, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=81 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 100(GETNEXT)
+|  |  |  |
+|  |  |  99:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=80 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 99(GETNEXT)
+|  |  |
+|  |  105:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73,74 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 193(OPEN)
+|  |  |
+|  |  |--194:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.75MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=168 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 193(GETNEXT)
+|  |  |  |
+|  |  |  F61:PLAN FRAGMENT [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=10.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  193:AGGREGATE [FINALIZE]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=168 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 193(GETNEXT), 94(OPEN)
+|  |  |  |
+|  |  |  192:EXCHANGE [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)]
+|  |  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=168 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 94(GETNEXT)
+|  |  |  |
+|  |  |  F58:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=110.31MB mem-reservation=10.88MB thread-reservation=2
+|  |  |  104:AGGREGATE [STREAMING]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=168 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 94(GETNEXT)
+|  |  |  |
+|  |  |  98:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=76,77,78 row-size=40B cardinality=1.44M
+|  |  |  |  in pipelines: 94(GETNEXT), 96(OPEN)
+|  |  |  |
+|  |  |  |--191:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=78 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 96(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F60:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  96:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=78 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 96(GETNEXT)
+|  |  |  |
+|  |  |  97:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=76,77 row-size=32B cardinality=1.44M
+|  |  |  |  in pipelines: 94(GETNEXT), 95(OPEN)
+|  |  |  |
+|  |  |  |--190:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=77 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 95(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F59:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  |  95:SCAN HDFS [tpcds_parquet.item ics, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=77 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 95(GETNEXT)
+|  |  |  |
+|  |  |  94:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=76 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 94(GETNEXT)
+|  |  |
+|  |  93:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73,74 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 91(OPEN)
+|  |  |
+|  |  |--189:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=74 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 91(GETNEXT)
+|  |  |  |
+|  |  |  F57:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  91:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=74 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 91(GETNEXT)
+|  |  |
+|  |  92:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73 row-size=32B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 90(OPEN)
+|  |  |
+|  |  |--188:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=73 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 90(GETNEXT)
+|  |  |  |
+|  |  |  F56:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  90:SCAN HDFS [tpcds_parquet.item iss, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=73 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 90(GETNEXT)
+|  |  |
+|  |  89:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=72 row-size=12B cardinality=2.88M
+|  |     in pipelines: 89(GETNEXT)
+|  |
+|  111:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=68,70,69 row-size=52B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT), 86(OPEN)
+|  |
+|  |--187:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=69 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 86(GETNEXT)
+|  |  |
+|  |  F54:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  86:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=69 row-size=20B cardinality=18.00K
+|  |     in pipelines: 86(GETNEXT)
+|  |
+|  110:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF088[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=68,70 row-size=32B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT), 87(OPEN)
+|  |
+|  |--186:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=70 row-size=12B cardinality=108
+|  |  |  in pipelines: 87(GETNEXT)
+|  |  |
+|  |  F53:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  87:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=70 row-size=12B cardinality=108
+|  |     in pipelines: 87(GETNEXT)
+|  |
+|  85:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF088[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=68 row-size=20B cardinality=719.38K
+|     in pipelines: 85(GETNEXT)
+|
+|--84:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  |  predicates: sum(cs_quantity * cs_list_price) > avg(quantity * list_price)
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54,65 row-size=52B cardinality=85.31K
+|  |  in pipelines: 179(GETNEXT), 184(OPEN)
+|  |
+|  |--185:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=65 row-size=16B cardinality=1
+|  |  |  in pipelines: 184(GETNEXT)
+|  |  |
+|  |  F51:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  184:AGGREGATE [FINALIZE]
+|  |  |  output: avg:merge(quantity * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=65 row-size=16B cardinality=1
+|  |  |  in pipelines: 184(GETNEXT), 83(OPEN)
+|  |  |
+|  |  183:EXCHANGE [UNPARTITIONED]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=64 row-size=16B cardinality=1
+|  |  |  in pipelines: 83(GETNEXT)
+|  |  |
+|  |  F50:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=156.00MB mem-reservation=5.94MB thread-reservation=2
+|  |  83:AGGREGATE
+|  |  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=64 row-size=16B cardinality=1
+|  |  |  in pipelines: 83(GETNEXT), 74(OPEN), 77(OPEN), 80(OPEN)
+|  |  |
+|  |  73:UNION
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=62 row-size=8B cardinality=5.04M
+|  |  |  in pipelines: 74(GETNEXT), 77(GETNEXT), 80(GETNEXT)
+|  |  |
+|  |  |--82:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=60,61 row-size=20B cardinality=719.38K
+|  |  |  |  in pipelines: 80(GETNEXT), 81(OPEN)
+|  |  |  |
+|  |  |  |--182:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=61 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 81(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F49:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  81:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=61 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 81(GETNEXT)
+|  |  |  |
+|  |  |  80:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=60 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 80(GETNEXT)
+|  |  |
+|  |  |--79:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=58,59 row-size=20B cardinality=1.44M
+|  |  |  |  in pipelines: 77(GETNEXT), 78(OPEN)
+|  |  |  |
+|  |  |  |--181:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=59 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 78(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F47:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  78:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=59 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 78(GETNEXT)
+|  |  |  |
+|  |  |  77:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=58 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 77(GETNEXT)
+|  |  |
+|  |  76:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=56,57 row-size=20B cardinality=2.88M
+|  |  |  in pipelines: 74(GETNEXT), 75(OPEN)
+|  |  |
+|  |  |--180:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=57 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 75(GETNEXT)
+|  |  |  |
+|  |  |  F45:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  75:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=57 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 75(GETNEXT)
+|  |  |
+|  |  74:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=56 row-size=12B cardinality=2.88M
+|  |     in pipelines: 74(GETNEXT)
+|  |
+|  179:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_quantity * cs_list_price), count:merge(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=54 row-size=36B cardinality=85.31K
+|  |  in pipelines: 179(GETNEXT), 43(OPEN)
+|  |
+|  178:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  mem-estimate=1.09MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54 row-size=36B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT)
+|  |
+|  F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=209.37MB mem-reservation=13.81MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  72:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(cs_quantity AS DECIMAL(10,0)) * cs_list_price), count(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=54 row-size=36B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT)
+|  |
+|  71:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: cs_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=34,36,35 row-size=52B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT), 176(OPEN)
+|  |
+|  |--177:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=176.43KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=148 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 176(GETNEXT)
+|  |  |
+|  |  F42:PLAN FRAGMENT [HASH(tpcds_parquet.item.i_item_sk)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reservation=1
+|  |  176:AGGREGATE [FINALIZE]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=148 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 176(GETNEXT), 173(OPEN)
+|  |  |
+|  |  175:EXCHANGE [HASH(tpcds_parquet.item.i_item_sk)]
+|  |  |  mem-estimate=82.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=148 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 173(GETNEXT)
+|  |  |
+|  |  F40:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=22.92MB mem-reservation=5.88MB thread-reservation=1
+|  |  70:AGGREGATE [STREAMING]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=148 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 173(GETNEXT)
+|  |  |
+|  |  67:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=50,37 row-size=32B cardinality=148.80K
+|  |  |  in pipelines: 173(GETNEXT), 46(OPEN)
+|  |  |
+|  |  |--174:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=37 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 46(GETNEXT)
+|  |  |  |
+|  |  |  F41:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  46:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=37 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 46(GETNEXT)
+|  |  |
+|  |  173:AGGREGATE [FINALIZE]
+|  |  |  group by: $a$2.brand_id, $a$2.class_id, $a$2.category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=50 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 173(GETNEXT), 47(OPEN)
+|  |  |
+|  |  172:EXCHANGE [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)]
+|  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=50 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 47(GETNEXT)
+|  |  |
+|  |  F29:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=39.54MB mem-reservation=13.12MB thread-reservation=2
+|  |  66:AGGREGATE [STREAMING]
+|  |  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=50 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 47(GETNEXT)
+|  |  |
+|  |  65:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39,40 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 170(OPEN)
+|  |  |
+|  |  |--171:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=147 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 170(GETNEXT)
+|  |  |  |
+|  |  |  F39:PLAN FRAGMENT [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)] hosts=2 instances=2
+|  |  |  Per-Host Resources: mem-estimate=10.88MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  170:AGGREGATE [FINALIZE]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=147 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 170(GETNEXT), 57(OPEN)
+|  |  |  |
+|  |  |  169:EXCHANGE [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)]
+|  |  |  |  mem-estimate=903.88KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=147 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 57(GETNEXT)
+|  |  |  |
+|  |  |  F36:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Host Resources: mem-estimate=78.31MB mem-reservation=10.88MB thread-reservation=2
+|  |  |  64:AGGREGATE [STREAMING]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=147 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 57(GETNEXT)
+|  |  |  |
+|  |  |  61:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=46,47,48 row-size=40B cardinality=719.38K
+|  |  |  |  in pipelines: 57(GETNEXT), 59(OPEN)
+|  |  |  |
+|  |  |  |--168:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=48 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 59(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F38:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  59:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=48 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 59(GETNEXT)
+|  |  |  |
+|  |  |  60:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=46,47 row-size=32B cardinality=719.38K
+|  |  |  |  in pipelines: 57(GETNEXT), 58(OPEN)
+|  |  |  |
+|  |  |  |--167:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=47 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 58(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F37:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  |  58:SCAN HDFS [tpcds_parquet.item iws, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=47 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 58(GETNEXT)
+|  |  |  |
+|  |  |  57:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=46 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 57(GETNEXT)
+|  |  |
+|  |  63:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39,40 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 165(OPEN)
+|  |  |
+|  |  |--166:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.75MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=146 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 165(GETNEXT)
+|  |  |  |
+|  |  |  F35:PLAN FRAGMENT [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=10.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  165:AGGREGATE [FINALIZE]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=146 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 165(GETNEXT), 52(OPEN)
+|  |  |  |
+|  |  |  164:EXCHANGE [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)]
+|  |  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=146 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 52(GETNEXT)
+|  |  |  |
+|  |  |  F32:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=110.31MB mem-reservation=10.88MB thread-reservation=2
+|  |  |  62:AGGREGATE [STREAMING]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=146 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 52(GETNEXT)
+|  |  |  |
+|  |  |  56:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=42,43,44 row-size=40B cardinality=1.44M
+|  |  |  |  in pipelines: 52(GETNEXT), 54(OPEN)
+|  |  |  |
+|  |  |  |--163:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=44 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 54(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F34:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  54:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=44 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 54(GETNEXT)
+|  |  |  |
+|  |  |  55:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=42,43 row-size=32B cardinality=1.44M
+|  |  |  |  in pipelines: 52(GETNEXT), 53(OPEN)
+|  |  |  |
+|  |  |  |--162:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=43 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 53(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F33:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  |  53:SCAN HDFS [tpcds_parquet.item ics, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=43 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 53(GETNEXT)
+|  |  |  |
+|  |  |  52:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=42 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 52(GETNEXT)
+|  |  |
+|  |  51:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39,40 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 49(OPEN)
+|  |  |
+|  |  |--161:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=40 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 49(GETNEXT)
+|  |  |  |
+|  |  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  49:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=40 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 49(GETNEXT)
+|  |  |
+|  |  50:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39 row-size=32B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 48(OPEN)
+|  |  |
+|  |  |--160:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=39 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 48(GETNEXT)
+|  |  |  |
+|  |  |  F30:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  48:SCAN HDFS [tpcds_parquet.item iss, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=39 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 48(GETNEXT)
+|  |  |
+|  |  47:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=38 row-size=12B cardinality=2.88M
+|  |     in pipelines: 47(GETNEXT)
+|  |
+|  69:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=34,36,35 row-size=52B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT), 44(OPEN)
+|  |
+|  |--159:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=35 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 44(GETNEXT)
+|  |  |
+|  |  F28:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  44:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=35 row-size=20B cardinality=18.00K
+|  |     in pipelines: 44(GETNEXT)
+|  |
+|  68:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF046[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=34,36 row-size=32B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT), 45(OPEN)
+|  |
+|  |--158:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=36 row-size=12B cardinality=108
+|  |  |  in pipelines: 45(GETNEXT)
+|  |  |
+|  |  F27:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  45:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=36 row-size=12B cardinality=108
+|  |     in pipelines: 45(GETNEXT)
+|  |
+|  43:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF046[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=34 row-size=20B cardinality=1.44M
+|     in pipelines: 43(GETNEXT)
+|
+42:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  predicates: sum(ss_quantity * ss_list_price) > avg(quantity * list_price)
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=20,31 row-size=52B cardinality=148.80K
+|  in pipelines: 151(GETNEXT), 156(OPEN)
+|
+|--157:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=31 row-size=16B cardinality=1
+|  |  in pipelines: 156(GETNEXT)
+|  |
+|  F25:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  156:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(quantity * list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=31 row-size=16B cardinality=1
+|  |  in pipelines: 156(GETNEXT), 41(OPEN)
+|  |
+|  155:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=30 row-size=16B cardinality=1
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=156.00MB mem-reservation=5.94MB thread-reservation=2
+|  41:AGGREGATE
+|  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=30 row-size=16B cardinality=1
+|  |  in pipelines: 41(GETNEXT), 32(OPEN), 35(OPEN), 38(OPEN)
+|  |
+|  31:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=5.04M
+|  |  in pipelines: 32(GETNEXT), 35(GETNEXT), 38(GETNEXT)
+|  |
+|  |--40:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=26,27 row-size=20B cardinality=719.38K
+|  |  |  in pipelines: 38(GETNEXT), 39(OPEN)
+|  |  |
+|  |  |--154:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=27 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 39(GETNEXT)
+|  |  |  |
+|  |  |  F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  39:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=27 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 39(GETNEXT)
+|  |  |
+|  |  38:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=26 row-size=12B cardinality=719.38K
+|  |     in pipelines: 38(GETNEXT)
+|  |
+|  |--37:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=24,25 row-size=20B cardinality=1.44M
+|  |  |  in pipelines: 35(GETNEXT), 36(OPEN)
+|  |  |
+|  |  |--153:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=25 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 36(GETNEXT)
+|  |  |  |
+|  |  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  36:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=25 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 36(GETNEXT)
+|  |  |
+|  |  35:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=24 row-size=12B cardinality=1.44M
+|  |     in pipelines: 35(GETNEXT)
+|  |
+|  34:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22,23 row-size=20B cardinality=2.88M
+|  |  in pipelines: 32(GETNEXT), 33(OPEN)
+|  |
+|  |--152:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=23 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 33(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  33:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=23 row-size=8B cardinality=7.30K
+|  |     in pipelines: 33(GETNEXT)
+|  |
+|  32:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=22 row-size=12B cardinality=2.88M
+|     in pipelines: 32(GETNEXT)
+|
+151:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_quantity * ss_list_price), count:merge(*)
+|  group by: i_brand_id, i_class_id, i_category_id
+|  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=20 row-size=36B cardinality=148.80K
+|  in pipelines: 151(GETNEXT), 01(OPEN)
+|
+150:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  mem-estimate=1.82MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=20 row-size=36B cardinality=148.80K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=67.37MB mem-reservation=14.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+30:AGGREGATE [STREAMING]
+|  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_list_price), count(*)
+|  group by: i_brand_id, i_class_id, i_category_id
+|  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=20 row-size=36B cardinality=148.80K
+|  in pipelines: 01(GETNEXT)
+|
+29:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  runtime filters: RF000[bloom] <- tpcds_parquet.item.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=52B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 148(OPEN)
+|
+|--149:EXCHANGE [BROADCAST]
+|  |  mem-estimate=176.43KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=126 row-size=8B cardinality=17.98K
+|  |  in pipelines: 148(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [HASH(tpcds_parquet.item.i_item_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reservation=1
+|  148:AGGREGATE [FINALIZE]
+|  |  group by: tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=126 row-size=8B cardinality=17.98K
+|  |  in pipelines: 148(GETNEXT), 145(OPEN)
+|  |
+|  147:EXCHANGE [HASH(tpcds_parquet.item.i_item_sk)]
+|  |  mem-estimate=82.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=126 row-size=8B cardinality=17.98K
+|  |  in pipelines: 145(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=25.92MB mem-reservation=8.88MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  28:AGGREGATE [STREAMING]
+|  |  group by: tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=126 row-size=8B cardinality=17.98K
+|  |  in pipelines: 145(GETNEXT)
+|  |
+|  25:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  runtime filters: RF006[bloom] <- i_brand_id, RF007[bloom] <- i_category_id, RF008[bloom] <- i_class_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,3 row-size=32B cardinality=148.80K
+|  |  in pipelines: 145(GETNEXT), 04(OPEN)
+|  |
+|  |--146:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  04:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=20B cardinality=18.00K
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  145:AGGREGATE [FINALIZE]
+|  |  group by: $a$2.brand_id, $a$2.class_id, $a$2.category_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 145(GETNEXT), 05(OPEN)
+|  |
+|  144:EXCHANGE [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)]
+|  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=41.54MB mem-reservation=15.12MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  24:AGGREGATE [STREAMING]
+|  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  23:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  runtime filters: RF012[bloom] <- iws.i_brand_id, RF013[bloom] <- iws.i_category_id
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 142(OPEN)
+|  |
+|  |--143:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=125 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 142(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=10.88MB mem-reservation=1.94MB thread-reservation=1
+|  |  142:AGGREGATE [FINALIZE]
+|  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=125 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 142(GETNEXT), 15(OPEN)
+|  |  |
+|  |  141:EXCHANGE [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)]
+|  |  |  mem-estimate=903.88KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=125 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=78.31MB mem-reservation=10.88MB thread-reservation=2
+|  |  22:AGGREGATE [STREAMING]
+|  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=125 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13,14 row-size=40B cardinality=719.38K
+|  |  |  in pipelines: 15(GETNEXT), 17(OPEN)
+|  |  |
+|  |  |--140:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=14 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 17(GETNEXT)
+|  |  |  |
+|  |  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  17:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=14 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 17(GETNEXT)
+|  |  |
+|  |  18:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13 row-size=32B cardinality=719.38K
+|  |  |  in pipelines: 15(GETNEXT), 16(OPEN)
+|  |  |
+|  |  |--139:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 16(GETNEXT)
+|  |  |  |
+|  |  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  16:SCAN HDFS [tpcds_parquet.item iws, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=13 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 16(GETNEXT)
+|  |  |
+|  |  15:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=12B cardinality=719.38K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  21:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 137(OPEN)
+|  |
+|  |--138:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.75MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=124 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 137(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=10.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  137:AGGREGATE [FINALIZE]
+|  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=124 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 137(GETNEXT), 10(OPEN)
+|  |  |
+|  |  136:EXCHANGE [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)]
+|  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=124 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=110.31MB mem-reservation=10.88MB thread-reservation=2
+|  |  20:AGGREGATE [STREAMING]
+|  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=124 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9,10 row-size=40B cardinality=1.44M
+|  |  |  in pipelines: 10(GETNEXT), 12(OPEN)
+|  |  |
+|  |  |--135:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 12(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  12:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 12(GETNEXT)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9 row-size=32B cardinality=1.44M
+|  |  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |  |
+|  |  |--134:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=9 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 11(GETNEXT)
+|  |  |  |
+|  |  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  11:SCAN HDFS [tpcds_parquet.item ics, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=9 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  10:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=8 row-size=12B cardinality=1.44M
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 07(OPEN)
+|  |
+|  |--133:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=8B cardinality=7.30K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=32B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 06(OPEN)
+|  |
+|  |--132:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=69.00MB mem-reservation=5.25MB thread-reservation=2 runtime-filters-memory=5.00MB
+|  |  06:SCAN HDFS [tpcds_parquet.item iss, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF006[bloom] -> iss.i_brand_id, RF007[bloom] -> iss.i_category_id, RF008[bloom] -> iss.i_class_id, RF012[bloom] -> iss.i_brand_id, RF013[bloom] -> iss.i_category_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=20B cardinality=18.00K
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=12B cardinality=2.88M
+|     in pipelines: 05(GETNEXT)
+|
+27:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=52B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--131:EXCHANGE [BROADCAST]
+|  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=20B cardinality=18.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=65.00MB mem-reservation=1.25MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+26:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=32B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--130:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> ss_sold_date_sk, RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=634.00MB Threads=135
+Per-Host Resource Estimates: Memory=2.36GB
+F80:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=32.03KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(104,105,106,107,108) WHEN 104 THEN channel WHEN 105 THEN channel WHEN 106 THEN channel WHEN 107 THEN channel WHEN 108 THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_brand_id WHEN 105 THEN i_brand_id WHEN 106 THEN i_brand_id WHEN 107 THEN NULL WHEN 108 THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_class_id WHEN 105 THEN i_class_id WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_category_id WHEN 105 THEN NULL WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END, aggif(valid_tid(104,105,106,107,108) IN (104, 105, 106, 107, 108), CASE valid_tid(104,105,106,107,108) WHEN 104 THEN sum(sales) WHEN 105 THEN sum(sales) WHEN 106 THEN sum(sales) WHEN 107 THEN sum(sales) WHEN 108 THEN sum(sales) END), aggif(valid_tid(104,105,106,107,108) IN (104, 105, 106, 107, 108), CASE valid_tid(104,105,106,107,108) WHEN 104 THEN sum(number_sales) WHEN 105 THEN sum(number_sales) WHEN 106 THEN sum(number_sales) WHEN 107 THEN sum(number_sales) WHEN 108 THEN sum(number_sales) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+216:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: CASE valid_tid(104,105,106,107,108) WHEN 104 THEN channel WHEN 105 THEN channel WHEN 106 THEN channel WHEN 107 THEN channel WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_brand_id WHEN 105 THEN i_brand_id WHEN 106 THEN i_brand_id WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_class_id WHEN 105 THEN i_class_id WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_category_id WHEN 105 THEN NULL WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC
+|  limit: 100
+|  mem-estimate=32.03KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=110 row-size=48B cardinality=100
+|  in pipelines: 129(GETNEXT)
+|
+F79:PLAN FRAGMENT [HASH(CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(channel) WHEN 105 THEN murmur_hash(channel) WHEN 106 THEN murmur_hash(channel) WHEN 107 THEN murmur_hash(channel) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_brand_id) WHEN 105 THEN murmur_hash(i_brand_id) WHEN 106 THEN murmur_hash(i_brand_id) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_class_id) WHEN 105 THEN murmur_hash(i_class_id) WHEN 106 THEN murmur_hash(NULL) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_category_id) WHEN 105 THEN murmur_hash(NULL) WHEN 106 THEN murmur_hash(NULL) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=112.31MB mem-reservation=83.25MB thread-reservation=1
+129:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(104,105,106,107,108) WHEN 104 THEN channel WHEN 105 THEN channel WHEN 106 THEN channel WHEN 107 THEN channel WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_brand_id WHEN 105 THEN i_brand_id WHEN 106 THEN i_brand_id WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_class_id WHEN 105 THEN i_class_id WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC, CASE valid_tid(104,105,106,107,108) WHEN 104 THEN i_category_id WHEN 105 THEN NULL WHEN 106 THEN NULL WHEN 107 THEN NULL WHEN 108 THEN NULL END ASC
+|  mem-estimate=4.69KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=110 row-size=48B cardinality=100
+|  in pipelines: 129(GETNEXT), 128(OPEN)
+|
+128:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(104,105,106,107,108) IN (CAST(104 AS INT), CAST(105 AS INT), CAST(106 AS INT), CAST(107 AS INT), CAST(108 AS INT)), CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN sum(sales) WHEN CAST(105 AS INT) THEN sum(sales) WHEN CAST(106 AS INT) THEN sum(sales) WHEN CAST(107 AS INT) THEN sum(sales) WHEN CAST(108 AS INT) THEN sum(sales) END), aggif(valid_tid(104,105,106,107,108) IN (CAST(104 AS INT), CAST(105 AS INT), CAST(106 AS INT), CAST(107 AS INT), CAST(108 AS INT)), CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN sum(number_sales) WHEN CAST(105 AS INT) THEN sum(number_sales) WHEN CAST(106 AS INT) THEN sum(number_sales) WHEN CAST(107 AS INT) THEN sum(number_sales) WHEN CAST(108 AS INT) THEN sum(number_sales) END)
+|  group by: CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN channel WHEN CAST(105 AS INT) THEN channel WHEN CAST(106 AS INT) THEN channel WHEN CAST(107 AS INT) THEN channel WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN i_brand_id WHEN CAST(105 AS INT) THEN i_brand_id WHEN CAST(106 AS INT) THEN i_brand_id WHEN CAST(107 AS INT) THEN NULL WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN i_class_id WHEN CAST(105 AS INT) THEN i_class_id WHEN CAST(106 AS INT) THEN NULL WHEN CAST(107 AS INT) THEN NULL WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN i_category_id WHEN CAST(105 AS INT) THEN NULL WHEN CAST(106 AS INT) THEN NULL WHEN CAST(107 AS INT) THEN NULL WHEN CAST(108 AS INT) THEN NULL END, CASE valid_tid(104,105,106,107,108) WHEN CAST(104 AS INT) THEN CAST(104 AS INT) WHEN CAST(105 AS INT) THEN CAST(105 AS INT) WHEN CAST(106 AS INT) THEN CAST(106 AS INT) WHEN CAST(107 AS INT) THEN CAST(107 AS INT) WHEN CAST(108 AS INT) THEN CAST(108 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=109 row-size=52B cardinality=562.30K
+|  in pipelines: 128(GETNEXT), 215(OPEN)
+|
+215:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum:merge(sales), sum:merge(number_sales)
+|    group by: channel, i_brand_id, i_class_id, i_category_id
+|  Class 1
+|    output: sum:merge(sales), sum:merge(number_sales)
+|    group by: channel, i_brand_id, i_class_id, NULL
+|  Class 2
+|    output: sum:merge(sales), sum:merge(number_sales)
+|    group by: channel, i_brand_id, NULL, NULL
+|  Class 3
+|    output: sum:merge(sales), sum:merge(number_sales)
+|    group by: channel, NULL, NULL, NULL
+|  Class 4
+|    output: sum:merge(sales), sum:merge(number_sales)
+|    group by: NULL, NULL, NULL, NULL
+|  mem-estimate=100.78MB mem-reservation=74.75MB thread-reservation=0
+|  tuple-ids=104N,105N,106N,107N,108N row-size=240B cardinality=562.30K
+|  in pipelines: 215(GETNEXT), 151(OPEN), 179(OPEN), 207(OPEN)
+|
+214:EXCHANGE [HASH(CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(channel) WHEN 105 THEN murmur_hash(channel) WHEN 106 THEN murmur_hash(channel) WHEN 107 THEN murmur_hash(channel) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_brand_id) WHEN 105 THEN murmur_hash(i_brand_id) WHEN 106 THEN murmur_hash(i_brand_id) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_class_id) WHEN 105 THEN murmur_hash(i_class_id) WHEN 106 THEN murmur_hash(NULL) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END,CASE valid_tid(104,105,106,107,108) WHEN 104 THEN murmur_hash(i_category_id) WHEN 105 THEN murmur_hash(NULL) WHEN 106 THEN murmur_hash(NULL) WHEN 107 THEN murmur_hash(NULL) WHEN 108 THEN murmur_hash(NULL) END)]
+|  mem-estimate=11.52MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=104N,105N,106N,107N,108N row-size=240B cardinality=562.30K
+|  in pipelines: 151(GETNEXT), 179(GETNEXT), 207(GETNEXT)
+|
+F78:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=76.80MB mem-reservation=43.88MB thread-reservation=1
+127:AGGREGATE [STREAMING]
+|  Class 0
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, i_brand_id, i_class_id, i_category_id
+|  Class 1
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, i_brand_id, i_class_id, NULL
+|  Class 2
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, i_brand_id, NULL, NULL
+|  Class 3
+|    output: sum(sales), sum(number_sales)
+|    group by: channel, NULL, NULL, NULL
+|  Class 4
+|    output: sum(sales), sum(number_sales)
+|    group by: NULL, NULL, NULL, NULL
+|  mem-estimate=64.87MB mem-reservation=41.00MB thread-reservation=0
+|  tuple-ids=104N,105N,106N,107N,108N row-size=240B cardinality=562.30K
+|  in pipelines: 151(GETNEXT), 179(GETNEXT), 207(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=102 row-size=48B cardinality=276.96K
+|  in pipelines: 151(GETNEXT), 179(GETNEXT), 207(GETNEXT)
+|
+|--126:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  |  join table id: 08
+|  |  predicates: sum(ws_quantity * ws_list_price) > avg(quantity * list_price)
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=88,99 row-size=52B cardinality=42.85K
+|  |  in pipelines: 207(GETNEXT), 212(OPEN)
+|  |
+|  |--F89:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=08 plan-id=09 cohort-id=01
+|  |  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  |
+|  |  213:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=99 row-size=16B cardinality=1
+|  |  |  in pipelines: 212(GETNEXT)
+|  |  |
+|  |  F77:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  212:AGGREGATE [FINALIZE]
+|  |  |  output: avg:merge(quantity * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=99 row-size=16B cardinality=1
+|  |  |  in pipelines: 212(GETNEXT), 125(OPEN)
+|  |  |
+|  |  211:EXCHANGE [UNPARTITIONED]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=98 row-size=16B cardinality=1
+|  |  |  in pipelines: 125(GETNEXT)
+|  |  |
+|  |  F76:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  125:AGGREGATE
+|  |  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=98 row-size=16B cardinality=1
+|  |  |  in pipelines: 125(GETNEXT), 116(OPEN), 119(OPEN), 122(OPEN)
+|  |  |
+|  |  115:UNION
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=96 row-size=8B cardinality=5.04M
+|  |  |  in pipelines: 116(GETNEXT), 119(GETNEXT), 122(GETNEXT)
+|  |  |
+|  |  |--124:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=11
+|  |  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=94,95 row-size=20B cardinality=719.38K
+|  |  |  |  in pipelines: 122(GETNEXT), 123(OPEN)
+|  |  |  |
+|  |  |  |--F92:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=11 plan-id=12 cohort-id=04
+|  |  |  |  |  build expressions: d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  210:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=95 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 123(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F75:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  123:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=95 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 123(GETNEXT)
+|  |  |  |
+|  |  |  122:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=94 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 122(GETNEXT)
+|  |  |
+|  |  |--121:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=10
+|  |  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=92,93 row-size=20B cardinality=1.44M
+|  |  |  |  in pipelines: 119(GETNEXT), 120(OPEN)
+|  |  |  |
+|  |  |  |--F91:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=10 plan-id=11 cohort-id=04
+|  |  |  |  |  build expressions: d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  209:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=93 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 120(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F73:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  120:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=93 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 120(GETNEXT)
+|  |  |  |
+|  |  |  119:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=92 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 119(GETNEXT)
+|  |  |
+|  |  118:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=09
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=90,91 row-size=20B cardinality=2.88M
+|  |  |  in pipelines: 116(GETNEXT), 117(OPEN)
+|  |  |
+|  |  |--F90:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=09 plan-id=10 cohort-id=04
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  208:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=91 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 117(GETNEXT)
+|  |  |  |
+|  |  |  F71:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  117:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=91 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 117(GETNEXT)
+|  |  |
+|  |  116:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=90 row-size=12B cardinality=2.88M
+|  |     in pipelines: 116(GETNEXT)
+|  |
+|  207:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_quantity * ws_list_price), count:merge(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=88 row-size=36B cardinality=42.85K
+|  |  in pipelines: 207(GETNEXT), 85(OPEN)
+|  |
+|  206:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  mem-estimate=833.29KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=88 row-size=36B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT)
+|  |
+|  F52:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=42.00MB mem-reservation=7.00MB thread-reservation=1
+|  114:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(ws_quantity AS DECIMAL(10,0)) * ws_list_price), count(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=88 row-size=36B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT)
+|  |
+|  113:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=36
+|  |  hash predicates: ws_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=68,70,69 row-size=52B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT), 204(OPEN)
+|  |
+|  |--F117:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.08MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=36 plan-id=37 cohort-id=01
+|  |  |  build expressions: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  205:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=212.43KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=170 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 204(GETNEXT)
+|  |  |
+|  |  F68:PLAN FRAGMENT [HASH(tpcds_parquet.item.i_item_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=10.12MB mem-reservation=1.94MB thread-reservation=1
+|  |  204:AGGREGATE [FINALIZE]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=170 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 204(GETNEXT), 201(OPEN)
+|  |  |
+|  |  203:EXCHANGE [HASH(tpcds_parquet.item.i_item_sk)]
+|  |  |  mem-estimate=118.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=170 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 201(GETNEXT)
+|  |  |
+|  |  F66:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=20.66MB mem-reservation=3.94MB thread-reservation=1
+|  |  112:AGGREGATE [STREAMING]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=170 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 201(GETNEXT)
+|  |  |
+|  |  109:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash-table-id=37
+|  |  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=84,71 row-size=32B cardinality=148.80K
+|  |  |  in pipelines: 201(GETNEXT), 88(OPEN)
+|  |  |
+|  |  |--F118:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=6
+|  |  |  |  Per-Instance Resources: mem-estimate=2.30MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=37 plan-id=38 cohort-id=11
+|  |  |  |  build expressions: i_brand_id, i_category_id, i_class_id
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  202:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=71 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 88(GETNEXT)
+|  |  |  |
+|  |  |  F67:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  88:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=71 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 88(GETNEXT)
+|  |  |
+|  |  201:AGGREGATE [FINALIZE]
+|  |  |  group by: $a$2.brand_id, $a$2.class_id, $a$2.category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=84 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 201(GETNEXT), 89(OPEN)
+|  |  |
+|  |  200:EXCHANGE [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)]
+|  |  |  mem-estimate=677.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=84 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 89(GETNEXT)
+|  |  |
+|  |  F55:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.50MB thread-reservation=1
+|  |  108:AGGREGATE [STREAMING]
+|  |  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=84 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 89(GETNEXT)
+|  |  |
+|  |  107:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash-table-id=38
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73,74 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 198(OPEN)
+|  |  |
+|  |  |--F119:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=7.48MB mem-reservation=5.75MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=38 plan-id=39 cohort-id=11
+|  |  |  |  build expressions: iws.i_brand_id, iws.i_category_id, iws.i_class_id
+|  |  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |
+|  |  |  199:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=169 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 198(GETNEXT)
+|  |  |  |
+|  |  |  F65:PLAN FRAGMENT [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=10.88MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  198:AGGREGATE [FINALIZE]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=169 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 198(GETNEXT), 99(OPEN)
+|  |  |  |
+|  |  |  197:EXCHANGE [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)]
+|  |  |  |  mem-estimate=903.88KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=169 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 99(GETNEXT)
+|  |  |  |
+|  |  |  F62:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=42.00MB mem-reservation=7.00MB thread-reservation=1
+|  |  |  106:AGGREGATE [STREAMING]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=169 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 99(GETNEXT)
+|  |  |  |
+|  |  |  103:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=39
+|  |  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=80,81,82 row-size=40B cardinality=719.38K
+|  |  |  |  in pipelines: 99(GETNEXT), 101(OPEN)
+|  |  |  |
+|  |  |  |--F120:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=39 plan-id=40 cohort-id=12
+|  |  |  |  |  build expressions: d3.d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  196:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=82 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 101(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F64:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  101:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=82 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 101(GETNEXT)
+|  |  |  |
+|  |  |  102:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=40
+|  |  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=80,81 row-size=32B cardinality=719.38K
+|  |  |  |  in pipelines: 99(GETNEXT), 100(OPEN)
+|  |  |  |
+|  |  |  |--F121:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=40 plan-id=41 cohort-id=12
+|  |  |  |  |  build expressions: iws.i_item_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  195:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=81 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 100(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F63:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |  100:SCAN HDFS [tpcds_parquet.item iws, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |  |     tuple-ids=81 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 100(GETNEXT)
+|  |  |  |
+|  |  |  99:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=80 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 99(GETNEXT)
+|  |  |
+|  |  105:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash-table-id=41
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73,74 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 193(OPEN)
+|  |  |
+|  |  |--F122:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=7.50MB mem-reservation=5.75MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=41 plan-id=42 cohort-id=11
+|  |  |  |  build expressions: ics.i_brand_id, ics.i_category_id, ics.i_class_id
+|  |  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |
+|  |  |  194:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.75MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=168 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 193(GETNEXT)
+|  |  |  |
+|  |  |  F61:PLAN FRAGMENT [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=10.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  193:AGGREGATE [FINALIZE]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=168 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 193(GETNEXT), 94(OPEN)
+|  |  |  |
+|  |  |  192:EXCHANGE [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)]
+|  |  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=168 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 94(GETNEXT)
+|  |  |  |
+|  |  |  F58:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=7.00MB thread-reservation=1
+|  |  |  104:AGGREGATE [STREAMING]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=168 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 94(GETNEXT)
+|  |  |  |
+|  |  |  98:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=42
+|  |  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=76,77,78 row-size=40B cardinality=1.44M
+|  |  |  |  in pipelines: 94(GETNEXT), 96(OPEN)
+|  |  |  |
+|  |  |  |--F123:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=42 plan-id=43 cohort-id=13
+|  |  |  |  |  build expressions: d2.d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  191:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=78 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 96(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F60:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  96:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=78 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 96(GETNEXT)
+|  |  |  |
+|  |  |  97:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=43
+|  |  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=76,77 row-size=32B cardinality=1.44M
+|  |  |  |  in pipelines: 94(GETNEXT), 95(OPEN)
+|  |  |  |
+|  |  |  |--F124:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=43 plan-id=44 cohort-id=13
+|  |  |  |  |  build expressions: ics.i_item_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  190:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=77 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 95(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F59:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |  95:SCAN HDFS [tpcds_parquet.item ics, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |  |     tuple-ids=77 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 95(GETNEXT)
+|  |  |  |
+|  |  |  94:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=76 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 94(GETNEXT)
+|  |  |
+|  |  93:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=44
+|  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73,74 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 91(OPEN)
+|  |  |
+|  |  |--F125:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=44 plan-id=45 cohort-id=11
+|  |  |  |  build expressions: d1.d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  189:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=74 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 91(GETNEXT)
+|  |  |  |
+|  |  |  F57:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  91:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=74 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 91(GETNEXT)
+|  |  |
+|  |  92:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=45
+|  |  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=72,73 row-size=32B cardinality=2.88M
+|  |  |  in pipelines: 89(GETNEXT), 90(OPEN)
+|  |  |
+|  |  |--F126:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=45 plan-id=46 cohort-id=11
+|  |  |  |  build expressions: iss.i_item_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  188:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=73 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 90(GETNEXT)
+|  |  |  |
+|  |  |  F56:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  90:SCAN HDFS [tpcds_parquet.item iss, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=73 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 90(GETNEXT)
+|  |  |
+|  |  89:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=72 row-size=12B cardinality=2.88M
+|  |     in pipelines: 89(GETNEXT)
+|  |
+|  111:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=46
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=68,70,69 row-size=52B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT), 86(OPEN)
+|  |
+|  |--F127:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=46 plan-id=47 cohort-id=01
+|  |  |  build expressions: i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  187:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=69 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 86(GETNEXT)
+|  |  |
+|  |  F54:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  86:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=69 row-size=20B cardinality=18.00K
+|  |     in pipelines: 86(GETNEXT)
+|  |
+|  110:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=47
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=68,70 row-size=32B cardinality=42.85K
+|  |  in pipelines: 85(GETNEXT), 87(OPEN)
+|  |
+|  |--F128:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=47 plan-id=48 cohort-id=01
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF088[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  186:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=70 row-size=12B cardinality=108
+|  |  |  in pipelines: 87(GETNEXT)
+|  |  |
+|  |  F53:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  87:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=70 row-size=12B cardinality=108
+|  |     in pipelines: 87(GETNEXT)
+|  |
+|  85:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF088[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=68 row-size=20B cardinality=719.38K
+|     in pipelines: 85(GETNEXT)
+|
+|--84:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  |  join table id: 04
+|  |  predicates: sum(cs_quantity * cs_list_price) > avg(quantity * list_price)
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54,65 row-size=52B cardinality=85.31K
+|  |  in pipelines: 179(GETNEXT), 184(OPEN)
+|  |
+|  |--F85:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  |
+|  |  185:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=65 row-size=16B cardinality=1
+|  |  |  in pipelines: 184(GETNEXT)
+|  |  |
+|  |  F51:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  184:AGGREGATE [FINALIZE]
+|  |  |  output: avg:merge(quantity * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=65 row-size=16B cardinality=1
+|  |  |  in pipelines: 184(GETNEXT), 83(OPEN)
+|  |  |
+|  |  183:EXCHANGE [UNPARTITIONED]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=64 row-size=16B cardinality=1
+|  |  |  in pipelines: 83(GETNEXT)
+|  |  |
+|  |  F50:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  83:AGGREGATE
+|  |  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=64 row-size=16B cardinality=1
+|  |  |  in pipelines: 83(GETNEXT), 74(OPEN), 77(OPEN), 80(OPEN)
+|  |  |
+|  |  73:UNION
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=62 row-size=8B cardinality=5.04M
+|  |  |  in pipelines: 74(GETNEXT), 77(GETNEXT), 80(GETNEXT)
+|  |  |
+|  |  |--82:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=07
+|  |  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=60,61 row-size=20B cardinality=719.38K
+|  |  |  |  in pipelines: 80(GETNEXT), 81(OPEN)
+|  |  |  |
+|  |  |  |--F88:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=07 plan-id=08 cohort-id=03
+|  |  |  |  |  build expressions: d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  182:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=61 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 81(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F49:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  81:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=61 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 81(GETNEXT)
+|  |  |  |
+|  |  |  80:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=60 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 80(GETNEXT)
+|  |  |
+|  |  |--79:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=06
+|  |  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=58,59 row-size=20B cardinality=1.44M
+|  |  |  |  in pipelines: 77(GETNEXT), 78(OPEN)
+|  |  |  |
+|  |  |  |--F87:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=06 plan-id=07 cohort-id=03
+|  |  |  |  |  build expressions: d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  181:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=59 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 78(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F47:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  78:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=59 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 78(GETNEXT)
+|  |  |  |
+|  |  |  77:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=58 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 77(GETNEXT)
+|  |  |
+|  |  76:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=05
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=56,57 row-size=20B cardinality=2.88M
+|  |  |  in pipelines: 74(GETNEXT), 75(OPEN)
+|  |  |
+|  |  |--F86:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  180:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=57 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 75(GETNEXT)
+|  |  |  |
+|  |  |  F45:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  75:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=57 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 75(GETNEXT)
+|  |  |
+|  |  74:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=56 row-size=12B cardinality=2.88M
+|  |     in pipelines: 74(GETNEXT)
+|  |
+|  179:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_quantity * cs_list_price), count:merge(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=54 row-size=36B cardinality=85.31K
+|  |  in pipelines: 179(GETNEXT), 43(OPEN)
+|  |
+|  178:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  mem-estimate=1.09MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=54 row-size=36B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT)
+|  |
+|  F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=7.00MB thread-reservation=1
+|  72:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(cs_quantity AS DECIMAL(10,0)) * cs_list_price), count(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=54 row-size=36B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT)
+|  |
+|  71:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=24
+|  |  hash predicates: cs_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=34,36,35 row-size=52B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT), 176(OPEN)
+|  |
+|  |--F105:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.08MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=24 plan-id=25 cohort-id=01
+|  |  |  build expressions: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  177:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=212.43KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=148 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 176(GETNEXT)
+|  |  |
+|  |  F42:PLAN FRAGMENT [HASH(tpcds_parquet.item.i_item_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=10.12MB mem-reservation=1.94MB thread-reservation=1
+|  |  176:AGGREGATE [FINALIZE]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=148 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 176(GETNEXT), 173(OPEN)
+|  |  |
+|  |  175:EXCHANGE [HASH(tpcds_parquet.item.i_item_sk)]
+|  |  |  mem-estimate=118.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=148 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 173(GETNEXT)
+|  |  |
+|  |  F40:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=20.66MB mem-reservation=3.94MB thread-reservation=1
+|  |  70:AGGREGATE [STREAMING]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=148 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 173(GETNEXT)
+|  |  |
+|  |  67:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash-table-id=25
+|  |  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=50,37 row-size=32B cardinality=148.80K
+|  |  |  in pipelines: 173(GETNEXT), 46(OPEN)
+|  |  |
+|  |  |--F106:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=6
+|  |  |  |  Per-Instance Resources: mem-estimate=2.30MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=25 plan-id=26 cohort-id=08
+|  |  |  |  build expressions: i_brand_id, i_category_id, i_class_id
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  174:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=37 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 46(GETNEXT)
+|  |  |  |
+|  |  |  F41:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  46:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=37 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 46(GETNEXT)
+|  |  |
+|  |  173:AGGREGATE [FINALIZE]
+|  |  |  group by: $a$2.brand_id, $a$2.class_id, $a$2.category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=50 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 173(GETNEXT), 47(OPEN)
+|  |  |
+|  |  172:EXCHANGE [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)]
+|  |  |  mem-estimate=677.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=50 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 47(GETNEXT)
+|  |  |
+|  |  F29:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.50MB thread-reservation=1
+|  |  66:AGGREGATE [STREAMING]
+|  |  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=50 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 47(GETNEXT)
+|  |  |
+|  |  65:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash-table-id=26
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39,40 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 170(OPEN)
+|  |  |
+|  |  |--F107:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=7.48MB mem-reservation=5.75MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=26 plan-id=27 cohort-id=08
+|  |  |  |  build expressions: iws.i_brand_id, iws.i_category_id, iws.i_class_id
+|  |  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |
+|  |  |  171:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=147 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 170(GETNEXT)
+|  |  |  |
+|  |  |  F39:PLAN FRAGMENT [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=10.88MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  170:AGGREGATE [FINALIZE]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=147 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 170(GETNEXT), 57(OPEN)
+|  |  |  |
+|  |  |  169:EXCHANGE [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)]
+|  |  |  |  mem-estimate=903.88KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=147 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 57(GETNEXT)
+|  |  |  |
+|  |  |  F36:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=42.00MB mem-reservation=7.00MB thread-reservation=1
+|  |  |  64:AGGREGATE [STREAMING]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=147 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 57(GETNEXT)
+|  |  |  |
+|  |  |  61:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=27
+|  |  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=46,47,48 row-size=40B cardinality=719.38K
+|  |  |  |  in pipelines: 57(GETNEXT), 59(OPEN)
+|  |  |  |
+|  |  |  |--F108:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=27 plan-id=28 cohort-id=09
+|  |  |  |  |  build expressions: d3.d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  168:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=48 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 59(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F38:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  59:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=48 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 59(GETNEXT)
+|  |  |  |
+|  |  |  60:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=28
+|  |  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=46,47 row-size=32B cardinality=719.38K
+|  |  |  |  in pipelines: 57(GETNEXT), 58(OPEN)
+|  |  |  |
+|  |  |  |--F109:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=28 plan-id=29 cohort-id=09
+|  |  |  |  |  build expressions: iws.i_item_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  167:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=47 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 58(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F37:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |  58:SCAN HDFS [tpcds_parquet.item iws, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |  |     tuple-ids=47 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 58(GETNEXT)
+|  |  |  |
+|  |  |  57:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=46 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 57(GETNEXT)
+|  |  |
+|  |  63:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash-table-id=29
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39,40 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 165(OPEN)
+|  |  |
+|  |  |--F110:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=7.50MB mem-reservation=5.75MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=29 plan-id=30 cohort-id=08
+|  |  |  |  build expressions: ics.i_brand_id, ics.i_category_id, ics.i_class_id
+|  |  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |
+|  |  |  166:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.75MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=146 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 165(GETNEXT)
+|  |  |  |
+|  |  |  F35:PLAN FRAGMENT [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=10.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  165:AGGREGATE [FINALIZE]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=146 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 165(GETNEXT), 52(OPEN)
+|  |  |  |
+|  |  |  164:EXCHANGE [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)]
+|  |  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=146 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 52(GETNEXT)
+|  |  |  |
+|  |  |  F32:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=7.00MB thread-reservation=1
+|  |  |  62:AGGREGATE [STREAMING]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=146 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 52(GETNEXT)
+|  |  |  |
+|  |  |  56:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=30
+|  |  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=42,43,44 row-size=40B cardinality=1.44M
+|  |  |  |  in pipelines: 52(GETNEXT), 54(OPEN)
+|  |  |  |
+|  |  |  |--F111:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=30 plan-id=31 cohort-id=10
+|  |  |  |  |  build expressions: d2.d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  163:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=44 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 54(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F34:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  54:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=44 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 54(GETNEXT)
+|  |  |  |
+|  |  |  55:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=31
+|  |  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=42,43 row-size=32B cardinality=1.44M
+|  |  |  |  in pipelines: 52(GETNEXT), 53(OPEN)
+|  |  |  |
+|  |  |  |--F112:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=31 plan-id=32 cohort-id=10
+|  |  |  |  |  build expressions: ics.i_item_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  162:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=43 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 53(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F33:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |  53:SCAN HDFS [tpcds_parquet.item ics, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |  |     tuple-ids=43 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 53(GETNEXT)
+|  |  |  |
+|  |  |  52:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=42 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 52(GETNEXT)
+|  |  |
+|  |  51:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=32
+|  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39,40 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 49(OPEN)
+|  |  |
+|  |  |--F113:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=32 plan-id=33 cohort-id=08
+|  |  |  |  build expressions: d1.d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  161:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=40 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 49(GETNEXT)
+|  |  |  |
+|  |  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  49:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=40 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 49(GETNEXT)
+|  |  |
+|  |  50:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=33
+|  |  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=38,39 row-size=32B cardinality=2.88M
+|  |  |  in pipelines: 47(GETNEXT), 48(OPEN)
+|  |  |
+|  |  |--F114:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=33 plan-id=34 cohort-id=08
+|  |  |  |  build expressions: iss.i_item_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  160:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=39 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 48(GETNEXT)
+|  |  |  |
+|  |  |  F30:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  48:SCAN HDFS [tpcds_parquet.item iss, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=39 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 48(GETNEXT)
+|  |  |
+|  |  47:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=38 row-size=12B cardinality=2.88M
+|  |     in pipelines: 47(GETNEXT)
+|  |
+|  69:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=34
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=34,36,35 row-size=52B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT), 44(OPEN)
+|  |
+|  |--F115:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=34 plan-id=35 cohort-id=01
+|  |  |  build expressions: i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  159:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=35 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 44(GETNEXT)
+|  |  |
+|  |  F28:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  44:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=35 row-size=20B cardinality=18.00K
+|  |     in pipelines: 44(GETNEXT)
+|  |
+|  68:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=35
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=34,36 row-size=32B cardinality=85.31K
+|  |  in pipelines: 43(GETNEXT), 45(OPEN)
+|  |
+|  |--F116:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=35 plan-id=36 cohort-id=01
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF046[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  158:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=36 row-size=12B cardinality=108
+|  |  |  in pipelines: 45(GETNEXT)
+|  |  |
+|  |  F27:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  45:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=36 row-size=12B cardinality=108
+|  |     in pipelines: 45(GETNEXT)
+|  |
+|  43:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF046[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=34 row-size=20B cardinality=1.44M
+|     in pipelines: 43(GETNEXT)
+|
+42:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  join table id: 00
+|  predicates: sum(ss_quantity * ss_list_price) > avg(quantity * list_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=20,31 row-size=52B cardinality=148.80K
+|  in pipelines: 151(GETNEXT), 156(OPEN)
+|
+|--F81:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |
+|  157:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=31 row-size=16B cardinality=1
+|  |  in pipelines: 156(GETNEXT)
+|  |
+|  F25:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  156:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(quantity * list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=31 row-size=16B cardinality=1
+|  |  in pipelines: 156(GETNEXT), 41(OPEN)
+|  |
+|  155:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=30 row-size=16B cardinality=1
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=4.00MB thread-reservation=1
+|  41:AGGREGATE
+|  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=30 row-size=16B cardinality=1
+|  |  in pipelines: 41(GETNEXT), 32(OPEN), 35(OPEN), 38(OPEN)
+|  |
+|  31:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=5.04M
+|  |  in pipelines: 32(GETNEXT), 35(GETNEXT), 38(GETNEXT)
+|  |
+|  |--40:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=03
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=26,27 row-size=20B cardinality=719.38K
+|  |  |  in pipelines: 38(GETNEXT), 39(OPEN)
+|  |  |
+|  |  |--F84:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  154:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=27 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 39(GETNEXT)
+|  |  |  |
+|  |  |  F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  39:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=27 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 39(GETNEXT)
+|  |  |
+|  |  38:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=26 row-size=12B cardinality=719.38K
+|  |     in pipelines: 38(GETNEXT)
+|  |
+|  |--37:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=24,25 row-size=20B cardinality=1.44M
+|  |  |  in pipelines: 35(GETNEXT), 36(OPEN)
+|  |  |
+|  |  |--F83:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  153:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=25 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 36(GETNEXT)
+|  |  |  |
+|  |  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  36:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=25 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 36(GETNEXT)
+|  |  |
+|  |  35:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=24 row-size=12B cardinality=1.44M
+|  |     in pipelines: 35(GETNEXT)
+|  |
+|  34:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22,23 row-size=20B cardinality=2.88M
+|  |  in pipelines: 32(GETNEXT), 33(OPEN)
+|  |
+|  |--F82:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  152:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=23 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 33(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  33:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=23 row-size=8B cardinality=7.30K
+|  |     in pipelines: 33(GETNEXT)
+|  |
+|  32:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=22 row-size=12B cardinality=2.88M
+|     in pipelines: 32(GETNEXT)
+|
+151:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_quantity * ss_list_price), count:merge(*)
+|  group by: i_brand_id, i_class_id, i_category_id
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=20 row-size=36B cardinality=148.80K
+|  in pipelines: 151(GETNEXT), 01(OPEN)
+|
+150:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  mem-estimate=1.94MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=20 row-size=36B cardinality=148.80K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+30:AGGREGATE [STREAMING]
+|  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_list_price), count(*)
+|  group by: i_brand_id, i_class_id, i_category_id
+|  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=20 row-size=36B cardinality=148.80K
+|  in pipelines: 01(GETNEXT)
+|
+29:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash-table-id=12
+|  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=52B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 148(OPEN)
+|
+|--F93:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.08MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=12 plan-id=13 cohort-id=01
+|  |  build expressions: tpcds_parquet.item.i_item_sk
+|  |  runtime filters: RF000[bloom] <- tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  149:EXCHANGE [BROADCAST]
+|  |  mem-estimate=212.43KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=126 row-size=8B cardinality=17.98K
+|  |  in pipelines: 148(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [HASH(tpcds_parquet.item.i_item_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=10.12MB mem-reservation=1.94MB thread-reservation=1
+|  148:AGGREGATE [FINALIZE]
+|  |  group by: tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=126 row-size=8B cardinality=17.98K
+|  |  in pipelines: 148(GETNEXT), 145(OPEN)
+|  |
+|  147:EXCHANGE [HASH(tpcds_parquet.item.i_item_sk)]
+|  |  mem-estimate=118.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=126 row-size=8B cardinality=17.98K
+|  |  in pipelines: 145(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=20.66MB mem-reservation=3.94MB thread-reservation=1
+|  28:AGGREGATE [STREAMING]
+|  |  group by: tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=126 row-size=8B cardinality=17.98K
+|  |  in pipelines: 145(GETNEXT)
+|  |
+|  25:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=13
+|  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,3 row-size=32B cardinality=148.80K
+|  |  in pipelines: 145(GETNEXT), 04(OPEN)
+|  |
+|  |--F94:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=5.30MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=13 plan-id=14 cohort-id=05
+|  |  |  build expressions: i_brand_id, i_category_id, i_class_id
+|  |  |  runtime filters: RF006[bloom] <- i_brand_id, RF007[bloom] <- i_category_id, RF008[bloom] <- i_class_id
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  146:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  04:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=20B cardinality=18.00K
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  145:AGGREGATE [FINALIZE]
+|  |  group by: $a$2.brand_id, $a$2.class_id, $a$2.category_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 145(GETNEXT), 05(OPEN)
+|  |
+|  144:EXCHANGE [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)]
+|  |  mem-estimate=677.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.50MB thread-reservation=1
+|  24:AGGREGATE [STREAMING]
+|  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  23:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=14
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 142(OPEN)
+|  |
+|  |--F95:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=9.48MB mem-reservation=7.75MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=14 plan-id=15 cohort-id=05
+|  |  |  build expressions: iws.i_brand_id, iws.i_category_id, iws.i_class_id
+|  |  |  runtime filters: RF012[bloom] <- iws.i_brand_id, RF013[bloom] <- iws.i_category_id
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  143:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=125 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 142(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=10.88MB mem-reservation=1.94MB thread-reservation=1
+|  |  142:AGGREGATE [FINALIZE]
+|  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=125 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 142(GETNEXT), 15(OPEN)
+|  |  |
+|  |  141:EXCHANGE [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)]
+|  |  |  mem-estimate=903.88KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=125 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=42.00MB mem-reservation=7.00MB thread-reservation=1
+|  |  22:AGGREGATE [STREAMING]
+|  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=125 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=15
+|  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13,14 row-size=40B cardinality=719.38K
+|  |  |  in pipelines: 15(GETNEXT), 17(OPEN)
+|  |  |
+|  |  |--F96:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=15 plan-id=16 cohort-id=06
+|  |  |  |  build expressions: d3.d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  140:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=14 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 17(GETNEXT)
+|  |  |  |
+|  |  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  17:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=14 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 17(GETNEXT)
+|  |  |
+|  |  18:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=16
+|  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13 row-size=32B cardinality=719.38K
+|  |  |  in pipelines: 15(GETNEXT), 16(OPEN)
+|  |  |
+|  |  |--F97:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=16 plan-id=17 cohort-id=06
+|  |  |  |  build expressions: iws.i_item_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  139:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 16(GETNEXT)
+|  |  |  |
+|  |  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  16:SCAN HDFS [tpcds_parquet.item iws, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=13 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 16(GETNEXT)
+|  |  |
+|  |  15:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=12 row-size=12B cardinality=719.38K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  21:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=17
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 137(OPEN)
+|  |
+|  |--F98:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=7.50MB mem-reservation=5.75MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=17 plan-id=18 cohort-id=05
+|  |  |  build expressions: ics.i_brand_id, ics.i_category_id, ics.i_class_id
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  138:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.75MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=124 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 137(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=10.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  137:AGGREGATE [FINALIZE]
+|  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=124 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 137(GETNEXT), 10(OPEN)
+|  |  |
+|  |  136:EXCHANGE [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)]
+|  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=124 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=7.00MB thread-reservation=1
+|  |  20:AGGREGATE [STREAMING]
+|  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=124 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=18
+|  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9,10 row-size=40B cardinality=1.44M
+|  |  |  in pipelines: 10(GETNEXT), 12(OPEN)
+|  |  |
+|  |  |--F99:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=18 plan-id=19 cohort-id=07
+|  |  |  |  build expressions: d2.d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  135:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 12(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  12:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 12(GETNEXT)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=19
+|  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9 row-size=32B cardinality=1.44M
+|  |  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |  |
+|  |  |--F100:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=19 plan-id=20 cohort-id=07
+|  |  |  |  build expressions: ics.i_item_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  134:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=9 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 11(GETNEXT)
+|  |  |  |
+|  |  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  11:SCAN HDFS [tpcds_parquet.item ics, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=9 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  10:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=8 row-size=12B cardinality=1.44M
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=20
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 07(OPEN)
+|  |
+|  |--F101:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=20 plan-id=21 cohort-id=05
+|  |  |  build expressions: d1.d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  133:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=6 row-size=8B cardinality=7.30K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=21
+|  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=32B cardinality=2.88M
+|  |  in pipelines: 05(GETNEXT), 06(OPEN)
+|  |
+|  |--F102:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=21 plan-id=22 cohort-id=05
+|  |  |  build expressions: iss.i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  132:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  06:SCAN HDFS [tpcds_parquet.item iss, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF006[bloom] -> iss.i_brand_id, RF007[bloom] -> iss.i_category_id, RF008[bloom] -> iss.i_class_id, RF012[bloom] -> iss.i_brand_id, RF013[bloom] -> iss.i_category_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=5 row-size=20B cardinality=18.00K
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=4 row-size=12B cardinality=2.88M
+|     in pipelines: 05(GETNEXT)
+|
+27:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=22
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=52B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F103:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.24MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=22 plan-id=23 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  131:EXCHANGE [BROADCAST]
+|  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=20B cardinality=18.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=1 row-size=20B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+26:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=23
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=32B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--F104:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=23 plan-id=24 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  130:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> ss_sold_date_sk, RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q14b.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q14b.test
new file mode 100644
index 0000000..bde95df
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q14b.test
@@ -0,0 +1,3677 @@
+# TPCDS-Q14b second of two queries
+WITH cross_items AS
+
+  (SELECT i_item_sk ss_item_sk
+   FROM item,
+     (SELECT iss.i_brand_id brand_id,
+             iss.i_class_id class_id,
+             iss.i_category_id category_id
+      FROM store_sales,
+           item iss,
+           date_dim d1
+      WHERE ss_item_sk = iss.i_item_sk
+        AND ss_sold_date_sk = d1.d_date_sk
+        AND d1.d_year BETWEEN 1999 AND 1999 + 2 INTERSECT
+        SELECT ics.i_brand_id,
+               ics.i_class_id,
+               ics.i_category_id
+        FROM catalog_sales,
+             item ics,
+             date_dim d2 WHERE cs_item_sk = ics.i_item_sk
+        AND cs_sold_date_sk = d2.d_date_sk
+        AND d2.d_year BETWEEN 1999 AND 1999 + 2 INTERSECT
+        SELECT iws.i_brand_id,
+               iws.i_class_id,
+               iws.i_category_id
+        FROM web_sales,
+             item iws,
+             date_dim d3 WHERE ws_item_sk = iws.i_item_sk
+        AND ws_sold_date_sk = d3.d_date_sk
+        AND d3.d_year BETWEEN 1999 AND 1999 + 2) x
+   WHERE i_brand_id = brand_id
+     AND i_class_id = class_id
+     AND i_category_id = category_id ),
+     avg_sales AS
+
+  (SELECT avg(quantity*list_price) average_sales
+   FROM
+     (SELECT ss_quantity quantity,
+             ss_list_price list_price
+      FROM store_sales,
+           date_dim
+      WHERE ss_sold_date_sk = d_date_sk
+        AND d_year BETWEEN 1999 AND 1999 + 2
+      UNION ALL SELECT cs_quantity quantity,
+                       cs_list_price list_price
+      FROM catalog_sales,
+           date_dim
+      WHERE cs_sold_date_sk = d_date_sk
+        AND d_year BETWEEN 1999 AND 1999 + 2
+      UNION ALL SELECT ws_quantity quantity,
+                       ws_list_price list_price
+      FROM web_sales,
+           date_dim
+      WHERE ws_sold_date_sk = d_date_sk
+        AND d_year BETWEEN 1999 AND 1999 + 2) x)
+SELECT this_year.channel ty_channel,
+       this_year.i_brand_id ty_brand,
+       this_year.i_class_id ty_class,
+       this_year.i_category_id ty_category,
+       this_year.sales ty_sales,
+       this_year.number_sales ty_number_sales,
+       last_year.channel ly_channel,
+       last_year.i_brand_id ly_brand,
+       last_year.i_class_id ly_class,
+       last_year.i_category_id ly_category,
+       last_year.sales ly_sales,
+       last_year.number_sales ly_number_sales
+FROM
+  (SELECT 'store' channel,
+                  i_brand_id,
+                  i_class_id,
+                  i_category_id,
+                  sum(ss_quantity*ss_list_price) sales,
+                  count(*) number_sales
+   FROM store_sales,
+        item,
+        date_dim
+   WHERE ss_item_sk IN
+
+       (SELECT ss_item_sk
+        FROM cross_items)
+     AND ss_item_sk = i_item_sk
+     AND ss_sold_date_sk = d_date_sk
+     AND d_week_seq =
+       (SELECT d_week_seq
+        FROM date_dim
+        WHERE d_year = 1999 + 1
+          AND d_moy = 12
+          AND d_dom = 11)
+   GROUP BY i_brand_id,
+            i_class_id,
+            i_category_id
+   HAVING sum(ss_quantity*ss_list_price) >
+     (SELECT average_sales
+      FROM avg_sales)) this_year,
+  (SELECT 'store' channel,
+                  i_brand_id,
+                  i_class_id,
+                  i_category_id,
+                  sum(ss_quantity*ss_list_price) sales,
+                  count(*) number_sales
+   FROM store_sales,
+        item,
+        date_dim
+   WHERE ss_item_sk IN
+
+       (SELECT ss_item_sk
+        FROM cross_items)
+     AND ss_item_sk = i_item_sk
+     AND ss_sold_date_sk = d_date_sk
+     AND d_week_seq =
+       (SELECT d_week_seq
+        FROM date_dim
+        WHERE d_year = 1999
+          AND d_moy = 12
+          AND d_dom = 11)
+   GROUP BY i_brand_id,
+            i_class_id,
+            i_category_id
+   HAVING sum(ss_quantity*ss_list_price) >
+     (SELECT average_sales
+      FROM avg_sales)) last_year
+WHERE this_year.i_brand_id= last_year.i_brand_id
+  AND this_year.i_class_id = last_year.i_class_id
+  AND this_year.i_category_id = last_year.i_category_id
+ORDER BY this_year.channel,
+         this_year.i_brand_id,
+         this_year.i_class_id,
+         this_year.i_category_id
+LIMIT 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=95.62MB Threads=33
+Per-Host Resource Estimates: Memory=1.85GB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=1.85GB mem-reservation=95.62MB thread-reservation=33 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: channel, i_brand_id, i_class_id, i_category_id, sales, number_sales, channel, i_brand_id, i_class_id, i_category_id, sales, number_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+91:TOP-N [LIMIT=100]
+|  order by: channel ASC, i_brand_id ASC, i_class_id ASC, i_category_id ASC
+|  mem-estimate=480B mem-reservation=0B thread-reservation=0
+|  tuple-ids=74 row-size=96B cardinality=5
+|  in pipelines: 91(GETNEXT), 32(OPEN)
+|
+90:HASH JOIN [INNER JOIN]
+|  hash predicates: i_brand_id = i_brand_id, i_category_id = i_category_id, i_class_id = i_class_id
+|  fk/pk conjuncts: i_brand_id = i_brand_id, i_category_id = i_category_id, i_class_id = i_class_id
+|  runtime filters: RF000[bloom] <- i_brand_id, RF001[bloom] <- i_category_id, RF002[bloom] <- i_class_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22,33,59,70 row-size=104B cardinality=5
+|  in pipelines: 32(GETNEXT), 77(OPEN)
+|
+|--89:NESTED LOOP JOIN [INNER JOIN]
+|  |  predicates: sum(ss_quantity * ss_list_price) > avg(quantity * list_price)
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=59,70 row-size=52B cardinality=271
+|  |  in pipelines: 77(GETNEXT), 88(OPEN)
+|  |
+|  |--88:AGGREGATE [FINALIZE]
+|  |  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=70 row-size=16B cardinality=1
+|  |  |  in pipelines: 88(GETNEXT), 79(OPEN), 82(OPEN), 85(OPEN)
+|  |  |
+|  |  78:UNION
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=67 row-size=8B cardinality=5.04M
+|  |  |  in pipelines: 79(GETNEXT), 82(GETNEXT), 85(GETNEXT)
+|  |  |
+|  |  |--87:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=65,66 row-size=20B cardinality=719.38K
+|  |  |  |  in pipelines: 85(GETNEXT), 86(OPEN)
+|  |  |  |
+|  |  |  |--86:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=66 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 86(GETNEXT)
+|  |  |  |
+|  |  |  85:SCAN HDFS [tpcds_parquet.web_sales]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=65 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 85(GETNEXT)
+|  |  |
+|  |  |--84:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=63,64 row-size=20B cardinality=1.44M
+|  |  |  |  in pipelines: 82(GETNEXT), 83(OPEN)
+|  |  |  |
+|  |  |  |--83:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=64 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 83(GETNEXT)
+|  |  |  |
+|  |  |  82:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=63 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 82(GETNEXT)
+|  |  |
+|  |  81:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=61,62 row-size=20B cardinality=2.88M
+|  |  |  in pipelines: 79(GETNEXT), 80(OPEN)
+|  |  |
+|  |  |--80:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=62 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 80(GETNEXT)
+|  |  |
+|  |  79:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=61 row-size=12B cardinality=2.88M
+|  |     in pipelines: 79(GETNEXT)
+|  |
+|  77:AGGREGATE [FINALIZE]
+|  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_list_price), count(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=59 row-size=36B cardinality=271
+|  |  in pipelines: 77(GETNEXT), 45(OPEN)
+|  |
+|  76:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: d_week_seq = d_week_seq
+|  |  runtime filters: RF050[bloom] <- d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38,39 row-size=48B cardinality=271
+|  |  in pipelines: 45(GETNEXT), 71(OPEN)
+|  |
+|  |--71:CARDINALITY CHECK
+|  |  |  limit: 1
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=57 row-size=16B cardinality=1
+|  |  |  in pipelines: 71(GETNEXT), 70(OPEN)
+|  |  |
+|  |  70:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1999 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1999 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|  |     limit: 2
+|  |     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=57 row-size=16B cardinality=2
+|  |     in pipelines: 70(GETNEXT)
+|  |
+|  75:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38,39 row-size=48B cardinality=2.88M
+|  |  in pipelines: 45(GETNEXT), 74(OPEN)
+|  |
+|  |--74:AGGREGATE [FINALIZE]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=114 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 74(GETNEXT), 68(OPEN)
+|  |  |
+|  |  69:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=53,40 row-size=32B cardinality=148.80K
+|  |  |  in pipelines: 68(GETNEXT), 48(OPEN)
+|  |  |
+|  |  |--48:SCAN HDFS [tpcds_parquet.item]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=40 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 48(GETNEXT)
+|  |  |
+|  |  68:AGGREGATE [FINALIZE]
+|  |  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=53 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 68(GETNEXT), 49(OPEN)
+|  |  |
+|  |  67:HASH JOIN [LEFT SEMI JOIN]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42,43 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 66(OPEN)
+|  |  |
+|  |  |--66:AGGREGATE [FINALIZE]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=112 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 66(GETNEXT), 59(OPEN)
+|  |  |  |
+|  |  |  63:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=49,50,51 row-size=40B cardinality=719.38K
+|  |  |  |  in pipelines: 59(GETNEXT), 61(OPEN)
+|  |  |  |
+|  |  |  |--61:SCAN HDFS [tpcds_parquet.date_dim d3]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=51 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 61(GETNEXT)
+|  |  |  |
+|  |  |  62:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=49,50 row-size=32B cardinality=719.38K
+|  |  |  |  in pipelines: 59(GETNEXT), 60(OPEN)
+|  |  |  |
+|  |  |  |--60:SCAN HDFS [tpcds_parquet.item iws]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=50 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 60(GETNEXT)
+|  |  |  |
+|  |  |  59:SCAN HDFS [tpcds_parquet.web_sales]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=49 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 59(GETNEXT)
+|  |  |
+|  |  65:HASH JOIN [LEFT SEMI JOIN]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42,43 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 64(OPEN)
+|  |  |
+|  |  |--64:AGGREGATE [FINALIZE]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=111 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 64(GETNEXT), 54(OPEN)
+|  |  |  |
+|  |  |  58:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=45,46,47 row-size=40B cardinality=1.44M
+|  |  |  |  in pipelines: 54(GETNEXT), 56(OPEN)
+|  |  |  |
+|  |  |  |--56:SCAN HDFS [tpcds_parquet.date_dim d2]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=47 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 56(GETNEXT)
+|  |  |  |
+|  |  |  57:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=45,46 row-size=32B cardinality=1.44M
+|  |  |  |  in pipelines: 54(GETNEXT), 55(OPEN)
+|  |  |  |
+|  |  |  |--55:SCAN HDFS [tpcds_parquet.item ics]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=46 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 55(GETNEXT)
+|  |  |  |
+|  |  |  54:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=45 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 54(GETNEXT)
+|  |  |
+|  |  53:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42,43 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 51(OPEN)
+|  |  |
+|  |  |--51:SCAN HDFS [tpcds_parquet.date_dim d1]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=43 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 51(GETNEXT)
+|  |  |
+|  |  52:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42 row-size=32B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 50(OPEN)
+|  |  |
+|  |  |--50:SCAN HDFS [tpcds_parquet.item iss]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=42 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 50(GETNEXT)
+|  |  |
+|  |  49:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=41 row-size=12B cardinality=2.88M
+|  |     in pipelines: 49(GETNEXT)
+|  |
+|  73:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38,39 row-size=48B cardinality=2.88M
+|  |  in pipelines: 45(GETNEXT), 47(OPEN)
+|  |
+|  |--47:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF050[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=39 row-size=8B cardinality=73.05K
+|  |     in pipelines: 47(GETNEXT)
+|  |
+|  72:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38 row-size=40B cardinality=2.88M
+|  |  in pipelines: 45(GETNEXT), 46(OPEN)
+|  |
+|  |--46:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=38 row-size=20B cardinality=18.00K
+|  |     in pipelines: 46(GETNEXT)
+|  |
+|  45:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=37 row-size=20B cardinality=2.88M
+|     in pipelines: 45(GETNEXT)
+|
+44:NESTED LOOP JOIN [INNER JOIN]
+|  predicates: sum(ss_quantity * ss_list_price) > avg(quantity * list_price)
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=22,33 row-size=52B cardinality=271
+|  in pipelines: 32(GETNEXT), 43(OPEN)
+|
+|--43:AGGREGATE [FINALIZE]
+|  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=33 row-size=16B cardinality=1
+|  |  in pipelines: 43(GETNEXT), 34(OPEN), 37(OPEN), 40(OPEN)
+|  |
+|  33:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=30 row-size=8B cardinality=5.04M
+|  |  in pipelines: 34(GETNEXT), 37(GETNEXT), 40(GETNEXT)
+|  |
+|  |--42:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=28,29 row-size=20B cardinality=719.38K
+|  |  |  in pipelines: 40(GETNEXT), 41(OPEN)
+|  |  |
+|  |  |--41:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=29 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 41(GETNEXT)
+|  |  |
+|  |  40:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=28 row-size=12B cardinality=719.38K
+|  |     in pipelines: 40(GETNEXT)
+|  |
+|  |--39:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=26,27 row-size=20B cardinality=1.44M
+|  |  |  in pipelines: 37(GETNEXT), 38(OPEN)
+|  |  |
+|  |  |--38:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=27 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 38(GETNEXT)
+|  |  |
+|  |  37:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=26 row-size=12B cardinality=1.44M
+|  |     in pipelines: 37(GETNEXT)
+|  |
+|  36:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,25 row-size=20B cardinality=2.88M
+|  |  in pipelines: 34(GETNEXT), 35(OPEN)
+|  |
+|  |--35:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=25 row-size=8B cardinality=7.30K
+|  |     in pipelines: 35(GETNEXT)
+|  |
+|  34:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=24 row-size=12B cardinality=2.88M
+|     in pipelines: 34(GETNEXT)
+|
+32:AGGREGATE [FINALIZE]
+|  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_list_price), count(*)
+|  group by: i_brand_id, i_class_id, i_category_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22 row-size=36B cardinality=271
+|  in pipelines: 32(GETNEXT), 00(OPEN)
+|
+31:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: d_week_seq = d_week_seq
+|  runtime filters: RF006[bloom] <- d_week_seq
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=48B cardinality=271
+|  in pipelines: 00(GETNEXT), 26(OPEN)
+|
+|--26:CARDINALITY CHECK
+|  |  limit: 1
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=16B cardinality=1
+|  |  in pipelines: 26(GETNEXT), 25(OPEN)
+|  |
+|  25:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2000 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2000 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|     limit: 2
+|     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=20 row-size=16B cardinality=2
+|     in pipelines: 25(GETNEXT)
+|
+30:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  runtime filters: RF008[bloom] <- tpcds_parquet.item.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=48B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 29(OPEN)
+|
+|--29:AGGREGATE [FINALIZE]
+|  |  group by: tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=91 row-size=8B cardinality=17.98K
+|  |  in pipelines: 29(GETNEXT), 23(OPEN)
+|  |
+|  24:HASH JOIN [INNER JOIN]
+|  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  runtime filters: RF014[bloom] <- i_brand_id, RF015[bloom] <- i_category_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,3 row-size=32B cardinality=148.80K
+|  |  in pipelines: 23(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=20B cardinality=18.00K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  23:AGGREGATE [FINALIZE]
+|  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 23(GETNEXT), 04(OPEN)
+|  |
+|  22:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 21(OPEN)
+|  |
+|  |--21:AGGREGATE [FINALIZE]
+|  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=89 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 21(GETNEXT), 14(OPEN)
+|  |  |
+|  |  18:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13,14 row-size=40B cardinality=719.38K
+|  |  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |  |
+|  |  |--16:SCAN HDFS [tpcds_parquet.date_dim d3]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=14 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 16(GETNEXT)
+|  |  |
+|  |  17:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13 row-size=32B cardinality=719.38K
+|  |  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |  |
+|  |  |--15:SCAN HDFS [tpcds_parquet.item iws]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=13 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 15(GETNEXT)
+|  |  |
+|  |  14:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=12B cardinality=719.38K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  20:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 19(OPEN)
+|  |
+|  |--19:AGGREGATE [FINALIZE]
+|  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=88 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 19(GETNEXT), 09(OPEN)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9,10 row-size=40B cardinality=1.44M
+|  |  |  in pipelines: 09(GETNEXT), 11(OPEN)
+|  |  |
+|  |  |--11:SCAN HDFS [tpcds_parquet.date_dim d2]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  12:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9 row-size=32B cardinality=1.44M
+|  |  |  in pipelines: 09(GETNEXT), 10(OPEN)
+|  |  |
+|  |  |--10:SCAN HDFS [tpcds_parquet.item ics]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=9 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 10(GETNEXT)
+|  |  |
+|  |  09:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=8 row-size=12B cardinality=1.44M
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 06(OPEN)
+|  |
+|  |--06:SCAN HDFS [tpcds_parquet.date_dim d1]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=8B cardinality=7.30K
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=32B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 05(OPEN)
+|  |
+|  |--05:SCAN HDFS [tpcds_parquet.item iss]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF014[bloom] -> iss.i_brand_id, RF015[bloom] -> iss.i_category_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=20B cardinality=18.00K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  04:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=12B cardinality=2.88M
+|     in pipelines: 04(GETNEXT)
+|
+28:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF010[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=48B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF006[bloom] -> d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=73.05K
+|     in pipelines: 02(GETNEXT)
+|
+27:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF012[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=40B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_brand_id, RF001[bloom] -> tpcds_parquet.item.i_category_id, RF002[bloom] -> tpcds_parquet.item.i_class_id, RF008[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF008[bloom] -> ss_item_sk, RF010[bloom] -> ss_sold_date_sk, RF012[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=160.81MB Threads=86
+Per-Host Resource Estimates: Memory=2.23GB
+F56:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: channel, i_brand_id, i_class_id, i_category_id, sales, number_sales, channel, i_brand_id, i_class_id, i_category_id, sales, number_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+152:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: channel ASC, i_brand_id ASC, i_class_id ASC, i_category_id ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=74 row-size=96B cardinality=5
+|  in pipelines: 91(GETNEXT)
+|
+F19:PLAN FRAGMENT [HASH(i_brand_id,i_class_id,i_category_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=25.00MB mem-reservation=8.81MB thread-reservation=1 runtime-filters-memory=3.00MB
+91:TOP-N [LIMIT=100]
+|  order by: channel ASC, i_brand_id ASC, i_class_id ASC, i_category_id ASC
+|  mem-estimate=480B mem-reservation=0B thread-reservation=0
+|  tuple-ids=74 row-size=96B cardinality=5
+|  in pipelines: 91(GETNEXT), 115(OPEN)
+|
+90:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: i_brand_id = i_brand_id, i_category_id = i_category_id, i_class_id = i_class_id
+|  fk/pk conjuncts: i_brand_id = i_brand_id, i_category_id = i_category_id, i_class_id = i_class_id
+|  runtime filters: RF000[bloom] <- i_brand_id, RF001[bloom] <- i_category_id, RF002[bloom] <- i_class_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22,33,59,70 row-size=104B cardinality=5
+|  in pipelines: 115(GETNEXT), 145(OPEN)
+|
+|--89:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  |  predicates: sum(ss_quantity * ss_list_price) > avg(quantity * list_price)
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=59,70 row-size=52B cardinality=271
+|  |  in pipelines: 145(GETNEXT), 150(OPEN)
+|  |
+|  |--151:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=70 row-size=16B cardinality=1
+|  |  |  in pipelines: 150(GETNEXT)
+|  |  |
+|  |  F55:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  150:AGGREGATE [FINALIZE]
+|  |  |  output: avg:merge(quantity * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=70 row-size=16B cardinality=1
+|  |  |  in pipelines: 150(GETNEXT), 88(OPEN)
+|  |  |
+|  |  149:EXCHANGE [UNPARTITIONED]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=69 row-size=16B cardinality=1
+|  |  |  in pipelines: 88(GETNEXT)
+|  |  |
+|  |  F54:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=156.00MB mem-reservation=5.94MB thread-reservation=2
+|  |  88:AGGREGATE
+|  |  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=69 row-size=16B cardinality=1
+|  |  |  in pipelines: 88(GETNEXT), 79(OPEN), 82(OPEN), 85(OPEN)
+|  |  |
+|  |  78:UNION
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=67 row-size=8B cardinality=5.04M
+|  |  |  in pipelines: 79(GETNEXT), 82(GETNEXT), 85(GETNEXT)
+|  |  |
+|  |  |--87:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=65,66 row-size=20B cardinality=719.38K
+|  |  |  |  in pipelines: 85(GETNEXT), 86(OPEN)
+|  |  |  |
+|  |  |  |--148:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=66 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 86(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F53:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  86:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=66 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 86(GETNEXT)
+|  |  |  |
+|  |  |  85:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=65 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 85(GETNEXT)
+|  |  |
+|  |  |--84:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=63,64 row-size=20B cardinality=1.44M
+|  |  |  |  in pipelines: 82(GETNEXT), 83(OPEN)
+|  |  |  |
+|  |  |  |--147:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=64 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 83(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F51:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  83:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=64 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 83(GETNEXT)
+|  |  |  |
+|  |  |  82:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=63 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 82(GETNEXT)
+|  |  |
+|  |  81:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=61,62 row-size=20B cardinality=2.88M
+|  |  |  in pipelines: 79(GETNEXT), 80(OPEN)
+|  |  |
+|  |  |--146:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=62 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 80(GETNEXT)
+|  |  |  |
+|  |  |  F49:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  80:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=62 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 80(GETNEXT)
+|  |  |
+|  |  79:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=61 row-size=12B cardinality=2.88M
+|  |     in pipelines: 79(GETNEXT)
+|  |
+|  145:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_quantity * ss_list_price), count:merge(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=59 row-size=36B cardinality=271
+|  |  in pipelines: 145(GETNEXT), 45(OPEN)
+|  |
+|  144:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  mem-estimate=34.93KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=59 row-size=36B cardinality=271
+|  |  in pipelines: 45(GETNEXT)
+|  |
+|  F28:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=67.87MB mem-reservation=11.75MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  77:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_list_price), count(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=59 row-size=36B cardinality=271
+|  |  in pipelines: 45(GETNEXT)
+|  |
+|  76:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: d_week_seq = d_week_seq
+|  |  runtime filters: RF050[bloom] <- d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38,39 row-size=48B cardinality=271
+|  |  in pipelines: 45(GETNEXT), 71(OPEN)
+|  |
+|  |--143:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=57 row-size=16B cardinality=1
+|  |  |  in pipelines: 71(GETNEXT)
+|  |  |
+|  |  F46:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  71:CARDINALITY CHECK
+|  |  |  limit: 1
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=57 row-size=16B cardinality=1
+|  |  |  in pipelines: 71(GETNEXT), 70(OPEN)
+|  |  |
+|  |  142:EXCHANGE [UNPARTITIONED]
+|  |  |  limit: 2
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=57 row-size=16B cardinality=2
+|  |  |  in pipelines: 70(GETNEXT)
+|  |  |
+|  |  F45:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  70:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1999 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1999 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|  |     limit: 2
+|  |     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=57 row-size=16B cardinality=2
+|  |     in pipelines: 70(GETNEXT)
+|  |
+|  75:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38,39 row-size=48B cardinality=2.88M
+|  |  in pipelines: 45(GETNEXT), 140(OPEN)
+|  |
+|  |--141:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=176.43KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=114 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 140(GETNEXT)
+|  |  |
+|  |  F44:PLAN FRAGMENT [HASH(tpcds_parquet.item.i_item_sk)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reservation=1
+|  |  140:AGGREGATE [FINALIZE]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=114 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 140(GETNEXT), 137(OPEN)
+|  |  |
+|  |  139:EXCHANGE [HASH(tpcds_parquet.item.i_item_sk)]
+|  |  |  mem-estimate=82.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=114 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 137(GETNEXT)
+|  |  |
+|  |  F42:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=22.92MB mem-reservation=5.88MB thread-reservation=1
+|  |  74:AGGREGATE [STREAMING]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=114 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 137(GETNEXT)
+|  |  |
+|  |  69:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=53,40 row-size=32B cardinality=148.80K
+|  |  |  in pipelines: 137(GETNEXT), 48(OPEN)
+|  |  |
+|  |  |--138:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=40 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 48(GETNEXT)
+|  |  |  |
+|  |  |  F43:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  48:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=40 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 48(GETNEXT)
+|  |  |
+|  |  137:AGGREGATE [FINALIZE]
+|  |  |  group by: $a$2.brand_id, $a$2.class_id, $a$2.category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=53 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 137(GETNEXT), 49(OPEN)
+|  |  |
+|  |  136:EXCHANGE [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)]
+|  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=53 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 49(GETNEXT)
+|  |  |
+|  |  F31:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=39.54MB mem-reservation=13.12MB thread-reservation=2
+|  |  68:AGGREGATE [STREAMING]
+|  |  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=53 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 49(GETNEXT)
+|  |  |
+|  |  67:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42,43 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 134(OPEN)
+|  |  |
+|  |  |--135:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=112 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 134(GETNEXT)
+|  |  |  |
+|  |  |  F41:PLAN FRAGMENT [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)] hosts=2 instances=2
+|  |  |  Per-Host Resources: mem-estimate=10.88MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  134:AGGREGATE [FINALIZE]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=112 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 134(GETNEXT), 59(OPEN)
+|  |  |  |
+|  |  |  133:EXCHANGE [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)]
+|  |  |  |  mem-estimate=903.88KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=112 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 59(GETNEXT)
+|  |  |  |
+|  |  |  F38:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Host Resources: mem-estimate=78.31MB mem-reservation=10.88MB thread-reservation=2
+|  |  |  66:AGGREGATE [STREAMING]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=112 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 59(GETNEXT)
+|  |  |  |
+|  |  |  63:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=49,50,51 row-size=40B cardinality=719.38K
+|  |  |  |  in pipelines: 59(GETNEXT), 61(OPEN)
+|  |  |  |
+|  |  |  |--132:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=51 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 61(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F40:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  61:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=51 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 61(GETNEXT)
+|  |  |  |
+|  |  |  62:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=49,50 row-size=32B cardinality=719.38K
+|  |  |  |  in pipelines: 59(GETNEXT), 60(OPEN)
+|  |  |  |
+|  |  |  |--131:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=50 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 60(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F39:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  |  60:SCAN HDFS [tpcds_parquet.item iws, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=50 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 60(GETNEXT)
+|  |  |  |
+|  |  |  59:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=49 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 59(GETNEXT)
+|  |  |
+|  |  65:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42,43 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 129(OPEN)
+|  |  |
+|  |  |--130:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.75MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=111 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 129(GETNEXT)
+|  |  |  |
+|  |  |  F37:PLAN FRAGMENT [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=10.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  129:AGGREGATE [FINALIZE]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=111 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 129(GETNEXT), 54(OPEN)
+|  |  |  |
+|  |  |  128:EXCHANGE [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)]
+|  |  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=111 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 54(GETNEXT)
+|  |  |  |
+|  |  |  F34:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=110.31MB mem-reservation=10.88MB thread-reservation=2
+|  |  |  64:AGGREGATE [STREAMING]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=111 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 54(GETNEXT)
+|  |  |  |
+|  |  |  58:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=45,46,47 row-size=40B cardinality=1.44M
+|  |  |  |  in pipelines: 54(GETNEXT), 56(OPEN)
+|  |  |  |
+|  |  |  |--127:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=47 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 56(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F36:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  56:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=47 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 56(GETNEXT)
+|  |  |  |
+|  |  |  57:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=45,46 row-size=32B cardinality=1.44M
+|  |  |  |  in pipelines: 54(GETNEXT), 55(OPEN)
+|  |  |  |
+|  |  |  |--126:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=46 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 55(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F35:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  |  55:SCAN HDFS [tpcds_parquet.item ics, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=46 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 55(GETNEXT)
+|  |  |  |
+|  |  |  54:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=45 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 54(GETNEXT)
+|  |  |
+|  |  53:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42,43 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 51(OPEN)
+|  |  |
+|  |  |--125:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=43 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 51(GETNEXT)
+|  |  |  |
+|  |  |  F33:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  51:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=43 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 51(GETNEXT)
+|  |  |
+|  |  52:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42 row-size=32B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 50(OPEN)
+|  |  |
+|  |  |--124:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=42 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 50(GETNEXT)
+|  |  |  |
+|  |  |  F32:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  50:SCAN HDFS [tpcds_parquet.item iss, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=42 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 50(GETNEXT)
+|  |  |
+|  |  49:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=41 row-size=12B cardinality=2.88M
+|  |     in pipelines: 49(GETNEXT)
+|  |
+|  73:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38,39 row-size=48B cardinality=2.88M
+|  |  in pipelines: 45(GETNEXT), 47(OPEN)
+|  |
+|  |--123:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=39 row-size=8B cardinality=73.05K
+|  |  |  in pipelines: 47(GETNEXT)
+|  |  |
+|  |  F30:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  47:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF050[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=39 row-size=8B cardinality=73.05K
+|  |     in pipelines: 47(GETNEXT)
+|  |
+|  72:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38 row-size=40B cardinality=2.88M
+|  |  in pipelines: 45(GETNEXT), 46(OPEN)
+|  |
+|  |--122:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=38 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 46(GETNEXT)
+|  |  |
+|  |  F29:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  46:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=38 row-size=20B cardinality=18.00K
+|  |     in pipelines: 46(GETNEXT)
+|  |
+|  45:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=37 row-size=20B cardinality=2.88M
+|     in pipelines: 45(GETNEXT)
+|
+44:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  predicates: sum(ss_quantity * ss_list_price) > avg(quantity * list_price)
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=22,33 row-size=52B cardinality=271
+|  in pipelines: 115(GETNEXT), 120(OPEN)
+|
+|--121:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=33 row-size=16B cardinality=1
+|  |  in pipelines: 120(GETNEXT)
+|  |
+|  F27:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  120:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(quantity * list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=33 row-size=16B cardinality=1
+|  |  in pipelines: 120(GETNEXT), 43(OPEN)
+|  |
+|  119:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=32 row-size=16B cardinality=1
+|  |  in pipelines: 43(GETNEXT)
+|  |
+|  F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=156.00MB mem-reservation=5.94MB thread-reservation=2
+|  43:AGGREGATE
+|  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=32 row-size=16B cardinality=1
+|  |  in pipelines: 43(GETNEXT), 34(OPEN), 37(OPEN), 40(OPEN)
+|  |
+|  33:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=30 row-size=8B cardinality=5.04M
+|  |  in pipelines: 34(GETNEXT), 37(GETNEXT), 40(GETNEXT)
+|  |
+|  |--42:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=28,29 row-size=20B cardinality=719.38K
+|  |  |  in pipelines: 40(GETNEXT), 41(OPEN)
+|  |  |
+|  |  |--118:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=29 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 41(GETNEXT)
+|  |  |  |
+|  |  |  F25:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  41:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=29 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 41(GETNEXT)
+|  |  |
+|  |  40:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=28 row-size=12B cardinality=719.38K
+|  |     in pipelines: 40(GETNEXT)
+|  |
+|  |--39:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=26,27 row-size=20B cardinality=1.44M
+|  |  |  in pipelines: 37(GETNEXT), 38(OPEN)
+|  |  |
+|  |  |--117:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=27 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 38(GETNEXT)
+|  |  |  |
+|  |  |  F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  38:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=27 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 38(GETNEXT)
+|  |  |
+|  |  37:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=26 row-size=12B cardinality=1.44M
+|  |     in pipelines: 37(GETNEXT)
+|  |
+|  36:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,25 row-size=20B cardinality=2.88M
+|  |  in pipelines: 34(GETNEXT), 35(OPEN)
+|  |
+|  |--116:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=25 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 35(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  35:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=25 row-size=8B cardinality=7.30K
+|  |     in pipelines: 35(GETNEXT)
+|  |
+|  34:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=24 row-size=12B cardinality=2.88M
+|     in pipelines: 34(GETNEXT)
+|
+115:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_quantity * ss_list_price), count:merge(*)
+|  group by: i_brand_id, i_class_id, i_category_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22 row-size=36B cardinality=271
+|  in pipelines: 115(GETNEXT), 00(OPEN)
+|
+114:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  mem-estimate=34.93KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=22 row-size=36B cardinality=271
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=70.87MB mem-reservation=14.75MB thread-reservation=2 runtime-filters-memory=4.00MB
+32:AGGREGATE [STREAMING]
+|  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_list_price), count(*)
+|  group by: i_brand_id, i_class_id, i_category_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22 row-size=36B cardinality=271
+|  in pipelines: 00(GETNEXT)
+|
+31:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: d_week_seq = d_week_seq
+|  runtime filters: RF006[bloom] <- d_week_seq
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=48B cardinality=271
+|  in pipelines: 00(GETNEXT), 26(OPEN)
+|
+|--113:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=16B cardinality=1
+|  |  in pipelines: 26(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  26:CARDINALITY CHECK
+|  |  limit: 1
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=16B cardinality=1
+|  |  in pipelines: 26(GETNEXT), 25(OPEN)
+|  |
+|  112:EXCHANGE [UNPARTITIONED]
+|  |  limit: 2
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=16B cardinality=2
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=2
+|  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2000 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2000 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|     limit: 2
+|     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=20 row-size=16B cardinality=2
+|     in pipelines: 25(GETNEXT)
+|
+30:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  runtime filters: RF008[bloom] <- tpcds_parquet.item.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=48B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 110(OPEN)
+|
+|--111:EXCHANGE [BROADCAST]
+|  |  mem-estimate=176.43KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=91 row-size=8B cardinality=17.98K
+|  |  in pipelines: 110(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [HASH(tpcds_parquet.item.i_item_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reservation=1
+|  110:AGGREGATE [FINALIZE]
+|  |  group by: tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=91 row-size=8B cardinality=17.98K
+|  |  in pipelines: 110(GETNEXT), 107(OPEN)
+|  |
+|  109:EXCHANGE [HASH(tpcds_parquet.item.i_item_sk)]
+|  |  mem-estimate=82.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=91 row-size=8B cardinality=17.98K
+|  |  in pipelines: 107(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=24.92MB mem-reservation=7.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  29:AGGREGATE [STREAMING]
+|  |  group by: tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=91 row-size=8B cardinality=17.98K
+|  |  in pipelines: 107(GETNEXT)
+|  |
+|  24:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  runtime filters: RF014[bloom] <- i_brand_id, RF015[bloom] <- i_category_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,3 row-size=32B cardinality=148.80K
+|  |  in pipelines: 107(GETNEXT), 03(OPEN)
+|  |
+|  |--108:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=20B cardinality=18.00K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  107:AGGREGATE [FINALIZE]
+|  |  group by: $a$2.brand_id, $a$2.class_id, $a$2.category_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 107(GETNEXT), 04(OPEN)
+|  |
+|  106:EXCHANGE [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)]
+|  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=39.54MB mem-reservation=13.12MB thread-reservation=2
+|  23:AGGREGATE [STREAMING]
+|  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  22:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 104(OPEN)
+|  |
+|  |--105:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=89 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 104(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=10.88MB mem-reservation=1.94MB thread-reservation=1
+|  |  104:AGGREGATE [FINALIZE]
+|  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=89 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 104(GETNEXT), 14(OPEN)
+|  |  |
+|  |  103:EXCHANGE [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)]
+|  |  |  mem-estimate=903.88KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=89 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=78.31MB mem-reservation=10.88MB thread-reservation=2
+|  |  21:AGGREGATE [STREAMING]
+|  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=89 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  18:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13,14 row-size=40B cardinality=719.38K
+|  |  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |  |
+|  |  |--102:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=14 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 16(GETNEXT)
+|  |  |  |
+|  |  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  16:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=14 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 16(GETNEXT)
+|  |  |
+|  |  17:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13 row-size=32B cardinality=719.38K
+|  |  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |  |
+|  |  |--101:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 15(GETNEXT)
+|  |  |  |
+|  |  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  15:SCAN HDFS [tpcds_parquet.item iws, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=13 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 15(GETNEXT)
+|  |  |
+|  |  14:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=12B cardinality=719.38K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  20:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 99(OPEN)
+|  |
+|  |--100:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.75MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=88 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 99(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=10.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  99:AGGREGATE [FINALIZE]
+|  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=88 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 99(GETNEXT), 09(OPEN)
+|  |  |
+|  |  98:EXCHANGE [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)]
+|  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=88 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=110.31MB mem-reservation=10.88MB thread-reservation=2
+|  |  19:AGGREGATE [STREAMING]
+|  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=88 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9,10 row-size=40B cardinality=1.44M
+|  |  |  in pipelines: 09(GETNEXT), 11(OPEN)
+|  |  |
+|  |  |--97:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 11(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  11:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9 row-size=32B cardinality=1.44M
+|  |  |  in pipelines: 09(GETNEXT), 10(OPEN)
+|  |  |
+|  |  |--96:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=9 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 10(GETNEXT)
+|  |  |  |
+|  |  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  10:SCAN HDFS [tpcds_parquet.item ics, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=9 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 10(GETNEXT)
+|  |  |
+|  |  09:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=8 row-size=12B cardinality=1.44M
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 06(OPEN)
+|  |
+|  |--95:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  06:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=8B cardinality=7.30K
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=32B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 05(OPEN)
+|  |
+|  |--94:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 05(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=66.00MB mem-reservation=2.25MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  05:SCAN HDFS [tpcds_parquet.item iss, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF014[bloom] -> iss.i_brand_id, RF015[bloom] -> iss.i_category_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=20B cardinality=18.00K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  04:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=12B cardinality=2.88M
+|     in pipelines: 04(GETNEXT)
+|
+28:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF010[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=48B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--93:EXCHANGE [BROADCAST]
+|  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=73.05K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF006[bloom] -> d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=73.05K
+|     in pipelines: 02(GETNEXT)
+|
+27:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF012[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=40B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--92:EXCHANGE [BROADCAST]
+|  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=20B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=68.00MB mem-reservation=4.25MB thread-reservation=2 runtime-filters-memory=4.00MB
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_brand_id, RF001[bloom] -> tpcds_parquet.item.i_category_id, RF002[bloom] -> tpcds_parquet.item.i_class_id, RF008[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF008[bloom] -> ss_item_sk, RF010[bloom] -> ss_sold_date_sk, RF012[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=280.88MB Threads=99
+Per-Host Resource Estimates: Memory=1.42GB
+F56:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: channel, i_brand_id, i_class_id, i_category_id, sales, number_sales, channel, i_brand_id, i_class_id, i_category_id, sales, number_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+152:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: channel ASC, i_brand_id ASC, i_class_id ASC, i_category_id ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=74 row-size=96B cardinality=5
+|  in pipelines: 91(GETNEXT)
+|
+F19:PLAN FRAGMENT [HASH(i_brand_id,i_class_id,i_category_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.07MB mem-reservation=1.94MB thread-reservation=1
+91:TOP-N [LIMIT=100]
+|  order by: channel ASC, i_brand_id ASC, i_class_id ASC, i_category_id ASC
+|  mem-estimate=480B mem-reservation=0B thread-reservation=0
+|  tuple-ids=74 row-size=96B cardinality=5
+|  in pipelines: 91(GETNEXT), 115(OPEN)
+|
+90:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: i_brand_id = i_brand_id, i_category_id = i_category_id, i_class_id = i_class_id
+|  fk/pk conjuncts: i_brand_id = i_brand_id, i_category_id = i_category_id, i_class_id = i_class_id
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22,33,59,70 row-size=104B cardinality=5
+|  in pipelines: 115(GETNEXT), 145(OPEN)
+|
+|--F57:PLAN FRAGMENT [HASH(i_brand_id,i_class_id,i_category_id)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=14.94MB mem-reservation=6.88MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_brand_id, i_category_id, i_class_id
+|  |  runtime filters: RF000[bloom] <- i_brand_id, RF001[bloom] <- i_category_id, RF002[bloom] <- i_class_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  89:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  |  join table id: 01
+|  |  predicates: sum(ss_quantity * ss_list_price) > avg(quantity * list_price)
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=59,70 row-size=52B cardinality=271
+|  |  in pipelines: 145(GETNEXT), 150(OPEN)
+|  |
+|  |--F58:PLAN FRAGMENT [HASH(i_brand_id,i_class_id,i_category_id)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  |
+|  |  151:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=70 row-size=16B cardinality=1
+|  |  |  in pipelines: 150(GETNEXT)
+|  |  |
+|  |  F55:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  150:AGGREGATE [FINALIZE]
+|  |  |  output: avg:merge(quantity * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=70 row-size=16B cardinality=1
+|  |  |  in pipelines: 150(GETNEXT), 88(OPEN)
+|  |  |
+|  |  149:EXCHANGE [UNPARTITIONED]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=69 row-size=16B cardinality=1
+|  |  |  in pipelines: 88(GETNEXT)
+|  |  |
+|  |  F54:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  88:AGGREGATE
+|  |  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=69 row-size=16B cardinality=1
+|  |  |  in pipelines: 88(GETNEXT), 79(OPEN), 82(OPEN), 85(OPEN)
+|  |  |
+|  |  78:UNION
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=67 row-size=8B cardinality=5.04M
+|  |  |  in pipelines: 79(GETNEXT), 82(GETNEXT), 85(GETNEXT)
+|  |  |
+|  |  |--87:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=04
+|  |  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=65,66 row-size=20B cardinality=719.38K
+|  |  |  |  in pipelines: 85(GETNEXT), 86(OPEN)
+|  |  |  |
+|  |  |  |--F61:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=04 plan-id=05 cohort-id=03
+|  |  |  |  |  build expressions: d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  148:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=66 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 86(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F53:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  86:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=66 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 86(GETNEXT)
+|  |  |  |
+|  |  |  85:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=65 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 85(GETNEXT)
+|  |  |
+|  |  |--84:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=03
+|  |  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=63,64 row-size=20B cardinality=1.44M
+|  |  |  |  in pipelines: 82(GETNEXT), 83(OPEN)
+|  |  |  |
+|  |  |  |--F60:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=03 plan-id=04 cohort-id=03
+|  |  |  |  |  build expressions: d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  147:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=64 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 83(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F51:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  83:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=64 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 83(GETNEXT)
+|  |  |  |
+|  |  |  82:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=63 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 82(GETNEXT)
+|  |  |
+|  |  81:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=61,62 row-size=20B cardinality=2.88M
+|  |  |  in pipelines: 79(GETNEXT), 80(OPEN)
+|  |  |
+|  |  |--F59:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  146:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=62 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 80(GETNEXT)
+|  |  |  |
+|  |  |  F49:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  80:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=62 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 80(GETNEXT)
+|  |  |
+|  |  79:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=61 row-size=12B cardinality=2.88M
+|  |     in pipelines: 79(GETNEXT)
+|  |
+|  145:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_quantity * ss_list_price), count:merge(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=59 row-size=36B cardinality=271
+|  |  in pipelines: 145(GETNEXT), 45(OPEN)
+|  |
+|  144:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  mem-estimate=66.69KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=59 row-size=36B cardinality=271
+|  |  in pipelines: 45(GETNEXT)
+|  |
+|  F28:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+|  77:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_list_price), count(*)
+|  |  group by: i_brand_id, i_class_id, i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=59 row-size=36B cardinality=271
+|  |  in pipelines: 45(GETNEXT)
+|  |
+|  76:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: d_week_seq = d_week_seq
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38,39 row-size=48B cardinality=271
+|  |  in pipelines: 45(GETNEXT), 71(OPEN)
+|  |
+|  |--F62:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: d_week_seq
+|  |  |  runtime filters: RF050[bloom] <- d_week_seq
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  143:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=57 row-size=16B cardinality=1
+|  |  |  in pipelines: 71(GETNEXT)
+|  |  |
+|  |  F46:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  71:CARDINALITY CHECK
+|  |  |  limit: 1
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=57 row-size=16B cardinality=1
+|  |  |  in pipelines: 71(GETNEXT), 70(OPEN)
+|  |  |
+|  |  142:EXCHANGE [UNPARTITIONED]
+|  |  |  limit: 2
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=57 row-size=16B cardinality=2
+|  |  |  in pipelines: 70(GETNEXT)
+|  |  |
+|  |  F45:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  70:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1999 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1999 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|  |     limit: 2
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=57 row-size=16B cardinality=2
+|  |     in pipelines: 70(GETNEXT)
+|  |
+|  75:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38,39 row-size=48B cardinality=2.88M
+|  |  in pipelines: 45(GETNEXT), 140(OPEN)
+|  |
+|  |--F63:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.08MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=02
+|  |  |  build expressions: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  141:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=212.43KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=114 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 140(GETNEXT)
+|  |  |
+|  |  F44:PLAN FRAGMENT [HASH(tpcds_parquet.item.i_item_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=10.12MB mem-reservation=1.94MB thread-reservation=1
+|  |  140:AGGREGATE [FINALIZE]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=114 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 140(GETNEXT), 137(OPEN)
+|  |  |
+|  |  139:EXCHANGE [HASH(tpcds_parquet.item.i_item_sk)]
+|  |  |  mem-estimate=118.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=114 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 137(GETNEXT)
+|  |  |
+|  |  F42:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=20.66MB mem-reservation=3.94MB thread-reservation=1
+|  |  74:AGGREGATE [STREAMING]
+|  |  |  group by: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=114 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 137(GETNEXT)
+|  |  |
+|  |  69:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash-table-id=07
+|  |  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=53,40 row-size=32B cardinality=148.80K
+|  |  |  in pipelines: 137(GETNEXT), 48(OPEN)
+|  |  |
+|  |  |--F64:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=6
+|  |  |  |  Per-Instance Resources: mem-estimate=2.30MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=07 plan-id=08 cohort-id=04
+|  |  |  |  build expressions: i_brand_id, i_category_id, i_class_id
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  138:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=40 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 48(GETNEXT)
+|  |  |  |
+|  |  |  F43:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  48:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=40 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 48(GETNEXT)
+|  |  |
+|  |  137:AGGREGATE [FINALIZE]
+|  |  |  group by: $a$2.brand_id, $a$2.class_id, $a$2.category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=53 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 137(GETNEXT), 49(OPEN)
+|  |  |
+|  |  136:EXCHANGE [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)]
+|  |  |  mem-estimate=677.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=53 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 49(GETNEXT)
+|  |  |
+|  |  F31:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.50MB thread-reservation=1
+|  |  68:AGGREGATE [STREAMING]
+|  |  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=53 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 49(GETNEXT)
+|  |  |
+|  |  67:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash-table-id=08
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42,43 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 134(OPEN)
+|  |  |
+|  |  |--F65:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=7.48MB mem-reservation=5.75MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=08 plan-id=09 cohort-id=04
+|  |  |  |  build expressions: iws.i_brand_id, iws.i_category_id, iws.i_class_id
+|  |  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |
+|  |  |  135:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=112 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 134(GETNEXT)
+|  |  |  |
+|  |  |  F41:PLAN FRAGMENT [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=10.88MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  134:AGGREGATE [FINALIZE]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=112 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 134(GETNEXT), 59(OPEN)
+|  |  |  |
+|  |  |  133:EXCHANGE [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)]
+|  |  |  |  mem-estimate=903.88KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=112 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 59(GETNEXT)
+|  |  |  |
+|  |  |  F38:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=42.00MB mem-reservation=7.00MB thread-reservation=1
+|  |  |  66:AGGREGATE [STREAMING]
+|  |  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=112 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 59(GETNEXT)
+|  |  |  |
+|  |  |  63:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=09
+|  |  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=49,50,51 row-size=40B cardinality=719.38K
+|  |  |  |  in pipelines: 59(GETNEXT), 61(OPEN)
+|  |  |  |
+|  |  |  |--F66:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=09 plan-id=10 cohort-id=05
+|  |  |  |  |  build expressions: d3.d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  132:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=51 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 61(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F40:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  61:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=51 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 61(GETNEXT)
+|  |  |  |
+|  |  |  62:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=10
+|  |  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=49,50 row-size=32B cardinality=719.38K
+|  |  |  |  in pipelines: 59(GETNEXT), 60(OPEN)
+|  |  |  |
+|  |  |  |--F67:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=10 plan-id=11 cohort-id=05
+|  |  |  |  |  build expressions: iws.i_item_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  131:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=50 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 60(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F39:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |  60:SCAN HDFS [tpcds_parquet.item iws, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |  |     tuple-ids=50 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 60(GETNEXT)
+|  |  |  |
+|  |  |  59:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=49 row-size=12B cardinality=719.38K
+|  |  |     in pipelines: 59(GETNEXT)
+|  |  |
+|  |  65:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash-table-id=11
+|  |  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42,43 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 129(OPEN)
+|  |  |
+|  |  |--F68:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=7.50MB mem-reservation=5.75MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=11 plan-id=12 cohort-id=04
+|  |  |  |  build expressions: ics.i_brand_id, ics.i_category_id, ics.i_class_id
+|  |  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |
+|  |  |  130:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.75MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=111 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 129(GETNEXT)
+|  |  |  |
+|  |  |  F37:PLAN FRAGMENT [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=10.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  129:AGGREGATE [FINALIZE]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=111 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 129(GETNEXT), 54(OPEN)
+|  |  |  |
+|  |  |  128:EXCHANGE [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)]
+|  |  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=111 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 54(GETNEXT)
+|  |  |  |
+|  |  |  F34:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=7.00MB thread-reservation=1
+|  |  |  64:AGGREGATE [STREAMING]
+|  |  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=111 row-size=12B cardinality=148.80K
+|  |  |  |  in pipelines: 54(GETNEXT)
+|  |  |  |
+|  |  |  58:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=12
+|  |  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=45,46,47 row-size=40B cardinality=1.44M
+|  |  |  |  in pipelines: 54(GETNEXT), 56(OPEN)
+|  |  |  |
+|  |  |  |--F69:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=12 plan-id=13 cohort-id=06
+|  |  |  |  |  build expressions: d2.d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  127:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=47 row-size=8B cardinality=7.30K
+|  |  |  |  |  in pipelines: 56(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F36:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  56:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=47 row-size=8B cardinality=7.30K
+|  |  |  |     in pipelines: 56(GETNEXT)
+|  |  |  |
+|  |  |  57:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=13
+|  |  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=45,46 row-size=32B cardinality=1.44M
+|  |  |  |  in pipelines: 54(GETNEXT), 55(OPEN)
+|  |  |  |
+|  |  |  |--F70:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=13 plan-id=14 cohort-id=06
+|  |  |  |  |  build expressions: ics.i_item_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  126:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=46 row-size=20B cardinality=18.00K
+|  |  |  |  |  in pipelines: 55(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F35:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |  55:SCAN HDFS [tpcds_parquet.item ics, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |  |     tuple-ids=46 row-size=20B cardinality=18.00K
+|  |  |  |     in pipelines: 55(GETNEXT)
+|  |  |  |
+|  |  |  54:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=45 row-size=12B cardinality=1.44M
+|  |  |     in pipelines: 54(GETNEXT)
+|  |  |
+|  |  53:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=14
+|  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42,43 row-size=40B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 51(OPEN)
+|  |  |
+|  |  |--F71:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=14 plan-id=15 cohort-id=04
+|  |  |  |  build expressions: d1.d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  125:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=43 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 51(GETNEXT)
+|  |  |  |
+|  |  |  F33:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  51:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=43 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 51(GETNEXT)
+|  |  |
+|  |  52:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=15
+|  |  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=41,42 row-size=32B cardinality=2.88M
+|  |  |  in pipelines: 49(GETNEXT), 50(OPEN)
+|  |  |
+|  |  |--F72:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=15 plan-id=16 cohort-id=04
+|  |  |  |  build expressions: iss.i_item_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  124:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=42 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 50(GETNEXT)
+|  |  |  |
+|  |  |  F32:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  50:SCAN HDFS [tpcds_parquet.item iss, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=42 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 50(GETNEXT)
+|  |  |
+|  |  49:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=41 row-size=12B cardinality=2.88M
+|  |     in pipelines: 49(GETNEXT)
+|  |
+|  73:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=16
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38,39 row-size=48B cardinality=2.88M
+|  |  in pipelines: 45(GETNEXT), 47(OPEN)
+|  |
+|  |--F73:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.44MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=16 plan-id=17 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  123:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=39 row-size=8B cardinality=73.05K
+|  |  |  in pipelines: 47(GETNEXT)
+|  |  |
+|  |  F30:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  47:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF050[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=39 row-size=8B cardinality=73.05K
+|  |     in pipelines: 47(GETNEXT)
+|  |
+|  72:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=17
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=37,38 row-size=40B cardinality=2.88M
+|  |  in pipelines: 45(GETNEXT), 46(OPEN)
+|  |
+|  |--F74:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=17 plan-id=18 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  122:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=38 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 46(GETNEXT)
+|  |  |
+|  |  F29:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  46:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=38 row-size=20B cardinality=18.00K
+|  |     in pipelines: 46(GETNEXT)
+|  |
+|  45:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=37 row-size=20B cardinality=2.88M
+|     in pipelines: 45(GETNEXT)
+|
+44:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  join table id: 18
+|  predicates: sum(ss_quantity * ss_list_price) > avg(quantity * list_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=22,33 row-size=52B cardinality=271
+|  in pipelines: 115(GETNEXT), 120(OPEN)
+|
+|--F75:PLAN FRAGMENT [HASH(i_brand_id,i_class_id,i_category_id)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=18 plan-id=19 cohort-id=01
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |
+|  121:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=33 row-size=16B cardinality=1
+|  |  in pipelines: 120(GETNEXT)
+|  |
+|  F27:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  120:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(quantity * list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=33 row-size=16B cardinality=1
+|  |  in pipelines: 120(GETNEXT), 43(OPEN)
+|  |
+|  119:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=32 row-size=16B cardinality=1
+|  |  in pipelines: 43(GETNEXT)
+|  |
+|  F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=4.00MB thread-reservation=1
+|  43:AGGREGATE
+|  |  output: avg(CAST(quantity AS DECIMAL(10,0)) * list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=32 row-size=16B cardinality=1
+|  |  in pipelines: 43(GETNEXT), 34(OPEN), 37(OPEN), 40(OPEN)
+|  |
+|  33:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=30 row-size=8B cardinality=5.04M
+|  |  in pipelines: 34(GETNEXT), 37(GETNEXT), 40(GETNEXT)
+|  |
+|  |--42:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=21
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=28,29 row-size=20B cardinality=719.38K
+|  |  |  in pipelines: 40(GETNEXT), 41(OPEN)
+|  |  |
+|  |  |--F78:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=21 plan-id=22 cohort-id=07
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  118:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=29 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 41(GETNEXT)
+|  |  |  |
+|  |  |  F25:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  41:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=29 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 41(GETNEXT)
+|  |  |
+|  |  40:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=28 row-size=12B cardinality=719.38K
+|  |     in pipelines: 40(GETNEXT)
+|  |
+|  |--39:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=20
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=26,27 row-size=20B cardinality=1.44M
+|  |  |  in pipelines: 37(GETNEXT), 38(OPEN)
+|  |  |
+|  |  |--F77:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=20 plan-id=21 cohort-id=07
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  117:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=27 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 38(GETNEXT)
+|  |  |  |
+|  |  |  F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  38:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=27 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 38(GETNEXT)
+|  |  |
+|  |  37:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=26 row-size=12B cardinality=1.44M
+|  |     in pipelines: 37(GETNEXT)
+|  |
+|  36:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=19
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,25 row-size=20B cardinality=2.88M
+|  |  in pipelines: 34(GETNEXT), 35(OPEN)
+|  |
+|  |--F76:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=19 plan-id=20 cohort-id=07
+|  |  |  build expressions: d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  116:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=25 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 35(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  35:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d_year <= CAST(2001 AS INT), d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=25 row-size=8B cardinality=7.30K
+|  |     in pipelines: 35(GETNEXT)
+|  |
+|  34:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=24 row-size=12B cardinality=2.88M
+|     in pipelines: 34(GETNEXT)
+|
+115:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_quantity * ss_list_price), count:merge(*)
+|  group by: i_brand_id, i_class_id, i_category_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22 row-size=36B cardinality=271
+|  in pipelines: 115(GETNEXT), 00(OPEN)
+|
+114:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  mem-estimate=66.69KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=22 row-size=36B cardinality=271
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+32:AGGREGATE [STREAMING]
+|  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_list_price), count(*)
+|  group by: i_brand_id, i_class_id, i_category_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22 row-size=36B cardinality=271
+|  in pipelines: 00(GETNEXT)
+|
+31:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash-table-id=22
+|  hash predicates: d_week_seq = d_week_seq
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=48B cardinality=271
+|  in pipelines: 00(GETNEXT), 26(OPEN)
+|
+|--F79:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=22 plan-id=23 cohort-id=01
+|  |  build expressions: d_week_seq
+|  |  runtime filters: RF006[bloom] <- d_week_seq
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  113:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=16B cardinality=1
+|  |  in pipelines: 26(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  26:CARDINALITY CHECK
+|  |  limit: 1
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=16B cardinality=1
+|  |  in pipelines: 26(GETNEXT), 25(OPEN)
+|  |
+|  112:EXCHANGE [UNPARTITIONED]
+|  |  limit: 2
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=16B cardinality=2
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2000 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2000 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_dom = CAST(11 AS INT), d_moy = CAST(12 AS INT)
+|     limit: 2
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=20 row-size=16B cardinality=2
+|     in pipelines: 25(GETNEXT)
+|
+30:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash-table-id=23
+|  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=48B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 110(OPEN)
+|
+|--F80:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.08MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=23 plan-id=24 cohort-id=01
+|  |  build expressions: tpcds_parquet.item.i_item_sk
+|  |  runtime filters: RF008[bloom] <- tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  111:EXCHANGE [BROADCAST]
+|  |  mem-estimate=212.43KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=91 row-size=8B cardinality=17.98K
+|  |  in pipelines: 110(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [HASH(tpcds_parquet.item.i_item_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=10.12MB mem-reservation=1.94MB thread-reservation=1
+|  110:AGGREGATE [FINALIZE]
+|  |  group by: tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=91 row-size=8B cardinality=17.98K
+|  |  in pipelines: 110(GETNEXT), 107(OPEN)
+|  |
+|  109:EXCHANGE [HASH(tpcds_parquet.item.i_item_sk)]
+|  |  mem-estimate=118.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=91 row-size=8B cardinality=17.98K
+|  |  in pipelines: 107(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=20.66MB mem-reservation=3.94MB thread-reservation=1
+|  29:AGGREGATE [STREAMING]
+|  |  group by: tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=91 row-size=8B cardinality=17.98K
+|  |  in pipelines: 107(GETNEXT)
+|  |
+|  24:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=24
+|  |  hash predicates: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  fk/pk conjuncts: $a$2.brand_id = i_brand_id, $a$2.category_id = i_category_id, $a$2.class_id = i_class_id
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,3 row-size=32B cardinality=148.80K
+|  |  in pipelines: 107(GETNEXT), 03(OPEN)
+|  |
+|  |--F81:PLAN FRAGMENT [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=4.30MB mem-reservation=3.94MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=24 plan-id=25 cohort-id=08
+|  |  |  build expressions: i_brand_id, i_category_id, i_class_id
+|  |  |  runtime filters: RF014[bloom] <- i_brand_id, RF015[bloom] <- i_category_id
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  108:EXCHANGE [HASH(i_brand_id,i_class_id,i_category_id)]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=20B cardinality=18.00K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  107:AGGREGATE [FINALIZE]
+|  |  group by: $a$2.brand_id, $a$2.class_id, $a$2.category_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 107(GETNEXT), 04(OPEN)
+|  |
+|  106:EXCHANGE [HASH($a$2.brand_id,$a$2.class_id,$a$2.category_id)]
+|  |  mem-estimate=677.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.50MB thread-reservation=1
+|  23:AGGREGATE [STREAMING]
+|  |  group by: iss.i_brand_id, iss.i_class_id, iss.i_category_id
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=12B cardinality=148.80K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  22:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=25
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM iws.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM iws.i_category_id, iss.i_class_id IS NOT DISTINCT FROM iws.i_class_id
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 104(OPEN)
+|  |
+|  |--F82:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=7.48MB mem-reservation=5.75MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=25 plan-id=26 cohort-id=08
+|  |  |  build expressions: iws.i_brand_id, iws.i_category_id, iws.i_class_id
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  105:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=89 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 104(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=10.88MB mem-reservation=1.94MB thread-reservation=1
+|  |  104:AGGREGATE [FINALIZE]
+|  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=89 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 104(GETNEXT), 14(OPEN)
+|  |  |
+|  |  103:EXCHANGE [HASH(iws.i_brand_id,iws.i_class_id,iws.i_category_id)]
+|  |  |  mem-estimate=903.88KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=89 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=42.00MB mem-reservation=7.00MB thread-reservation=1
+|  |  21:AGGREGATE [STREAMING]
+|  |  |  group by: iws.i_brand_id, iws.i_class_id, iws.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=89 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  18:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=26
+|  |  |  hash predicates: ws_sold_date_sk = d3.d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d3.d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13,14 row-size=40B cardinality=719.38K
+|  |  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |  |
+|  |  |--F83:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=26 plan-id=27 cohort-id=09
+|  |  |  |  build expressions: d3.d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  102:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=14 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 16(GETNEXT)
+|  |  |  |
+|  |  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  16:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d3.d_year <= CAST(2001 AS INT), d3.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=14 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 16(GETNEXT)
+|  |  |
+|  |  17:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=27
+|  |  |  hash predicates: ws_item_sk = iws.i_item_sk
+|  |  |  fk/pk conjuncts: ws_item_sk = iws.i_item_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12,13 row-size=32B cardinality=719.38K
+|  |  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |  |
+|  |  |--F84:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=27 plan-id=28 cohort-id=09
+|  |  |  |  build expressions: iws.i_item_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  101:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 15(GETNEXT)
+|  |  |  |
+|  |  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  15:SCAN HDFS [tpcds_parquet.item iws, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=13 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 15(GETNEXT)
+|  |  |
+|  |  14:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=12 row-size=12B cardinality=719.38K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  20:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=28
+|  |  hash predicates: iss.i_brand_id IS NOT DISTINCT FROM ics.i_brand_id, iss.i_category_id IS NOT DISTINCT FROM ics.i_category_id, iss.i_class_id IS NOT DISTINCT FROM ics.i_class_id
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 99(OPEN)
+|  |
+|  |--F85:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=7.50MB mem-reservation=5.75MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=28 plan-id=29 cohort-id=08
+|  |  |  build expressions: ics.i_brand_id, ics.i_category_id, ics.i_class_id
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  100:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.75MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=88 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 99(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=10.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  99:AGGREGATE [FINALIZE]
+|  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=88 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 99(GETNEXT), 09(OPEN)
+|  |  |
+|  |  98:EXCHANGE [HASH(ics.i_brand_id,ics.i_class_id,ics.i_category_id)]
+|  |  |  mem-estimate=629.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=88 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=7.00MB thread-reservation=1
+|  |  19:AGGREGATE [STREAMING]
+|  |  |  group by: ics.i_brand_id, ics.i_class_id, ics.i_category_id
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=88 row-size=12B cardinality=148.80K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=29
+|  |  |  hash predicates: cs_sold_date_sk = d2.d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d2.d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9,10 row-size=40B cardinality=1.44M
+|  |  |  in pipelines: 09(GETNEXT), 11(OPEN)
+|  |  |
+|  |  |--F86:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=29 plan-id=30 cohort-id=10
+|  |  |  |  build expressions: d2.d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  97:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  |  |  in pipelines: 11(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  11:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     parquet dictionary predicates: d2.d_year <= CAST(2001 AS INT), d2.d_year >= CAST(1999 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=30
+|  |  |  hash predicates: cs_item_sk = ics.i_item_sk
+|  |  |  fk/pk conjuncts: cs_item_sk = ics.i_item_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9 row-size=32B cardinality=1.44M
+|  |  |  in pipelines: 09(GETNEXT), 10(OPEN)
+|  |  |
+|  |  |--F87:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=30 plan-id=31 cohort-id=10
+|  |  |  |  build expressions: ics.i_item_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  96:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=9 row-size=20B cardinality=18.00K
+|  |  |  |  in pipelines: 10(GETNEXT)
+|  |  |  |
+|  |  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  10:SCAN HDFS [tpcds_parquet.item ics, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=9 row-size=20B cardinality=18.00K
+|  |  |     in pipelines: 10(GETNEXT)
+|  |  |
+|  |  09:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=8 row-size=12B cardinality=1.44M
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=31
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=40B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 06(OPEN)
+|  |
+|  |--F88:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=31 plan-id=32 cohort-id=08
+|  |  |  build expressions: d1.d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  95:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  06:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d1.d_year <= CAST(2001 AS INT), d1.d_year >= CAST(1999 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=6 row-size=8B cardinality=7.30K
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=32
+|  |  hash predicates: ss_item_sk = iss.i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = iss.i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=32B cardinality=2.88M
+|  |  in pipelines: 04(GETNEXT), 05(OPEN)
+|  |
+|  |--F89:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.24MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=32 plan-id=33 cohort-id=08
+|  |  |  build expressions: iss.i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  94:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=20B cardinality=18.00K
+|  |  |  in pipelines: 05(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  05:SCAN HDFS [tpcds_parquet.item iss, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF014[bloom] -> iss.i_brand_id, RF015[bloom] -> iss.i_category_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=5 row-size=20B cardinality=18.00K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  04:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=4 row-size=12B cardinality=2.88M
+|     in pipelines: 04(GETNEXT)
+|
+28:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=33
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=48B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F90:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.44MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=33 plan-id=34 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  93:EXCHANGE [BROADCAST]
+|  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=73.05K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF006[bloom] -> d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=8B cardinality=73.05K
+|     in pipelines: 02(GETNEXT)
+|
+27:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=34
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=40B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F91:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.24MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=34 plan-id=35 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF012[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  92:EXCHANGE [BROADCAST]
+|  |  mem-estimate=375.56KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=20B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_brand_id, RF001[bloom] -> tpcds_parquet.item.i_category_id, RF002[bloom] -> tpcds_parquet.item.i_class_id, RF008[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=1 row-size=20B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF008[bloom] -> ss_item_sk, RF010[bloom] -> ss_sold_date_sk, RF012[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q15.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q15.test
new file mode 100644
index 0000000..9700f93
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q15.test
@@ -0,0 +1,444 @@
+# TPCDS-Q15
+SELECT ca_zip,
+       sum(cs_sales_price)
+FROM catalog_sales,
+     customer,
+     customer_address,
+     date_dim
+WHERE cs_bill_customer_sk = c_customer_sk
+  AND c_current_addr_sk = ca_address_sk
+  AND (SUBSTRING(ca_zip, 1, 5) IN ('85669',
+                                '86197',
+                                '88274',
+                                '83405',
+                                '86475',
+                                '85392',
+                                '85460',
+                                '80348',
+                                '81792')
+       OR ca_state IN ('CA',
+                       'WA',
+                       'GA')
+       OR cs_sales_price > 500)
+  AND cs_sold_date_sk = d_date_sk
+  AND d_qoy = 2
+  AND d_year = 2001
+GROUP BY ca_zip
+ORDER BY ca_zip
+LIMIT 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=15.75MB Threads=5
+Per-Host Resource Estimates: Memory=282MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=281.75MB mem-reservation=15.75MB thread-reservation=5 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: ca_zip, sum(cs_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+08:TOP-N [LIMIT=100]
+|  order by: ca_zip ASC
+|  mem-estimate=3.22KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=33B cardinality=100
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+07:AGGREGATE [FINALIZE]
+|  output: sum(cs_sales_price)
+|  group by: ca_zip
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=33B cardinality=3.96K
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  other predicates: (substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792') OR ca_state IN ('CA', 'WA', 'GA') OR cs_sales_price > CAST(500 AS DECIMAL(5,0)))
+|  runtime filters: RF000[bloom] <- ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=67B cardinality=146.92K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=35B cardinality=50.00K
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=32B cardinality=146.92K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=24B cardinality=146.92K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=186
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF002[bloom] -> cs_bill_customer_sk, RF004[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=20.75MB Threads=12
+Per-Host Resource Estimates: Memory=308MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: ca_zip, sum(cs_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+16:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: ca_zip ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=33B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ca_zip)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.15MB mem-reservation=1.94MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: ca_zip ASC
+|  mem-estimate=3.22KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=33B cardinality=100
+|  in pipelines: 08(GETNEXT), 15(OPEN)
+|
+15:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_sales_price)
+|  group by: ca_zip
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=33B cardinality=3.96K
+|  in pipelines: 15(GETNEXT), 00(OPEN)
+|
+14:EXCHANGE [HASH(ca_zip)]
+|  mem-estimate=153.55KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=33B cardinality=3.96K
+|  in pipelines: 00(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=16.27MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+07:AGGREGATE [STREAMING]
+|  output: sum(cs_sales_price)
+|  group by: ca_zip
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=33B cardinality=3.96K
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  other predicates: (substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792') OR ca_state IN ('CA', 'WA', 'GA') OR cs_sales_price > CAST(500 AS DECIMAL(5,0)))
+|  runtime filters: RF000[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=67B cardinality=146.92K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--13:EXCHANGE [HASH(ca_address_sk)]
+|  |  mem-estimate=1.71MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=35B cardinality=50.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=35B cardinality=50.00K
+|     in pipelines: 02(GETNEXT)
+|
+12:EXCHANGE [HASH(c_current_addr_sk)]
+|  mem-estimate=1.62MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,1 row-size=32B cardinality=146.92K
+|  in pipelines: 00(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=4.93MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+05:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=32B cardinality=146.92K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--11:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=100.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  01:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+10:EXCHANGE [HASH(cs_bill_customer_sk)]
+|  mem-estimate=1.21MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3 row-size=24B cardinality=146.92K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=147.95MB mem-reservation=7.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=24B cardinality=146.92K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=186
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=186
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF002[bloom] -> cs_bill_customer_sk, RF004[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=23.69MB Threads=11
+Per-Host Resource Estimates: Memory=135MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: ca_zip, sum(cs_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+16:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: ca_zip ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=33B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ca_zip)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=10.15MB mem-reservation=1.94MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: ca_zip ASC
+|  mem-estimate=3.22KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=33B cardinality=100
+|  in pipelines: 08(GETNEXT), 15(OPEN)
+|
+15:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_sales_price)
+|  group by: ca_zip
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=33B cardinality=3.96K
+|  in pipelines: 15(GETNEXT), 00(OPEN)
+|
+14:EXCHANGE [HASH(ca_zip)]
+|  mem-estimate=153.55KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=33B cardinality=3.96K
+|  in pipelines: 00(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=11.62MB mem-reservation=2.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  output: sum(cs_sales_price)
+|  group by: ca_zip
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=33B cardinality=3.96K
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  other predicates: (substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792') OR ca_state IN ('CA', 'WA', 'GA') OR cs_sales_price > CAST(500 AS DECIMAL(5,0)))
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=67B cardinality=146.92K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F08:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.64MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: ca_address_sk
+|  |  runtime filters: RF000[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [HASH(ca_address_sk)]
+|  |  mem-estimate=1.71MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=35B cardinality=50.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=35B cardinality=50.00K
+|     in pipelines: 02(GETNEXT)
+|
+12:EXCHANGE [HASH(c_current_addr_sk)]
+|  mem-estimate=1.62MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,1 row-size=32B cardinality=146.92K
+|  in pipelines: 00(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=1.21MB mem-reservation=0B thread-reservation=1
+05:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=01
+|  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=32B cardinality=146.92K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F09:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.71MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF002[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=100.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=1 row-size=8B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+10:EXCHANGE [HASH(cs_bill_customer_sk)]
+|  mem-estimate=1.21MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3 row-size=24B cardinality=146.92K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=24B cardinality=146.92K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=186
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=12B cardinality=186
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF002[bloom] -> cs_bill_customer_sk, RF004[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=12B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q16.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q16.test
new file mode 100644
index 0000000..9ead108
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q16.test
@@ -0,0 +1,587 @@
+# TPCDS-Q16
+SELECT count(DISTINCT cs_order_number) AS "order count",
+       sum(cs_ext_ship_cost) AS "total shipping cost",
+       sum(cs_net_profit) AS "total net profit"
+FROM catalog_sales cs1,
+     date_dim,
+     customer_address,
+     call_center
+WHERE d_date BETWEEN '2002-02-01' AND cast('2002-04-02' AS date)
+  AND cs1.cs_ship_date_sk = d_date_sk
+  AND cs1.cs_ship_addr_sk = ca_address_sk
+  AND ca_state = 'GA'
+  AND cs1.cs_call_center_sk = cc_call_center_sk
+  AND cc_county = 'Williamson County'
+  AND EXISTS
+    (SELECT *
+     FROM catalog_sales cs2
+     WHERE cs1.cs_order_number = cs2.cs_order_number
+       AND cs1.cs_warehouse_sk <> cs2.cs_warehouse_sk)
+  AND NOT EXISTS
+    (SELECT *
+     FROM catalog_returns cr1
+     WHERE cs1.cs_order_number = cr1.cr_order_number)
+ORDER BY count(DISTINCT cs_order_number)
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=39.44MB Threads=7
+Per-Host Resource Estimates: Memory=565MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=564.69MB mem-reservation=39.44MB thread-reservation=7 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: count(cs_order_number), sum(cs_ext_ship_cost), sum(cs_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:TOP-N [LIMIT=100]
+|  order by: count(cs_order_number) ASC
+|  mem-estimate=40B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=40B cardinality=1
+|  in pipelines: 13(GETNEXT), 12(OPEN)
+|
+12:AGGREGATE [FINALIZE]
+|  output: count(cs_order_number), sum:merge(cs_ext_ship_cost), sum:merge(cs_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 12(GETNEXT), 11(OPEN)
+|
+11:AGGREGATE
+|  output: sum(cs_ext_ship_cost), sum(cs_net_profit)
+|  group by: cs_order_number
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=8 row-size=40B cardinality=30.02K
+|  in pipelines: 11(GETNEXT), 04(OPEN)
+|
+10:HASH JOIN [LEFT ANTI JOIN]
+|  hash predicates: cs1.cs_order_number = cr1.cr_order_number
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=109B cardinality=30.02K
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.catalog_returns cr1]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=6 row-size=8B cardinality=144.07K
+|     in pipelines: 05(GETNEXT)
+|
+09:HASH JOIN [RIGHT SEMI JOIN]
+|  hash predicates: cs2.cs_order_number = cs1.cs_order_number
+|  other join predicates: cs1.cs_warehouse_sk != cs2.cs_warehouse_sk
+|  runtime filters: RF000[bloom] <- cs1.cs_order_number
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=109B cardinality=30.02K
+|  in pipelines: 04(GETNEXT), 00(OPEN)
+|
+|--08:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs1.cs_call_center_sk = cc_call_center_sk
+|  |  fk/pk conjuncts: cs1.cs_call_center_sk = cc_call_center_sk
+|  |  runtime filters: RF002[bloom] <- cc_call_center_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,1,3 row-size=109B cardinality=30.02K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.call_center]
+|  |     HDFS partitions=1/1 files=1 size=10.28KB
+|  |     predicates: cc_county = 'Williamson County'
+|  |     stored statistics:
+|  |       table: rows=6 size=10.28KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=6
+|  |     parquet statistics predicates: cc_county = 'Williamson County'
+|  |     parquet dictionary predicates: cc_county = 'Williamson County'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=33B cardinality=6
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs1.cs_ship_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs1.cs_ship_date_sk = d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,1 row-size=76B cardinality=30.02K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--01:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '2002-04-02', CAST(d_date AS DATE) >= DATE '2002-02-01'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2002-04-02', CAST(d_date AS DATE) >= DATE '2002-02-01'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2002-04-02', CAST(d_date AS DATE) >= DATE '2002-02-01'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=26B cardinality=7.30K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs1.cs_ship_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: cs1.cs_ship_addr_sk = ca_address_sk
+|  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2 row-size=50B cardinality=30.02K
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_state = 'GA'
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_state = 'GA'
+|  |     parquet dictionary predicates: ca_state = 'GA'
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=18B cardinality=980
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.catalog_sales cs1]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF002[bloom] -> cs1.cs_call_center_sk, RF004[bloom] -> cs1.cs_ship_date_sk, RF006[bloom] -> cs1.cs_ship_addr_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=336.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=0 row-size=32B cardinality=1.44M
+|     in pipelines: 00(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.catalog_sales cs2]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs2.cs_order_number
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=4 row-size=12B cardinality=1.44M
+   in pipelines: 04(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=40.83MB Threads=14
+Per-Host Resource Estimates: Memory=593MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(cs_order_number), sum(cs_ext_ship_cost), sum(cs_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:TOP-N [LIMIT=100]
+|  order by: count(cs_order_number) ASC
+|  mem-estimate=40B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=40B cardinality=1
+|  in pipelines: 13(GETNEXT), 21(OPEN)
+|
+21:AGGREGATE [FINALIZE]
+|  output: count:merge(cs_order_number), sum:merge(cs_ext_ship_cost), sum:merge(cs_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 21(GETNEXT), 12(OPEN)
+|
+20:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 12(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(cs1.cs_order_number)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=21.36MB mem-reservation=7.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+12:AGGREGATE
+|  output: count(cs_order_number), sum:merge(cs_ext_ship_cost), sum:merge(cs_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 12(GETNEXT), 11(OPEN)
+|
+11:AGGREGATE
+|  output: sum(cs_ext_ship_cost), sum(cs_net_profit)
+|  group by: cs_order_number
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=40B cardinality=30.02K
+|  in pipelines: 11(GETNEXT), 04(OPEN)
+|
+10:HASH JOIN [LEFT ANTI JOIN, PARTITIONED]
+|  hash predicates: cs1.cs_order_number = cr1.cr_order_number
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=109B cardinality=30.02K
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--19:EXCHANGE [HASH(cr1.cr_order_number)]
+|  |  mem-estimate=1.11MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=8B cardinality=144.07K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.catalog_returns cr1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=6 row-size=8B cardinality=144.07K
+|     in pipelines: 05(GETNEXT)
+|
+09:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash predicates: cs2.cs_order_number = cs1.cs_order_number
+|  other join predicates: cs1.cs_warehouse_sk != cs2.cs_warehouse_sk
+|  runtime filters: RF000[bloom] <- cs1.cs_order_number
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=109B cardinality=30.02K
+|  in pipelines: 04(GETNEXT), 00(OPEN)
+|
+|--18:EXCHANGE [HASH(cs1.cs_order_number)]
+|  |  mem-estimate=1.41MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,2,1,3 row-size=109B cardinality=30.02K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=345.08MB mem-reservation=24.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs1.cs_call_center_sk = cc_call_center_sk
+|  |  fk/pk conjuncts: cs1.cs_call_center_sk = cc_call_center_sk
+|  |  runtime filters: RF002[bloom] <- cc_call_center_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,1,3 row-size=109B cardinality=30.02K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--16:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=33B cardinality=6
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.28KB
+|  |     predicates: cc_county = 'Williamson County'
+|  |     stored statistics:
+|  |       table: rows=6 size=10.28KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=6
+|  |     parquet statistics predicates: cc_county = 'Williamson County'
+|  |     parquet dictionary predicates: cc_county = 'Williamson County'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=33B cardinality=6
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs1.cs_ship_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs1.cs_ship_date_sk = d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,1 row-size=76B cardinality=30.02K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--15:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '2002-04-02', CAST(d_date AS DATE) >= DATE '2002-02-01'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2002-04-02', CAST(d_date AS DATE) >= DATE '2002-02-01'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2002-04-02', CAST(d_date AS DATE) >= DATE '2002-02-01'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=26B cardinality=7.30K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs1.cs_ship_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: cs1.cs_ship_addr_sk = ca_address_sk
+|  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2 row-size=50B cardinality=30.02K
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--14:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=38.28KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=18B cardinality=980
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_state = 'GA'
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_state = 'GA'
+|  |     parquet dictionary predicates: ca_state = 'GA'
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=18B cardinality=980
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.catalog_sales cs1, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF002[bloom] -> cs1.cs_call_center_sk, RF004[bloom] -> cs1.cs_ship_date_sk, RF006[bloom] -> cs1.cs_ship_addr_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=336.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=0 row-size=32B cardinality=1.44M
+|     in pipelines: 00(GETNEXT)
+|
+17:EXCHANGE [HASH(cs2.cs_order_number)]
+|  mem-estimate=5.55MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=12B cardinality=1.44M
+|  in pipelines: 04(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=97.00MB mem-reservation=5.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+04:SCAN HDFS [tpcds_parquet.catalog_sales cs2, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs2.cs_order_number
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=4 row-size=12B cardinality=1.44M
+   in pipelines: 04(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=49.64MB Threads=13
+Per-Host Resource Estimates: Memory=225MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(cs_order_number), sum(cs_ext_ship_cost), sum(cs_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:TOP-N [LIMIT=100]
+|  order by: count(cs_order_number) ASC
+|  mem-estimate=40B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=40B cardinality=1
+|  in pipelines: 13(GETNEXT), 21(OPEN)
+|
+21:AGGREGATE [FINALIZE]
+|  output: count:merge(cs_order_number), sum:merge(cs_ext_ship_cost), sum:merge(cs_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 21(GETNEXT), 12(OPEN)
+|
+20:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 12(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(cs1.cs_order_number)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+12:AGGREGATE
+|  output: count(cs_order_number), sum:merge(cs_ext_ship_cost), sum:merge(cs_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 12(GETNEXT), 11(OPEN)
+|
+11:AGGREGATE
+|  output: sum(cs_ext_ship_cost), sum(cs_net_profit)
+|  group by: cs_order_number
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=40B cardinality=30.02K
+|  in pipelines: 11(GETNEXT), 04(OPEN)
+|
+10:HASH JOIN [LEFT ANTI JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: cs1.cs_order_number = cr1.cr_order_number
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=109B cardinality=30.02K
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--F08:PLAN FRAGMENT [HASH(cs1.cs_order_number)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.05MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: cr1.cr_order_number
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [HASH(cr1.cr_order_number)]
+|  |  mem-estimate=1.11MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=8B cardinality=144.07K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.catalog_returns cr1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=6 row-size=8B cardinality=144.07K
+|     in pipelines: 05(GETNEXT)
+|
+09:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash-table-id=01
+|  hash predicates: cs2.cs_order_number = cs1.cs_order_number
+|  other join predicates: cs1.cs_warehouse_sk != cs2.cs_warehouse_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=109B cardinality=30.02K
+|  in pipelines: 04(GETNEXT), 00(OPEN)
+|
+|--F09:PLAN FRAGMENT [HASH(cs1.cs_order_number)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.28MB mem-reservation=3.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: cs1.cs_order_number
+|  |  runtime filters: RF000[bloom] <- cs1.cs_order_number
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [HASH(cs1.cs_order_number)]
+|  |  mem-estimate=1.41MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,2,1,3 row-size=109B cardinality=30.02K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=1
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: cs1.cs_call_center_sk = cc_call_center_sk
+|  |  fk/pk conjuncts: cs1.cs_call_center_sk = cc_call_center_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,1,3 row-size=109B cardinality=30.02K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: cc_call_center_sk
+|  |  |  runtime filters: RF002[bloom] <- cc_call_center_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  16:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=33B cardinality=6
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.28KB
+|  |     predicates: cc_county = 'Williamson County'
+|  |     stored statistics:
+|  |       table: rows=6 size=10.28KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=6
+|  |     parquet statistics predicates: cc_county = 'Williamson County'
+|  |     parquet dictionary predicates: cc_county = 'Williamson County'
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=33B cardinality=6
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: cs1.cs_ship_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs1.cs_ship_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,1 row-size=76B cardinality=30.02K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=5.09MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  15:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '2002-04-02', CAST(d_date AS DATE) >= DATE '2002-02-01'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2002-04-02', CAST(d_date AS DATE) >= DATE '2002-02-01'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2002-04-02', CAST(d_date AS DATE) >= DATE '2002-02-01'
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=1 row-size=26B cardinality=7.30K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: cs1.cs_ship_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: cs1.cs_ship_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2 row-size=50B cardinality=30.02K
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--F12:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.91MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: ca_address_sk
+|  |  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  14:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=38.28KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=18B cardinality=980
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_state = 'GA'
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_state = 'GA'
+|  |     parquet dictionary predicates: ca_state = 'GA'
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=2 row-size=18B cardinality=980
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.catalog_sales cs1, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF002[bloom] -> cs1.cs_call_center_sk, RF004[bloom] -> cs1.cs_ship_date_sk, RF006[bloom] -> cs1.cs_ship_addr_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=0 row-size=32B cardinality=1.44M
+|     in pipelines: 00(GETNEXT)
+|
+17:EXCHANGE [HASH(cs2.cs_order_number)]
+|  mem-estimate=5.55MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=12B cardinality=1.44M
+|  in pipelines: 04(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+Per-Instance Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+04:SCAN HDFS [tpcds_parquet.catalog_sales cs2, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs2.cs_order_number
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=4 row-size=12B cardinality=1.44M
+   in pipelines: 04(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q17.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q17.test
new file mode 100644
index 0000000..47058b2
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q17.test
@@ -0,0 +1,792 @@
+# TPCDS-Q17
+SELECT i_item_id,
+       i_item_desc,
+       s_state,
+       count(ss_quantity) AS store_sales_quantitycount,
+       avg(ss_quantity) AS store_sales_quantityave,
+       stddev_samp(ss_quantity) AS store_sales_quantitystdev,
+       stddev_samp(ss_quantity)/avg(ss_quantity) AS store_sales_quantitycov,
+       count(sr_return_quantity) AS store_returns_quantitycount,
+       avg(sr_return_quantity) AS store_returns_quantityave,
+       stddev_samp(sr_return_quantity) AS store_returns_quantitystdev,
+       stddev_samp(sr_return_quantity)/avg(sr_return_quantity) AS store_returns_quantitycov,
+       count(cs_quantity) AS catalog_sales_quantitycount,
+       avg(cs_quantity) AS catalog_sales_quantityave,
+       stddev_samp(cs_quantity) AS catalog_sales_quantitystdev,
+       stddev_samp(cs_quantity)/avg(cs_quantity) AS catalog_sales_quantitycov
+FROM store_sales,
+     store_returns,
+     catalog_sales,
+     date_dim d1,
+     date_dim d2,
+     date_dim d3,
+     store,
+     item
+WHERE d1.d_quarter_name = '2001Q1'
+  AND d1.d_date_sk = ss_sold_date_sk
+  AND i_item_sk = ss_item_sk
+  AND s_store_sk = ss_store_sk
+  AND ss_customer_sk = sr_customer_sk
+  AND ss_item_sk = sr_item_sk
+  AND ss_ticket_number = sr_ticket_number
+  AND sr_returned_date_sk = d2.d_date_sk
+  AND d2.d_quarter_name IN ('2001Q1',
+                            '2001Q2',
+                            '2001Q3')
+  AND sr_customer_sk = cs_bill_customer_sk
+  AND sr_item_sk = cs_item_sk
+  AND cs_sold_date_sk = d3.d_date_sk
+  AND d3.d_quarter_name IN ('2001Q1',
+                            '2001Q2',
+                            '2001Q3')
+GROUP BY i_item_id,
+         i_item_desc,
+         s_state
+ORDER BY i_item_id,
+         i_item_desc,
+         s_state
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=49.27MB Threads=9
+Per-Host Resource Estimates: Memory=586MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=585.75MB mem-reservation=49.27MB thread-reservation=9 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, s_state, count(ss_quantity), avg(ss_quantity), stddev_samp(ss_quantity), stddev_samp(ss_quantity) / avg(ss_quantity), count(sr_return_quantity), avg(sr_return_quantity), stddev_samp(sr_return_quantity), stddev_samp(sr_return_quantity) / avg(sr_return_quantity), count(cs_quantity), avg(cs_quantity), stddev_samp(cs_quantity), stddev_samp(cs_quantity) / avg(cs_quantity)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+16:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC, i_item_desc ASC, s_state ASC
+|  mem-estimate=22.11KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=226B cardinality=100
+|  in pipelines: 16(GETNEXT), 15(OPEN)
+|
+15:AGGREGATE [FINALIZE]
+|  output: count(ss_quantity), avg(CAST(ss_quantity AS BIGINT)), stddev_samp(ss_quantity), count(sr_return_quantity), avg(CAST(sr_return_quantity AS BIGINT)), stddev_samp(sr_return_quantity), count(cs_quantity), avg(CAST(cs_quantity AS BIGINT)), stddev_samp(cs_quantity)
+|  group by: i_item_id, i_item_desc, s_state
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9 row-size=226B cardinality=2.02K
+|  in pipelines: 15(GETNEXT), 07(OPEN)
+|
+14:HASH JOIN [INNER JOIN]
+|  hash predicates: i_item_sk = ss_item_sk
+|  fk/pk conjuncts: i_item_sk = ss_item_sk
+|  runtime filters: RF000[bloom] <- ss_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,2,1,0,3,4,5,6 row-size=312B cardinality=2.02K
+|  in pipelines: 07(GETNEXT), 02(OPEN)
+|
+|--13:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF002[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,1,0,3,4,5,6 row-size=164B cardinality=2.02K
+|  |  in pipelines: 02(GETNEXT), 06(OPEN)
+|  |
+|  |--06:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=18B cardinality=12
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d3.d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d3.d_date_sk
+|  |  runtime filters: RF004[bloom] <- d3.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,1,0,3,4,5 row-size=146B cardinality=2.02K
+|  |  in pipelines: 02(GETNEXT), 05(OPEN)
+|  |
+|  |--05:SCAN HDFS [tpcds_parquet.date_dim d3]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d3.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d3.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |     parquet dictionary predicates: d3.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=22B cardinality=273
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  11:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  |  fk/pk conjuncts: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  |  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=2,1,0,3,4 row-size=124B cardinality=13.53K
+|  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |
+|  |--10:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  |  |  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d2.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=1,0,3,4 row-size=104B cardinality=14.48K
+|  |  |  in pipelines: 01(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--04:SCAN HDFS [tpcds_parquet.date_dim d2]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d2.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d2.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |  |     parquet dictionary predicates: d2.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=4 row-size=22B cardinality=273
+|  |  |     in pipelines: 04(GETNEXT)
+|  |  |
+|  |  09:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: sr_customer_sk = ss_customer_sk, sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  fk/pk conjuncts: sr_customer_sk = ss_customer_sk, sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  runtime filters: RF012[bloom] <- ss_customer_sk, RF013[bloom] <- ss_item_sk, RF014[bloom] <- ss_ticket_number
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |  tuple-ids=1,0,3 row-size=82B cardinality=105.69K
+|  |  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--08:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  |  runtime filters: RF018[bloom] <- d1.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=0,3 row-size=54B cardinality=143.71K
+|  |  |  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |  |  |
+|  |  |  |--03:SCAN HDFS [tpcds_parquet.date_dim d1]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d1.d_quarter_name = '2001Q1'
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d1.d_quarter_name = '2001Q1'
+|  |  |  |     parquet dictionary predicates: d1.d_quarter_name = '2001Q1'
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=3 row-size=22B cardinality=91
+|  |  |  |     in pipelines: 03(GETNEXT)
+|  |  |  |
+|  |  |  00:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     runtime filters: RF002[bloom] -> ss_store_sk, RF018[bloom] -> ss_sold_date_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=0 row-size=32B cardinality=2.88M
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  01:SCAN HDFS [tpcds_parquet.store_returns]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     runtime filters: RF010[bloom] -> sr_returned_date_sk, RF012[bloom] -> sr_customer_sk, RF013[bloom] -> sr_item_sk, RF014[bloom] -> sr_ticket_number
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=120.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=28B cardinality=287.51K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> cs_sold_date_sk, RF006[bloom] -> cs_bill_customer_sk, RF007[bloom] -> cs_item_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=2 row-size=20B cardinality=1.44M
+|     in pipelines: 02(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.item]
+   HDFS partitions=1/1 files=1 size=1.73MB
+   runtime filters: RF000[bloom] -> i_item_sk
+   stored statistics:
+     table: rows=18.00K size=1.73MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=18.00K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=7 row-size=148B cardinality=18.00K
+   in pipelines: 07(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=62.77MB Threads=20
+Per-Host Resource Estimates: Memory=640MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=74.88KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, s_state, count(ss_quantity), avg(ss_quantity), stddev_samp(ss_quantity), stddev_samp(ss_quantity) / avg(ss_quantity), count(sr_return_quantity), avg(sr_return_quantity), stddev_samp(sr_return_quantity), stddev_samp(sr_return_quantity) / avg(sr_return_quantity), count(cs_quantity), avg(cs_quantity), stddev_samp(cs_quantity), stddev_samp(cs_quantity) / avg(cs_quantity)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+28:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC, i_item_desc ASC, s_state ASC
+|  limit: 100
+|  mem-estimate=74.88KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=226B cardinality=100
+|  in pipelines: 16(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,s_state)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.82MB mem-reservation=1.94MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC, i_item_desc ASC, s_state ASC
+|  mem-estimate=22.11KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=226B cardinality=100
+|  in pipelines: 16(GETNEXT), 27(OPEN)
+|
+27:AGGREGATE [FINALIZE]
+|  output: count:merge(ss_quantity), avg:merge(ss_quantity), stddev_samp:merge(ss_quantity), count:merge(sr_return_quantity), avg:merge(sr_return_quantity), stddev_samp:merge(sr_return_quantity), count:merge(cs_quantity), avg:merge(cs_quantity), stddev_samp:merge(cs_quantity)
+|  group by: i_item_id, i_item_desc, s_state
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9 row-size=226B cardinality=2.02K
+|  in pipelines: 27(GETNEXT), 02(OPEN)
+|
+26:EXCHANGE [HASH(i_item_id,i_item_desc,s_state)]
+|  mem-estimate=840.49KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=226B cardinality=2.02K
+|  in pipelines: 02(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=16.30MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+15:AGGREGATE [STREAMING]
+|  output: count(ss_quantity), avg(CAST(ss_quantity AS BIGINT)), stddev_samp(ss_quantity), count(sr_return_quantity), avg(CAST(sr_return_quantity AS BIGINT)), stddev_samp(sr_return_quantity), count(cs_quantity), avg(CAST(cs_quantity AS BIGINT)), stddev_samp(cs_quantity)
+|  group by: i_item_id, i_item_desc, s_state
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=226B cardinality=2.02K
+|  in pipelines: 02(GETNEXT)
+|
+14:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6,7 row-size=312B cardinality=2.02K
+|  in pipelines: 02(GETNEXT), 07(OPEN)
+|
+|--25:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=2.70MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=148B cardinality=18.00K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  07:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=7 row-size=148B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+24:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=684.05KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=164B cardinality=2.02K
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=205.57MB mem-reservation=19.75MB thread-reservation=2 runtime-filters-memory=5.00MB
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=164B cardinality=2.02K
+|  in pipelines: 02(GETNEXT), 06(OPEN)
+|
+|--23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=18B cardinality=12
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  06:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=6 row-size=18B cardinality=12
+|     in pipelines: 06(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d3.d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d3.d_date_sk
+|  runtime filters: RF004[bloom] <- d3.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5 row-size=146B cardinality=2.02K
+|  in pipelines: 02(GETNEXT), 05(OPEN)
+|
+|--22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=22B cardinality=273
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d3.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d3.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|     parquet dictionary predicates: d3.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=22B cardinality=273
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4 row-size=124B cardinality=13.53K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.79MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=104B cardinality=14.48K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=21.06MB mem-reservation=10.69MB thread-reservation=1 runtime-filters-memory=4.00MB
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  |  runtime filters: RF010[bloom] <- d2.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=104B cardinality=14.48K
+|  |  in pipelines: 00(GETNEXT), 04(OPEN)
+|  |
+|  |--20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=22B cardinality=273
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d2.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d2.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |     parquet dictionary predicates: d2.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=22B cardinality=273
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  runtime filters: RF012[bloom] <- sr_customer_sk, RF013[bloom] <- sr_item_sk, RF014[bloom] <- sr_ticket_number
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1 row-size=82B cardinality=105.69K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--19:EXCHANGE [HASH(sr_customer_sk,sr_item_sk,sr_ticket_number)]
+|  |  |  mem-estimate=7.71MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=28B cardinality=287.51K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=122.00MB mem-reservation=10.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.store_returns.sr_item_sk, RF010[bloom] -> sr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=120.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=28B cardinality=287.51K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  18:EXCHANGE [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)]
+|  |  mem-estimate=2.65MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3 row-size=54B cardinality=143.71K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=87.95MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=6.00MB
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  runtime filters: RF018[bloom] <- d1.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3 row-size=54B cardinality=143.71K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--17:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=22B cardinality=91
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_quarter_name = '2001Q1'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_quarter_name = '2001Q1'
+|  |     parquet dictionary predicates: d1.d_quarter_name = '2001Q1'
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=22B cardinality=91
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_store_sk, RF012[bloom] -> ss_customer_sk, RF013[bloom] -> ss_item_sk, RF014[bloom] -> ss_ticket_number, RF018[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=0 row-size=32B cardinality=2.88M
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF004[bloom] -> cs_sold_date_sk, RF006[bloom] -> cs_bill_customer_sk, RF007[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=2 row-size=20B cardinality=1.44M
+   in pipelines: 02(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=100.27MB Threads=26
+Per-Host Resource Estimates: Memory=363MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=142.39KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, s_state, count(ss_quantity), avg(ss_quantity), stddev_samp(ss_quantity), stddev_samp(ss_quantity) / avg(ss_quantity), count(sr_return_quantity), avg(sr_return_quantity), stddev_samp(sr_return_quantity), stddev_samp(sr_return_quantity) / avg(sr_return_quantity), count(cs_quantity), avg(cs_quantity), stddev_samp(cs_quantity), stddev_samp(cs_quantity) / avg(cs_quantity)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+28:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC, i_item_desc ASC, s_state ASC
+|  limit: 100
+|  mem-estimate=142.39KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=226B cardinality=100
+|  in pipelines: 16(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,s_state)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.50MB mem-reservation=1.94MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC, i_item_desc ASC, s_state ASC
+|  mem-estimate=22.11KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=226B cardinality=100
+|  in pipelines: 16(GETNEXT), 27(OPEN)
+|
+27:AGGREGATE [FINALIZE]
+|  output: count:merge(ss_quantity), avg:merge(ss_quantity), stddev_samp:merge(ss_quantity), count:merge(sr_return_quantity), avg:merge(sr_return_quantity), stddev_samp:merge(sr_return_quantity), count:merge(cs_quantity), avg:merge(cs_quantity), stddev_samp:merge(cs_quantity)
+|  group by: i_item_id, i_item_desc, s_state
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9 row-size=226B cardinality=2.02K
+|  in pipelines: 27(GETNEXT), 02(OPEN)
+|
+26:EXCHANGE [HASH(i_item_id,i_item_desc,s_state)]
+|  mem-estimate=1.50MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=226B cardinality=2.02K
+|  in pipelines: 02(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.23MB mem-reservation=2.00MB thread-reservation=1
+15:AGGREGATE [STREAMING]
+|  output: count(ss_quantity), avg(CAST(ss_quantity AS BIGINT)), stddev_samp(ss_quantity), count(sr_return_quantity), avg(CAST(sr_return_quantity AS BIGINT)), stddev_samp(sr_return_quantity), count(cs_quantity), avg(CAST(cs_quantity AS BIGINT)), stddev_samp(cs_quantity)
+|  group by: i_item_id, i_item_desc, s_state
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=226B cardinality=2.02K
+|  in pipelines: 02(GETNEXT)
+|
+14:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6,7 row-size=312B cardinality=2.02K
+|  in pipelines: 02(GETNEXT), 07(OPEN)
+|
+|--F12:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=5.63MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF000[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  25:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=2.70MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=148B cardinality=18.00K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  07:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=7 row-size=148B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+24:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=1.23MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=164B cardinality=2.02K
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=164B cardinality=2.02K
+|  in pipelines: 02(GETNEXT), 06(OPEN)
+|
+|--F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF002[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=18B cardinality=12
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  06:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=6 row-size=18B cardinality=12
+|     in pipelines: 06(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: cs_sold_date_sk = d3.d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d3.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5 row-size=146B cardinality=2.02K
+|  in pipelines: 02(GETNEXT), 05(OPEN)
+|
+|--F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: d3.d_date_sk
+|  |  runtime filters: RF004[bloom] <- d3.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=22B cardinality=273
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d3.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d3.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|     parquet dictionary predicates: d3.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=5 row-size=22B cardinality=273
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4 row-size=124B cardinality=13.53K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=9.89MB mem-reservation=7.75MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: sr_customer_sk, sr_item_sk
+|  |  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.14MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=104B cardinality=14.48K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=2.83MB mem-reservation=0B thread-reservation=1
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=104B cardinality=14.48K
+|  |  in pipelines: 00(GETNEXT), 04(OPEN)
+|  |
+|  |--F16:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: d2.d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d2.d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=22B cardinality=273
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d2.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d2.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |     parquet dictionary predicates: d2.d_quarter_name IN ('2001Q1', '2001Q2', '2001Q3')
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=4 row-size=22B cardinality=273
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=05
+|  |  hash predicates: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1 row-size=82B cardinality=105.69K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--F17:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=13.58MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: sr_customer_sk, sr_item_sk, sr_ticket_number
+|  |  |  runtime filters: RF012[bloom] <- sr_customer_sk, RF013[bloom] <- sr_item_sk, RF014[bloom] <- sr_ticket_number
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  19:EXCHANGE [HASH(sr_customer_sk,sr_item_sk,sr_ticket_number)]
+|  |  |  mem-estimate=7.71MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=28B cardinality=287.51K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.store_returns.sr_item_sk, RF010[bloom] -> sr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=24.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=1 row-size=28B cardinality=287.51K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  18:EXCHANGE [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)]
+|  |  mem-estimate=2.83MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3 row-size=54B cardinality=143.71K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=6.00MB mem-reservation=6.00MB thread-reservation=0 runtime-filters-memory=6.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3 row-size=54B cardinality=143.71K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=02
+|  |  |  build expressions: d1.d_date_sk
+|  |  |  runtime filters: RF018[bloom] <- d1.d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  17:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=22B cardinality=91
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_quarter_name = '2001Q1'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_quarter_name = '2001Q1'
+|  |     parquet dictionary predicates: d1.d_quarter_name = '2001Q1'
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=22B cardinality=91
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_store_sk, RF012[bloom] -> ss_customer_sk, RF013[bloom] -> ss_item_sk, RF014[bloom] -> ss_ticket_number, RF018[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=0 row-size=32B cardinality=2.88M
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF004[bloom] -> cs_sold_date_sk, RF006[bloom] -> cs_bill_customer_sk, RF007[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=2 row-size=20B cardinality=1.44M
+   in pipelines: 02(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q18.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q18.test
new file mode 100644
index 0000000..b1cd6fc
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q18.test
@@ -0,0 +1,473 @@
+# TPCDS-Q18
+select  i_item_id,
+        ca_country,
+        ca_state,
+        ca_county,
+        avg( cast(cs_quantity as decimal(12,2))) agg1,
+        avg( cast(cs_list_price as decimal(12,2))) agg2,
+        avg( cast(cs_coupon_amt as decimal(12,2))) agg3,
+        avg( cast(cs_sales_price as decimal(12,2))) agg4,
+        avg( cast(cs_net_profit as decimal(12,2))) agg5,
+        avg( cast(c_birth_year as decimal(12,2))) agg6,
+        avg( cast(cd1.cd_dep_count as decimal(12,2))) agg7
+ from catalog_sales, customer_demographics cd1,
+      customer_demographics cd2, customer, customer_address, date_dim, item
+ where cs_sold_date_sk = d_date_sk and
+       cs_item_sk = i_item_sk and
+       cs_bill_cdemo_sk = cd1.cd_demo_sk and
+       cs_bill_customer_sk = c_customer_sk and
+       cd1.cd_gender = 'M' and
+       cd1.cd_education_status = 'College' and
+       c_current_cdemo_sk = cd2.cd_demo_sk and
+       c_current_addr_sk = ca_address_sk and
+       c_birth_month in (9,5,12,4,1,10) and
+       d_year = 2001 and
+       ca_state in ('ND','WI','AL'
+                   ,'NC','OK','MS','TN')
+ group by rollup (i_item_id, ca_country, ca_state, ca_county)
+ order by ca_country,
+        ca_state,
+        ca_county,
+        i_item_id
+ limit 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=107.38MB Threads=8
+Per-Host Resource Estimates: Memory=686MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=685.75MB mem-reservation=107.38MB thread-reservation=8 runtime-filters-memory=6.00MB
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(16,8,10,12,14) WHEN 8 THEN i_item_id WHEN 10 THEN i_item_id WHEN 12 THEN i_item_id WHEN 14 THEN i_item_id WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_country WHEN 10 THEN ca_country WHEN 12 THEN ca_country WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_state WHEN 10 THEN ca_state WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_county WHEN 10 THEN NULL WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END, aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+15:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_country WHEN 10 THEN ca_country WHEN 12 THEN ca_country WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_state WHEN 10 THEN ca_state WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_county WHEN 10 THEN NULL WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN i_item_id WHEN 10 THEN i_item_id WHEN 12 THEN i_item_id WHEN 14 THEN i_item_id WHEN 16 THEN NULL END ASC
+|  mem-estimate=10.16KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=18 row-size=104B cardinality=100
+|  in pipelines: 15(GETNEXT), 14(OPEN)
+|
+14:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) END)
+|  group by: CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN i_item_id WHEN CAST(10 AS INT) THEN i_item_id WHEN CAST(12 AS INT) THEN i_item_id WHEN CAST(14 AS INT) THEN i_item_id WHEN CAST(16 AS INT) THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN ca_country WHEN CAST(10 AS INT) THEN ca_country WHEN CAST(12 AS INT) THEN ca_country WHEN CAST(14 AS INT) THEN NULL WHEN CAST(16 AS INT) THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN ca_state WHEN CAST(10 AS INT) THEN ca_state WHEN CAST(12 AS INT) THEN NULL WHEN CAST(14 AS INT) THEN NULL WHEN CAST(16 AS INT) THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN ca_county WHEN CAST(10 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL WHEN CAST(14 AS INT) THEN NULL WHEN CAST(16 AS INT) THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN CAST(8 AS INT) WHEN CAST(10 AS INT) THEN CAST(10 AS INT) WHEN CAST(12 AS INT) THEN CAST(12 AS INT) WHEN CAST(14 AS INT) THEN CAST(14 AS INT) WHEN CAST(16 AS INT) THEN CAST(16 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=17 row-size=108B cardinality=75.61K
+|  in pipelines: 14(GETNEXT), 13(OPEN)
+|
+13:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, ca_country, ca_state, ca_county
+|  Class 1
+|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, ca_country, ca_state, NULL
+|  Class 2
+|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, ca_country, NULL, NULL
+|  Class 3
+|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, NULL, NULL, NULL
+|  Class 4
+|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: NULL, NULL, NULL, NULL
+|  mem-estimate=98.00MB mem-reservation=86.94MB thread-reservation=0
+|  tuple-ids=7N,9N,11N,13N,15N row-size=641B cardinality=75.61K
+|  in pipelines: 13(GETNEXT), 02(OPEN)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,1,0,5,3,4,6 row-size=220B cardinality=28.95K
+|  in pipelines: 02(GETNEXT), 06(OPEN)
+|
+|--06:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=6 row-size=36B cardinality=18.00K
+|     in pipelines: 06(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: cd2.cd_demo_sk = c_current_cdemo_sk
+|  fk/pk conjuncts: cd2.cd_demo_sk = c_current_cdemo_sk
+|  runtime filters: RF002[bloom] <- c_current_cdemo_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=2,1,0,5,3,4 row-size=184B cardinality=28.95K
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--10:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cd1.cd_demo_sk = cs_bill_cdemo_sk
+|  |  fk/pk conjuncts: cd1.cd_demo_sk = cs_bill_cdemo_sk
+|  |  runtime filters: RF004[bloom] <- cs_bill_cdemo_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=1,0,5,3,4 row-size=180B cardinality=28.95K
+|  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |
+|  |--09:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,5,3,4 row-size=137B cardinality=28.95K
+|  |  |  in pipelines: 00(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--04:SCAN HDFS [tpcds_parquet.customer_address]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_state IN ('ND', 'WI', 'AL', 'NC', 'OK', 'MS', 'TN')
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_state IN ('ND', 'WI', 'AL', 'NC', 'OK', 'MS', 'TN')
+|  |  |     parquet dictionary predicates: ca_state IN ('ND', 'WI', 'AL', 'NC', 'OK', 'MS', 'TN')
+|  |  |     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=4 row-size=69B cardinality=6.86K
+|  |  |     in pipelines: 04(GETNEXT)
+|  |  |
+|  |  08:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  |  |  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  |  |  runtime filters: RF008[bloom] <- c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,5,3 row-size=68B cardinality=181.77K
+|  |  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |  |
+|  |  |--03:SCAN HDFS [tpcds_parquet.customer]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     predicates: c_birth_month IN (CAST(9 AS INT), CAST(5 AS INT), CAST(12 AS INT), CAST(4 AS INT), CAST(1 AS INT), CAST(10 AS INT))
+|  |  |     runtime filters: RF006[bloom] -> c_current_addr_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     parquet statistics predicates: c_birth_month IN (CAST(9 AS INT), CAST(5 AS INT), CAST(12 AS INT), CAST(4 AS INT), CAST(1 AS INT), CAST(10 AS INT))
+|  |  |     parquet dictionary predicates: c_birth_month IN (CAST(9 AS INT), CAST(5 AS INT), CAST(12 AS INT), CAST(4 AS INT), CAST(1 AS INT), CAST(10 AS INT))
+|  |  |     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=3 row-size=20B cardinality=50.00K
+|  |  |     in pipelines: 03(GETNEXT)
+|  |  |
+|  |  07:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,5 row-size=48B cardinality=294.63K
+|  |  |  in pipelines: 00(GETNEXT), 05(OPEN)
+|  |  |
+|  |  |--05:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2001 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2001 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2001 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=5 row-size=8B cardinality=373
+|  |  |     in pipelines: 05(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF000[bloom] -> cs_item_sk, RF008[bloom] -> cs_bill_customer_sk, RF010[bloom] -> cs_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=384.00MB mem-reservation=16.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=40B cardinality=1.44M
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.customer_demographics cd1]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd1.cd_gender = 'M', cd1.cd_education_status = 'College'
+|     runtime filters: RF004[bloom] -> cd1.cd_demo_sk
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd1.cd_gender = 'M', cd1.cd_education_status = 'College'
+|     parquet dictionary predicates: cd1.cd_gender = 'M', cd1.cd_education_status = 'College'
+|     mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=1 row-size=43B cardinality=194.03K
+|     in pipelines: 01(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.customer_demographics cd2]
+   HDFS partitions=1/1 files=1 size=7.49MB
+   runtime filters: RF002[bloom] -> cd2.cd_demo_sk
+   stored statistics:
+     table: rows=1.92M size=7.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=1.92M
+   mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=2 row-size=4B cardinality=1.92M
+   in pipelines: 02(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=204.44MB Threads=18
+Per-Host Resource Estimates: Memory=895MB
+F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=35.03KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(16,8,10,12,14) WHEN 8 THEN i_item_id WHEN 10 THEN i_item_id WHEN 12 THEN i_item_id WHEN 14 THEN i_item_id WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_country WHEN 10 THEN ca_country WHEN 12 THEN ca_country WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_state WHEN 10 THEN ca_state WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_county WHEN 10 THEN NULL WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END, aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (8, 10, 12, 14, 16), CASE valid_tid(16,8,10,12,14) WHEN 8 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 10 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 12 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 14 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN 16 THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+26:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_country WHEN 10 THEN ca_country WHEN 12 THEN ca_country WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_state WHEN 10 THEN ca_state WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_county WHEN 10 THEN NULL WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN i_item_id WHEN 10 THEN i_item_id WHEN 12 THEN i_item_id WHEN 14 THEN i_item_id WHEN 16 THEN NULL END ASC
+|  limit: 100
+|  mem-estimate=35.03KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=18 row-size=104B cardinality=100
+|  in pipelines: 15(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(i_item_id) WHEN 9 THEN murmur_hash(i_item_id) WHEN 11 THEN murmur_hash(i_item_id) WHEN 13 THEN murmur_hash(i_item_id) WHEN 15 THEN murmur_hash(NULL) END,CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(ca_country) WHEN 9 THEN murmur_hash(ca_country) WHEN 11 THEN murmur_hash(ca_country) WHEN 13 THEN murmur_hash(NULL) WHEN 15 THEN murmur_hash(NULL) END,CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(ca_state) WHEN 9 THEN murmur_hash(ca_state) WHEN 11 THEN murmur_hash(NULL) WHEN 13 THEN murmur_hash(NULL) WHEN 15 THEN murmur_hash(NULL) END,CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(ca_county) WHEN 9 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 13 THEN murmur_hash(NULL) WHEN 15 THEN murmur_hash(NULL) END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=109.94MB mem-reservation=91.69MB thread-reservation=1
+15:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_country WHEN 10 THEN ca_country WHEN 12 THEN ca_country WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_state WHEN 10 THEN ca_state WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN ca_county WHEN 10 THEN NULL WHEN 12 THEN NULL WHEN 14 THEN NULL WHEN 16 THEN NULL END ASC, CASE valid_tid(16,8,10,12,14) WHEN 8 THEN i_item_id WHEN 10 THEN i_item_id WHEN 12 THEN i_item_id WHEN 14 THEN i_item_id WHEN 16 THEN NULL END ASC
+|  mem-estimate=10.16KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=18 row-size=104B cardinality=100
+|  in pipelines: 15(GETNEXT), 14(OPEN)
+|
+14:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cs_quantity AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cs_list_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cs_coupon_amt AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cs_sales_price AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cs_net_profit AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(c_birth_year AS DECIMAL(12,2))) END), aggif(valid_tid(16,8,10,12,14) IN (CAST(8 AS INT), CAST(10 AS INT), CAST(12 AS INT), CAST(14 AS INT), CAST(16 AS INT)), CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN CAST(10 AS INT) THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN CAST(12 AS INT) THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN CAST(14 AS INT) THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) WHEN CAST(16 AS INT) THEN avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2))) END)
+|  group by: CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN i_item_id WHEN CAST(10 AS INT) THEN i_item_id WHEN CAST(12 AS INT) THEN i_item_id WHEN CAST(14 AS INT) THEN i_item_id WHEN CAST(16 AS INT) THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN ca_country WHEN CAST(10 AS INT) THEN ca_country WHEN CAST(12 AS INT) THEN ca_country WHEN CAST(14 AS INT) THEN NULL WHEN CAST(16 AS INT) THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN ca_state WHEN CAST(10 AS INT) THEN ca_state WHEN CAST(12 AS INT) THEN NULL WHEN CAST(14 AS INT) THEN NULL WHEN CAST(16 AS INT) THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN ca_county WHEN CAST(10 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL WHEN CAST(14 AS INT) THEN NULL WHEN CAST(16 AS INT) THEN NULL END, CASE valid_tid(16,8,10,12,14) WHEN CAST(8 AS INT) THEN CAST(8 AS INT) WHEN CAST(10 AS INT) THEN CAST(10 AS INT) WHEN CAST(12 AS INT) THEN CAST(12 AS INT) WHEN CAST(14 AS INT) THEN CAST(14 AS INT) WHEN CAST(16 AS INT) THEN CAST(16 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=17 row-size=108B cardinality=75.61K
+|  in pipelines: 14(GETNEXT), 25(OPEN)
+|
+25:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: avg:merge(CAST(cs_quantity AS DECIMAL(12,2))), avg:merge(CAST(cs_list_price AS DECIMAL(12,2))), avg:merge(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg:merge(CAST(cs_sales_price AS DECIMAL(12,2))), avg:merge(CAST(cs_net_profit AS DECIMAL(12,2))), avg:merge(CAST(c_birth_year AS DECIMAL(12,2))), avg:merge(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, ca_country, ca_state, ca_county
+|  Class 1
+|    output: avg:merge(CAST(cs_quantity AS DECIMAL(12,2))), avg:merge(CAST(cs_list_price AS DECIMAL(12,2))), avg:merge(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg:merge(CAST(cs_sales_price AS DECIMAL(12,2))), avg:merge(CAST(cs_net_profit AS DECIMAL(12,2))), avg:merge(CAST(c_birth_year AS DECIMAL(12,2))), avg:merge(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, ca_country, ca_state, NULL
+|  Class 2
+|    output: avg:merge(CAST(cs_quantity AS DECIMAL(12,2))), avg:merge(CAST(cs_list_price AS DECIMAL(12,2))), avg:merge(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg:merge(CAST(cs_sales_price AS DECIMAL(12,2))), avg:merge(CAST(cs_net_profit AS DECIMAL(12,2))), avg:merge(CAST(c_birth_year AS DECIMAL(12,2))), avg:merge(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, ca_country, NULL, NULL
+|  Class 3
+|    output: avg:merge(CAST(cs_quantity AS DECIMAL(12,2))), avg:merge(CAST(cs_list_price AS DECIMAL(12,2))), avg:merge(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg:merge(CAST(cs_sales_price AS DECIMAL(12,2))), avg:merge(CAST(cs_net_profit AS DECIMAL(12,2))), avg:merge(CAST(c_birth_year AS DECIMAL(12,2))), avg:merge(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, NULL, NULL, NULL
+|  Class 4
+|    output: avg:merge(CAST(cs_quantity AS DECIMAL(12,2))), avg:merge(CAST(cs_list_price AS DECIMAL(12,2))), avg:merge(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg:merge(CAST(cs_sales_price AS DECIMAL(12,2))), avg:merge(CAST(cs_net_profit AS DECIMAL(12,2))), avg:merge(CAST(c_birth_year AS DECIMAL(12,2))), avg:merge(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: NULL, NULL, NULL, NULL
+|  mem-estimate=98.00MB mem-reservation=86.94MB thread-reservation=0
+|  tuple-ids=8N,10N,12N,14N,16N row-size=641B cardinality=75.61K
+|  in pipelines: 25(GETNEXT), 00(OPEN)
+|
+24:EXCHANGE [HASH(CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(i_item_id) WHEN 9 THEN murmur_hash(i_item_id) WHEN 11 THEN murmur_hash(i_item_id) WHEN 13 THEN murmur_hash(i_item_id) WHEN 15 THEN murmur_hash(NULL) END,CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(ca_country) WHEN 9 THEN murmur_hash(ca_country) WHEN 11 THEN murmur_hash(ca_country) WHEN 13 THEN murmur_hash(NULL) WHEN 15 THEN murmur_hash(NULL) END,CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(ca_state) WHEN 9 THEN murmur_hash(ca_state) WHEN 11 THEN murmur_hash(NULL) WHEN 13 THEN murmur_hash(NULL) WHEN 15 THEN murmur_hash(NULL) END,CASE valid_tid(7,9,11,13,15) WHEN 7 THEN murmur_hash(ca_county) WHEN 9 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 13 THEN murmur_hash(NULL) WHEN 15 THEN murmur_hash(NULL) END)]
+|  mem-estimate=11.94MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7N,9N,11N,13N,15N row-size=641B cardinality=75.61K
+|  in pipelines: 00(GETNEXT)
+|
+F07:PLAN FRAGMENT [HASH(c_current_cdemo_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=82.92MB mem-reservation=62.69MB thread-reservation=1 runtime-filters-memory=2.00MB
+13:AGGREGATE [STREAMING]
+|  Class 0
+|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, ca_country, ca_state, ca_county
+|  Class 1
+|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, ca_country, ca_state, NULL
+|  Class 2
+|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, ca_country, NULL, NULL
+|  Class 3
+|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: i_item_id, NULL, NULL, NULL
+|  Class 4
+|    output: avg(CAST(cs_quantity AS DECIMAL(12,2))), avg(CAST(cs_list_price AS DECIMAL(12,2))), avg(CAST(cs_coupon_amt AS DECIMAL(12,2))), avg(CAST(cs_sales_price AS DECIMAL(12,2))), avg(CAST(cs_net_profit AS DECIMAL(12,2))), avg(CAST(c_birth_year AS DECIMAL(12,2))), avg(CAST(cd1.cd_dep_count AS DECIMAL(12,2)))
+|    group by: NULL, NULL, NULL, NULL
+|  mem-estimate=64.00MB mem-reservation=54.00MB thread-reservation=0
+|  tuple-ids=7N,9N,11N,13N,15N row-size=641B cardinality=75.61K
+|  in pipelines: 00(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,5,3,4,1,2,6 row-size=220B cardinality=28.95K
+|  in pipelines: 00(GETNEXT), 06(OPEN)
+|
+|--23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=36B cardinality=18.00K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  06:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=6 row-size=36B cardinality=18.00K
+|     in pipelines: 06(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_current_cdemo_sk = cd2.cd_demo_sk
+|  fk/pk conjuncts: c_current_cdemo_sk = cd2.cd_demo_sk
+|  runtime filters: RF002[bloom] <- cd2.cd_demo_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,5,3,4,1,2 row-size=184B cardinality=28.95K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--22:EXCHANGE [HASH(cd2.cd_demo_sk)]
+|  |  mem-estimate=7.34MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=4B cardinality=1.92M
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.customer_demographics cd2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=2 row-size=4B cardinality=1.92M
+|     in pipelines: 02(GETNEXT)
+|
+21:EXCHANGE [HASH(c_current_cdemo_sk)]
+|  mem-estimate=2.24MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,5,3,4,1 row-size=180B cardinality=28.95K
+|  in pipelines: 00(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(cs_bill_cdemo_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=15.38MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+10:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: cs_bill_cdemo_sk = cd1.cd_demo_sk
+|  fk/pk conjuncts: cs_bill_cdemo_sk = cd1.cd_demo_sk
+|  runtime filters: RF004[bloom] <- cd1.cd_demo_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,5,3,4,1 row-size=180B cardinality=28.95K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--20:EXCHANGE [HASH(cd1.cd_demo_sk)]
+|  |  mem-estimate=7.92MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=43B cardinality=194.03K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.customer_demographics cd1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd1.cd_gender = 'M', cd1.cd_education_status = 'College'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd1.cd_gender = 'M', cd1.cd_education_status = 'College'
+|     parquet dictionary predicates: cd1.cd_gender = 'M', cd1.cd_education_status = 'College'
+|     mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=1 row-size=43B cardinality=194.03K
+|     in pipelines: 01(GETNEXT)
+|
+19:EXCHANGE [HASH(cs_bill_cdemo_sk)]
+|  mem-estimate=1.71MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,5,3,4 row-size=137B cardinality=28.95K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=396.33MB mem-reservation=26.81MB thread-reservation=2 runtime-filters-memory=5.00MB
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF006[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,5,3,4 row-size=137B cardinality=28.95K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=535.14KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=69B cardinality=6.86K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_state IN ('ND', 'WI', 'AL', 'NC', 'OK', 'MS', 'TN')
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_state IN ('ND', 'WI', 'AL', 'NC', 'OK', 'MS', 'TN')
+|     parquet dictionary predicates: ca_state IN ('ND', 'WI', 'AL', 'NC', 'OK', 'MS', 'TN')
+|     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=69B cardinality=6.86K
+|     in pipelines: 04(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  runtime filters: RF008[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,5,3 row-size=68B cardinality=181.77K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--17:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1000.56KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=20B cardinality=50.00K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=82.00MB mem-reservation=4.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  03:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     predicates: c_birth_month IN (CAST(9 AS INT), CAST(5 AS INT), CAST(12 AS INT), CAST(4 AS INT), CAST(1 AS INT), CAST(10 AS INT))
+|     runtime filters: RF002[bloom] -> c_current_cdemo_sk, RF006[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     parquet statistics predicates: c_birth_month IN (CAST(9 AS INT), CAST(5 AS INT), CAST(12 AS INT), CAST(4 AS INT), CAST(1 AS INT), CAST(10 AS INT))
+|     parquet dictionary predicates: c_birth_month IN (CAST(9 AS INT), CAST(5 AS INT), CAST(12 AS INT), CAST(4 AS INT), CAST(1 AS INT), CAST(10 AS INT))
+|     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=3 row-size=20B cardinality=50.00K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF010[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,5 row-size=48B cardinality=294.63K
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--16:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=373
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=373
+|     in pipelines: 05(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_item_sk, RF004[bloom] -> cs_bill_cdemo_sk, RF008[bloom] -> cs_bill_customer_sk, RF010[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=384.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=40B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q19.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q19.test
new file mode 100644
index 0000000..d6c8735
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q19.test
@@ -0,0 +1,617 @@
+# TPCDS-Q19
+select
+  i_brand_id brand_id,
+  i_brand brand,
+  i_manufact_id,
+  i_manufact,
+  sum(ss_ext_sales_price) ext_price
+from
+  date_dim,
+  store_sales,
+  item,
+  customer,
+  customer_address,
+  store
+where
+  d_date_sk = ss_sold_date_sk
+  and ss_item_sk = i_item_sk
+  and i_manager_id = 7
+  and d_moy = 11
+  and d_year = 1999
+  and ss_customer_sk = c_customer_sk
+  and c_current_addr_sk = ca_address_sk
+  and substr(ca_zip, 1, 5) <> substr(s_zip, 1, 5)
+  and ss_store_sk = s_store_sk
+group by
+  i_brand,
+  i_brand_id,
+  i_manufact_id,
+  i_manufact
+order by
+  ext_price desc,
+  i_brand,
+  i_brand_id,
+  i_manufact_id,
+  i_manufact
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=16.27MB Threads=7
+Per-Host Resource Estimates: Memory=315MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=314.81MB mem-reservation=16.27MB thread-reservation=7 runtime-filters-memory=5.00MB
+PLAN-ROOT SINK
+|  output exprs: i_brand_id, i_brand, i_manufact_id, i_manufact, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+12:TOP-N [LIMIT=100]
+|  order by: sum(ss_ext_sales_price) DESC, i_brand ASC, i_brand_id ASC, i_manufact_id ASC, i_manufact ASC
+|  mem-estimate=7.38KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=76B cardinality=100
+|  in pipelines: 12(GETNEXT), 11(OPEN)
+|
+11:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_brand, i_brand_id, i_manufact_id, i_manufact
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=76B cardinality=1.73K
+|  in pipelines: 11(GETNEXT), 04(OPEN)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  other predicates: substr(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) != substr(s_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT))
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4,3,1,2,0,5 row-size=158B cardinality=1.73K
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=5 row-size=21B cardinality=12
+|     in pipelines: 05(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: ca_address_sk = c_current_addr_sk
+|  fk/pk conjuncts: ca_address_sk = c_current_addr_sk
+|  runtime filters: RF002[bloom] <- c_current_addr_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4,3,1,2,0 row-size=137B cardinality=1.73K
+|  in pipelines: 04(GETNEXT), 03(OPEN)
+|
+|--08:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = ss_customer_sk
+|  |  fk/pk conjuncts: c_customer_sk = ss_customer_sk
+|  |  runtime filters: RF004[bloom] <- ss_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,1,2,0 row-size=116B cardinality=1.73K
+|  |  in pipelines: 03(GETNEXT), 01(OPEN)
+|  |
+|  |--07:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=1,2,0 row-size=108B cardinality=1.73K
+|  |  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--00:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=0 row-size=12B cardinality=108
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  06:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=1,2 row-size=96B cardinality=29.12K
+|  |  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |  |
+|  |  |--02:SCAN HDFS [tpcds_parquet.item]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     predicates: i_manager_id = CAST(7 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     parquet statistics predicates: i_manager_id = CAST(7 AS INT)
+|  |  |     parquet dictionary predicates: i_manager_id = CAST(7 AS INT)
+|  |  |     mem-estimate=96.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=2 row-size=72B cardinality=182
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  01:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF000[bloom] -> ss_store_sk, RF006[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=24B cardinality=2.88M
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF004[bloom] -> c_customer_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=100.00K
+|     in pipelines: 03(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.customer_address]
+   HDFS partitions=1/1 files=1 size=1.16MB
+   runtime filters: RF002[bloom] -> ca_address_sk
+   stored statistics:
+     table: rows=50.00K size=1.16MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=50.00K
+   mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=4 row-size=21B cardinality=50.00K
+   in pipelines: 04(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=26.14MB Threads=16
+Per-Host Resource Estimates: Memory=345MB
+F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=25.76KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_brand_id, i_brand, i_manufact_id, i_manufact, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+22:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(ss_ext_sales_price) DESC, i_brand ASC, i_brand_id ASC, i_manufact_id ASC, i_manufact ASC
+|  limit: 100
+|  mem-estimate=25.76KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=76B cardinality=100
+|  in pipelines: 12(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(i_brand,i_brand_id,i_manufact_id,i_manufact)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.27MB mem-reservation=1.94MB thread-reservation=1
+12:TOP-N [LIMIT=100]
+|  order by: sum(ss_ext_sales_price) DESC, i_brand ASC, i_brand_id ASC, i_manufact_id ASC, i_manufact ASC
+|  mem-estimate=7.38KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=76B cardinality=100
+|  in pipelines: 12(GETNEXT), 21(OPEN)
+|
+21:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_brand, i_brand_id, i_manufact_id, i_manufact
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=76B cardinality=1.73K
+|  in pipelines: 21(GETNEXT), 01(OPEN)
+|
+20:EXCHANGE [HASH(i_brand,i_brand_id,i_manufact_id,i_manufact)]
+|  mem-estimate=281.04KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=76B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=17.37MB mem-reservation=7.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+11:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_brand, i_brand_id, i_manufact_id, i_manufact
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=76B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  other predicates: substr(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) != substr(s_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT))
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0,3,4,5 row-size=158B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=21B cardinality=12
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=5 row-size=21B cardinality=12
+|     in pipelines: 05(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF002[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0,3,4 row-size=137B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--18:EXCHANGE [HASH(ca_address_sk)]
+|  |  mem-estimate=1.03MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=21B cardinality=50.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=21B cardinality=50.00K
+|     in pipelines: 04(GETNEXT)
+|
+17:EXCHANGE [HASH(c_current_addr_sk)]
+|  mem-estimate=459.50KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1,2,0,3 row-size=116B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=4.12MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF004[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0,3 row-size=116B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--16:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=8B cardinality=100.00K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  03:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF002[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=100.00K
+|     in pipelines: 03(GETNEXT)
+|
+15:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=419.01KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1,2,0 row-size=108B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=71.92MB mem-reservation=9.88MB thread-reservation=2 runtime-filters-memory=4.00MB
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=108B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=12B cardinality=108
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=0 row-size=12B cardinality=108
+|     in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF008[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=96B cardinality=29.12K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=26.14KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=72B cardinality=182
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=96.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_manager_id = CAST(7 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_manager_id = CAST(7 AS INT)
+|     parquet dictionary predicates: i_manager_id = CAST(7 AS INT)
+|     mem-estimate=96.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=72B cardinality=182
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF004[bloom] -> ss_customer_sk, RF006[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=1 row-size=24B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=45.77MB Threads=21
+Per-Host Resource Estimates: Memory=191MB
+F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=49.06KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_brand_id, i_brand, i_manufact_id, i_manufact, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+22:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(ss_ext_sales_price) DESC, i_brand ASC, i_brand_id ASC, i_manufact_id ASC, i_manufact ASC
+|  limit: 100
+|  mem-estimate=49.06KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=76B cardinality=100
+|  in pipelines: 12(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(i_brand,i_brand_id,i_manufact_id,i_manufact)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.51MB mem-reservation=1.94MB thread-reservation=1
+12:TOP-N [LIMIT=100]
+|  order by: sum(ss_ext_sales_price) DESC, i_brand ASC, i_brand_id ASC, i_manufact_id ASC, i_manufact ASC
+|  mem-estimate=7.38KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=76B cardinality=100
+|  in pipelines: 12(GETNEXT), 21(OPEN)
+|
+21:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_brand, i_brand_id, i_manufact_id, i_manufact
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=76B cardinality=1.73K
+|  in pipelines: 21(GETNEXT), 01(OPEN)
+|
+20:EXCHANGE [HASH(i_brand,i_brand_id,i_manufact_id,i_manufact)]
+|  mem-estimate=519.66KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=76B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.83MB mem-reservation=2.00MB thread-reservation=1
+11:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_brand, i_brand_id, i_manufact_id, i_manufact
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=76B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  other predicates: substr(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) != substr(s_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT))
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0,3,4,5 row-size=158B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--F10:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF000[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=21B cardinality=12
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=5 row-size=21B cardinality=12
+|     in pipelines: 05(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=01
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0,3,4 row-size=137B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--F11:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=3.96MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: ca_address_sk
+|  |  runtime filters: RF002[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [HASH(ca_address_sk)]
+|  |  mem-estimate=1.03MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=21B cardinality=50.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=4 row-size=21B cardinality=50.00K
+|     in pipelines: 04(GETNEXT)
+|
+17:EXCHANGE [HASH(c_current_addr_sk)]
+|  mem-estimate=854.12KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1,2,0,3 row-size=116B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=777.63KB mem-reservation=0B thread-reservation=1
+08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=02
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0,3 row-size=116B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--F12:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=3.71MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF004[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  16:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=8B cardinality=100.00K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF002[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=3 row-size=8B cardinality=100.00K
+|     in pipelines: 03(GETNEXT)
+|
+15:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=777.63KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1,2,0 row-size=108B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=108B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=12B cardinality=108
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=0 row-size=12B cardinality=108
+|     in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=96B cardinality=29.12K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=26.14KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=72B cardinality=182
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_manager_id = CAST(7 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_manager_id = CAST(7 AS INT)
+|     parquet dictionary predicates: i_manager_id = CAST(7 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=72B cardinality=182
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF004[bloom] -> ss_customer_sk, RF006[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=1 row-size=24B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q20.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q20.test
new file mode 100644
index 0000000..51a4e53
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q20.test
@@ -0,0 +1,383 @@
+# TPCDS-Q20
+
+SELECT i_item_id ,
+       i_item_desc,
+       i_category,
+       i_class,
+       i_current_price ,
+       sum(cs_ext_sales_price) AS itemrevenue,
+       sum(cs_ext_sales_price)*100.0000/sum(sum(cs_ext_sales_price)) OVER (PARTITION BY i_class) AS revenueratio
+FROM catalog_sales ,
+     item,
+     date_dim
+WHERE cs_item_sk = i_item_sk
+  AND i_category IN ('Sports',
+                     'Books',
+                     'Home')
+  AND cs_sold_date_sk = d_date_sk
+  AND d_date BETWEEN cast('1999-02-22' AS date) AND cast('1999-03-24' AS date)
+GROUP BY i_item_id ,
+         i_item_desc,
+         i_category ,
+         i_class ,
+         i_current_price
+ORDER BY i_category ,
+         i_class ,
+         i_item_id ,
+         i_item_desc ,
+         revenueratio
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=52.00MB Threads=4
+Per-Host Resource Estimates: Memory=282MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=281.88MB mem-reservation=52.00MB thread-reservation=4 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_category, i_class, i_current_price, sum(cs_ext_sales_price), sum(cs_ext_sales_price) * CAST(100.0000 AS DECIMAL(7,4)) / sum(sum(cs_ext_sales_price))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+08:TOP-N [LIMIT=100]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(cs_ext_sales_price) * 100.0000 / sum(sum(cs_ext_sales_price)) ASC
+|  mem-estimate=20.91KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=100
+|  in pipelines: 08(GETNEXT), 06(OPEN)
+|
+07:ANALYTIC
+|  functions: sum(sum(cs_ext_sales_price))
+|  partition by: i_class
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10,9 row-size=214B cardinality=432.46K
+|  in pipelines: 06(GETNEXT)
+|
+06:SORT
+|  order by: i_class ASC NULLS LAST
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10 row-size=198B cardinality=432.46K
+|  in pipelines: 06(GETNEXT), 05(OPEN)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(cs_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=89.88MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=432.46K
+|  in pipelines: 05(GETNEXT), 00(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=232B cardinality=432.46K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=206B cardinality=432.46K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Sports', 'Books', 'Home')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Sports', 'Books', 'Home')
+|     parquet dictionary predicates: i_category IN ('Sports', 'Books', 'Home')
+|     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=190B cardinality=5.40K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_sold_date_sk, RF002[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=100.88MB Threads=8
+Per-Host Resource Estimates: Memory=385MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=70.87KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_category, i_class, i_current_price, sum(cs_ext_sales_price), sum(cs_ext_sales_price) * CAST(100.0000 AS DECIMAL(7,4)) / sum(sum(cs_ext_sales_price))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(cs_ext_sales_price) * 100.0000 / sum(sum(cs_ext_sales_price)) ASC
+|  limit: 100
+|  mem-estimate=70.87KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(i_class)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=60.94MB mem-reservation=50.00MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(cs_ext_sales_price) * 100.0000 / sum(sum(cs_ext_sales_price)) ASC
+|  mem-estimate=20.91KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=100
+|  in pipelines: 08(GETNEXT), 06(OPEN)
+|
+07:ANALYTIC
+|  functions: sum(sum(cs_ext_sales_price))
+|  partition by: i_class
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10,9 row-size=214B cardinality=432.46K
+|  in pipelines: 06(GETNEXT)
+|
+06:SORT
+|  order by: i_class ASC NULLS LAST
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10 row-size=198B cardinality=432.46K
+|  in pipelines: 06(GETNEXT), 12(OPEN)
+|
+12:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=44.94MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=432.46K
+|  in pipelines: 12(GETNEXT), 00(OPEN)
+|
+11:EXCHANGE [HASH(i_class)]
+|  mem-estimate=10.59MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=432.46K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=196.19MB mem-reservation=47.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(cs_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=44.94MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=432.46K
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=232B cardinality=432.46K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=206B cardinality=432.46K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.17MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=190B cardinality=5.40K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Sports', 'Books', 'Home')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Sports', 'Books', 'Home')
+|     parquet dictionary predicates: i_category IN ('Sports', 'Books', 'Home')
+|     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=190B cardinality=5.40K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_sold_date_sk, RF002[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=106.75MB Threads=7
+Per-Host Resource Estimates: Memory=199MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=70.87KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_category, i_class, i_current_price, sum(cs_ext_sales_price), sum(cs_ext_sales_price) * CAST(100.0000 AS DECIMAL(7,4)) / sum(sum(cs_ext_sales_price))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(cs_ext_sales_price) * 100.0000 / sum(sum(cs_ext_sales_price)) ASC
+|  limit: 100
+|  mem-estimate=70.87KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(i_class)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=60.94MB mem-reservation=50.00MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(cs_ext_sales_price) * 100.0000 / sum(sum(cs_ext_sales_price)) ASC
+|  mem-estimate=20.91KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=100
+|  in pipelines: 08(GETNEXT), 06(OPEN)
+|
+07:ANALYTIC
+|  functions: sum(sum(cs_ext_sales_price))
+|  partition by: i_class
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10,9 row-size=214B cardinality=432.46K
+|  in pipelines: 06(GETNEXT)
+|
+06:SORT
+|  order by: i_class ASC NULLS LAST
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10 row-size=198B cardinality=432.46K
+|  in pipelines: 06(GETNEXT), 12(OPEN)
+|
+12:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=44.94MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=432.46K
+|  in pipelines: 12(GETNEXT), 00(OPEN)
+|
+11:EXCHANGE [HASH(i_class)]
+|  mem-estimate=10.59MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=432.46K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=92.94MB mem-reservation=42.00MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(cs_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=44.94MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=432.46K
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=232B cardinality=432.46K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.09MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1999-03-24', CAST(d_date AS DATE) >= DATE '1999-02-22'
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=206B cardinality=432.46K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=6.04MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.17MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=190B cardinality=5.40K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Sports', 'Books', 'Home')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Sports', 'Books', 'Home')
+|     parquet dictionary predicates: i_category IN ('Sports', 'Books', 'Home')
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=1 row-size=190B cardinality=5.40K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_sold_date_sk, RF002[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=0 row-size=16B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q21.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q21.test
new file mode 100644
index 0000000..f6c8504
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q21.test
@@ -0,0 +1,425 @@
+# TPCDS-Q21
+SELECT *
+FROM
+  (SELECT w_warehouse_name,
+          i_item_id,
+          sum(CASE
+                  WHEN (cast(d_date AS date) < CAST ('2000-03-11' AS date)) THEN inv_quantity_on_hand
+                  ELSE 0
+              END) AS inv_before,
+          sum(CASE
+                  WHEN (cast(d_date AS date) >= CAST ('2000-03-11' AS date)) THEN inv_quantity_on_hand
+                  ELSE 0
+              END) AS inv_after
+   FROM inventory,
+        warehouse,
+        item,
+        date_dim
+   WHERE i_current_price BETWEEN 0.99 AND 1.49
+     AND i_item_sk = inv_item_sk
+     AND inv_warehouse_sk = w_warehouse_sk
+     AND inv_date_sk = d_date_sk
+     AND d_date BETWEEN CAST ('2000-02-10' AS date) AND CAST ('2000-04-10' AS date)
+   GROUP BY w_warehouse_name,
+            i_item_id) x
+WHERE (CASE
+           WHEN inv_before > 0 THEN (inv_after*1.000) / inv_before
+           ELSE NULL
+       END) BETWEEN 2.000/3.000 AND 3.000/2.000
+ORDER BY w_warehouse_name,
+         i_item_id
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=29.56MB Threads=5
+Per-Host Resource Estimates: Memory=249MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=248.81MB mem-reservation=29.56MB thread-reservation=5 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: w_warehouse_name, i_item_id, inv_before, inv_after
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+08:TOP-N [LIMIT=100]
+|  order by: w_warehouse_name ASC, i_item_id ASC
+|  mem-estimate=7.18KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=74B cardinality=100
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+07:AGGREGATE [FINALIZE]
+|  output: sum(CAST(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE CAST(0 AS INT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN inv_quantity_on_hand ELSE CAST(0 AS INT) END AS BIGINT))
+|  group by: w_warehouse_name, i_item_id
+|  having: (CASE WHEN sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) > CAST(0 AS BIGINT) THEN (CAST(sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) * CAST(1.000 AS DECIMAL(4,3))) / CAST(sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) ELSE NULL END) <= CAST(1.50000000 AS DECIMAL(12,8)), (CASE WHEN sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) > CAST(0 AS BIGINT) THEN (CAST(sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) * CAST(1.000 AS DECIMAL(4,3))) / CAST(sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) ELSE NULL END) >= CAST(0.66666667 AS DECIMAL(12,8))
+|  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=4 row-size=74B cardinality=3.54K
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=120B cardinality=1.17M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=26B cardinality=7.30K
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF002[bloom] <- w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=94B cardinality=1.17M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.warehouse]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=34B cardinality=5
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  runtime filters: RF004[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=60B cardinality=1.17M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     parquet dictionary predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=40B cardinality=1.80K
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.inventory]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF000[bloom] -> inv_date_sk, RF002[bloom] -> inv_warehouse_sk, RF004[bloom] -> inv_item_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=11.74M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=33.27MB Threads=10
+Per-Host Resource Estimates: Memory=271MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=18.73KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_warehouse_name, i_item_id, inv_before, inv_after
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_warehouse_name ASC, i_item_id ASC
+|  limit: 100
+|  mem-estimate=18.73KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=74B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(w_warehouse_name,i_item_id)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=11.39MB mem-reservation=1.94MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: w_warehouse_name ASC, i_item_id ASC
+|  mem-estimate=7.18KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=74B cardinality=100
+|  in pipelines: 08(GETNEXT), 13(OPEN)
+|
+13:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END), sum:merge(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END)
+|  group by: w_warehouse_name, i_item_id
+|  having: (CASE WHEN sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) > CAST(0 AS BIGINT) THEN (CAST(sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) * CAST(1.000 AS DECIMAL(4,3))) / CAST(sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) ELSE NULL END) <= CAST(1.50000000 AS DECIMAL(12,8)), (CASE WHEN sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) > CAST(0 AS BIGINT) THEN (CAST(sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) * CAST(1.000 AS DECIMAL(4,3))) / CAST(sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) ELSE NULL END) >= CAST(0.66666667 AS DECIMAL(12,8))
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=74B cardinality=3.54K
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+12:EXCHANGE [HASH(w_warehouse_name,i_item_id)]
+|  mem-estimate=1.39MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=74B cardinality=35.42K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=147.15MB mem-reservation=29.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+07:AGGREGATE [STREAMING]
+|  output: sum(CAST(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE CAST(0 AS INT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN inv_quantity_on_hand ELSE CAST(0 AS INT) END AS BIGINT))
+|  group by: w_warehouse_name, i_item_id
+|  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=4 row-size=74B cardinality=35.42K
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=120B cardinality=1.17M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=7.30K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=26B cardinality=7.30K
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF002[bloom] <- w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=94B cardinality=1.17M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=34B cardinality=5
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=34B cardinality=5
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  runtime filters: RF004[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=60B cardinality=1.17M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=114.31KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=40B cardinality=1.80K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     parquet dictionary predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=40B cardinality=1.80K
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF000[bloom] -> inv_date_sk, RF002[bloom] -> inv_warehouse_sk, RF004[bloom] -> inv_item_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=11.74M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=42.08MB Threads=9
+Per-Host Resource Estimates: Memory=119MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=18.73KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_warehouse_name, i_item_id, inv_before, inv_after
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_warehouse_name ASC, i_item_id ASC
+|  limit: 100
+|  mem-estimate=18.73KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=74B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(w_warehouse_name,i_item_id)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=11.39MB mem-reservation=1.94MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: w_warehouse_name ASC, i_item_id ASC
+|  mem-estimate=7.18KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=74B cardinality=100
+|  in pipelines: 08(GETNEXT), 13(OPEN)
+|
+13:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END), sum:merge(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END)
+|  group by: w_warehouse_name, i_item_id
+|  having: (CASE WHEN sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) > CAST(0 AS BIGINT) THEN (CAST(sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) * CAST(1.000 AS DECIMAL(4,3))) / CAST(sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) ELSE NULL END) <= CAST(1.50000000 AS DECIMAL(12,8)), (CASE WHEN sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) > CAST(0 AS BIGINT) THEN (CAST(sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) * CAST(1.000 AS DECIMAL(4,3))) / CAST(sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE 0 END) AS DECIMAL(19,0)) ELSE NULL END) >= CAST(0.66666667 AS DECIMAL(12,8))
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=74B cardinality=3.54K
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+12:EXCHANGE [HASH(w_warehouse_name,i_item_id)]
+|  mem-estimate=1.39MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=74B cardinality=35.42K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=42.00MB mem-reservation=21.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  output: sum(CAST(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN inv_quantity_on_hand ELSE CAST(0 AS INT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN inv_quantity_on_hand ELSE CAST(0 AS INT) END AS BIGINT))
+|  group by: w_warehouse_name, i_item_id
+|  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=4 row-size=74B cardinality=35.42K
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=120B cardinality=1.17M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=5.09MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=7.30K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=3 row-size=26B cardinality=7.30K
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=94B cardinality=1.17M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: w_warehouse_sk
+|  |  runtime filters: RF002[bloom] <- w_warehouse_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=34B cardinality=5
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=1 row-size=34B cardinality=5
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=60B cardinality=1.17M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F08:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.99MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF004[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=114.31KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=40B cardinality=1.80K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     parquet dictionary predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=40B cardinality=1.80K
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF000[bloom] -> inv_date_sk, RF002[bloom] -> inv_warehouse_sk, RF004[bloom] -> inv_item_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+   tuple-ids=0 row-size=20B cardinality=11.74M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q22.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q22.test
new file mode 100644
index 0000000..8729b40
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q22.test
@@ -0,0 +1,296 @@
+# TPCDS-Q22
+select  i_product_name
+             ,i_brand
+             ,i_class
+             ,i_category
+             ,avg(inv_quantity_on_hand) qoh
+       from inventory
+           ,date_dim
+           ,item
+           ,warehouse
+       where inv_date_sk=d_date_sk
+              and inv_item_sk=i_item_sk
+              and inv_warehouse_sk = w_warehouse_sk
+              and d_month_seq between 1212 and 1212 + 11
+       group by rollup(i_product_name
+                       ,i_brand
+                       ,i_class
+                       ,i_category)
+order by qoh, i_product_name, i_brand, i_class, i_category
+limit 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=149.44MB Threads=5
+Per-Host Resource Estimates: Memory=17.43GB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=17.43GB mem-reservation=149.44MB thread-reservation=5 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_brand WHEN 7 THEN i_brand WHEN 9 THEN i_brand WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_class WHEN 7 THEN i_class WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_category WHEN 7 THEN NULL WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END, aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+09:TOP-N [LIMIT=100]
+|  order by: aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END) ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_brand WHEN 7 THEN i_brand WHEN 9 THEN i_brand WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_class WHEN 7 THEN i_class WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_category WHEN 7 THEN NULL WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC
+|  mem-estimate=5.47KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=56B cardinality=100
+|  in pipelines: 09(GETNEXT), 08(OPEN)
+|
+08:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(5,7,9,11,13) IN (CAST(5 AS INT), CAST(7 AS INT), CAST(9 AS INT), CAST(11 AS INT), CAST(13 AS INT)), CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(7 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(9 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(11 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(13 AS INT) THEN avg(inv_quantity_on_hand) END)
+|  group by: CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_product_name WHEN CAST(7 AS INT) THEN i_product_name WHEN CAST(9 AS INT) THEN i_product_name WHEN CAST(11 AS INT) THEN i_product_name WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_brand WHEN CAST(7 AS INT) THEN i_brand WHEN CAST(9 AS INT) THEN i_brand WHEN CAST(11 AS INT) THEN NULL WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_class WHEN CAST(7 AS INT) THEN i_class WHEN CAST(9 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_category WHEN CAST(7 AS INT) THEN NULL WHEN CAST(9 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN CAST(5 AS INT) WHEN CAST(7 AS INT) THEN CAST(7 AS INT) WHEN CAST(9 AS INT) THEN CAST(9 AS INT) WHEN CAST(11 AS INT) THEN CAST(11 AS INT) WHEN CAST(13 AS INT) THEN CAST(13 AS INT) END
+|  mem-estimate=2.17GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=14 row-size=60B cardinality=35.25M
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+07:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: avg(CAST(inv_quantity_on_hand AS BIGINT))
+|    group by: i_product_name, i_brand, i_class, i_category
+|  Class 1
+|    output: avg(CAST(inv_quantity_on_hand AS BIGINT))
+|    group by: i_product_name, i_brand, i_class, NULL
+|  Class 2
+|    output: avg(CAST(inv_quantity_on_hand AS BIGINT))
+|    group by: i_product_name, i_brand, NULL, NULL
+|  Class 3
+|    output: avg(CAST(inv_quantity_on_hand AS BIGINT))
+|    group by: i_product_name, NULL, NULL, NULL
+|  Class 4
+|    output: avg(CAST(inv_quantity_on_hand AS BIGINT))
+|    group by: NULL, NULL, NULL, NULL
+|  mem-estimate=15.26GB mem-reservation=112.44MB thread-reservation=0
+|  tuple-ids=4N,6N,8N,10N,12N row-size=422B cardinality=35.25M
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF000[bloom] <- w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=136B cardinality=11.74M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.warehouse]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|     tuple-ids=3 row-size=4B cardinality=5
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=132B cardinality=11.74M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=104B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=28B cardinality=11.74M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.inventory]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF000[bloom] -> inv_warehouse_sk, RF002[bloom] -> inv_item_sk, RF004[bloom] -> inv_date_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=11.74M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=286.70MB Threads=10
+Per-Host Resource Estimates: Memory=41.61GB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_brand WHEN 7 THEN i_brand WHEN 9 THEN i_brand WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_class WHEN 7 THEN i_class WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_category WHEN 7 THEN NULL WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END, aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+15:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END) ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_brand WHEN 7 THEN i_brand WHEN 9 THEN i_brand WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_class WHEN 7 THEN i_class WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_category WHEN 7 THEN NULL WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=56B cardinality=100
+|  in pipelines: 09(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_product_name) WHEN 6 THEN murmur_hash(i_product_name) WHEN 8 THEN murmur_hash(i_product_name) WHEN 10 THEN murmur_hash(i_product_name) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_brand) WHEN 6 THEN murmur_hash(i_brand) WHEN 8 THEN murmur_hash(i_brand) WHEN 10 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_class) WHEN 6 THEN murmur_hash(i_class) WHEN 8 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_category) WHEN 6 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=29.90GB mem-reservation=146.44MB thread-reservation=1
+09:TOP-N [LIMIT=100]
+|  order by: aggif(valid_tid(5,7,9,11,13) IN (5, 7, 9, 11, 13), CASE valid_tid(5,7,9,11,13) WHEN 5 THEN avg(inv_quantity_on_hand) WHEN 7 THEN avg(inv_quantity_on_hand) WHEN 9 THEN avg(inv_quantity_on_hand) WHEN 11 THEN avg(inv_quantity_on_hand) WHEN 13 THEN avg(inv_quantity_on_hand) END) ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_product_name WHEN 7 THEN i_product_name WHEN 9 THEN i_product_name WHEN 11 THEN i_product_name WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_brand WHEN 7 THEN i_brand WHEN 9 THEN i_brand WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_class WHEN 7 THEN i_class WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC, CASE valid_tid(5,7,9,11,13) WHEN 5 THEN i_category WHEN 7 THEN NULL WHEN 9 THEN NULL WHEN 11 THEN NULL WHEN 13 THEN NULL END ASC
+|  mem-estimate=5.47KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=56B cardinality=100
+|  in pipelines: 09(GETNEXT), 08(OPEN)
+|
+08:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(5,7,9,11,13) IN (CAST(5 AS INT), CAST(7 AS INT), CAST(9 AS INT), CAST(11 AS INT), CAST(13 AS INT)), CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(7 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(9 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(11 AS INT) THEN avg(inv_quantity_on_hand) WHEN CAST(13 AS INT) THEN avg(inv_quantity_on_hand) END)
+|  group by: CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_product_name WHEN CAST(7 AS INT) THEN i_product_name WHEN CAST(9 AS INT) THEN i_product_name WHEN CAST(11 AS INT) THEN i_product_name WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_brand WHEN CAST(7 AS INT) THEN i_brand WHEN CAST(9 AS INT) THEN i_brand WHEN CAST(11 AS INT) THEN NULL WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_class WHEN CAST(7 AS INT) THEN i_class WHEN CAST(9 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN i_category WHEN CAST(7 AS INT) THEN NULL WHEN CAST(9 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(5,7,9,11,13) WHEN CAST(5 AS INT) THEN CAST(5 AS INT) WHEN CAST(7 AS INT) THEN CAST(7 AS INT) WHEN CAST(9 AS INT) THEN CAST(9 AS INT) WHEN CAST(11 AS INT) THEN CAST(11 AS INT) WHEN CAST(13 AS INT) THEN CAST(13 AS INT) END
+|  mem-estimate=1.63GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=14 row-size=60B cardinality=35.25M
+|  in pipelines: 08(GETNEXT), 14(OPEN)
+|
+14:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: avg:merge(inv_quantity_on_hand)
+|    group by: i_product_name, i_brand, i_class, i_category
+|  Class 1
+|    output: avg:merge(inv_quantity_on_hand)
+|    group by: i_product_name, i_brand, i_class, NULL
+|  Class 2
+|    output: avg:merge(inv_quantity_on_hand)
+|    group by: i_product_name, i_brand, NULL, NULL
+|  Class 3
+|    output: avg:merge(inv_quantity_on_hand)
+|    group by: i_product_name, NULL, NULL, NULL
+|  Class 4
+|    output: avg:merge(inv_quantity_on_hand)
+|    group by: NULL, NULL, NULL, NULL
+|  mem-estimate=28.27GB mem-reservation=112.44MB thread-reservation=0
+|  tuple-ids=5N,7N,9N,11N,13N row-size=422B cardinality=35.25M
+|  in pipelines: 14(GETNEXT), 00(OPEN)
+|
+13:EXCHANGE [HASH(CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_product_name) WHEN 6 THEN murmur_hash(i_product_name) WHEN 8 THEN murmur_hash(i_product_name) WHEN 10 THEN murmur_hash(i_product_name) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_brand) WHEN 6 THEN murmur_hash(i_brand) WHEN 8 THEN murmur_hash(i_brand) WHEN 10 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_class) WHEN 6 THEN murmur_hash(i_class) WHEN 8 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,6,8,10,12) WHEN 4 THEN murmur_hash(i_category) WHEN 6 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END)]
+|  mem-estimate=10.86MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4N,6N,8N,10N,12N row-size=422B cardinality=35.25M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=11.59GB mem-reservation=138.75MB thread-reservation=2 runtime-filters-memory=3.00MB
+07:AGGREGATE [STREAMING]
+|  Class 0
+|    output: avg(CAST(inv_quantity_on_hand AS BIGINT))
+|    group by: i_product_name, i_brand, i_class, i_category
+|  Class 1
+|    output: avg(CAST(inv_quantity_on_hand AS BIGINT))
+|    group by: i_product_name, i_brand, i_class, NULL
+|  Class 2
+|    output: avg(CAST(inv_quantity_on_hand AS BIGINT))
+|    group by: i_product_name, i_brand, NULL, NULL
+|  Class 3
+|    output: avg(CAST(inv_quantity_on_hand AS BIGINT))
+|    group by: i_product_name, NULL, NULL, NULL
+|  Class 4
+|    output: avg(CAST(inv_quantity_on_hand AS BIGINT))
+|    group by: NULL, NULL, NULL, NULL
+|  mem-estimate=11.45GB mem-reservation=113.00MB thread-reservation=0
+|  tuple-ids=4N,6N,8N,10N,12N row-size=422B cardinality=35.25M
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF000[bloom] <- w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=136B cardinality=11.74M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=4B cardinality=5
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|     tuple-ids=3 row-size=4B cardinality=5
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=132B cardinality=11.74M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.89MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=104B cardinality=18.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=104B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=28B cardinality=11.74M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF000[bloom] -> inv_warehouse_sk, RF002[bloom] -> inv_item_sk, RF004[bloom] -> inv_date_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=11.74M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23a.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23a.test
new file mode 100644
index 0000000..c112554
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23a.test
@@ -0,0 +1,1230 @@
+# TPCDS-Q23-1 First of two queries.
+with frequent_ss_items as
+ (select substr(i_item_desc,1,30) itemdesc,i_item_sk item_sk,d_date solddate,count(*) cnt
+  from store_sales
+      ,date_dim
+      ,item
+  where ss_sold_date_sk = d_date_sk
+    and ss_item_sk = i_item_sk
+    and d_year in (2000,2000+1,2000+2,2000+3)
+  group by substr(i_item_desc,1,30),i_item_sk,d_date
+  having count(*) >4),
+ max_store_sales as
+ (select max(csales) tpcds_cmax
+  from (select c_customer_sk,sum(ss_quantity*ss_sales_price) csales
+        from store_sales
+            ,customer
+            ,date_dim
+        where ss_customer_sk = c_customer_sk
+         and ss_sold_date_sk = d_date_sk
+         and d_year in (2000,2000+1,2000+2,2000+3)
+        group by c_customer_sk) x),
+ best_ss_customer as
+ (select c_customer_sk,sum(ss_quantity*ss_sales_price) ssales
+  from store_sales
+      ,customer
+  where ss_customer_sk = c_customer_sk
+  group by c_customer_sk
+  having sum(ss_quantity*ss_sales_price) > (50/100.0) * (select
+  *
+from
+ max_store_sales))
+  select  sum(sales)
+ from (select cs_quantity*cs_list_price sales
+       from catalog_sales
+           ,date_dim
+       where d_year = 2000
+         and d_moy = 2
+         and cs_sold_date_sk = d_date_sk
+         and cs_item_sk in (select item_sk from frequent_ss_items)
+         and cs_bill_customer_sk in (select c_customer_sk from best_ss_customer)
+      union all
+      select ws_quantity*ws_list_price sales
+       from web_sales
+           ,date_dim
+       where d_year = 2000
+         and d_moy = 2
+         and ws_sold_date_sk = d_date_sk
+         and ws_item_sk in (select item_sk from frequent_ss_items)
+         and ws_bill_customer_sk in (select c_customer_sk from best_ss_customer)) y
+ limit 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=75.19MB Threads=11
+Per-Host Resource Estimates: Memory=622MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=621.94MB mem-reservation=75.19MB thread-reservation=11 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: sum(sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+49:AGGREGATE [FINALIZE]
+|  output: sum(sales)
+|  limit: 100
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=46 row-size=16B cardinality=1
+|  in pipelines: 49(GETNEXT), 12(OPEN), 36(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=44 row-size=8B cardinality=128.16K
+|  in pipelines: 12(GETNEXT), 36(GETNEXT)
+|
+|--48:HASH JOIN [RIGHT SEMI JOIN]
+|  |  hash predicates: c_customer_sk = ws_bill_customer_sk
+|  |  runtime filters: RF016[bloom] <- ws_bill_customer_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=22,23 row-size=36B cardinality=42.85K
+|  |  in pipelines: 36(GETNEXT), 25(OPEN)
+|  |
+|  |--47:HASH JOIN [LEFT SEMI JOIN]
+|  |  |  hash predicates: ws_item_sk = i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=22,23 row-size=36B cardinality=42.85K
+|  |  |  in pipelines: 25(GETNEXT), 46(OPEN)
+|  |  |
+|  |  |--46:AGGREGATE [FINALIZE]
+|  |  |  |  group by: i_item_sk
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=68 row-size=8B cardinality=17.98K
+|  |  |  |  in pipelines: 46(GETNEXT), 32(OPEN)
+|  |  |  |
+|  |  |  32:AGGREGATE [FINALIZE]
+|  |  |  |  output: count(*)
+|  |  |  |  group by: substr(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), i_item_sk, d_date
+|  |  |  |  having: count(*) > CAST(4 AS BIGINT)
+|  |  |  |  mem-estimate=123.50MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  tuple-ids=27 row-size=50B cardinality=235.45K
+|  |  |  |  in pipelines: 32(GETNEXT), 27(OPEN)
+|  |  |  |
+|  |  |  31:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  |  tuple-ids=24,25,26 row-size=162B cardinality=2.35M
+|  |  |  |  in pipelines: 27(GETNEXT), 29(OPEN)
+|  |  |  |
+|  |  |  |--29:SCAN HDFS [tpcds_parquet.item]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  |     tuple-ids=26 row-size=120B cardinality=18.00K
+|  |  |  |     in pipelines: 29(GETNEXT)
+|  |  |  |
+|  |  |  30:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  |  runtime filters: RF030[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=24,25 row-size=42B cardinality=2.35M
+|  |  |  |  in pipelines: 27(GETNEXT), 28(OPEN)
+|  |  |  |
+|  |  |  |--28:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  |     tuple-ids=25 row-size=30B cardinality=1.49K
+|  |  |  |     in pipelines: 28(GETNEXT)
+|  |  |  |
+|  |  |  27:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     runtime filters: RF030[bloom] -> ss_sold_date_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=24 row-size=12B cardinality=2.88M
+|  |  |     in pipelines: 27(GETNEXT)
+|  |  |
+|  |  45:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF026[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=22,23 row-size=36B cardinality=42.85K
+|  |  |  in pipelines: 25(GETNEXT), 26(OPEN)
+|  |  |
+|  |  |--26:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=23 row-size=12B cardinality=108
+|  |  |     in pipelines: 26(GETNEXT)
+|  |  |
+|  |  25:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF026[bloom] -> ws_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=160.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=22 row-size=24B cardinality=719.38K
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  44:NESTED LOOP JOIN [INNER JOIN]
+|  |  predicates: sum(ss_quantity * ss_sales_price) > CAST(0.500000 AS DECIMAL(10,6)) * max(csales)
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=32,39 row-size=36B cardinality=100.00K
+|  |  in pipelines: 36(GETNEXT), 43(OPEN)
+|  |
+|  |--43:AGGREGATE [FINALIZE]
+|  |  |  output: max(sum(ss_quantity * ss_sales_price))
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=39 row-size=16B cardinality=1
+|  |  |  in pipelines: 43(GETNEXT), 42(OPEN)
+|  |  |
+|  |  42:AGGREGATE [FINALIZE]
+|  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  |  group by: c_customer_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=37 row-size=20B cardinality=100.00K
+|  |  |  in pipelines: 42(GETNEXT), 37(OPEN)
+|  |  |
+|  |  41:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=34,36,35 row-size=28B cardinality=2.35M
+|  |  |  in pipelines: 37(GETNEXT), 38(OPEN)
+|  |  |
+|  |  |--38:SCAN HDFS [tpcds_parquet.customer]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=35 row-size=4B cardinality=100.00K
+|  |  |     in pipelines: 38(GETNEXT)
+|  |  |
+|  |  40:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF022[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=34,36 row-size=24B cardinality=2.35M
+|  |  |  in pipelines: 37(GETNEXT), 39(OPEN)
+|  |  |
+|  |  |--39:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=36 row-size=8B cardinality=1.49K
+|  |  |     in pipelines: 39(GETNEXT)
+|  |  |
+|  |  37:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF022[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=34 row-size=16B cardinality=2.88M
+|  |     in pipelines: 37(GETNEXT)
+|  |
+|  36:AGGREGATE [FINALIZE]
+|  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  group by: c_customer_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=32 row-size=20B cardinality=100.00K
+|  |  in pipelines: 36(GETNEXT), 33(OPEN)
+|  |
+|  35:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=30,31 row-size=16B cardinality=2.88M
+|  |  in pipelines: 33(GETNEXT), 34(OPEN)
+|  |
+|  |--34:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF016[bloom] -> tpcds_parquet.customer.c_customer_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=31 row-size=4B cardinality=100.00K
+|  |     in pipelines: 34(GETNEXT)
+|  |
+|  33:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF016[bloom] -> tpcds_parquet.store_sales.ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=30 row-size=12B cardinality=2.88M
+|     in pipelines: 33(GETNEXT)
+|
+24:HASH JOIN [RIGHT SEMI JOIN]
+|  hash predicates: c_customer_sk = cs_bill_customer_sk
+|  runtime filters: RF000[bloom] <- cs_bill_customer_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=36B cardinality=85.31K
+|  in pipelines: 12(GETNEXT), 01(OPEN)
+|
+|--23:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=36B cardinality=85.31K
+|  |  in pipelines: 01(GETNEXT), 22(OPEN)
+|  |
+|  |--22:AGGREGATE [FINALIZE]
+|  |  |  group by: i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=57 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 22(GETNEXT), 08(OPEN)
+|  |  |
+|  |  08:AGGREGATE [FINALIZE]
+|  |  |  output: count(*)
+|  |  |  group by: substr(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), i_item_sk, d_date
+|  |  |  having: count(*) > CAST(4 AS BIGINT)
+|  |  |  mem-estimate=123.50MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=5 row-size=50B cardinality=235.45K
+|  |  |  in pipelines: 08(GETNEXT), 03(OPEN)
+|  |  |
+|  |  07:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=2,3,4 row-size=162B cardinality=2.35M
+|  |  |  in pipelines: 03(GETNEXT), 05(OPEN)
+|  |  |
+|  |  |--05:SCAN HDFS [tpcds_parquet.item]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=4 row-size=120B cardinality=18.00K
+|  |  |     in pipelines: 05(GETNEXT)
+|  |  |
+|  |  06:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2,3 row-size=42B cardinality=2.35M
+|  |  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--04:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=3 row-size=30B cardinality=1.49K
+|  |  |     in pipelines: 04(GETNEXT)
+|  |  |
+|  |  03:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF014[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=12B cardinality=2.88M
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=36B cardinality=85.31K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=1 row-size=12B cardinality=108
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF010[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=240.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=0 row-size=24B cardinality=1.44M
+|     in pipelines: 01(GETNEXT)
+|
+20:NESTED LOOP JOIN [INNER JOIN]
+|  predicates: sum(ss_quantity * ss_sales_price) > CAST(0.500000 AS DECIMAL(10,6)) * max(csales)
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10,17 row-size=36B cardinality=100.00K
+|  in pipelines: 12(GETNEXT), 19(OPEN)
+|
+|--19:AGGREGATE [FINALIZE]
+|  |  output: max(sum(ss_quantity * ss_sales_price))
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17 row-size=16B cardinality=1
+|  |  in pipelines: 19(GETNEXT), 18(OPEN)
+|  |
+|  18:AGGREGATE [FINALIZE]
+|  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  group by: c_customer_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=15 row-size=20B cardinality=100.00K
+|  |  in pipelines: 18(GETNEXT), 13(OPEN)
+|  |
+|  17:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  runtime filters: RF004[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14,13 row-size=28B cardinality=2.35M
+|  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |
+|  |--14:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=4B cardinality=100.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14 row-size=24B cardinality=2.35M
+|  |  in pipelines: 13(GETNEXT), 15(OPEN)
+|  |
+|  |--15:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=14 row-size=8B cardinality=1.49K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=12 row-size=16B cardinality=2.88M
+|     in pipelines: 13(GETNEXT)
+|
+12:AGGREGATE [FINALIZE]
+|  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  group by: c_customer_sk
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=10 row-size=20B cardinality=100.00K
+|  in pipelines: 12(GETNEXT), 09(OPEN)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8,9 row-size=16B cardinality=2.88M
+|  in pipelines: 09(GETNEXT), 10(OPEN)
+|
+|--10:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=9 row-size=4B cardinality=100.00K
+|     in pipelines: 10(GETNEXT)
+|
+09:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF002[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=8 row-size=12B cardinality=2.88M
+   in pipelines: 09(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=243.38MB Threads=50
+Per-Host Resource Estimates: Memory=1.47GB
+F31:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: sum(sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+89:AGGREGATE [FINALIZE]
+|  output: sum:merge(sales)
+|  limit: 100
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=46 row-size=16B cardinality=1
+|  in pipelines: 89(GETNEXT), 49(OPEN)
+|
+88:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=46 row-size=16B cardinality=1
+|  in pipelines: 49(GETNEXT)
+|
+F30:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=25.76MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+49:AGGREGATE
+|  output: sum(sales)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=46 row-size=16B cardinality=1
+|  in pipelines: 49(GETNEXT), 52(OPEN), 71(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=44 row-size=8B cardinality=128.16K
+|  in pipelines: 52(GETNEXT), 71(GETNEXT)
+|
+|--48:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  |  hash predicates: c_customer_sk = ws_bill_customer_sk
+|  |  runtime filters: RF016[bloom] <- ws_bill_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22,23 row-size=36B cardinality=42.85K
+|  |  in pipelines: 71(GETNEXT), 25(OPEN)
+|  |
+|  |--87:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  |  mem-estimate=841.29KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=22,23 row-size=36B cardinality=42.85K
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F23:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=165.06MB mem-reservation=12.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  47:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash predicates: ws_item_sk = i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=22,23 row-size=36B cardinality=42.85K
+|  |  |  in pipelines: 25(GETNEXT), 85(OPEN)
+|  |  |
+|  |  |--86:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=176.43KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=68 row-size=8B cardinality=17.98K
+|  |  |  |  in pipelines: 85(GETNEXT)
+|  |  |  |
+|  |  |  F29:PLAN FRAGMENT [HASH(i_item_sk)] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  85:AGGREGATE [FINALIZE]
+|  |  |  |  group by: i_item_sk
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=68 row-size=8B cardinality=17.98K
+|  |  |  |  in pipelines: 85(GETNEXT), 83(OPEN)
+|  |  |  |
+|  |  |  84:EXCHANGE [HASH(i_item_sk)]
+|  |  |  |  mem-estimate=82.81KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=68 row-size=8B cardinality=17.98K
+|  |  |  |  in pipelines: 83(GETNEXT)
+|  |  |  |
+|  |  |  F28:PLAN FRAGMENT [HASH(substr(i_item_desc, 1, 30),i_item_sk,d_date)] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=81.91MB mem-reservation=36.00MB thread-reservation=1
+|  |  |  46:AGGREGATE [STREAMING]
+|  |  |  |  group by: i_item_sk
+|  |  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=68 row-size=8B cardinality=17.98K
+|  |  |  |  in pipelines: 83(GETNEXT)
+|  |  |  |
+|  |  |  83:AGGREGATE [FINALIZE]
+|  |  |  |  output: count:merge(*)
+|  |  |  |  group by: substr(i_item_desc, 1, 30), i_item_sk, d_date
+|  |  |  |  having: count(*) > CAST(4 AS BIGINT)
+|  |  |  |  mem-estimate=61.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  tuple-ids=27 row-size=50B cardinality=235.45K
+|  |  |  |  in pipelines: 83(GETNEXT), 27(OPEN)
+|  |  |  |
+|  |  |  82:EXCHANGE [HASH(substr(i_item_desc, 1, 30),i_item_sk,d_date)]
+|  |  |  |  mem-estimate=10.16MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=27 row-size=50B cardinality=2.35M
+|  |  |  |  in pipelines: 27(GETNEXT)
+|  |  |  |
+|  |  |  F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=87.70MB mem-reservation=42.19MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  |  32:AGGREGATE [STREAMING]
+|  |  |  |  output: count(*)
+|  |  |  |  group by: substr(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), i_item_sk, d_date
+|  |  |  |  mem-estimate=61.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  tuple-ids=27 row-size=50B cardinality=2.35M
+|  |  |  |  in pipelines: 27(GETNEXT)
+|  |  |  |
+|  |  |  31:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  |  tuple-ids=24,25,26 row-size=162B cardinality=2.35M
+|  |  |  |  in pipelines: 27(GETNEXT), 29(OPEN)
+|  |  |  |
+|  |  |  |--81:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=2.19MB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=26 row-size=120B cardinality=18.00K
+|  |  |  |  |  in pipelines: 29(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F27:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  |  |  29:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  |     tuple-ids=26 row-size=120B cardinality=18.00K
+|  |  |  |     in pipelines: 29(GETNEXT)
+|  |  |  |
+|  |  |  30:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  |  runtime filters: RF030[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=24,25 row-size=42B cardinality=2.35M
+|  |  |  |  in pipelines: 27(GETNEXT), 28(OPEN)
+|  |  |  |
+|  |  |  |--80:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=77.68KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=25 row-size=30B cardinality=1.49K
+|  |  |  |  |  in pipelines: 28(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  |  |  28:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  |     tuple-ids=25 row-size=30B cardinality=1.49K
+|  |  |  |     in pipelines: 28(GETNEXT)
+|  |  |  |
+|  |  |  27:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     runtime filters: RF030[bloom] -> ss_sold_date_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=24 row-size=12B cardinality=2.88M
+|  |  |     in pipelines: 27(GETNEXT)
+|  |  |
+|  |  45:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF026[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=22,23 row-size=36B cardinality=42.85K
+|  |  |  in pipelines: 25(GETNEXT), 26(OPEN)
+|  |  |
+|  |  |--79:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=23 row-size=12B cardinality=108
+|  |  |  |  in pipelines: 26(GETNEXT)
+|  |  |  |
+|  |  |  F24:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  26:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=23 row-size=12B cardinality=108
+|  |  |     in pipelines: 26(GETNEXT)
+|  |  |
+|  |  25:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF026[bloom] -> ws_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=160.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=22 row-size=24B cardinality=719.38K
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  44:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  |  predicates: sum(ss_quantity * ss_sales_price) > CAST(0.500000 AS DECIMAL(10,6)) * max(csales)
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=32,39 row-size=36B cardinality=100.00K
+|  |  in pipelines: 71(GETNEXT), 77(OPEN)
+|  |
+|  |--78:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=39 row-size=16B cardinality=1
+|  |  |  in pipelines: 77(GETNEXT)
+|  |  |
+|  |  F22:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  77:AGGREGATE [FINALIZE]
+|  |  |  output: max:merge(csales)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=39 row-size=16B cardinality=1
+|  |  |  in pipelines: 77(GETNEXT), 43(OPEN)
+|  |  |
+|  |  76:EXCHANGE [UNPARTITIONED]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=39 row-size=16B cardinality=1
+|  |  |  in pipelines: 43(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  |  43:AGGREGATE
+|  |  |  output: max(sum(ss_quantity * ss_sales_price))
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=39 row-size=16B cardinality=1
+|  |  |  in pipelines: 43(GETNEXT), 75(OPEN)
+|  |  |
+|  |  75:AGGREGATE [FINALIZE]
+|  |  |  output: sum:merge(ss_quantity * ss_sales_price)
+|  |  |  group by: c_customer_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=37 row-size=20B cardinality=100.00K
+|  |  |  in pipelines: 75(GETNEXT), 37(OPEN)
+|  |  |
+|  |  74:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=723.04KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=37 row-size=20B cardinality=100.00K
+|  |  |  in pipelines: 37(GETNEXT)
+|  |  |
+|  |  F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=63.29MB mem-reservation=8.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  42:AGGREGATE [STREAMING]
+|  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  |  group by: c_customer_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=37 row-size=20B cardinality=100.00K
+|  |  |  in pipelines: 37(GETNEXT)
+|  |  |
+|  |  41:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=34,36,35 row-size=28B cardinality=2.35M
+|  |  |  in pipelines: 37(GETNEXT), 38(OPEN)
+|  |  |
+|  |  |--73:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=35 row-size=4B cardinality=100.00K
+|  |  |  |  in pipelines: 38(GETNEXT)
+|  |  |  |
+|  |  |  F20:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  38:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=35 row-size=4B cardinality=100.00K
+|  |  |     in pipelines: 38(GETNEXT)
+|  |  |
+|  |  40:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF022[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=34,36 row-size=24B cardinality=2.35M
+|  |  |  in pipelines: 37(GETNEXT), 39(OPEN)
+|  |  |
+|  |  |--72:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=23.65KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=36 row-size=8B cardinality=1.49K
+|  |  |  |  in pipelines: 39(GETNEXT)
+|  |  |  |
+|  |  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  39:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=36 row-size=8B cardinality=1.49K
+|  |  |     in pipelines: 39(GETNEXT)
+|  |  |
+|  |  37:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF022[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=34 row-size=16B cardinality=2.88M
+|  |     in pipelines: 37(GETNEXT)
+|  |
+|  71:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_quantity * ss_sales_price)
+|  |  group by: c_customer_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=32 row-size=20B cardinality=100.00K
+|  |  in pipelines: 71(GETNEXT), 33(OPEN)
+|  |
+|  70:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=723.04KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=32 row-size=20B cardinality=100.00K
+|  |  in pipelines: 33(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=61.33MB mem-reservation=6.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  36:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  group by: c_customer_sk
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=32 row-size=20B cardinality=100.00K
+|  |  in pipelines: 33(GETNEXT)
+|  |
+|  35:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=30,31 row-size=16B cardinality=2.88M
+|  |  in pipelines: 33(GETNEXT), 34(OPEN)
+|  |
+|  |--69:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=31 row-size=4B cardinality=100.00K
+|  |  |  in pipelines: 34(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=17.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  34:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF016[bloom] -> tpcds_parquet.customer.c_customer_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=31 row-size=4B cardinality=100.00K
+|  |     in pipelines: 34(GETNEXT)
+|  |
+|  33:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF016[bloom] -> tpcds_parquet.store_sales.ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=30 row-size=12B cardinality=2.88M
+|     in pipelines: 33(GETNEXT)
+|
+24:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash predicates: c_customer_sk = cs_bill_customer_sk
+|  runtime filters: RF000[bloom] <- cs_bill_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=36B cardinality=85.31K
+|  in pipelines: 52(GETNEXT), 01(OPEN)
+|
+|--68:EXCHANGE [HASH(cs_bill_customer_sk)]
+|  |  mem-estimate=1.11MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,1 row-size=36B cardinality=85.31K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=245.06MB mem-reservation=12.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  23:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=36B cardinality=85.31K
+|  |  in pipelines: 01(GETNEXT), 66(OPEN)
+|  |
+|  |--67:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=176.43KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=57 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 66(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [HASH(i_item_sk)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reservation=1
+|  |  66:AGGREGATE [FINALIZE]
+|  |  |  group by: i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=57 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 66(GETNEXT), 64(OPEN)
+|  |  |
+|  |  65:EXCHANGE [HASH(i_item_sk)]
+|  |  |  mem-estimate=82.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=57 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 64(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [HASH(substr(i_item_desc, 1, 30),i_item_sk,d_date)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=81.91MB mem-reservation=36.00MB thread-reservation=1
+|  |  22:AGGREGATE [STREAMING]
+|  |  |  group by: i_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=57 row-size=8B cardinality=17.98K
+|  |  |  in pipelines: 64(GETNEXT)
+|  |  |
+|  |  64:AGGREGATE [FINALIZE]
+|  |  |  output: count:merge(*)
+|  |  |  group by: substr(i_item_desc, 1, 30), i_item_sk, d_date
+|  |  |  having: count(*) > CAST(4 AS BIGINT)
+|  |  |  mem-estimate=61.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=5 row-size=50B cardinality=235.45K
+|  |  |  in pipelines: 64(GETNEXT), 03(OPEN)
+|  |  |
+|  |  63:EXCHANGE [HASH(substr(i_item_desc, 1, 30),i_item_sk,d_date)]
+|  |  |  mem-estimate=10.16MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=50B cardinality=2.35M
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=87.70MB mem-reservation=42.19MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  08:AGGREGATE [STREAMING]
+|  |  |  output: count(*)
+|  |  |  group by: substr(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), i_item_sk, d_date
+|  |  |  mem-estimate=61.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=5 row-size=50B cardinality=2.35M
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=2,3,4 row-size=162B cardinality=2.35M
+|  |  |  in pipelines: 03(GETNEXT), 05(OPEN)
+|  |  |
+|  |  |--62:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=2.19MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=4 row-size=120B cardinality=18.00K
+|  |  |  |  in pipelines: 05(GETNEXT)
+|  |  |  |
+|  |  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  |  05:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=4 row-size=120B cardinality=18.00K
+|  |  |     in pipelines: 05(GETNEXT)
+|  |  |
+|  |  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2,3 row-size=42B cardinality=2.35M
+|  |  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--61:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=77.68KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=3 row-size=30B cardinality=1.49K
+|  |  |  |  in pipelines: 04(GETNEXT)
+|  |  |  |
+|  |  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=3 row-size=30B cardinality=1.49K
+|  |  |     in pipelines: 04(GETNEXT)
+|  |  |
+|  |  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF014[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=12B cardinality=2.88M
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=36B cardinality=85.31K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--60:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=12B cardinality=108
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=1 row-size=12B cardinality=108
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF010[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=240.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=0 row-size=24B cardinality=1.44M
+|     in pipelines: 01(GETNEXT)
+|
+20:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  predicates: sum(ss_quantity * ss_sales_price) > CAST(0.500000 AS DECIMAL(10,6)) * max(csales)
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10,17 row-size=36B cardinality=100.00K
+|  in pipelines: 52(GETNEXT), 58(OPEN)
+|
+|--59:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=16B cardinality=1
+|  |  in pipelines: 58(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  58:AGGREGATE [FINALIZE]
+|  |  output: max:merge(csales)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17 row-size=16B cardinality=1
+|  |  in pipelines: 58(GETNEXT), 19(OPEN)
+|  |
+|  57:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=16B cardinality=1
+|  |  in pipelines: 19(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  19:AGGREGATE
+|  |  output: max(sum(ss_quantity * ss_sales_price))
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17 row-size=16B cardinality=1
+|  |  in pipelines: 19(GETNEXT), 56(OPEN)
+|  |
+|  56:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_quantity * ss_sales_price)
+|  |  group by: c_customer_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=15 row-size=20B cardinality=100.00K
+|  |  in pipelines: 56(GETNEXT), 13(OPEN)
+|  |
+|  55:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=723.04KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=20B cardinality=100.00K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=64.29MB mem-reservation=9.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  18:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  group by: c_customer_sk
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=15 row-size=20B cardinality=100.00K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  17:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  runtime filters: RF004[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14,13 row-size=28B cardinality=2.35M
+|  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |
+|  |--54:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=4B cardinality=100.00K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  14:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=4B cardinality=100.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14 row-size=24B cardinality=2.35M
+|  |  in pipelines: 13(GETNEXT), 15(OPEN)
+|  |
+|  |--53:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=23.65KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=8B cardinality=1.49K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  15:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=14 row-size=8B cardinality=1.49K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=12 row-size=16B cardinality=2.88M
+|     in pipelines: 13(GETNEXT)
+|
+52:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_quantity * ss_sales_price)
+|  group by: c_customer_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=10 row-size=20B cardinality=100.00K
+|  in pipelines: 52(GETNEXT), 09(OPEN)
+|
+51:EXCHANGE [HASH(c_customer_sk)]
+|  mem-estimate=723.04KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=20B cardinality=100.00K
+|  in pipelines: 09(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=62.33MB mem-reservation=7.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+12:AGGREGATE [STREAMING]
+|  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  group by: c_customer_sk
+|  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=10 row-size=20B cardinality=100.00K
+|  in pipelines: 09(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8,9 row-size=16B cardinality=2.88M
+|  in pipelines: 09(GETNEXT), 10(OPEN)
+|
+|--50:EXCHANGE [BROADCAST]
+|  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=4B cardinality=100.00K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=17.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  10:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=9 row-size=4B cardinality=100.00K
+|     in pipelines: 10(GETNEXT)
+|
+09:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF002[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=8 row-size=12B cardinality=2.88M
+   in pipelines: 09(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23b.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23b.test
new file mode 100644
index 0000000..5dd2ee7
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q23b.test
@@ -0,0 +1,2325 @@
+# TPCDS-Q23b second of two queries
+WITH frequent_ss_items AS
+  (SELECT itemdesc,
+          i_item_sk item_sk,
+          d_date solddate,
+          count(*) cnt
+   FROM store_sales,
+        date_dim,
+     (SELECT SUBSTRING(i_item_desc, 1, 30) itemdesc,
+             *
+      FROM item) sq1
+   WHERE ss_sold_date_sk = d_date_sk
+     AND ss_item_sk = i_item_sk
+     AND d_year IN (2000,
+                    2000+1,
+                    2000+2,
+                    2000+3)
+   GROUP BY itemdesc,
+            i_item_sk,
+            d_date
+   HAVING count(*) >4),
+     max_store_sales AS
+  (SELECT max(csales) tpcds_cmax
+   FROM
+     (SELECT c_customer_sk,
+             sum(ss_quantity*ss_sales_price) csales
+      FROM store_sales,
+           customer,
+           date_dim
+      WHERE ss_customer_sk = c_customer_sk
+        AND ss_sold_date_sk = d_date_sk
+        AND d_year IN (2000,
+                       2000+1,
+                       2000+2,
+                       2000+3)
+      GROUP BY c_customer_sk) sq2),
+     best_ss_customer AS
+  (SELECT c_customer_sk,
+          sum(ss_quantity*ss_sales_price) ssales
+   FROM store_sales,
+        customer,
+        max_store_sales
+   WHERE ss_customer_sk = c_customer_sk
+   GROUP BY c_customer_sk
+   HAVING sum(ss_quantity*ss_sales_price) > (50/100.0) * max(tpcds_cmax))
+SELECT c_last_name,
+       c_first_name,
+       sales
+FROM
+  (SELECT c_last_name,
+          c_first_name,
+          sum(cs_quantity*cs_list_price) sales
+   FROM catalog_sales,
+        customer,
+        date_dim,
+        frequent_ss_items,
+        best_ss_customer
+   WHERE d_year = 2000
+     AND d_moy = 2
+     AND cs_sold_date_sk = d_date_sk
+     AND cs_item_sk = item_sk
+     AND cs_bill_customer_sk = best_ss_customer.c_customer_sk
+     AND cs_bill_customer_sk = customer.c_customer_sk
+   GROUP BY c_last_name,
+            c_first_name
+   UNION ALL SELECT c_last_name,
+                    c_first_name,
+                    sum(ws_quantity*ws_list_price) sales
+   FROM web_sales,
+        customer,
+        date_dim,
+        frequent_ss_items,
+        best_ss_customer
+   WHERE d_year = 2000
+     AND d_moy = 2
+     AND ws_sold_date_sk = d_date_sk
+     AND ws_item_sk = item_sk
+     AND ws_bill_customer_sk = best_ss_customer.c_customer_sk
+     AND ws_bill_customer_sk = customer.c_customer_sk
+   GROUP BY c_last_name,
+            c_first_name) sq3
+ORDER BY c_last_name,
+         c_first_name,
+         sales
+LIMIT 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=73.81MB Threads=12
+Per-Host Resource Estimates: Memory=660MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=659.94MB mem-reservation=73.81MB thread-reservation=12 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+53:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, c_first_name ASC, sales ASC
+|  mem-estimate=5.08KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=44 row-size=52B cardinality=100
+|  in pipelines: 53(GETNEXT), 26(OPEN), 52(OPEN)
+|
+00:UNION
+|  pass-through-operands: all
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=42 row-size=52B cardinality=20.15K
+|  in pipelines: 26(GETNEXT), 52(GETNEXT)
+|
+|--52:AGGREGATE [FINALIZE]
+|  |  output: sum(CAST(ws_quantity AS DECIMAL(10,0)) * ws_list_price)
+|  |  group by: c_last_name, c_first_name
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=41 row-size=52B cardinality=9.63K
+|  |  in pipelines: 52(GETNEXT), 35(OPEN)
+|  |
+|  51:HASH JOIN [INNER JOIN]
+|  |  hash predicates: i_item_sk = ws_item_sk
+|  |  fk/pk conjuncts: i_item_sk = ws_item_sk
+|  |  runtime filters: RF018[bloom] <- ws_item_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=28,22,21,23,39 row-size=162B cardinality=9.63K
+|  |  in pipelines: 35(GETNEXT), 28(OPEN)
+|  |
+|  |--50:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: customer.c_customer_sk = ws_bill_customer_sk
+|  |  |  fk/pk conjuncts: customer.c_customer_sk = ws_bill_customer_sk
+|  |  |  runtime filters: RF024[bloom] <- ws_bill_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=22,21,23,39 row-size=112B cardinality=9.63K
+|  |  |  in pipelines: 28(GETNEXT), 27(OPEN)
+|  |  |
+|  |  |--49:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  |  |  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  |  |  |  runtime filters: RF026[bloom] <- c_customer_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=21,23,39 row-size=72B cardinality=9.63K
+|  |  |  |  in pipelines: 27(GETNEXT), 47(OPEN)
+|  |  |  |
+|  |  |  |--47:AGGREGATE [FINALIZE]
+|  |  |  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price), max(max(csales))
+|  |  |  |  |  group by: c_customer_sk
+|  |  |  |  |  having: sum(ss_quantity * ss_sales_price) > CAST(0.500000 AS DECIMAL(10,6)) * max(tpcds_cmax)
+|  |  |  |  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=39 row-size=36B cardinality=10.00K
+|  |  |  |  |  in pipelines: 47(GETNEXT), 36(OPEN)
+|  |  |  |  |
+|  |  |  |  46:NESTED LOOP JOIN [CROSS JOIN]
+|  |  |  |  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=30,31,37 row-size=32B cardinality=2.88M
+|  |  |  |  |  in pipelines: 36(GETNEXT), 44(OPEN)
+|  |  |  |  |
+|  |  |  |  |--44:AGGREGATE [FINALIZE]
+|  |  |  |  |  |  output: max(sum(ss_quantity * ss_sales_price))
+|  |  |  |  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=37 row-size=16B cardinality=1
+|  |  |  |  |  |  in pipelines: 44(GETNEXT), 43(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  43:AGGREGATE [FINALIZE]
+|  |  |  |  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  |  |  |  |  group by: c_customer_sk
+|  |  |  |  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=35 row-size=20B cardinality=100.00K
+|  |  |  |  |  |  in pipelines: 43(GETNEXT), 38(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  42:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  |  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=32,34,33 row-size=28B cardinality=2.35M
+|  |  |  |  |  |  in pipelines: 38(GETNEXT), 39(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  |--39:SCAN HDFS [tpcds_parquet.customer]
+|  |  |  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |  |  |       columns: all
+|  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |  |     tuple-ids=33 row-size=4B cardinality=100.00K
+|  |  |  |  |  |     in pipelines: 39(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  41:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=32,34 row-size=24B cardinality=2.35M
+|  |  |  |  |  |  in pipelines: 38(GETNEXT), 40(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  |--40:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |  |  |       columns: all
+|  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |  |     tuple-ids=34 row-size=8B cardinality=1.49K
+|  |  |  |  |  |     in pipelines: 40(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  38:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=2.88M size=201.02MB
+|  |  |  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |  |  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |  |  |     tuple-ids=32 row-size=16B cardinality=2.88M
+|  |  |  |  |     in pipelines: 38(GETNEXT)
+|  |  |  |  |
+|  |  |  |  45:HASH JOIN [INNER JOIN]
+|  |  |  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=30,31 row-size=16B cardinality=2.88M
+|  |  |  |  |  in pipelines: 36(GETNEXT), 37(OPEN)
+|  |  |  |  |
+|  |  |  |  |--37:SCAN HDFS [tpcds_parquet.customer]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |     tuple-ids=31 row-size=4B cardinality=100.00K
+|  |  |  |  |     in pipelines: 37(GETNEXT)
+|  |  |  |  |
+|  |  |  |  36:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=2.88M size=201.02MB
+|  |  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |  |     tuple-ids=30 row-size=12B cardinality=2.88M
+|  |  |  |     in pipelines: 36(GETNEXT)
+|  |  |  |
+|  |  |  48:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  |  runtime filters: RF028[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=21,23 row-size=36B cardinality=42.85K
+|  |  |  |  in pipelines: 27(GETNEXT), 29(OPEN)
+|  |  |  |
+|  |  |  |--29:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=23 row-size=12B cardinality=108
+|  |  |  |     in pipelines: 29(GETNEXT)
+|  |  |  |
+|  |  |  27:SCAN HDFS [tpcds_parquet.web_sales]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     runtime filters: RF028[bloom] -> ws_sold_date_sk, RF026[bloom] -> ws_bill_customer_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=160.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |     tuple-ids=21 row-size=24B cardinality=719.38K
+|  |  |     in pipelines: 27(GETNEXT)
+|  |  |
+|  |  28:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF024[bloom] -> customer.c_customer_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=22 row-size=40B cardinality=100.00K
+|  |     in pipelines: 28(GETNEXT)
+|  |
+|  35:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  group by: substring(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), tpcds_parquet.item.i_item_sk, d_date
+|  |  having: count(*) > CAST(4 AS BIGINT)
+|  |  mem-estimate=123.50MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=235.45K
+|  |  in pipelines: 35(GETNEXT), 30(OPEN)
+|  |
+|  34:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=24,25,26 row-size=162B cardinality=2.35M
+|  |  in pipelines: 30(GETNEXT), 32(OPEN)
+|  |
+|  |--32:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF018[bloom] -> tpcds_parquet.item.i_item_sk
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=26 row-size=120B cardinality=18.00K
+|  |     in pipelines: 32(GETNEXT)
+|  |
+|  33:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,25 row-size=42B cardinality=2.35M
+|  |  in pipelines: 30(GETNEXT), 31(OPEN)
+|  |
+|  |--31:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=25 row-size=30B cardinality=1.49K
+|  |     in pipelines: 31(GETNEXT)
+|  |
+|  30:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF018[bloom] -> tpcds_parquet.store_sales.ss_item_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=24 row-size=12B cardinality=2.88M
+|     in pipelines: 30(GETNEXT)
+|
+26:AGGREGATE [FINALIZE]
+|  output: sum(CAST(cs_quantity AS DECIMAL(10,0)) * cs_list_price)
+|  group by: c_last_name, c_first_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=20 row-size=52B cardinality=10.53K
+|  in pipelines: 26(GETNEXT), 09(OPEN)
+|
+25:HASH JOIN [INNER JOIN]
+|  hash predicates: i_item_sk = cs_item_sk
+|  fk/pk conjuncts: i_item_sk = cs_item_sk
+|  runtime filters: RF000[bloom] <- cs_item_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=7,1,0,2,18 row-size=162B cardinality=10.53K
+|  in pipelines: 09(GETNEXT), 02(OPEN)
+|
+|--24:HASH JOIN [INNER JOIN]
+|  |  hash predicates: customer.c_customer_sk = cs_bill_customer_sk
+|  |  fk/pk conjuncts: customer.c_customer_sk = cs_bill_customer_sk
+|  |  runtime filters: RF006[bloom] <- cs_bill_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,0,2,18 row-size=112B cardinality=10.53K
+|  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |
+|  |--23:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  |  |  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  |  |  runtime filters: RF008[bloom] <- c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,2,18 row-size=72B cardinality=10.53K
+|  |  |  in pipelines: 01(GETNEXT), 21(OPEN)
+|  |  |
+|  |  |--21:AGGREGATE [FINALIZE]
+|  |  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price), max(max(csales))
+|  |  |  |  group by: c_customer_sk
+|  |  |  |  having: sum(ss_quantity * ss_sales_price) > CAST(0.500000 AS DECIMAL(10,6)) * max(tpcds_cmax)
+|  |  |  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  |  tuple-ids=18 row-size=36B cardinality=10.00K
+|  |  |  |  in pipelines: 21(GETNEXT), 10(OPEN)
+|  |  |  |
+|  |  |  20:NESTED LOOP JOIN [CROSS JOIN]
+|  |  |  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=9,10,16 row-size=32B cardinality=2.88M
+|  |  |  |  in pipelines: 10(GETNEXT), 18(OPEN)
+|  |  |  |
+|  |  |  |--18:AGGREGATE [FINALIZE]
+|  |  |  |  |  output: max(sum(ss_quantity * ss_sales_price))
+|  |  |  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  |  tuple-ids=16 row-size=16B cardinality=1
+|  |  |  |  |  in pipelines: 18(GETNEXT), 17(OPEN)
+|  |  |  |  |
+|  |  |  |  17:AGGREGATE [FINALIZE]
+|  |  |  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  |  |  |  group by: c_customer_sk
+|  |  |  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=14 row-size=20B cardinality=100.00K
+|  |  |  |  |  in pipelines: 17(GETNEXT), 12(OPEN)
+|  |  |  |  |
+|  |  |  |  16:HASH JOIN [INNER JOIN]
+|  |  |  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=11,13,12 row-size=28B cardinality=2.35M
+|  |  |  |  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |  |  |  |
+|  |  |  |  |--13:SCAN HDFS [tpcds_parquet.customer]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |     tuple-ids=12 row-size=4B cardinality=100.00K
+|  |  |  |  |     in pipelines: 13(GETNEXT)
+|  |  |  |  |
+|  |  |  |  15:HASH JOIN [INNER JOIN]
+|  |  |  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=11,13 row-size=24B cardinality=2.35M
+|  |  |  |  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |  |  |  |
+|  |  |  |  |--14:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |     tuple-ids=13 row-size=8B cardinality=1.49K
+|  |  |  |  |     in pipelines: 14(GETNEXT)
+|  |  |  |  |
+|  |  |  |  12:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |  |     runtime filters: RF016[bloom] -> ss_sold_date_sk
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=2.88M size=201.02MB
+|  |  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |  |     tuple-ids=11 row-size=16B cardinality=2.88M
+|  |  |  |     in pipelines: 12(GETNEXT)
+|  |  |  |
+|  |  |  19:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=9,10 row-size=16B cardinality=2.88M
+|  |  |  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |  |  |
+|  |  |  |--11:SCAN HDFS [tpcds_parquet.customer]
+|  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=10 row-size=4B cardinality=100.00K
+|  |  |  |     in pipelines: 11(GETNEXT)
+|  |  |  |
+|  |  |  10:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=9 row-size=12B cardinality=2.88M
+|  |  |     in pipelines: 10(GETNEXT)
+|  |  |
+|  |  22:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,2 row-size=36B cardinality=85.31K
+|  |  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |  |
+|  |  |--03:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=2 row-size=12B cardinality=108
+|  |  |     in pipelines: 03(GETNEXT)
+|  |  |
+|  |  01:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF010[bloom] -> cs_sold_date_sk, RF008[bloom] -> cs_bill_customer_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=240.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=24B cardinality=1.44M
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF006[bloom] -> customer.c_customer_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=40B cardinality=100.00K
+|     in pipelines: 02(GETNEXT)
+|
+09:AGGREGATE [FINALIZE]
+|  output: count(*)
+|  group by: substring(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), tpcds_parquet.item.i_item_sk, d_date
+|  having: count(*) > CAST(4 AS BIGINT)
+|  mem-estimate=123.50MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=50B cardinality=235.45K
+|  in pipelines: 09(GETNEXT), 04(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  fk/pk conjuncts: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=3,4,5 row-size=162B cardinality=2.35M
+|  in pipelines: 04(GETNEXT), 06(OPEN)
+|
+|--06:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=5 row-size=120B cardinality=18.00K
+|     in pipelines: 06(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,4 row-size=42B cardinality=2.35M
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=4 row-size=30B cardinality=1.49K
+|     in pipelines: 05(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_item_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=3 row-size=12B cardinality=2.88M
+   in pipelines: 04(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=260.81MB Threads=56
+Per-Host Resource Estimates: Memory=1.59GB
+F35:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=18.09KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+96:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_last_name ASC, c_first_name ASC, sales ASC
+|  limit: 100
+|  mem-estimate=18.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=44 row-size=52B cardinality=100
+|  in pipelines: 53(GETNEXT)
+|
+F34:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.35MB mem-reservation=1.94MB thread-reservation=1
+53:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, c_first_name ASC, sales ASC
+|  mem-estimate=5.08KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=44 row-size=52B cardinality=100
+|  in pipelines: 53(GETNEXT), 74(OPEN), 95(OPEN)
+|
+00:UNION
+|  pass-through-operands: all
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=42 row-size=52B cardinality=20.15K
+|  in pipelines: 74(GETNEXT), 95(GETNEXT)
+|
+|--95:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_quantity * ws_list_price)
+|  |  group by: c_last_name, c_first_name
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=41 row-size=52B cardinality=9.63K
+|  |  in pipelines: 95(GETNEXT), 78(OPEN)
+|  |
+|  94:EXCHANGE [HASH(c_last_name,c_first_name)]
+|  |  mem-estimate=356.17KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=41 row-size=52B cardinality=9.63K
+|  |  in pipelines: 78(GETNEXT)
+|  |
+|  F20:PLAN FRAGMENT [HASH(itemdesc,i_item_sk,d_date)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=117.94MB mem-reservation=39.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  52:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(ws_quantity AS DECIMAL(10,0)) * ws_list_price)
+|  |  group by: c_last_name, c_first_name
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=41 row-size=52B cardinality=9.63K
+|  |  in pipelines: 78(GETNEXT)
+|  |
+|  51:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: i_item_sk = ws_item_sk
+|  |  fk/pk conjuncts: i_item_sk = ws_item_sk
+|  |  runtime filters: RF018[bloom] <- ws_item_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=28,21,23,39,22 row-size=162B cardinality=9.63K
+|  |  in pipelines: 78(GETNEXT), 27(OPEN)
+|  |
+|  |--93:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.28MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21,23,39,22 row-size=112B cardinality=9.63K
+|  |  |  in pipelines: 27(GETNEXT)
+|  |  |
+|  |  F32:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=7.22MB mem-reservation=2.88MB thread-reservation=1
+|  |  50:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash predicates: ws_bill_customer_sk = customer.c_customer_sk
+|  |  |  fk/pk conjuncts: ws_bill_customer_sk = customer.c_customer_sk
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=21,23,39,22 row-size=112B cardinality=9.63K
+|  |  |  in pipelines: 27(GETNEXT), 28(OPEN)
+|  |  |
+|  |  |--92:EXCHANGE [HASH(customer.c_customer_sk)]
+|  |  |  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=40B cardinality=100.00K
+|  |  |  |  in pipelines: 28(GETNEXT)
+|  |  |  |
+|  |  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  |  28:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=22 row-size=40B cardinality=100.00K
+|  |  |     in pipelines: 28(GETNEXT)
+|  |  |
+|  |  91:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  |  mem-estimate=506.41KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21,23,39 row-size=72B cardinality=9.63K
+|  |  |  in pipelines: 27(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=166.35MB mem-reservation=13.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  49:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  |  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  |  |  runtime filters: RF026[bloom] <- c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=21,23,39 row-size=72B cardinality=9.63K
+|  |  |  in pipelines: 27(GETNEXT), 89(OPEN)
+|  |  |
+|  |  |--90:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=471.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=39 row-size=36B cardinality=10.00K
+|  |  |  |  in pipelines: 89(GETNEXT)
+|  |  |  |
+|  |  |  F30:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=11.26MB mem-reservation=2.88MB thread-reservation=1
+|  |  |  89:AGGREGATE [FINALIZE]
+|  |  |  |  output: sum:merge(ss_quantity * ss_sales_price), max:merge(tpcds_cmax)
+|  |  |  |  group by: c_customer_sk
+|  |  |  |  having: sum(ss_quantity * ss_sales_price) > CAST(0.500000 AS DECIMAL(10,6)) * max(tpcds_cmax)
+|  |  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=39 row-size=36B cardinality=10.00K
+|  |  |  |  in pipelines: 89(GETNEXT), 36(OPEN)
+|  |  |  |
+|  |  |  88:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  |  mem-estimate=1.26MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=39 row-size=36B cardinality=100.00K
+|  |  |  |  in pipelines: 36(GETNEXT)
+|  |  |  |
+|  |  |  F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=60.34MB mem-reservation=7.94MB thread-reservation=2
+|  |  |  47:AGGREGATE [STREAMING]
+|  |  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price), max(max(csales))
+|  |  |  |  group by: c_customer_sk
+|  |  |  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  |  tuple-ids=39 row-size=36B cardinality=100.00K
+|  |  |  |  in pipelines: 36(GETNEXT)
+|  |  |  |
+|  |  |  46:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  |  |  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=30,31,37 row-size=32B cardinality=2.88M
+|  |  |  |  in pipelines: 36(GETNEXT), 86(OPEN)
+|  |  |  |
+|  |  |  |--87:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=37 row-size=16B cardinality=1
+|  |  |  |  |  in pipelines: 86(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F29:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  |  |  86:AGGREGATE [FINALIZE]
+|  |  |  |  |  output: max:merge(csales)
+|  |  |  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  |  tuple-ids=37 row-size=16B cardinality=1
+|  |  |  |  |  in pipelines: 86(GETNEXT), 44(OPEN)
+|  |  |  |  |
+|  |  |  |  85:EXCHANGE [UNPARTITIONED]
+|  |  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=37 row-size=16B cardinality=1
+|  |  |  |  |  in pipelines: 44(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F28:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=3
+|  |  |  |  Per-Host Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  |  44:AGGREGATE
+|  |  |  |  |  output: max(sum(ss_quantity * ss_sales_price))
+|  |  |  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  |  tuple-ids=37 row-size=16B cardinality=1
+|  |  |  |  |  in pipelines: 44(GETNEXT), 84(OPEN)
+|  |  |  |  |
+|  |  |  |  84:AGGREGATE [FINALIZE]
+|  |  |  |  |  output: sum:merge(ss_quantity * ss_sales_price)
+|  |  |  |  |  group by: c_customer_sk
+|  |  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=35 row-size=20B cardinality=100.00K
+|  |  |  |  |  in pipelines: 84(GETNEXT), 38(OPEN)
+|  |  |  |  |
+|  |  |  |  83:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  |  |  mem-estimate=723.04KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=35 row-size=20B cardinality=100.00K
+|  |  |  |  |  in pipelines: 38(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Host Resources: mem-estimate=63.29MB mem-reservation=8.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  |  |  43:AGGREGATE [STREAMING]
+|  |  |  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  |  |  |  group by: c_customer_sk
+|  |  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=35 row-size=20B cardinality=100.00K
+|  |  |  |  |  in pipelines: 38(GETNEXT)
+|  |  |  |  |
+|  |  |  |  42:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=32,34,33 row-size=28B cardinality=2.35M
+|  |  |  |  |  in pipelines: 38(GETNEXT), 39(OPEN)
+|  |  |  |  |
+|  |  |  |  |--82:EXCHANGE [BROADCAST]
+|  |  |  |  |  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  |  tuple-ids=33 row-size=4B cardinality=100.00K
+|  |  |  |  |  |  in pipelines: 39(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  F27:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  |  39:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |     tuple-ids=33 row-size=4B cardinality=100.00K
+|  |  |  |  |     in pipelines: 39(GETNEXT)
+|  |  |  |  |
+|  |  |  |  41:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  |  |  runtime filters: RF034[bloom] <- d_date_sk
+|  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=32,34 row-size=24B cardinality=2.35M
+|  |  |  |  |  in pipelines: 38(GETNEXT), 40(OPEN)
+|  |  |  |  |
+|  |  |  |  |--81:EXCHANGE [BROADCAST]
+|  |  |  |  |  |  mem-estimate=23.65KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  |  tuple-ids=34 row-size=8B cardinality=1.49K
+|  |  |  |  |  |  in pipelines: 40(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  |  40:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |     tuple-ids=34 row-size=8B cardinality=1.49K
+|  |  |  |  |     in pipelines: 40(GETNEXT)
+|  |  |  |  |
+|  |  |  |  38:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |  |     runtime filters: RF034[bloom] -> ss_sold_date_sk
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=2.88M size=201.02MB
+|  |  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |  |     tuple-ids=32 row-size=16B cardinality=2.88M
+|  |  |  |     in pipelines: 38(GETNEXT)
+|  |  |  |
+|  |  |  45:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=30,31 row-size=16B cardinality=2.88M
+|  |  |  |  in pipelines: 36(GETNEXT), 37(OPEN)
+|  |  |  |
+|  |  |  |--80:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=31 row-size=4B cardinality=100.00K
+|  |  |  |  |  in pipelines: 37(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F24:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  37:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=31 row-size=4B cardinality=100.00K
+|  |  |  |     in pipelines: 37(GETNEXT)
+|  |  |  |
+|  |  |  36:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=30 row-size=12B cardinality=2.88M
+|  |  |     in pipelines: 36(GETNEXT)
+|  |  |
+|  |  48:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF028[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=21,23 row-size=36B cardinality=42.85K
+|  |  |  in pipelines: 27(GETNEXT), 29(OPEN)
+|  |  |
+|  |  |--79:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=23 row-size=12B cardinality=108
+|  |  |  |  in pipelines: 29(GETNEXT)
+|  |  |  |
+|  |  |  F22:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  29:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=23 row-size=12B cardinality=108
+|  |  |     in pipelines: 29(GETNEXT)
+|  |  |
+|  |  27:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF028[bloom] -> ws_sold_date_sk, RF026[bloom] -> ws_bill_customer_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=160.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=21 row-size=24B cardinality=719.38K
+|  |     in pipelines: 27(GETNEXT)
+|  |
+|  78:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  group by: itemdesc, i_item_sk, d_date
+|  |  having: count(*) > CAST(4 AS BIGINT)
+|  |  mem-estimate=92.63MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=235.45K
+|  |  in pipelines: 78(GETNEXT), 30(OPEN)
+|  |
+|  77:EXCHANGE [HASH(itemdesc,i_item_sk,d_date)]
+|  |  mem-estimate=10.16MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=2.35M
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=88.70MB mem-reservation=43.19MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  35:AGGREGATE [STREAMING]
+|  |  output: count(*)
+|  |  group by: substring(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), tpcds_parquet.item.i_item_sk, d_date
+|  |  mem-estimate=61.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=2.35M
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  34:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=24,25,26 row-size=162B cardinality=2.35M
+|  |  in pipelines: 30(GETNEXT), 32(OPEN)
+|  |
+|  |--76:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=2.19MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=26 row-size=120B cardinality=18.00K
+|  |  |  in pipelines: 32(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  32:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF018[bloom] -> tpcds_parquet.item.i_item_sk
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=26 row-size=120B cardinality=18.00K
+|  |     in pipelines: 32(GETNEXT)
+|  |
+|  33:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF022[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,25 row-size=42B cardinality=2.35M
+|  |  in pipelines: 30(GETNEXT), 31(OPEN)
+|  |
+|  |--75:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.68KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=25 row-size=30B cardinality=1.49K
+|  |  |  in pipelines: 31(GETNEXT)
+|  |  |
+|  |  F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  31:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=25 row-size=30B cardinality=1.49K
+|  |     in pipelines: 31(GETNEXT)
+|  |
+|  30:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF018[bloom] -> tpcds_parquet.store_sales.ss_item_sk, RF022[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=24 row-size=12B cardinality=2.88M
+|     in pipelines: 30(GETNEXT)
+|
+74:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_quantity * cs_list_price)
+|  group by: c_last_name, c_first_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=20 row-size=52B cardinality=10.53K
+|  in pipelines: 74(GETNEXT), 57(OPEN)
+|
+73:EXCHANGE [HASH(c_last_name,c_first_name)]
+|  mem-estimate=345.95KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=20 row-size=52B cardinality=10.53K
+|  in pipelines: 57(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(itemdesc,i_item_sk,d_date)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=87.28MB mem-reservation=39.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+26:AGGREGATE [STREAMING]
+|  output: sum(CAST(cs_quantity AS DECIMAL(10,0)) * cs_list_price)
+|  group by: c_last_name, c_first_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=20 row-size=52B cardinality=10.53K
+|  in pipelines: 57(GETNEXT)
+|
+25:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: i_item_sk = cs_item_sk
+|  fk/pk conjuncts: i_item_sk = cs_item_sk
+|  runtime filters: RF000[bloom] <- cs_item_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=7,0,2,18,1 row-size=162B cardinality=10.53K
+|  in pipelines: 57(GETNEXT), 01(OPEN)
+|
+|--72:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.50MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,2,18,1 row-size=112B cardinality=10.53K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=7.22MB mem-reservation=2.88MB thread-reservation=1
+|  24:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: cs_bill_customer_sk = customer.c_customer_sk
+|  |  fk/pk conjuncts: cs_bill_customer_sk = customer.c_customer_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=0,2,18,1 row-size=112B cardinality=10.53K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--71:EXCHANGE [HASH(customer.c_customer_sk)]
+|  |  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=40B cardinality=100.00K
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  02:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=40B cardinality=100.00K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  70:EXCHANGE [HASH(cs_bill_customer_sk)]
+|  |  mem-estimate=498.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,2,18 row-size=72B cardinality=10.53K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=246.35MB mem-reservation=13.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  23:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  |  runtime filters: RF008[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,18 row-size=72B cardinality=10.53K
+|  |  in pipelines: 01(GETNEXT), 68(OPEN)
+|  |
+|  |--69:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=471.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=36B cardinality=10.00K
+|  |  |  in pipelines: 68(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=11.26MB mem-reservation=2.88MB thread-reservation=1
+|  |  68:AGGREGATE [FINALIZE]
+|  |  |  output: sum:merge(ss_quantity * ss_sales_price), max:merge(tpcds_cmax)
+|  |  |  group by: c_customer_sk
+|  |  |  having: sum(ss_quantity * ss_sales_price) > CAST(0.500000 AS DECIMAL(10,6)) * max(tpcds_cmax)
+|  |  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=18 row-size=36B cardinality=10.00K
+|  |  |  in pipelines: 68(GETNEXT), 10(OPEN)
+|  |  |
+|  |  67:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=1.26MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=36B cardinality=100.00K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=60.34MB mem-reservation=7.94MB thread-reservation=2
+|  |  21:AGGREGATE [STREAMING]
+|  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price), max(max(csales))
+|  |  |  group by: c_customer_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=18 row-size=36B cardinality=100.00K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  20:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  |  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9,10,16 row-size=32B cardinality=2.88M
+|  |  |  in pipelines: 10(GETNEXT), 65(OPEN)
+|  |  |
+|  |  |--66:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=16 row-size=16B cardinality=1
+|  |  |  |  in pipelines: 65(GETNEXT)
+|  |  |  |
+|  |  |  F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  |  65:AGGREGATE [FINALIZE]
+|  |  |  |  output: max:merge(csales)
+|  |  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  tuple-ids=16 row-size=16B cardinality=1
+|  |  |  |  in pipelines: 65(GETNEXT), 18(OPEN)
+|  |  |  |
+|  |  |  64:EXCHANGE [UNPARTITIONED]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=16 row-size=16B cardinality=1
+|  |  |  |  in pipelines: 18(GETNEXT)
+|  |  |  |
+|  |  |  F11:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  18:AGGREGATE
+|  |  |  |  output: max(sum(ss_quantity * ss_sales_price))
+|  |  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  tuple-ids=16 row-size=16B cardinality=1
+|  |  |  |  in pipelines: 18(GETNEXT), 63(OPEN)
+|  |  |  |
+|  |  |  63:AGGREGATE [FINALIZE]
+|  |  |  |  output: sum:merge(ss_quantity * ss_sales_price)
+|  |  |  |  group by: c_customer_sk
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=14 row-size=20B cardinality=100.00K
+|  |  |  |  in pipelines: 63(GETNEXT), 12(OPEN)
+|  |  |  |
+|  |  |  62:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  |  mem-estimate=723.04KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=14 row-size=20B cardinality=100.00K
+|  |  |  |  in pipelines: 12(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=63.29MB mem-reservation=8.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  |  17:AGGREGATE [STREAMING]
+|  |  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  |  |  group by: c_customer_sk
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=14 row-size=20B cardinality=100.00K
+|  |  |  |  in pipelines: 12(GETNEXT)
+|  |  |  |
+|  |  |  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=11,13,12 row-size=28B cardinality=2.35M
+|  |  |  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |  |  |
+|  |  |  |--61:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=12 row-size=4B cardinality=100.00K
+|  |  |  |  |  in pipelines: 13(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  13:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=12 row-size=4B cardinality=100.00K
+|  |  |  |     in pipelines: 13(GETNEXT)
+|  |  |  |
+|  |  |  15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=11,13 row-size=24B cardinality=2.35M
+|  |  |  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |  |  |
+|  |  |  |--60:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=23.65KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=13 row-size=8B cardinality=1.49K
+|  |  |  |  |  in pipelines: 14(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  |  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=13 row-size=8B cardinality=1.49K
+|  |  |  |     in pipelines: 14(GETNEXT)
+|  |  |  |
+|  |  |  12:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     runtime filters: RF016[bloom] -> ss_sold_date_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=11 row-size=16B cardinality=2.88M
+|  |  |     in pipelines: 12(GETNEXT)
+|  |  |
+|  |  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=9,10 row-size=16B cardinality=2.88M
+|  |  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |  |
+|  |  |--59:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=10 row-size=4B cardinality=100.00K
+|  |  |  |  in pipelines: 11(GETNEXT)
+|  |  |  |
+|  |  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  11:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=10 row-size=4B cardinality=100.00K
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  10:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=9 row-size=12B cardinality=2.88M
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2 row-size=36B cardinality=85.31K
+|  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |
+|  |--58:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=12B cardinality=108
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=12B cardinality=108
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF010[bloom] -> cs_sold_date_sk, RF008[bloom] -> cs_bill_customer_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=240.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=0 row-size=24B cardinality=1.44M
+|     in pipelines: 01(GETNEXT)
+|
+57:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: itemdesc, i_item_sk, d_date
+|  having: count(*) > CAST(4 AS BIGINT)
+|  mem-estimate=61.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=50B cardinality=235.45K
+|  in pipelines: 57(GETNEXT), 04(OPEN)
+|
+56:EXCHANGE [HASH(itemdesc,i_item_sk,d_date)]
+|  mem-estimate=10.16MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=50B cardinality=2.35M
+|  in pipelines: 04(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=88.70MB mem-reservation=43.19MB thread-reservation=2 runtime-filters-memory=2.00MB
+09:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: substring(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), tpcds_parquet.item.i_item_sk, d_date
+|  mem-estimate=61.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=50B cardinality=2.35M
+|  in pipelines: 04(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  fk/pk conjuncts: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=3,4,5 row-size=162B cardinality=2.35M
+|  in pipelines: 04(GETNEXT), 06(OPEN)
+|
+|--55:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.19MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=120B cardinality=18.00K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  06:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=5 row-size=120B cardinality=18.00K
+|     in pipelines: 06(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,4 row-size=42B cardinality=2.35M
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--54:EXCHANGE [BROADCAST]
+|  |  mem-estimate=77.68KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=30B cardinality=1.49K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=4 row-size=30B cardinality=1.49K
+|     in pipelines: 05(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_item_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=3 row-size=12B cardinality=2.88M
+   in pipelines: 04(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=402.19MB Threads=64
+Per-Host Resource Estimates: Memory=1.16GB
+F35:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=18.09KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+96:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_last_name ASC, c_first_name ASC, sales ASC
+|  limit: 100
+|  mem-estimate=18.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=44 row-size=52B cardinality=100
+|  in pipelines: 53(GETNEXT)
+|
+F34:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=10.35MB mem-reservation=1.94MB thread-reservation=1
+53:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, c_first_name ASC, sales ASC
+|  mem-estimate=5.08KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=44 row-size=52B cardinality=100
+|  in pipelines: 53(GETNEXT), 74(OPEN), 95(OPEN)
+|
+00:UNION
+|  pass-through-operands: all
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=42 row-size=52B cardinality=20.15K
+|  in pipelines: 74(GETNEXT), 95(GETNEXT)
+|
+|--95:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_quantity * ws_list_price)
+|  |  group by: c_last_name, c_first_name
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=41 row-size=52B cardinality=9.63K
+|  |  in pipelines: 95(GETNEXT), 78(OPEN)
+|  |
+|  94:EXCHANGE [HASH(c_last_name,c_first_name)]
+|  |  mem-estimate=356.17KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=41 row-size=52B cardinality=9.63K
+|  |  in pipelines: 78(GETNEXT)
+|  |
+|  F20:PLAN FRAGMENT [HASH(itemdesc,i_item_sk,d_date)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=112.94MB mem-reservation=36.00MB thread-reservation=1
+|  52:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(ws_quantity AS DECIMAL(10,0)) * ws_list_price)
+|  |  group by: c_last_name, c_first_name
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=41 row-size=52B cardinality=9.63K
+|  |  in pipelines: 78(GETNEXT)
+|  |
+|  51:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=10
+|  |  hash predicates: i_item_sk = ws_item_sk
+|  |  fk/pk conjuncts: i_item_sk = ws_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=28,21,23,39,22 row-size=162B cardinality=9.63K
+|  |  in pipelines: 78(GETNEXT), 27(OPEN)
+|  |
+|  |--F46:PLAN FRAGMENT [HASH(itemdesc,i_item_sk,d_date)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=8.03MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=10 plan-id=11 cohort-id=05
+|  |  |  build expressions: ws_item_sk
+|  |  |  runtime filters: RF018[bloom] <- ws_item_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  93:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.28MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21,23,39,22 row-size=112B cardinality=9.63K
+|  |  |  in pipelines: 27(GETNEXT)
+|  |  |
+|  |  F32:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=506.41KB mem-reservation=0B thread-reservation=1
+|  |  50:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash-table-id=11
+|  |  |  hash predicates: ws_bill_customer_sk = customer.c_customer_sk
+|  |  |  fk/pk conjuncts: ws_bill_customer_sk = customer.c_customer_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=21,23,39,22 row-size=112B cardinality=9.63K
+|  |  |  in pipelines: 27(GETNEXT), 28(OPEN)
+|  |  |
+|  |  |--F47:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  |  |  |  Per-Instance Resources: mem-estimate=6.73MB mem-reservation=2.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=11 plan-id=12 cohort-id=06
+|  |  |  |  build expressions: customer.c_customer_sk
+|  |  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |
+|  |  |  92:EXCHANGE [HASH(customer.c_customer_sk)]
+|  |  |  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=40B cardinality=100.00K
+|  |  |  |  in pipelines: 28(GETNEXT)
+|  |  |  |
+|  |  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |  28:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |  |     tuple-ids=22 row-size=40B cardinality=100.00K
+|  |  |     in pipelines: 28(GETNEXT)
+|  |  |
+|  |  91:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  |  mem-estimate=506.41KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21,23,39 row-size=72B cardinality=9.63K
+|  |  |  in pipelines: 27(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  |  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  49:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=12
+|  |  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  |  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=21,23,39 row-size=72B cardinality=9.63K
+|  |  |  in pipelines: 27(GETNEXT), 89(OPEN)
+|  |  |
+|  |  |--F48:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  Per-Instance Resources: mem-estimate=5.45MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=12 plan-id=13 cohort-id=06
+|  |  |  |  build expressions: c_customer_sk
+|  |  |  |  runtime filters: RF026[bloom] <- c_customer_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  90:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=591.56KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=39 row-size=36B cardinality=10.00K
+|  |  |  |  in pipelines: 89(GETNEXT)
+|  |  |  |
+|  |  |  F30:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=11.38MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  89:AGGREGATE [FINALIZE]
+|  |  |  |  output: sum:merge(ss_quantity * ss_sales_price), max:merge(tpcds_cmax)
+|  |  |  |  group by: c_customer_sk
+|  |  |  |  having: sum(ss_quantity * ss_sales_price) > CAST(0.500000 AS DECIMAL(10,6)) * max(tpcds_cmax)
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=39 row-size=36B cardinality=10.00K
+|  |  |  |  in pipelines: 89(GETNEXT), 36(OPEN)
+|  |  |  |
+|  |  |  88:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  |  mem-estimate=1.38MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=39 row-size=36B cardinality=100.00K
+|  |  |  |  in pipelines: 36(GETNEXT)
+|  |  |  |
+|  |  |  F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+|  |  |  47:AGGREGATE [STREAMING]
+|  |  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price), max(max(csales))
+|  |  |  |  group by: c_customer_sk
+|  |  |  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  |  tuple-ids=39 row-size=36B cardinality=100.00K
+|  |  |  |  in pipelines: 36(GETNEXT)
+|  |  |  |
+|  |  |  46:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  |  |  |  join table id: 13
+|  |  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=30,31,37 row-size=32B cardinality=2.88M
+|  |  |  |  in pipelines: 36(GETNEXT), 86(OPEN)
+|  |  |  |
+|  |  |  |--F49:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=13 plan-id=14 cohort-id=07
+|  |  |  |  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  |  |  |
+|  |  |  |  87:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=37 row-size=16B cardinality=1
+|  |  |  |  |  in pipelines: 86(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F29:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  |  |  86:AGGREGATE [FINALIZE]
+|  |  |  |  |  output: max:merge(csales)
+|  |  |  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  |  tuple-ids=37 row-size=16B cardinality=1
+|  |  |  |  |  in pipelines: 86(GETNEXT), 44(OPEN)
+|  |  |  |  |
+|  |  |  |  85:EXCHANGE [UNPARTITIONED]
+|  |  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=37 row-size=16B cardinality=1
+|  |  |  |  |  in pipelines: 44(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F28:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=6
+|  |  |  |  Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  |  44:AGGREGATE
+|  |  |  |  |  output: max(sum(ss_quantity * ss_sales_price))
+|  |  |  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  |  tuple-ids=37 row-size=16B cardinality=1
+|  |  |  |  |  in pipelines: 44(GETNEXT), 84(OPEN)
+|  |  |  |  |
+|  |  |  |  84:AGGREGATE [FINALIZE]
+|  |  |  |  |  output: sum:merge(ss_quantity * ss_sales_price)
+|  |  |  |  |  group by: c_customer_sk
+|  |  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=35 row-size=20B cardinality=100.00K
+|  |  |  |  |  in pipelines: 84(GETNEXT), 38(OPEN)
+|  |  |  |  |
+|  |  |  |  83:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  |  |  mem-estimate=795.04KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=35 row-size=20B cardinality=100.00K
+|  |  |  |  |  in pipelines: 38(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  |  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  |  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |  |  43:AGGREGATE [STREAMING]
+|  |  |  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  |  |  |  group by: c_customer_sk
+|  |  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=35 row-size=20B cardinality=100.00K
+|  |  |  |  |  in pipelines: 38(GETNEXT)
+|  |  |  |  |
+|  |  |  |  42:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  |  hash-table-id=14
+|  |  |  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=32,34,33 row-size=28B cardinality=2.35M
+|  |  |  |  |  in pipelines: 38(GETNEXT), 39(OPEN)
+|  |  |  |  |
+|  |  |  |  |--F50:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  |  Per-Instance Resources: mem-estimate=4.26MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  |  JOIN BUILD
+|  |  |  |  |  |  join-table-id=14 plan-id=15 cohort-id=08
+|  |  |  |  |  |  build expressions: c_customer_sk
+|  |  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |
+|  |  |  |  |  82:EXCHANGE [BROADCAST]
+|  |  |  |  |  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  |  tuple-ids=33 row-size=4B cardinality=100.00K
+|  |  |  |  |  |  in pipelines: 39(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  F27:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |  39:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |  |     tuple-ids=33 row-size=4B cardinality=100.00K
+|  |  |  |  |     in pipelines: 39(GETNEXT)
+|  |  |  |  |
+|  |  |  |  41:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  |  hash-table-id=15
+|  |  |  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=32,34 row-size=24B cardinality=2.35M
+|  |  |  |  |  in pipelines: 38(GETNEXT), 40(OPEN)
+|  |  |  |  |
+|  |  |  |  |--F51:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  |  |  JOIN BUILD
+|  |  |  |  |  |  join-table-id=15 plan-id=16 cohort-id=08
+|  |  |  |  |  |  build expressions: d_date_sk
+|  |  |  |  |  |  runtime filters: RF034[bloom] <- d_date_sk
+|  |  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |
+|  |  |  |  |  81:EXCHANGE [BROADCAST]
+|  |  |  |  |  |  mem-estimate=23.65KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  |  tuple-ids=34 row-size=8B cardinality=1.49K
+|  |  |  |  |  |  in pipelines: 40(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |  40:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |  |     tuple-ids=34 row-size=8B cardinality=1.49K
+|  |  |  |  |     in pipelines: 40(GETNEXT)
+|  |  |  |  |
+|  |  |  |  38:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |  |     runtime filters: RF034[bloom] -> ss_sold_date_sk
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=2.88M size=201.02MB
+|  |  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |  |  |     tuple-ids=32 row-size=16B cardinality=2.88M
+|  |  |  |     in pipelines: 38(GETNEXT)
+|  |  |  |
+|  |  |  45:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=16
+|  |  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=30,31 row-size=16B cardinality=2.88M
+|  |  |  |  in pipelines: 36(GETNEXT), 37(OPEN)
+|  |  |  |
+|  |  |  |--F52:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=4.26MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=16 plan-id=17 cohort-id=07
+|  |  |  |  |  build expressions: c_customer_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  80:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=31 row-size=4B cardinality=100.00K
+|  |  |  |  |  in pipelines: 37(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F24:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  37:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=31 row-size=4B cardinality=100.00K
+|  |  |  |     in pipelines: 37(GETNEXT)
+|  |  |  |
+|  |  |  36:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |  |     tuple-ids=30 row-size=12B cardinality=2.88M
+|  |  |     in pipelines: 36(GETNEXT)
+|  |  |
+|  |  48:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=17
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=21,23 row-size=36B cardinality=42.85K
+|  |  |  in pipelines: 27(GETNEXT), 29(OPEN)
+|  |  |
+|  |  |--F53:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=17 plan-id=18 cohort-id=06
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  runtime filters: RF028[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  79:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=23 row-size=12B cardinality=108
+|  |  |  |  in pipelines: 29(GETNEXT)
+|  |  |  |
+|  |  |  F22:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  29:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=23 row-size=12B cardinality=108
+|  |  |     in pipelines: 29(GETNEXT)
+|  |  |
+|  |  27:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF028[bloom] -> ws_sold_date_sk, RF026[bloom] -> ws_bill_customer_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=21 row-size=24B cardinality=719.38K
+|  |     in pipelines: 27(GETNEXT)
+|  |
+|  78:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  group by: itemdesc, i_item_sk, d_date
+|  |  having: count(*) > CAST(4 AS BIGINT)
+|  |  mem-estimate=92.63MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=235.45K
+|  |  in pipelines: 78(GETNEXT), 30(OPEN)
+|  |
+|  77:EXCHANGE [HASH(itemdesc,i_item_sk,d_date)]
+|  |  mem-estimate=10.32MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=2.35M
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=50.00MB mem-reservation=34.50MB thread-reservation=1
+|  35:AGGREGATE [STREAMING]
+|  |  output: count(*)
+|  |  group by: substring(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), tpcds_parquet.item.i_item_sk, d_date
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=2.35M
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  34:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=18
+|  |  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=24,25,26 row-size=162B cardinality=2.35M
+|  |  in pipelines: 30(GETNEXT), 32(OPEN)
+|  |
+|  |--F54:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=11.69MB mem-reservation=9.50MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=18 plan-id=19 cohort-id=05
+|  |  |  build expressions: tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |  |
+|  |  76:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=2.19MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=26 row-size=120B cardinality=18.00K
+|  |  |  in pipelines: 32(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  32:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF018[bloom] -> tpcds_parquet.item.i_item_sk
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=26 row-size=120B cardinality=18.00K
+|  |     in pipelines: 32(GETNEXT)
+|  |
+|  33:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=19
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,25 row-size=42B cardinality=2.35M
+|  |  in pipelines: 30(GETNEXT), 31(OPEN)
+|  |
+|  |--F55:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=19 plan-id=20 cohort-id=05
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF022[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  75:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.68KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=25 row-size=30B cardinality=1.49K
+|  |  |  in pipelines: 31(GETNEXT)
+|  |  |
+|  |  F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  31:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=25 row-size=30B cardinality=1.49K
+|  |     in pipelines: 31(GETNEXT)
+|  |
+|  30:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF018[bloom] -> tpcds_parquet.store_sales.ss_item_sk, RF022[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=24 row-size=12B cardinality=2.88M
+|     in pipelines: 30(GETNEXT)
+|
+74:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_quantity * cs_list_price)
+|  group by: c_last_name, c_first_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=20 row-size=52B cardinality=10.53K
+|  in pipelines: 74(GETNEXT), 57(OPEN)
+|
+73:EXCHANGE [HASH(c_last_name,c_first_name)]
+|  mem-estimate=345.95KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=20 row-size=52B cardinality=10.53K
+|  in pipelines: 57(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(itemdesc,i_item_sk,d_date)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=82.07MB mem-reservation=36.00MB thread-reservation=1
+26:AGGREGATE [STREAMING]
+|  output: sum(CAST(cs_quantity AS DECIMAL(10,0)) * cs_list_price)
+|  group by: c_last_name, c_first_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=20 row-size=52B cardinality=10.53K
+|  in pipelines: 57(GETNEXT)
+|
+25:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: i_item_sk = cs_item_sk
+|  fk/pk conjuncts: i_item_sk = cs_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=7,0,2,18,1 row-size=162B cardinality=10.53K
+|  in pipelines: 57(GETNEXT), 01(OPEN)
+|
+|--F36:PLAN FRAGMENT [HASH(itemdesc,i_item_sk,d_date)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=8.25MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: cs_item_sk
+|  |  runtime filters: RF000[bloom] <- cs_item_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  72:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.50MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,2,18,1 row-size=112B cardinality=10.53K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=498.70KB mem-reservation=0B thread-reservation=1
+|  24:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: cs_bill_customer_sk = customer.c_customer_sk
+|  |  fk/pk conjuncts: cs_bill_customer_sk = customer.c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=0,2,18,1 row-size=112B cardinality=10.53K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--F37:PLAN FRAGMENT [HASH(cs_bill_customer_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=6.73MB mem-reservation=2.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: customer.c_customer_sk
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  71:EXCHANGE [HASH(customer.c_customer_sk)]
+|  |  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=40B cardinality=100.00K
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  02:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=1 row-size=40B cardinality=100.00K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  70:EXCHANGE [HASH(cs_bill_customer_sk)]
+|  |  mem-estimate=498.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,2,18 row-size=72B cardinality=10.53K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+|  23:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: cs_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: cs_bill_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,18 row-size=72B cardinality=10.53K
+|  |  in pipelines: 01(GETNEXT), 68(OPEN)
+|  |
+|  |--F38:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=5.45MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF008[bloom] <- c_customer_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  69:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=591.56KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=36B cardinality=10.00K
+|  |  |  in pipelines: 68(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=11.38MB mem-reservation=1.94MB thread-reservation=1
+|  |  68:AGGREGATE [FINALIZE]
+|  |  |  output: sum:merge(ss_quantity * ss_sales_price), max:merge(tpcds_cmax)
+|  |  |  group by: c_customer_sk
+|  |  |  having: sum(ss_quantity * ss_sales_price) > CAST(0.500000 AS DECIMAL(10,6)) * max(tpcds_cmax)
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=18 row-size=36B cardinality=10.00K
+|  |  |  in pipelines: 68(GETNEXT), 10(OPEN)
+|  |  |
+|  |  67:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=1.38MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=36B cardinality=100.00K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+|  |  21:AGGREGATE [STREAMING]
+|  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price), max(max(csales))
+|  |  |  group by: c_customer_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=18 row-size=36B cardinality=100.00K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  20:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  |  |  join table id: 03
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9,10,16 row-size=32B cardinality=2.88M
+|  |  |  in pipelines: 10(GETNEXT), 65(OPEN)
+|  |  |
+|  |  |--F39:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=03 plan-id=04 cohort-id=03
+|  |  |  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |  |  |
+|  |  |  66:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=16 row-size=16B cardinality=1
+|  |  |  |  in pipelines: 65(GETNEXT)
+|  |  |  |
+|  |  |  F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  |  65:AGGREGATE [FINALIZE]
+|  |  |  |  output: max:merge(csales)
+|  |  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  tuple-ids=16 row-size=16B cardinality=1
+|  |  |  |  in pipelines: 65(GETNEXT), 18(OPEN)
+|  |  |  |
+|  |  |  64:EXCHANGE [UNPARTITIONED]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=16 row-size=16B cardinality=1
+|  |  |  |  in pipelines: 18(GETNEXT)
+|  |  |  |
+|  |  |  F11:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  18:AGGREGATE
+|  |  |  |  output: max(sum(ss_quantity * ss_sales_price))
+|  |  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  |  tuple-ids=16 row-size=16B cardinality=1
+|  |  |  |  in pipelines: 18(GETNEXT), 63(OPEN)
+|  |  |  |
+|  |  |  63:AGGREGATE [FINALIZE]
+|  |  |  |  output: sum:merge(ss_quantity * ss_sales_price)
+|  |  |  |  group by: c_customer_sk
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=14 row-size=20B cardinality=100.00K
+|  |  |  |  in pipelines: 63(GETNEXT), 12(OPEN)
+|  |  |  |
+|  |  |  62:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  |  mem-estimate=795.04KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=14 row-size=20B cardinality=100.00K
+|  |  |  |  in pipelines: 12(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |  17:AGGREGATE [STREAMING]
+|  |  |  |  output: sum(CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price)
+|  |  |  |  group by: c_customer_sk
+|  |  |  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=14 row-size=20B cardinality=100.00K
+|  |  |  |  in pipelines: 12(GETNEXT)
+|  |  |  |
+|  |  |  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=04
+|  |  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=11,13,12 row-size=28B cardinality=2.35M
+|  |  |  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |  |  |
+|  |  |  |--F40:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=4.26MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=04 plan-id=05 cohort-id=04
+|  |  |  |  |  build expressions: c_customer_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  61:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=12 row-size=4B cardinality=100.00K
+|  |  |  |  |  in pipelines: 13(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  13:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=12 row-size=4B cardinality=100.00K
+|  |  |  |     in pipelines: 13(GETNEXT)
+|  |  |  |
+|  |  |  15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=05
+|  |  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=11,13 row-size=24B cardinality=2.35M
+|  |  |  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |  |  |
+|  |  |  |--F41:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=05 plan-id=06 cohort-id=04
+|  |  |  |  |  build expressions: d_date_sk
+|  |  |  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  60:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=23.65KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=13 row-size=8B cardinality=1.49K
+|  |  |  |  |  in pipelines: 14(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|  |  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |  |     tuple-ids=13 row-size=8B cardinality=1.49K
+|  |  |  |     in pipelines: 14(GETNEXT)
+|  |  |  |
+|  |  |  12:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     runtime filters: RF016[bloom] -> ss_sold_date_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |  |     tuple-ids=11 row-size=16B cardinality=2.88M
+|  |  |     in pipelines: 12(GETNEXT)
+|  |  |
+|  |  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=06
+|  |  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=9,10 row-size=16B cardinality=2.88M
+|  |  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |  |
+|  |  |--F42:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=4.26MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=06 plan-id=07 cohort-id=03
+|  |  |  |  build expressions: c_customer_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  59:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=398.62KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=10 row-size=4B cardinality=100.00K
+|  |  |  |  in pipelines: 11(GETNEXT)
+|  |  |  |
+|  |  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  11:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=10 row-size=4B cardinality=100.00K
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  10:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=9 row-size=12B cardinality=2.88M
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=07
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2 row-size=36B cardinality=85.31K
+|  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |
+|  |--F43:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  58:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=12B cardinality=108
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(2 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=2 row-size=12B cardinality=108
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF010[bloom] -> cs_sold_date_sk, RF008[bloom] -> cs_bill_customer_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=0 row-size=24B cardinality=1.44M
+|     in pipelines: 01(GETNEXT)
+|
+57:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: itemdesc, i_item_sk, d_date
+|  having: count(*) > CAST(4 AS BIGINT)
+|  mem-estimate=61.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=50B cardinality=235.45K
+|  in pipelines: 57(GETNEXT), 04(OPEN)
+|
+56:EXCHANGE [HASH(itemdesc,i_item_sk,d_date)]
+|  mem-estimate=10.32MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=50B cardinality=2.35M
+|  in pipelines: 04(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=50.00MB mem-reservation=34.50MB thread-reservation=1
+09:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: substring(i_item_desc, CAST(1 AS BIGINT), CAST(30 AS BIGINT)), tpcds_parquet.item.i_item_sk, d_date
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=50B cardinality=2.35M
+|  in pipelines: 04(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=08
+|  hash predicates: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  fk/pk conjuncts: ss_item_sk = tpcds_parquet.item.i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=3,4,5 row-size=162B cardinality=2.35M
+|  in pipelines: 04(GETNEXT), 06(OPEN)
+|
+|--F44:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=11.69MB mem-reservation=9.50MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=08 plan-id=09 cohort-id=01
+|  |  build expressions: tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  55:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.19MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=120B cardinality=18.00K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  06:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=5 row-size=120B cardinality=18.00K
+|     in pipelines: 06(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=09
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,4 row-size=42B cardinality=2.35M
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--F45:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  54:EXCHANGE [BROADCAST]
+|  |  mem-estimate=77.68KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=30B cardinality=1.49K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|     parquet dictionary predicates: d_year IN (CAST(2000 AS INT), CAST(2001 AS INT), CAST(2002 AS INT), CAST(2003 AS INT))
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=4 row-size=30B cardinality=1.49K
+|     in pipelines: 05(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_item_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+   tuple-ids=3 row-size=12B cardinality=2.88M
+   in pipelines: 04(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24a.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24a.test
new file mode 100644
index 0000000..c887c2e
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24a.test
@@ -0,0 +1,1254 @@
+# TPCDS-Q24-1 first of two queries
+WITH ssales AS
+  (SELECT c_last_name,
+          c_first_name,
+          s_store_name,
+          ca_state,
+          s_state,
+          i_color,
+          i_current_price,
+          i_manager_id,
+          i_units,
+          i_size,
+          sum(ss_net_paid) netpaid
+   FROM store_sales,
+        store_returns,
+        store,
+        item,
+        customer,
+        customer_address
+   WHERE ss_ticket_number = sr_ticket_number
+     AND ss_item_sk = sr_item_sk
+     AND ss_customer_sk = c_customer_sk
+     AND ss_item_sk = i_item_sk
+     AND ss_store_sk = s_store_sk
+     AND c_current_addr_sk = ca_address_sk
+     AND c_birth_country <> upper(ca_country)
+     AND s_zip = ca_zip
+     AND s_market_id=8
+   GROUP BY c_last_name,
+            c_first_name,
+            s_store_name,
+            ca_state,
+            s_state,
+            i_color,
+            i_current_price,
+            i_manager_id,
+            i_units,
+            i_size)
+SELECT c_last_name,
+       c_first_name,
+       s_store_name,
+       sum(netpaid) paid
+FROM ssales
+WHERE i_color = 'peach'
+GROUP BY c_last_name,
+         c_first_name,
+         s_store_name
+HAVING sum(netpaid) >
+  (SELECT 0.05*avg(netpaid)
+   FROM ssales)
+ORDER BY c_last_name,
+         c_first_name,
+         s_store_name ;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=91.81MB Threads=13
+Per-Host Resource Estimates: Memory=936MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=936.44MB mem-reservation=91.81MB thread-reservation=13 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: $c$1, $c$2, $c$3, $c$4
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:SORT
+|  order by: $c$1 ASC, $c$2 ASC, $c$3 ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21 row-size=68B cardinality=7.69K
+|  in pipelines: 27(GETNEXT), 12(OPEN)
+|
+26:NESTED LOOP JOIN [INNER JOIN]
+|  predicates: sum(netpaid) > CAST(0.05 AS DECIMAL(2,2)) * avg(netpaid)
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8,19 row-size=84B cardinality=7.69K
+|  in pipelines: 12(GETNEXT), 25(OPEN)
+|
+|--25:AGGREGATE [FINALIZE]
+|  |  output: avg(sum(ss_net_paid))
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=19 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 24(OPEN)
+|  |
+|  24:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_net_paid)
+|  |  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  |  mem-estimate=114.18MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 24(GETNEXT), 13(OPEN)
+|  |
+|  23:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk, s_zip = ca_zip
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  other predicates: c_birth_country != upper(ca_country)
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14,15 row-size=290B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 18(OPEN)
+|  |
+|  |--18:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=15 row-size=60B cardinality=50.00K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14 row-size=230B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 17(OPEN)
+|  |
+|  |--17:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=14 row-size=65B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13 row-size=165B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 16(OPEN)
+|  |
+|  |--16:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=66B cardinality=18.00K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  runtime filters: RF022[bloom] <- sr_item_sk, RF023[bloom] <- sr_ticket_number
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11 row-size=99B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |
+|  |--14:SCAN HDFS [tpcds_parquet.store_returns]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=16B cardinality=287.51K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF026[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,12 row-size=83B cardinality=960.13K
+|  |  in pipelines: 13(GETNEXT), 15(OPEN)
+|  |
+|  |--15:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_market_id = CAST(8 AS INT)
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|  |     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|  |     mem-estimate=80.00MB mem-reservation=40.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=55B cardinality=2
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF026[bloom] -> ss_store_sk, RF022[bloom] -> ss_item_sk, RF023[bloom] -> ss_ticket_number
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=28B cardinality=2.88M
+|     in pipelines: 13(GETNEXT)
+|
+12:AGGREGATE [FINALIZE]
+|  output: sum(sum(ss_net_paid))
+|  group by: c_last_name, c_first_name, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 12(GETNEXT), 11(OPEN)
+|
+11:AGGREGATE [FINALIZE]
+|  output: sum(ss_net_paid)
+|  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 11(GETNEXT), 05(OPEN)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: ca_address_sk = c_current_addr_sk, ca_zip = s_zip
+|  fk/pk conjuncts: ca_address_sk = c_current_addr_sk
+|  other predicates: c_birth_country != upper(ca_country)
+|  runtime filters: RF000[bloom] <- c_current_addr_sk, RF001[bloom] <- s_zip
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,4,1,0,3,2 row-size=290B cardinality=7.69K
+|  in pipelines: 05(GETNEXT), 04(OPEN)
+|
+|--09:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = ss_customer_sk
+|  |  fk/pk conjuncts: c_customer_sk = ss_customer_sk
+|  |  runtime filters: RF004[bloom] <- ss_customer_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,1,0,3,2 row-size=230B cardinality=7.69K
+|  |  in pipelines: 04(GETNEXT), 01(OPEN)
+|  |
+|  |--08:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  fk/pk conjuncts: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  runtime filters: RF006[bloom] <- ss_item_sk, RF007[bloom] <- ss_ticket_number
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=1,0,3,2 row-size=165B cardinality=7.69K
+|  |  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--07:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_store_sk = s_store_sk
+|  |  |  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  |  |  runtime filters: RF010[bloom] <- s_store_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=0,3,2 row-size=149B cardinality=10.46K
+|  |  |  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |  |  |
+|  |  |  |--02:SCAN HDFS [tpcds_parquet.store]
+|  |  |  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |  |  |     predicates: s_market_id = CAST(8 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=12 size=9.93KB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |  |  |     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|  |  |  |     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|  |  |  |     mem-estimate=80.00MB mem-reservation=40.00KB thread-reservation=1
+|  |  |  |     tuple-ids=2 row-size=55B cardinality=2
+|  |  |  |     in pipelines: 02(GETNEXT)
+|  |  |  |
+|  |  |  06:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  |  runtime filters: RF012[bloom] <- i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=0,3 row-size=94B cardinality=31.36K
+|  |  |  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |  |  |
+|  |  |  |--03:SCAN HDFS [tpcds_parquet.item]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     predicates: tpcds_parquet.item.i_color = 'peach'
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     parquet statistics predicates: tpcds_parquet.item.i_color = 'peach'
+|  |  |  |     parquet dictionary predicates: tpcds_parquet.item.i_color = 'peach'
+|  |  |  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=3 row-size=66B cardinality=196
+|  |  |  |     in pipelines: 03(GETNEXT)
+|  |  |  |
+|  |  |  00:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     runtime filters: RF012[bloom] -> ss_item_sk, RF010[bloom] -> ss_store_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=0 row-size=28B cardinality=2.88M
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  01:SCAN HDFS [tpcds_parquet.store_returns]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     runtime filters: RF006[bloom] -> sr_item_sk, RF007[bloom] -> sr_ticket_number
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=16B cardinality=287.51K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  04:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF004[bloom] -> c_customer_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=4 row-size=65B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+05:SCAN HDFS [tpcds_parquet.customer_address]
+   HDFS partitions=1/1 files=1 size=1.16MB
+   runtime filters: RF000[bloom] -> ca_address_sk, RF001[bloom] -> ca_zip
+   stored statistics:
+     table: rows=50.00K size=1.16MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=50.00K
+   mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=5 row-size=60B cardinality=50.00K
+   in pipelines: 05(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=165.45MB Threads=32
+Per-Host Resource Estimates: Memory=1.14GB
+F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=387.40KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: $c$1, $c$2, $c$3, $c$4
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+50:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: $c$1 ASC, $c$2 ASC, $c$3 ASC
+|  mem-estimate=387.40KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=21 row-size=68B cardinality=7.69K
+|  in pipelines: 27(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=22.02MB mem-reservation=13.94MB thread-reservation=1
+27:SORT
+|  order by: $c$1 ASC, $c$2 ASC, $c$3 ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21 row-size=68B cardinality=7.69K
+|  in pipelines: 27(GETNEXT), 39(OPEN)
+|
+26:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  predicates: sum(netpaid) > CAST(0.05 AS DECIMAL(2,2)) * avg(netpaid)
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8,19 row-size=84B cardinality=7.69K
+|  in pipelines: 39(GETNEXT), 48(OPEN)
+|
+|--49:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=16B cardinality=1
+|  |  in pipelines: 48(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  48:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(netpaid)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=19 row-size=16B cardinality=1
+|  |  in pipelines: 48(GETNEXT), 25(OPEN)
+|  |
+|  47:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=67.55MB mem-reservation=34.00MB thread-reservation=1
+|  25:AGGREGATE
+|  |  output: avg(sum(ss_net_paid))
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=18 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 46(OPEN)
+|  |
+|  46:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_net_paid)
+|  |  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  |  mem-estimate=57.09MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 46(GETNEXT), 13(OPEN)
+|  |
+|  45:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)]
+|  |  mem-estimate=10.46MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=181.43MB mem-reservation=67.56MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  24:AGGREGATE [STREAMING]
+|  |  output: sum(ss_net_paid)
+|  |  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  |  mem-estimate=57.09MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  23:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk, s_zip = ca_zip
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  other predicates: c_birth_country != upper(ca_country)
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14,15 row-size=290B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 18(OPEN)
+|  |
+|  |--44:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=2.92MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=15 row-size=60B cardinality=50.00K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  18:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=15 row-size=60B cardinality=50.00K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14 row-size=230B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 17(OPEN)
+|  |
+|  |--43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=6.23MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=65B cardinality=100.00K
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  17:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=14 row-size=65B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13 row-size=165B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 16(OPEN)
+|  |
+|  |--42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.20MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=66B cardinality=18.00K
+|  |  |  in pipelines: 16(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  16:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=66B cardinality=18.00K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  runtime filters: RF022[bloom] <- sr_item_sk, RF023[bloom] <- sr_ticket_number
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11 row-size=99B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |
+|  |--41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=16B cardinality=287.51K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  14:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=16B cardinality=287.51K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF026[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,12 row-size=83B cardinality=960.13K
+|  |  in pipelines: 13(GETNEXT), 15(OPEN)
+|  |
+|  |--40:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=55B cardinality=2
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=80.00MB mem-reservation=40.00KB thread-reservation=2
+|  |  15:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_market_id = CAST(8 AS INT)
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|  |     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|  |     mem-estimate=80.00MB mem-reservation=40.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=55B cardinality=2
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF026[bloom] -> ss_store_sk, RF022[bloom] -> ss_item_sk, RF023[bloom] -> ss_ticket_number
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=28B cardinality=2.88M
+|     in pipelines: 13(GETNEXT)
+|
+39:AGGREGATE [FINALIZE]
+|  output: sum:merge(netpaid)
+|  group by: c_last_name, c_first_name, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 39(GETNEXT), 37(OPEN)
+|
+38:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name)]
+|  mem-estimate=387.40KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 37(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=20.84MB mem-reservation=3.94MB thread-reservation=1
+12:AGGREGATE [STREAMING]
+|  output: sum(sum(ss_net_paid))
+|  group by: c_last_name, c_first_name, s_store_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 37(GETNEXT)
+|
+37:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_net_paid)
+|  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 37(GETNEXT), 00(OPEN)
+|
+36:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)]
+|  mem-estimate=860.24KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(c_current_addr_sk,s_zip)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=18.15MB mem-reservation=5.94MB thread-reservation=1 runtime-filters-memory=2.00MB
+11:AGGREGATE [STREAMING]
+|  output: sum(ss_net_paid)
+|  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_current_addr_sk = ca_address_sk, s_zip = ca_zip
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  other predicates: c_birth_country != upper(ca_country)
+|  runtime filters: RF000[bloom] <- ca_address_sk, RF001[bloom] <- ca_zip
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1,4,5 row-size=290B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--35:EXCHANGE [HASH(ca_address_sk,ca_zip)]
+|  |  mem-estimate=2.92MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=60B cardinality=50.00K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=60B cardinality=50.00K
+|     in pipelines: 05(GETNEXT)
+|
+34:EXCHANGE [HASH(c_current_addr_sk,s_zip)]
+|  mem-estimate=1.29MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2,1,4 row-size=230B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=12.92MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF004[bloom] <- c_customer_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1,4 row-size=230B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--33:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=6.23MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=65B cardinality=100.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=81.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  04:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=4 row-size=65B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+32:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=956.98KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2,1 row-size=165B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.25MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  runtime filters: RF006[bloom] <- sr_item_sk, RF007[bloom] <- sr_ticket_number
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1 row-size=165B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--31:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=16B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+30:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  mem-estimate=991.19KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2 row-size=149B cardinality=10.46K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=88.92MB mem-reservation=12.88MB thread-reservation=2 runtime-filters-memory=5.00MB
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF010[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2 row-size=149B cardinality=10.46K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--29:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=55B cardinality=2
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=81.00MB mem-reservation=1.04MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_market_id = CAST(8 AS INT)
+|     runtime filters: RF001[bloom] -> s_zip
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|     mem-estimate=80.00MB mem-reservation=40.00KB thread-reservation=1
+|     tuple-ids=2 row-size=55B cardinality=2
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF012[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=94B cardinality=31.36K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--28:EXCHANGE [BROADCAST]
+|  |  mem-estimate=26.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=66B cardinality=196
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=97.00MB mem-reservation=1.25MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: tpcds_parquet.item.i_color = 'peach'
+|     runtime filters: RF006[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: tpcds_parquet.item.i_color = 'peach'
+|     parquet dictionary predicates: tpcds_parquet.item.i_color = 'peach'
+|     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=3 row-size=66B cardinality=196
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> ss_item_sk, RF010[bloom] -> ss_store_sk, RF006[bloom] -> ss_item_sk, RF007[bloom] -> ss_ticket_number, RF004[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=305.70MB Threads=42
+Per-Host Resource Estimates: Memory=667MB
+F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=604.05KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: $c$1, $c$2, $c$3, $c$4
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+50:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: $c$1 ASC, $c$2 ASC, $c$3 ASC
+|  mem-estimate=604.05KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=21 row-size=68B cardinality=7.69K
+|  in pipelines: 27(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=22.00MB mem-reservation=13.94MB thread-reservation=1
+27:SORT
+|  order by: $c$1 ASC, $c$2 ASC, $c$3 ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21 row-size=68B cardinality=7.69K
+|  in pipelines: 27(GETNEXT), 39(OPEN)
+|
+26:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  join table id: 00
+|  predicates: sum(netpaid) > CAST(0.05 AS DECIMAL(2,2)) * avg(netpaid)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8,19 row-size=84B cardinality=7.69K
+|  in pipelines: 39(GETNEXT), 48(OPEN)
+|
+|--F20:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |
+|  49:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=16B cardinality=1
+|  |  in pipelines: 48(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  48:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(netpaid)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=19 row-size=16B cardinality=1
+|  |  in pipelines: 48(GETNEXT), 25(OPEN)
+|  |
+|  47:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=44.93MB mem-reservation=34.00MB thread-reservation=1
+|  25:AGGREGATE
+|  |  output: avg(sum(ss_net_paid))
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=18 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 46(OPEN)
+|  |
+|  46:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_net_paid)
+|  |  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 46(GETNEXT), 13(OPEN)
+|  |
+|  45:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)]
+|  |  mem-estimate=10.93MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=50.00MB mem-reservation=38.00MB thread-reservation=1
+|  24:AGGREGATE [STREAMING]
+|  |  output: sum(ss_net_paid)
+|  |  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  23:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: c_current_addr_sk = ca_address_sk, s_zip = ca_zip
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  other predicates: c_birth_country != upper(ca_country)
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14,15 row-size=290B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 18(OPEN)
+|  |
+|  |--F21:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=12.42MB mem-reservation=9.50MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: ca_address_sk, ca_zip
+|  |  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |  |
+|  |  44:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=2.92MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=15 row-size=60B cardinality=50.00K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  18:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=15 row-size=60B cardinality=50.00K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14 row-size=230B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 17(OPEN)
+|  |
+|  |--F22:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=23.23MB mem-reservation=17.00MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: c_customer_sk
+|  |  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  |
+|  |  43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=6.23MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=65B cardinality=100.00K
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  17:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=14 row-size=65B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13 row-size=165B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 16(OPEN)
+|  |
+|  |--F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=6.95MB mem-reservation=5.75MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.20MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=66B cardinality=18.00K
+|  |  |  in pipelines: 16(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  16:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=13 row-size=66B cardinality=18.00K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11 row-size=99B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |
+|  |--F24:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=23.41MB mem-reservation=19.00MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: sr_item_sk, sr_ticket_number
+|  |  |  runtime filters: RF022[bloom] <- sr_item_sk, RF023[bloom] <- sr_ticket_number
+|  |  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  |
+|  |  41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=16B cardinality=287.51K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  14:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=11 row-size=16B cardinality=287.51K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,12 row-size=83B cardinality=960.13K
+|  |  in pipelines: 13(GETNEXT), 15(OPEN)
+|  |
+|  |--F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: s_store_sk
+|  |  |  runtime filters: RF026[bloom] <- s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  40:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=55B cardinality=2
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=40.00KB thread-reservation=1
+|  |  15:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_market_id = CAST(8 AS INT)
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|  |     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=40.00KB thread-reservation=0
+|  |     tuple-ids=12 row-size=55B cardinality=2
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF026[bloom] -> ss_store_sk, RF022[bloom] -> ss_item_sk, RF023[bloom] -> ss_ticket_number
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=10 row-size=28B cardinality=2.88M
+|     in pipelines: 13(GETNEXT)
+|
+39:AGGREGATE [FINALIZE]
+|  output: sum:merge(netpaid)
+|  group by: c_last_name, c_first_name, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 39(GETNEXT), 37(OPEN)
+|
+38:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name)]
+|  mem-estimate=604.05KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 37(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=21.30MB mem-reservation=3.94MB thread-reservation=1
+12:AGGREGATE [STREAMING]
+|  output: sum(sum(ss_net_paid))
+|  group by: c_last_name, c_first_name, s_store_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 37(GETNEXT)
+|
+37:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_net_paid)
+|  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 37(GETNEXT), 00(OPEN)
+|
+36:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)]
+|  mem-estimate=1.30MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(c_current_addr_sk,s_zip)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=12.03MB mem-reservation=2.00MB thread-reservation=1
+11:AGGREGATE [STREAMING]
+|  output: sum(ss_net_paid)
+|  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=06
+|  hash predicates: c_current_addr_sk = ca_address_sk, s_zip = ca_zip
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  other predicates: c_birth_country != upper(ca_country)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1,4,5 row-size=290B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--F26:PLAN FRAGMENT [HASH(c_current_addr_sk,s_zip)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=6.86MB mem-reservation=3.94MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: ca_address_sk, ca_zip
+|  |  runtime filters: RF000[bloom] <- ca_address_sk, RF001[bloom] <- ca_zip
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  35:EXCHANGE [HASH(ca_address_sk,ca_zip)]
+|  |  mem-estimate=2.92MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=60B cardinality=50.00K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=5 row-size=60B cardinality=50.00K
+|     in pipelines: 05(GETNEXT)
+|
+34:EXCHANGE [HASH(c_current_addr_sk,s_zip)]
+|  mem-estimate=2.03MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2,1,4 row-size=230B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=1.47MB mem-reservation=0B thread-reservation=1
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=07
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1,4 row-size=230B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F27:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=10.11MB mem-reservation=3.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=07 plan-id=08 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF004[bloom] <- c_customer_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  33:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=6.23MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=65B cardinality=100.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=4 row-size=65B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+32:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=1.47MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2,1 row-size=165B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=1.44MB mem-reservation=0B thread-reservation=1
+08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=08
+|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1 row-size=165B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F28:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=8.34MB mem-reservation=3.94MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=08 plan-id=09 cohort-id=01
+|  |  build expressions: sr_item_sk, sr_ticket_number
+|  |  runtime filters: RF006[bloom] <- sr_item_sk, RF007[bloom] <- sr_ticket_number
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  31:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=1 row-size=16B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+30:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  mem-estimate=1.44MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2 row-size=149B cardinality=10.46K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=09
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2 row-size=149B cardinality=10.46K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F29:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF010[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  29:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=55B cardinality=2
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=40.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_market_id = CAST(8 AS INT)
+|     runtime filters: RF001[bloom] -> s_zip
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|     mem-estimate=16.00MB mem-reservation=40.00KB thread-reservation=0
+|     tuple-ids=2 row-size=55B cardinality=2
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=10
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=94B cardinality=31.36K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F30:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF012[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  28:EXCHANGE [BROADCAST]
+|  |  mem-estimate=26.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=66B cardinality=196
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: tpcds_parquet.item.i_color = 'peach'
+|     runtime filters: RF006[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: tpcds_parquet.item.i_color = 'peach'
+|     parquet dictionary predicates: tpcds_parquet.item.i_color = 'peach'
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=3 row-size=66B cardinality=196
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> ss_item_sk, RF010[bloom] -> ss_store_sk, RF006[bloom] -> ss_item_sk, RF007[bloom] -> ss_ticket_number, RF004[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24b.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24b.test
new file mode 100644
index 0000000..475e922
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q24b.test
@@ -0,0 +1,1254 @@
+# TPCDS-Q24-2 second of two queries
+WITH ssales AS
+  (SELECT c_last_name,
+          c_first_name,
+          s_store_name,
+          ca_state,
+          s_state,
+          i_color,
+          i_current_price,
+          i_manager_id,
+          i_units,
+          i_size,
+          sum(ss_net_paid) netpaid
+   FROM store_sales,
+        store_returns,
+        store,
+        item,
+        customer,
+        customer_address
+   WHERE ss_ticket_number = sr_ticket_number
+     AND ss_item_sk = sr_item_sk
+     AND ss_customer_sk = c_customer_sk
+     AND ss_item_sk = i_item_sk
+     AND ss_store_sk = s_store_sk
+     AND c_current_addr_sk = ca_address_sk
+     AND c_birth_country <> upper(ca_country)
+     AND s_zip = ca_zip
+     AND s_market_id = 8
+   GROUP BY c_last_name,
+            c_first_name,
+            s_store_name,
+            ca_state,
+            s_state,
+            i_color,
+            i_current_price,
+            i_manager_id,
+            i_units,
+            i_size)
+SELECT c_last_name,
+       c_first_name,
+       s_store_name,
+       sum(netpaid) paid
+FROM ssales
+WHERE i_color = 'saddle'
+GROUP BY c_last_name,
+         c_first_name,
+         s_store_name
+HAVING sum(netpaid) >
+  (SELECT 0.05*avg(netpaid)
+   FROM ssales)
+ORDER BY c_last_name,
+         c_first_name,
+         s_store_name ;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=91.81MB Threads=13
+Per-Host Resource Estimates: Memory=936MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=936.44MB mem-reservation=91.81MB thread-reservation=13 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: $c$1, $c$2, $c$3, $c$4
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:SORT
+|  order by: $c$1 ASC, $c$2 ASC, $c$3 ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21 row-size=68B cardinality=7.69K
+|  in pipelines: 27(GETNEXT), 12(OPEN)
+|
+26:NESTED LOOP JOIN [INNER JOIN]
+|  predicates: sum(netpaid) > CAST(0.05 AS DECIMAL(2,2)) * avg(netpaid)
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8,19 row-size=84B cardinality=7.69K
+|  in pipelines: 12(GETNEXT), 25(OPEN)
+|
+|--25:AGGREGATE [FINALIZE]
+|  |  output: avg(sum(ss_net_paid))
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=19 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 24(OPEN)
+|  |
+|  24:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_net_paid)
+|  |  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  |  mem-estimate=114.18MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 24(GETNEXT), 13(OPEN)
+|  |
+|  23:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk, s_zip = ca_zip
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  other predicates: c_birth_country != upper(ca_country)
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14,15 row-size=290B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 18(OPEN)
+|  |
+|  |--18:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=15 row-size=60B cardinality=50.00K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14 row-size=230B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 17(OPEN)
+|  |
+|  |--17:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=14 row-size=65B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13 row-size=165B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 16(OPEN)
+|  |
+|  |--16:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=66B cardinality=18.00K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  runtime filters: RF022[bloom] <- sr_item_sk, RF023[bloom] <- sr_ticket_number
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11 row-size=99B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |
+|  |--14:SCAN HDFS [tpcds_parquet.store_returns]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=16B cardinality=287.51K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF026[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,12 row-size=83B cardinality=960.13K
+|  |  in pipelines: 13(GETNEXT), 15(OPEN)
+|  |
+|  |--15:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_market_id = CAST(8 AS INT)
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|  |     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|  |     mem-estimate=80.00MB mem-reservation=40.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=55B cardinality=2
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF026[bloom] -> ss_store_sk, RF022[bloom] -> ss_item_sk, RF023[bloom] -> ss_ticket_number
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=28B cardinality=2.88M
+|     in pipelines: 13(GETNEXT)
+|
+12:AGGREGATE [FINALIZE]
+|  output: sum(sum(ss_net_paid))
+|  group by: c_last_name, c_first_name, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 12(GETNEXT), 11(OPEN)
+|
+11:AGGREGATE [FINALIZE]
+|  output: sum(ss_net_paid)
+|  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 11(GETNEXT), 05(OPEN)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: ca_address_sk = c_current_addr_sk, ca_zip = s_zip
+|  fk/pk conjuncts: ca_address_sk = c_current_addr_sk
+|  other predicates: c_birth_country != upper(ca_country)
+|  runtime filters: RF000[bloom] <- c_current_addr_sk, RF001[bloom] <- s_zip
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,4,1,0,3,2 row-size=290B cardinality=7.69K
+|  in pipelines: 05(GETNEXT), 04(OPEN)
+|
+|--09:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = ss_customer_sk
+|  |  fk/pk conjuncts: c_customer_sk = ss_customer_sk
+|  |  runtime filters: RF004[bloom] <- ss_customer_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,1,0,3,2 row-size=230B cardinality=7.69K
+|  |  in pipelines: 04(GETNEXT), 01(OPEN)
+|  |
+|  |--08:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  fk/pk conjuncts: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  runtime filters: RF006[bloom] <- ss_item_sk, RF007[bloom] <- ss_ticket_number
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=1,0,3,2 row-size=165B cardinality=7.69K
+|  |  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--07:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_store_sk = s_store_sk
+|  |  |  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  |  |  runtime filters: RF010[bloom] <- s_store_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=0,3,2 row-size=149B cardinality=10.46K
+|  |  |  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |  |  |
+|  |  |  |--02:SCAN HDFS [tpcds_parquet.store]
+|  |  |  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |  |  |     predicates: s_market_id = CAST(8 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=12 size=9.93KB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |  |  |     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|  |  |  |     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|  |  |  |     mem-estimate=80.00MB mem-reservation=40.00KB thread-reservation=1
+|  |  |  |     tuple-ids=2 row-size=55B cardinality=2
+|  |  |  |     in pipelines: 02(GETNEXT)
+|  |  |  |
+|  |  |  06:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  |  runtime filters: RF012[bloom] <- i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=0,3 row-size=94B cardinality=31.36K
+|  |  |  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |  |  |
+|  |  |  |--03:SCAN HDFS [tpcds_parquet.item]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     predicates: tpcds_parquet.item.i_color = 'saddle'
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     parquet statistics predicates: tpcds_parquet.item.i_color = 'saddle'
+|  |  |  |     parquet dictionary predicates: tpcds_parquet.item.i_color = 'saddle'
+|  |  |  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=3 row-size=66B cardinality=196
+|  |  |  |     in pipelines: 03(GETNEXT)
+|  |  |  |
+|  |  |  00:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     runtime filters: RF012[bloom] -> ss_item_sk, RF010[bloom] -> ss_store_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=0 row-size=28B cardinality=2.88M
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  01:SCAN HDFS [tpcds_parquet.store_returns]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     runtime filters: RF006[bloom] -> sr_item_sk, RF007[bloom] -> sr_ticket_number
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=16B cardinality=287.51K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  04:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF004[bloom] -> c_customer_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=4 row-size=65B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+05:SCAN HDFS [tpcds_parquet.customer_address]
+   HDFS partitions=1/1 files=1 size=1.16MB
+   runtime filters: RF000[bloom] -> ca_address_sk, RF001[bloom] -> ca_zip
+   stored statistics:
+     table: rows=50.00K size=1.16MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=50.00K
+   mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=5 row-size=60B cardinality=50.00K
+   in pipelines: 05(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=165.45MB Threads=32
+Per-Host Resource Estimates: Memory=1.14GB
+F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=387.40KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: $c$1, $c$2, $c$3, $c$4
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+50:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: $c$1 ASC, $c$2 ASC, $c$3 ASC
+|  mem-estimate=387.40KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=21 row-size=68B cardinality=7.69K
+|  in pipelines: 27(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=22.02MB mem-reservation=13.94MB thread-reservation=1
+27:SORT
+|  order by: $c$1 ASC, $c$2 ASC, $c$3 ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21 row-size=68B cardinality=7.69K
+|  in pipelines: 27(GETNEXT), 39(OPEN)
+|
+26:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  predicates: sum(netpaid) > CAST(0.05 AS DECIMAL(2,2)) * avg(netpaid)
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8,19 row-size=84B cardinality=7.69K
+|  in pipelines: 39(GETNEXT), 48(OPEN)
+|
+|--49:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=16B cardinality=1
+|  |  in pipelines: 48(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  48:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(netpaid)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=19 row-size=16B cardinality=1
+|  |  in pipelines: 48(GETNEXT), 25(OPEN)
+|  |
+|  47:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=67.55MB mem-reservation=34.00MB thread-reservation=1
+|  25:AGGREGATE
+|  |  output: avg(sum(ss_net_paid))
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=18 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 46(OPEN)
+|  |
+|  46:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_net_paid)
+|  |  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  |  mem-estimate=57.09MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 46(GETNEXT), 13(OPEN)
+|  |
+|  45:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)]
+|  |  mem-estimate=10.46MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=181.43MB mem-reservation=67.56MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  24:AGGREGATE [STREAMING]
+|  |  output: sum(ss_net_paid)
+|  |  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  |  mem-estimate=57.09MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  23:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk, s_zip = ca_zip
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  other predicates: c_birth_country != upper(ca_country)
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14,15 row-size=290B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 18(OPEN)
+|  |
+|  |--44:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=2.92MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=15 row-size=60B cardinality=50.00K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  18:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=15 row-size=60B cardinality=50.00K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14 row-size=230B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 17(OPEN)
+|  |
+|  |--43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=6.23MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=65B cardinality=100.00K
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  17:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=14 row-size=65B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13 row-size=165B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 16(OPEN)
+|  |
+|  |--42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.20MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=66B cardinality=18.00K
+|  |  |  in pipelines: 16(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  16:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=66B cardinality=18.00K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  runtime filters: RF022[bloom] <- sr_item_sk, RF023[bloom] <- sr_ticket_number
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11 row-size=99B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |
+|  |--41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=16B cardinality=287.51K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  14:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=16B cardinality=287.51K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF026[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,12 row-size=83B cardinality=960.13K
+|  |  in pipelines: 13(GETNEXT), 15(OPEN)
+|  |
+|  |--40:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=55B cardinality=2
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=80.00MB mem-reservation=40.00KB thread-reservation=2
+|  |  15:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_market_id = CAST(8 AS INT)
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|  |     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|  |     mem-estimate=80.00MB mem-reservation=40.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=55B cardinality=2
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF026[bloom] -> ss_store_sk, RF022[bloom] -> ss_item_sk, RF023[bloom] -> ss_ticket_number
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=28B cardinality=2.88M
+|     in pipelines: 13(GETNEXT)
+|
+39:AGGREGATE [FINALIZE]
+|  output: sum:merge(netpaid)
+|  group by: c_last_name, c_first_name, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 39(GETNEXT), 37(OPEN)
+|
+38:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name)]
+|  mem-estimate=387.40KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 37(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=20.84MB mem-reservation=3.94MB thread-reservation=1
+12:AGGREGATE [STREAMING]
+|  output: sum(sum(ss_net_paid))
+|  group by: c_last_name, c_first_name, s_store_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 37(GETNEXT)
+|
+37:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_net_paid)
+|  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 37(GETNEXT), 00(OPEN)
+|
+36:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)]
+|  mem-estimate=860.24KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(c_current_addr_sk,s_zip)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=18.15MB mem-reservation=5.94MB thread-reservation=1 runtime-filters-memory=2.00MB
+11:AGGREGATE [STREAMING]
+|  output: sum(ss_net_paid)
+|  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_current_addr_sk = ca_address_sk, s_zip = ca_zip
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  other predicates: c_birth_country != upper(ca_country)
+|  runtime filters: RF000[bloom] <- ca_address_sk, RF001[bloom] <- ca_zip
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1,4,5 row-size=290B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--35:EXCHANGE [HASH(ca_address_sk,ca_zip)]
+|  |  mem-estimate=2.92MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=60B cardinality=50.00K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=60B cardinality=50.00K
+|     in pipelines: 05(GETNEXT)
+|
+34:EXCHANGE [HASH(c_current_addr_sk,s_zip)]
+|  mem-estimate=1.29MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2,1,4 row-size=230B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=12.92MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF004[bloom] <- c_customer_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1,4 row-size=230B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--33:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=6.23MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=65B cardinality=100.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=81.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  04:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=4 row-size=65B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+32:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=956.98KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2,1 row-size=165B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.25MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  runtime filters: RF006[bloom] <- sr_item_sk, RF007[bloom] <- sr_ticket_number
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1 row-size=165B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--31:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=16B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+30:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  mem-estimate=991.19KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2 row-size=149B cardinality=10.46K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=88.92MB mem-reservation=12.88MB thread-reservation=2 runtime-filters-memory=5.00MB
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF010[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2 row-size=149B cardinality=10.46K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--29:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=55B cardinality=2
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=81.00MB mem-reservation=1.04MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_market_id = CAST(8 AS INT)
+|     runtime filters: RF001[bloom] -> s_zip
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|     mem-estimate=80.00MB mem-reservation=40.00KB thread-reservation=1
+|     tuple-ids=2 row-size=55B cardinality=2
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF012[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=94B cardinality=31.36K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--28:EXCHANGE [BROADCAST]
+|  |  mem-estimate=26.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=66B cardinality=196
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=97.00MB mem-reservation=1.25MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: tpcds_parquet.item.i_color = 'saddle'
+|     runtime filters: RF006[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: tpcds_parquet.item.i_color = 'saddle'
+|     parquet dictionary predicates: tpcds_parquet.item.i_color = 'saddle'
+|     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=3 row-size=66B cardinality=196
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> ss_item_sk, RF010[bloom] -> ss_store_sk, RF006[bloom] -> ss_item_sk, RF007[bloom] -> ss_ticket_number, RF004[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=305.70MB Threads=42
+Per-Host Resource Estimates: Memory=667MB
+F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=604.05KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: $c$1, $c$2, $c$3, $c$4
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+50:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: $c$1 ASC, $c$2 ASC, $c$3 ASC
+|  mem-estimate=604.05KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=21 row-size=68B cardinality=7.69K
+|  in pipelines: 27(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=22.00MB mem-reservation=13.94MB thread-reservation=1
+27:SORT
+|  order by: $c$1 ASC, $c$2 ASC, $c$3 ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21 row-size=68B cardinality=7.69K
+|  in pipelines: 27(GETNEXT), 39(OPEN)
+|
+26:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  join table id: 00
+|  predicates: sum(netpaid) > CAST(0.05 AS DECIMAL(2,2)) * avg(netpaid)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8,19 row-size=84B cardinality=7.69K
+|  in pipelines: 39(GETNEXT), 48(OPEN)
+|
+|--F20:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |
+|  49:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=16B cardinality=1
+|  |  in pipelines: 48(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  48:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(netpaid)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=19 row-size=16B cardinality=1
+|  |  in pipelines: 48(GETNEXT), 25(OPEN)
+|  |
+|  47:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=44.93MB mem-reservation=34.00MB thread-reservation=1
+|  25:AGGREGATE
+|  |  output: avg(sum(ss_net_paid))
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=18 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 46(OPEN)
+|  |
+|  46:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_net_paid)
+|  |  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 46(GETNEXT), 13(OPEN)
+|  |
+|  45:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)]
+|  |  mem-estimate=10.93MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=50.00MB mem-reservation=38.00MB thread-reservation=1
+|  24:AGGREGATE [STREAMING]
+|  |  output: sum(ss_net_paid)
+|  |  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=154B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  23:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: c_current_addr_sk = ca_address_sk, s_zip = ca_zip
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  other predicates: c_birth_country != upper(ca_country)
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14,15 row-size=290B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 18(OPEN)
+|  |
+|  |--F21:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=12.42MB mem-reservation=9.50MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: ca_address_sk, ca_zip
+|  |  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |  |
+|  |  44:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=2.92MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=15 row-size=60B cardinality=50.00K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  18:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=15 row-size=60B cardinality=50.00K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13,14 row-size=230B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 17(OPEN)
+|  |
+|  |--F22:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=23.23MB mem-reservation=17.00MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: c_customer_sk
+|  |  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  |
+|  |  43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=6.23MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=65B cardinality=100.00K
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  17:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=14 row-size=65B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11,13 row-size=165B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 16(OPEN)
+|  |
+|  |--F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=6.95MB mem-reservation=5.75MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.20MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=66B cardinality=18.00K
+|  |  |  in pipelines: 16(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  16:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=13 row-size=66B cardinality=18.00K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=10,12,11 row-size=99B cardinality=706.14K
+|  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |
+|  |--F24:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=23.41MB mem-reservation=19.00MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: sr_item_sk, sr_ticket_number
+|  |  |  runtime filters: RF022[bloom] <- sr_item_sk, RF023[bloom] <- sr_ticket_number
+|  |  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  |
+|  |  41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=16B cardinality=287.51K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  14:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=11 row-size=16B cardinality=287.51K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,12 row-size=83B cardinality=960.13K
+|  |  in pipelines: 13(GETNEXT), 15(OPEN)
+|  |
+|  |--F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: s_store_sk
+|  |  |  runtime filters: RF026[bloom] <- s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  40:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=55B cardinality=2
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=40.00KB thread-reservation=1
+|  |  15:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_market_id = CAST(8 AS INT)
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|  |     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=40.00KB thread-reservation=0
+|  |     tuple-ids=12 row-size=55B cardinality=2
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF026[bloom] -> ss_store_sk, RF022[bloom] -> ss_item_sk, RF023[bloom] -> ss_ticket_number
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=10 row-size=28B cardinality=2.88M
+|     in pipelines: 13(GETNEXT)
+|
+39:AGGREGATE [FINALIZE]
+|  output: sum:merge(netpaid)
+|  group by: c_last_name, c_first_name, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 39(GETNEXT), 37(OPEN)
+|
+38:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name)]
+|  mem-estimate=604.05KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 37(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=21.30MB mem-reservation=3.94MB thread-reservation=1
+12:AGGREGATE [STREAMING]
+|  output: sum(sum(ss_net_paid))
+|  group by: c_last_name, c_first_name, s_store_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=68B cardinality=7.69K
+|  in pipelines: 37(GETNEXT)
+|
+37:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_net_paid)
+|  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 37(GETNEXT), 00(OPEN)
+|
+36:EXCHANGE [HASH(c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size)]
+|  mem-estimate=1.30MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(c_current_addr_sk,s_zip)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=12.03MB mem-reservation=2.00MB thread-reservation=1
+11:AGGREGATE [STREAMING]
+|  output: sum(ss_net_paid)
+|  group by: c_last_name, c_first_name, s_store_name, ca_state, s_state, i_color, i_current_price, i_manager_id, i_units, i_size
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=154B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=06
+|  hash predicates: c_current_addr_sk = ca_address_sk, s_zip = ca_zip
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  other predicates: c_birth_country != upper(ca_country)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1,4,5 row-size=290B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--F26:PLAN FRAGMENT [HASH(c_current_addr_sk,s_zip)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=6.86MB mem-reservation=3.94MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: ca_address_sk, ca_zip
+|  |  runtime filters: RF000[bloom] <- ca_address_sk, RF001[bloom] <- ca_zip
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  35:EXCHANGE [HASH(ca_address_sk,ca_zip)]
+|  |  mem-estimate=2.92MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=60B cardinality=50.00K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=5 row-size=60B cardinality=50.00K
+|     in pipelines: 05(GETNEXT)
+|
+34:EXCHANGE [HASH(c_current_addr_sk,s_zip)]
+|  mem-estimate=2.03MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2,1,4 row-size=230B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=1.47MB mem-reservation=0B thread-reservation=1
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=07
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1,4 row-size=230B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F27:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=10.11MB mem-reservation=3.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=07 plan-id=08 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF004[bloom] <- c_customer_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  33:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=6.23MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=65B cardinality=100.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=4 row-size=65B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+32:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=1.47MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2,1 row-size=165B cardinality=7.69K
+|  in pipelines: 00(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=1.44MB mem-reservation=0B thread-reservation=1
+08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=08
+|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1 row-size=165B cardinality=7.69K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F28:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=8.34MB mem-reservation=3.94MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=08 plan-id=09 cohort-id=01
+|  |  build expressions: sr_item_sk, sr_ticket_number
+|  |  runtime filters: RF006[bloom] <- sr_item_sk, RF007[bloom] <- sr_ticket_number
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  31:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=1 row-size=16B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+30:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  mem-estimate=1.44MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,2 row-size=149B cardinality=10.46K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=09
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2 row-size=149B cardinality=10.46K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F29:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF010[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  29:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=55B cardinality=2
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=40.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_market_id = CAST(8 AS INT)
+|     runtime filters: RF001[bloom] -> s_zip
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_market_id = CAST(8 AS INT)
+|     parquet dictionary predicates: s_market_id = CAST(8 AS INT)
+|     mem-estimate=16.00MB mem-reservation=40.00KB thread-reservation=0
+|     tuple-ids=2 row-size=55B cardinality=2
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=10
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=94B cardinality=31.36K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F30:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF012[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  28:EXCHANGE [BROADCAST]
+|  |  mem-estimate=26.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=66B cardinality=196
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: tpcds_parquet.item.i_color = 'saddle'
+|     runtime filters: RF006[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: tpcds_parquet.item.i_color = 'saddle'
+|     parquet dictionary predicates: tpcds_parquet.item.i_color = 'saddle'
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=3 row-size=66B cardinality=196
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> ss_item_sk, RF010[bloom] -> ss_store_sk, RF006[bloom] -> ss_item_sk, RF007[bloom] -> ss_ticket_number, RF004[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q25.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q25.test
new file mode 100644
index 0000000..ef8fd03
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q25.test
@@ -0,0 +1,786 @@
+# TPCDS-Q25
+
+SELECT i_item_id ,
+       i_item_desc ,
+       s_store_id ,
+       s_store_name ,
+       sum(ss_net_profit) AS store_sales_profit ,
+       sum(sr_net_loss) AS store_returns_loss ,
+       sum(cs_net_profit) AS catalog_sales_profit
+FROM store_sales ,
+     store_returns ,
+     catalog_sales ,
+     date_dim d1 ,
+     date_dim d2 ,
+     date_dim d3 ,
+     store ,
+     item
+WHERE d1.d_moy = 4
+  AND d1.d_year = 2001
+  AND d1.d_date_sk = ss_sold_date_sk
+  AND i_item_sk = ss_item_sk
+  AND s_store_sk = ss_store_sk
+  AND ss_customer_sk = sr_customer_sk
+  AND ss_item_sk = sr_item_sk
+  AND ss_ticket_number = sr_ticket_number
+  AND sr_returned_date_sk = d2.d_date_sk
+  AND d2.d_moy BETWEEN 4 AND 10
+  AND d2.d_year = 2001
+  AND sr_customer_sk = cs_bill_customer_sk
+  AND sr_item_sk = cs_item_sk
+  AND cs_sold_date_sk = d3.d_date_sk
+  AND d3.d_moy BETWEEN 4 AND 10
+  AND d3.d_year = 2001
+GROUP BY i_item_id ,
+         i_item_desc ,
+         s_store_id ,
+         s_store_name
+ORDER BY i_item_id ,
+         i_item_desc ,
+         s_store_id ,
+         s_store_name
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=49.27MB Threads=9
+Per-Host Resource Estimates: Memory=650MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=649.75MB mem-reservation=49.27MB thread-reservation=9 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, s_store_id, s_store_name, sum(ss_net_profit), sum(sr_net_loss), sum(cs_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+16:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC, i_item_desc ASC, s_store_id ASC, s_store_name ASC
+|  mem-estimate=22.72KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=233B cardinality=100
+|  in pipelines: 16(GETNEXT), 15(OPEN)
+|
+15:AGGREGATE [FINALIZE]
+|  output: sum(ss_net_profit), sum(sr_net_loss), sum(cs_net_profit)
+|  group by: i_item_id, i_item_desc, s_store_id, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=233B cardinality=449
+|  in pipelines: 15(GETNEXT), 07(OPEN)
+|
+14:HASH JOIN [INNER JOIN]
+|  hash predicates: i_item_sk = ss_item_sk
+|  fk/pk conjuncts: i_item_sk = ss_item_sk
+|  runtime filters: RF000[bloom] <- ss_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,2,1,0,3,4,5,6 row-size=313B cardinality=449
+|  in pipelines: 07(GETNEXT), 02(OPEN)
+|
+|--13:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF002[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,1,0,3,4,5,6 row-size=164B cardinality=449
+|  |  in pipelines: 02(GETNEXT), 06(OPEN)
+|  |
+|  |--06:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=48B cardinality=12
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d3.d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d3.d_date_sk
+|  |  runtime filters: RF004[bloom] <- d3.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,1,0,3,4,5 row-size=116B cardinality=449
+|  |  in pipelines: 02(GETNEXT), 05(OPEN)
+|  |
+|  |--05:SCAN HDFS [tpcds_parquet.date_dim d3]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d3.d_year = CAST(2001 AS INT), d3.d_moy <= CAST(10 AS INT), d3.d_moy >= CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d3.d_year = CAST(2001 AS INT), d3.d_moy <= CAST(10 AS INT), d3.d_moy >= CAST(4 AS INT)
+|  |     parquet dictionary predicates: d3.d_year = CAST(2001 AS INT), d3.d_moy <= CAST(10 AS INT), d3.d_moy >= CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=12B cardinality=118
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  11:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  |  fk/pk conjuncts: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  |  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,1,0,3,4 row-size=104B cardinality=6.94K
+|  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |
+|  |--10:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  |  |  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d2.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=1,0,3,4 row-size=84B cardinality=7.43K
+|  |  |  in pipelines: 01(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--04:SCAN HDFS [tpcds_parquet.date_dim d2]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy <= CAST(10 AS INT), d2.d_moy >= CAST(4 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy <= CAST(10 AS INT), d2.d_moy >= CAST(4 AS INT)
+|  |  |     parquet dictionary predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy <= CAST(10 AS INT), d2.d_moy >= CAST(4 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=4 row-size=12B cardinality=118
+|  |  |     in pipelines: 04(GETNEXT)
+|  |  |
+|  |  09:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: sr_customer_sk = ss_customer_sk, sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  fk/pk conjuncts: sr_customer_sk = ss_customer_sk, sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  runtime filters: RF012[bloom] <- ss_customer_sk, RF013[bloom] <- ss_item_sk, RF014[bloom] <- ss_ticket_number
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |  tuple-ids=1,0,3 row-size=72B cardinality=125.43K
+|  |  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--08:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  |  runtime filters: RF018[bloom] <- d1.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=0,3 row-size=44B cardinality=170.55K
+|  |  |  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |  |  |
+|  |  |  |--03:SCAN HDFS [tpcds_parquet.date_dim d1]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d1.d_year = CAST(2001 AS INT), d1.d_moy = CAST(4 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d1.d_year = CAST(2001 AS INT), d1.d_moy = CAST(4 AS INT)
+|  |  |  |     parquet dictionary predicates: d1.d_year = CAST(2001 AS INT), d1.d_moy = CAST(4 AS INT)
+|  |  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=3 row-size=12B cardinality=108
+|  |  |  |     in pipelines: 03(GETNEXT)
+|  |  |  |
+|  |  |  00:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     runtime filters: RF002[bloom] -> ss_store_sk, RF018[bloom] -> ss_sold_date_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=0 row-size=32B cardinality=2.88M
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  01:SCAN HDFS [tpcds_parquet.store_returns]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     runtime filters: RF010[bloom] -> sr_returned_date_sk, RF012[bloom] -> sr_customer_sk, RF013[bloom] -> sr_item_sk, RF014[bloom] -> sr_ticket_number
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=120.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=28B cardinality=287.51K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> cs_sold_date_sk, RF006[bloom] -> cs_bill_customer_sk, RF007[bloom] -> cs_item_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=2 row-size=20B cardinality=1.44M
+|     in pipelines: 02(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.item]
+   HDFS partitions=1/1 files=1 size=1.73MB
+   runtime filters: RF000[bloom] -> i_item_sk
+   stored statistics:
+     table: rows=18.00K size=1.73MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=18.00K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=7 row-size=148B cardinality=18.00K
+   in pipelines: 07(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=61.84MB Threads=20
+Per-Host Resource Estimates: Memory=701MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=76.92KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, s_store_id, s_store_name, sum(ss_net_profit), sum(sr_net_loss), sum(cs_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+28:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC, i_item_desc ASC, s_store_id ASC, s_store_name ASC
+|  limit: 100
+|  mem-estimate=76.92KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=233B cardinality=100
+|  in pipelines: 16(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,s_store_id,s_store_name)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC, i_item_desc ASC, s_store_id ASC, s_store_name ASC
+|  mem-estimate=22.72KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=233B cardinality=100
+|  in pipelines: 16(GETNEXT), 27(OPEN)
+|
+27:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_net_profit), sum:merge(sr_net_loss), sum:merge(cs_net_profit)
+|  group by: i_item_id, i_item_desc, s_store_id, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=233B cardinality=449
+|  in pipelines: 27(GETNEXT), 02(OPEN)
+|
+26:EXCHANGE [HASH(i_item_id,i_item_desc,s_store_id,s_store_name)]
+|  mem-estimate=345.35KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=233B cardinality=449
+|  in pipelines: 02(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=15.90MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+15:AGGREGATE [STREAMING]
+|  output: sum(ss_net_profit), sum(sr_net_loss), sum(cs_net_profit)
+|  group by: i_item_id, i_item_desc, s_store_id, s_store_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=233B cardinality=449
+|  in pipelines: 02(GETNEXT)
+|
+14:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6,7 row-size=313B cardinality=449
+|  in pipelines: 02(GETNEXT), 07(OPEN)
+|
+|--25:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=2.70MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=148B cardinality=18.00K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  07:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=7 row-size=148B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+24:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=276.90KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=164B cardinality=449
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=203.73MB mem-reservation=18.81MB thread-reservation=2 runtime-filters-memory=5.00MB
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=164B cardinality=449
+|  in pipelines: 02(GETNEXT), 06(OPEN)
+|
+|--23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=48B cardinality=12
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=2
+|  06:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=6 row-size=48B cardinality=12
+|     in pipelines: 06(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d3.d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d3.d_date_sk
+|  runtime filters: RF004[bloom] <- d3.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5 row-size=116B cardinality=449
+|  in pipelines: 02(GETNEXT), 05(OPEN)
+|
+|--22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=12B cardinality=118
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d3.d_year = CAST(2001 AS INT), d3.d_moy <= CAST(10 AS INT), d3.d_moy >= CAST(4 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d3.d_year = CAST(2001 AS INT), d3.d_moy <= CAST(10 AS INT), d3.d_moy >= CAST(4 AS INT)
+|     parquet dictionary predicates: d3.d_year = CAST(2001 AS INT), d3.d_moy <= CAST(10 AS INT), d3.d_moy >= CAST(4 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=12B cardinality=118
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4 row-size=104B cardinality=6.94K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=909.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=84B cardinality=7.43K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=20.95MB mem-reservation=10.69MB thread-reservation=1 runtime-filters-memory=4.00MB
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  |  runtime filters: RF010[bloom] <- d2.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=84B cardinality=7.43K
+|  |  in pipelines: 00(GETNEXT), 04(OPEN)
+|  |
+|  |--20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=12B cardinality=118
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy <= CAST(10 AS INT), d2.d_moy >= CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy <= CAST(10 AS INT), d2.d_moy >= CAST(4 AS INT)
+|  |     parquet dictionary predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy <= CAST(10 AS INT), d2.d_moy >= CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=12B cardinality=118
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  runtime filters: RF012[bloom] <- sr_customer_sk, RF013[bloom] <- sr_item_sk, RF014[bloom] <- sr_ticket_number
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1 row-size=72B cardinality=125.43K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--19:EXCHANGE [HASH(sr_customer_sk,sr_item_sk,sr_ticket_number)]
+|  |  |  mem-estimate=7.71MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=28B cardinality=287.51K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=122.00MB mem-reservation=10.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.store_returns.sr_item_sk, RF010[bloom] -> sr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=120.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=28B cardinality=287.51K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  18:EXCHANGE [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)]
+|  |  mem-estimate=2.54MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3 row-size=44B cardinality=170.55K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=87.95MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=6.00MB
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  runtime filters: RF018[bloom] <- d1.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3 row-size=44B cardinality=170.55K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--17:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year = CAST(2001 AS INT), d1.d_moy = CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year = CAST(2001 AS INT), d1.d_moy = CAST(4 AS INT)
+|  |     parquet dictionary predicates: d1.d_year = CAST(2001 AS INT), d1.d_moy = CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=12B cardinality=108
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_store_sk, RF012[bloom] -> ss_customer_sk, RF013[bloom] -> ss_item_sk, RF014[bloom] -> ss_ticket_number, RF018[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=0 row-size=32B cardinality=2.88M
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF004[bloom] -> cs_sold_date_sk, RF006[bloom] -> cs_bill_customer_sk, RF007[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=2 row-size=20B cardinality=1.44M
+   in pipelines: 02(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=98.40MB Threads=26
+Per-Host Resource Estimates: Memory=357MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=146.26KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, s_store_id, s_store_name, sum(ss_net_profit), sum(sr_net_loss), sum(cs_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+28:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC, i_item_desc ASC, s_store_id ASC, s_store_name ASC
+|  limit: 100
+|  mem-estimate=146.26KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=233B cardinality=100
+|  in pipelines: 16(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,s_store_id,s_store_name)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.64MB mem-reservation=1.94MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC, i_item_desc ASC, s_store_id ASC, s_store_name ASC
+|  mem-estimate=22.72KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=233B cardinality=100
+|  in pipelines: 16(GETNEXT), 27(OPEN)
+|
+27:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_net_profit), sum:merge(sr_net_loss), sum:merge(cs_net_profit)
+|  group by: i_item_id, i_item_desc, s_store_id, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=233B cardinality=449
+|  in pipelines: 27(GETNEXT), 02(OPEN)
+|
+26:EXCHANGE [HASH(i_item_id,i_item_desc,s_store_id,s_store_name)]
+|  mem-estimate=656.70KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=233B cardinality=449
+|  in pipelines: 02(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.52MB mem-reservation=2.00MB thread-reservation=1
+15:AGGREGATE [STREAMING]
+|  output: sum(ss_net_profit), sum(sr_net_loss), sum(cs_net_profit)
+|  group by: i_item_id, i_item_desc, s_store_id, s_store_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=233B cardinality=449
+|  in pipelines: 02(GETNEXT)
+|
+14:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6,7 row-size=313B cardinality=449
+|  in pipelines: 02(GETNEXT), 07(OPEN)
+|
+|--F12:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=5.63MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF000[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  25:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=2.70MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=148B cardinality=18.00K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  07:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=7 row-size=148B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+24:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=529.79KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=164B cardinality=449
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=164B cardinality=449
+|  in pipelines: 02(GETNEXT), 06(OPEN)
+|
+|--F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF002[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=48B cardinality=12
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  06:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|     tuple-ids=6 row-size=48B cardinality=12
+|     in pipelines: 06(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: cs_sold_date_sk = d3.d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d3.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5 row-size=116B cardinality=449
+|  in pipelines: 02(GETNEXT), 05(OPEN)
+|
+|--F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: d3.d_date_sk
+|  |  runtime filters: RF004[bloom] <- d3.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=12B cardinality=118
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d3.d_year = CAST(2001 AS INT), d3.d_moy <= CAST(10 AS INT), d3.d_moy >= CAST(4 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d3.d_year = CAST(2001 AS INT), d3.d_moy <= CAST(10 AS INT), d3.d_moy >= CAST(4 AS INT)
+|     parquet dictionary predicates: d3.d_year = CAST(2001 AS INT), d3.d_moy <= CAST(10 AS INT), d3.d_moy >= CAST(4 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=5 row-size=12B cardinality=118
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4 row-size=104B cardinality=6.94K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=7.06MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: sr_customer_sk, sr_item_sk
+|  |  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.18MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=84B cardinality=7.43K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=2.69MB mem-reservation=0B thread-reservation=1
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=84B cardinality=7.43K
+|  |  in pipelines: 00(GETNEXT), 04(OPEN)
+|  |
+|  |--F16:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: d2.d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d2.d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=12B cardinality=118
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy <= CAST(10 AS INT), d2.d_moy >= CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy <= CAST(10 AS INT), d2.d_moy >= CAST(4 AS INT)
+|  |     parquet dictionary predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy <= CAST(10 AS INT), d2.d_moy >= CAST(4 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=4 row-size=12B cardinality=118
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=05
+|  |  hash predicates: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1 row-size=72B cardinality=125.43K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--F17:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=13.58MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: sr_customer_sk, sr_item_sk, sr_ticket_number
+|  |  |  runtime filters: RF012[bloom] <- sr_customer_sk, RF013[bloom] <- sr_item_sk, RF014[bloom] <- sr_ticket_number
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  19:EXCHANGE [HASH(sr_customer_sk,sr_item_sk,sr_ticket_number)]
+|  |  |  mem-estimate=7.71MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=28B cardinality=287.51K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.store_returns.sr_item_sk, RF010[bloom] -> sr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=24.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=1 row-size=28B cardinality=287.51K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  18:EXCHANGE [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)]
+|  |  mem-estimate=2.69MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3 row-size=44B cardinality=170.55K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=6.00MB mem-reservation=6.00MB thread-reservation=0 runtime-filters-memory=6.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3 row-size=44B cardinality=170.55K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=02
+|  |  |  build expressions: d1.d_date_sk
+|  |  |  runtime filters: RF018[bloom] <- d1.d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  17:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year = CAST(2001 AS INT), d1.d_moy = CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year = CAST(2001 AS INT), d1.d_moy = CAST(4 AS INT)
+|  |     parquet dictionary predicates: d1.d_year = CAST(2001 AS INT), d1.d_moy = CAST(4 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=12B cardinality=108
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_store_sk, RF012[bloom] -> ss_customer_sk, RF013[bloom] -> ss_item_sk, RF014[bloom] -> ss_ticket_number, RF018[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=0 row-size=32B cardinality=2.88M
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF004[bloom] -> cs_sold_date_sk, RF006[bloom] -> cs_bill_customer_sk, RF007[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=2 row-size=20B cardinality=1.44M
+   in pipelines: 02(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q26.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q26.test
new file mode 100644
index 0000000..ac80c7c
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q26.test
@@ -0,0 +1,508 @@
+# TPCDS-Q26
+SELECT i_item_id,
+       avg(cs_quantity) agg1,
+       avg(cs_list_price) agg2,
+       avg(cs_coupon_amt) agg3,
+       avg(cs_sales_price) agg4
+FROM catalog_sales,
+     customer_demographics,
+     date_dim,
+     item,
+     promotion
+WHERE cs_sold_date_sk = d_date_sk
+  AND cs_item_sk = i_item_sk
+  AND cs_bill_cdemo_sk = cd_demo_sk
+  AND cs_promo_sk = p_promo_sk
+  AND cd_gender = 'M'
+  AND cd_marital_status = 'S'
+  AND cd_education_status = 'College'
+  AND (p_channel_email = 'N'
+       OR p_channel_event = 'N')
+  AND d_year = 2000
+GROUP BY i_item_id
+ORDER BY i_item_id
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=43.34MB Threads=6
+Per-Host Resource Estimates: Memory=578MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=578.31MB mem-reservation=43.34MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_id, avg(cs_quantity), avg(cs_list_price), avg(cs_coupon_amt), avg(cs_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+10:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=5.86KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=60B cardinality=100
+|  in pipelines: 10(GETNEXT), 09(OPEN)
+|
+09:AGGREGATE [FINALIZE]
+|  output: avg(CAST(cs_quantity AS BIGINT)), avg(cs_list_price), avg(cs_coupon_amt), avg(cs_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=60B cardinality=8.85K
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4,3 row-size=162B cardinality=186.24K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=36B cardinality=18.00K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_promo_sk = p_promo_sk
+|  fk/pk conjuncts: cs_promo_sk = p_promo_sk
+|  runtime filters: RF002[bloom] <- p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4 row-size=126B cardinality=186.24K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.promotion]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_email = 'N' OR p_channel_event = 'N')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=48.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=4 row-size=30B cardinality=300
+|     in pipelines: 04(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_bill_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: cs_bill_cdemo_sk = cd_demo_sk
+|  runtime filters: RF004[bloom] <- cd_demo_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=96B cardinality=187.48K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.customer_demographics]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     parquet dictionary predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=1 row-size=52B cardinality=97.40K
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=44B cardinality=294.63K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2000 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_item_sk, RF002[bloom] -> cs_promo_sk, RF004[bloom] -> cs_bill_cdemo_sk, RF006[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=384.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=36B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=44.66MB Threads=13
+Per-Host Resource Estimates: Memory=606MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=20.70KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, avg(cs_quantity), avg(cs_list_price), avg(cs_coupon_amt), avg(cs_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC
+|  limit: 100
+|  mem-estimate=20.70KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=60B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(i_item_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.36MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=5.86KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=60B cardinality=100
+|  in pipelines: 10(GETNEXT), 17(OPEN)
+|
+17:AGGREGATE [FINALIZE]
+|  output: avg:merge(cs_quantity), avg:merge(cs_list_price), avg:merge(cs_coupon_amt), avg:merge(cs_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=60B cardinality=8.85K
+|  in pipelines: 17(GETNEXT), 00(OPEN)
+|
+16:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=364.93KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=60B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(cs_bill_cdemo_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=29.54MB mem-reservation=11.75MB thread-reservation=1 runtime-filters-memory=3.00MB
+09:AGGREGATE [STREAMING]
+|  output: avg(CAST(cs_quantity AS BIGINT)), avg(cs_list_price), avg(cs_coupon_amt), avg(cs_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=60B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4,3 row-size=162B cardinality=186.24K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=36B cardinality=18.00K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=36B cardinality=18.00K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_promo_sk = p_promo_sk
+|  fk/pk conjuncts: cs_promo_sk = p_promo_sk
+|  runtime filters: RF002[bloom] <- p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4 row-size=126B cardinality=186.24K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=18.75KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=30B cardinality=300
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=32.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_email = 'N' OR p_channel_event = 'N')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=48.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=4 row-size=30B cardinality=300
+|     in pipelines: 04(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: cs_bill_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: cs_bill_cdemo_sk = cd_demo_sk
+|  runtime filters: RF004[bloom] <- cd_demo_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=96B cardinality=187.48K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--13:EXCHANGE [HASH(cd_demo_sk)]
+|  |  mem-estimate=4.84MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=52B cardinality=97.40K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     parquet dictionary predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=1 row-size=52B cardinality=97.40K
+|     in pipelines: 01(GETNEXT)
+|
+12:EXCHANGE [HASH(cs_bill_cdemo_sk)]
+|  mem-estimate=4.27MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,2 row-size=44B cardinality=294.63K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=389.95MB mem-reservation=21.94MB thread-reservation=2 runtime-filters-memory=4.00MB
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=44B cardinality=294.63K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2000 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_item_sk, RF002[bloom] -> cs_promo_sk, RF004[bloom] -> cs_bill_cdemo_sk, RF006[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=384.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=36B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=51.47MB Threads=12
+Per-Host Resource Estimates: Memory=165MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=20.70KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, avg(cs_quantity), avg(cs_list_price), avg(cs_coupon_amt), avg(cs_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC
+|  limit: 100
+|  mem-estimate=20.70KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=60B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(i_item_id)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=10.36MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=5.86KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=60B cardinality=100
+|  in pipelines: 10(GETNEXT), 17(OPEN)
+|
+17:AGGREGATE [FINALIZE]
+|  output: avg:merge(cs_quantity), avg:merge(cs_list_price), avg:merge(cs_coupon_amt), avg:merge(cs_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=60B cardinality=8.85K
+|  in pipelines: 17(GETNEXT), 00(OPEN)
+|
+16:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=364.93KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=60B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(cs_bill_cdemo_sk)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=14.27MB mem-reservation=2.00MB thread-reservation=1
+09:AGGREGATE [STREAMING]
+|  output: avg(CAST(cs_quantity AS BIGINT)), avg(cs_list_price), avg(cs_coupon_amt), avg(cs_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=60B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4,3 row-size=162B cardinality=186.24K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F08:PLAN FRAGMENT [HASH(cs_bill_cdemo_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.53MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF000[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=36B cardinality=18.00K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=36B cardinality=18.00K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: cs_promo_sk = p_promo_sk
+|  fk/pk conjuncts: cs_promo_sk = p_promo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,4 row-size=126B cardinality=186.24K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F09:PLAN FRAGMENT [HASH(cs_bill_cdemo_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: p_promo_sk
+|  |  runtime filters: RF002[bloom] <- p_promo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=18.75KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=30B cardinality=300
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_email = 'N' OR p_channel_event = 'N')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=0
+|     tuple-ids=4 row-size=30B cardinality=300
+|     in pipelines: 04(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=02
+|  hash predicates: cs_bill_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: cs_bill_cdemo_sk = cd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=96B cardinality=187.48K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F10:PLAN FRAGMENT [HASH(cs_bill_cdemo_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=8.72MB mem-reservation=3.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: cd_demo_sk
+|  |  runtime filters: RF004[bloom] <- cd_demo_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [HASH(cd_demo_sk)]
+|  |  mem-estimate=4.84MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=52B cardinality=97.40K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     parquet dictionary predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=1 row-size=52B cardinality=97.40K
+|     in pipelines: 01(GETNEXT)
+|
+12:EXCHANGE [HASH(cs_bill_cdemo_sk)]
+|  mem-estimate=4.27MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,2 row-size=44B cardinality=294.63K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=1
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=44B cardinality=294.63K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2000 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_item_sk, RF002[bloom] -> cs_promo_sk, RF004[bloom] -> cs_bill_cdemo_sk, RF006[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=0
+   tuple-ids=0 row-size=36B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q27.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q27.test
new file mode 100644
index 0000000..3fe729e
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q27.test
@@ -0,0 +1,336 @@
+# TPCDS-Q27
+select i_item_id,
+       s_state, grouping(s_state) g_state,
+       avg(ss_quantity) agg1,
+       avg(ss_list_price) agg2,
+       avg(ss_coupon_amt) agg3,
+       avg(ss_sales_price) agg4
+from store_sales, customer_demographics, date_dim, store, item
+where ss_sold_date_sk = d_date_sk and
+      ss_item_sk = i_item_sk and
+      ss_store_sk = s_store_sk and
+      ss_cdemo_sk = cd_demo_sk and
+      cd_gender = 'M' and
+      cd_marital_status = 'S' and
+      cd_education_status = 'College' and
+      d_year = 2002 and
+      s_state in ('TN')
+group by rollup (i_item_id, s_state)
+order by i_item_id
+        ,s_state
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=31.33MB Threads=6
+Per-Host Resource Estimates: Memory=290MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=290.31MB mem-reservation=31.33MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(6,8,10) WHEN 6 THEN i_item_id WHEN 8 THEN i_item_id WHEN 10 THEN NULL END, CASE valid_tid(6,8,10) WHEN 6 THEN s_state WHEN 8 THEN NULL WHEN 10 THEN NULL END, aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN 0 WHEN 8 THEN 1 WHEN 10 THEN 1 END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_quantity) WHEN 8 THEN avg(ss_quantity) WHEN 10 THEN avg(ss_quantity) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_list_price) WHEN 8 THEN avg(ss_list_price) WHEN 10 THEN avg(ss_list_price) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_coupon_amt) WHEN 8 THEN avg(ss_coupon_amt) WHEN 10 THEN avg(ss_coupon_amt) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_sales_price) WHEN 8 THEN avg(ss_sales_price) WHEN 10 THEN avg(ss_sales_price) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(6,8,10) WHEN 6 THEN i_item_id WHEN 8 THEN i_item_id WHEN 10 THEN NULL END ASC, CASE valid_tid(6,8,10) WHEN 6 THEN s_state WHEN 8 THEN NULL WHEN 10 THEN NULL END ASC
+|  mem-estimate=5.57KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=57B cardinality=100
+|  in pipelines: 11(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(6,8,10) IN (CAST(6 AS INT), CAST(8 AS INT), CAST(10 AS INT)), CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(8 AS INT) THEN CAST(1 AS TINYINT) WHEN CAST(10 AS INT) THEN CAST(1 AS TINYINT) END), aggif(valid_tid(6,8,10) IN (CAST(6 AS INT), CAST(8 AS INT), CAST(10 AS INT)), CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN avg(ss_quantity) WHEN CAST(8 AS INT) THEN avg(ss_quantity) WHEN CAST(10 AS INT) THEN avg(ss_quantity) END), aggif(valid_tid(6,8,10) IN (CAST(6 AS INT), CAST(8 AS INT), CAST(10 AS INT)), CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN avg(ss_list_price) WHEN CAST(8 AS INT) THEN avg(ss_list_price) WHEN CAST(10 AS INT) THEN avg(ss_list_price) END), aggif(valid_tid(6,8,10) IN (CAST(6 AS INT), CAST(8 AS INT), CAST(10 AS INT)), CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN avg(ss_coupon_amt) WHEN CAST(8 AS INT) THEN avg(ss_coupon_amt) WHEN CAST(10 AS INT) THEN avg(ss_coupon_amt) END), aggif(valid_tid(6,8,10) IN (CAST(6 AS INT), CAST(8 AS INT), CAST(10 AS INT)), CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN avg(ss_sales_price) WHEN CAST(8 AS INT) THEN avg(ss_sales_price) WHEN CAST(10 AS INT) THEN avg(ss_sales_price) END)
+|  group by: CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN i_item_id WHEN CAST(8 AS INT) THEN i_item_id WHEN CAST(10 AS INT) THEN NULL END, CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN s_state WHEN CAST(8 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL END, CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN CAST(6 AS INT) WHEN CAST(8 AS INT) THEN CAST(8 AS INT) WHEN CAST(10 AS INT) THEN CAST(10 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=11 row-size=61B cardinality=17.71K
+|  in pipelines: 10(GETNEXT), 09(OPEN)
+|
+09:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|    group by: i_item_id, s_state
+|  Class 1
+|    output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|    group by: i_item_id, NULL
+|  Class 2
+|    output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=7.69MB thread-reservation=0
+|  tuple-ids=5N,7N,9N row-size=202B cardinality=17.71K
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3,4 row-size=150B cardinality=263.34K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=36B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=114B cardinality=263.34K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_state IN ('TN')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_state IN ('TN')
+|     parquet dictionary predicates: s_state IN ('TN')
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=18B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
+|  runtime filters: RF004[bloom] <- cd_demo_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=96B cardinality=263.34K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.customer_demographics]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     parquet dictionary predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=1 row-size=52B cardinality=97.40K
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=44B cardinality=589.03K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2002 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2002 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2002 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_store_sk, RF004[bloom] -> ss_cdemo_sk, RF006[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=112.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=48.95MB Threads=12
+Per-Host Resource Estimates: Memory=366MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=19.73KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(6,8,10) WHEN 6 THEN i_item_id WHEN 8 THEN i_item_id WHEN 10 THEN NULL END, CASE valid_tid(6,8,10) WHEN 6 THEN s_state WHEN 8 THEN NULL WHEN 10 THEN NULL END, aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN 0 WHEN 8 THEN 1 WHEN 10 THEN 1 END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_quantity) WHEN 8 THEN avg(ss_quantity) WHEN 10 THEN avg(ss_quantity) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_list_price) WHEN 8 THEN avg(ss_list_price) WHEN 10 THEN avg(ss_list_price) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_coupon_amt) WHEN 8 THEN avg(ss_coupon_amt) WHEN 10 THEN avg(ss_coupon_amt) END), aggif(valid_tid(6,8,10) IN (6, 8, 10), CASE valid_tid(6,8,10) WHEN 6 THEN avg(ss_sales_price) WHEN 8 THEN avg(ss_sales_price) WHEN 10 THEN avg(ss_sales_price) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: CASE valid_tid(6,8,10) WHEN 6 THEN i_item_id WHEN 8 THEN i_item_id WHEN 10 THEN NULL END ASC, CASE valid_tid(6,8,10) WHEN 6 THEN s_state WHEN 8 THEN NULL WHEN 10 THEN NULL END ASC
+|  limit: 100
+|  mem-estimate=19.73KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=57B cardinality=100
+|  in pipelines: 11(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(CASE valid_tid(5,7,9) WHEN 5 THEN murmur_hash(i_item_id) WHEN 7 THEN murmur_hash(i_item_id) WHEN 9 THEN murmur_hash(NULL) END,CASE valid_tid(5,7,9) WHEN 5 THEN murmur_hash(s_state) WHEN 7 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=40.00MB mem-reservation=9.62MB thread-reservation=1
+11:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(6,8,10) WHEN 6 THEN i_item_id WHEN 8 THEN i_item_id WHEN 10 THEN NULL END ASC, CASE valid_tid(6,8,10) WHEN 6 THEN s_state WHEN 8 THEN NULL WHEN 10 THEN NULL END ASC
+|  mem-estimate=5.57KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=57B cardinality=100
+|  in pipelines: 11(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(6,8,10) IN (CAST(6 AS INT), CAST(8 AS INT), CAST(10 AS INT)), CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(8 AS INT) THEN CAST(1 AS TINYINT) WHEN CAST(10 AS INT) THEN CAST(1 AS TINYINT) END), aggif(valid_tid(6,8,10) IN (CAST(6 AS INT), CAST(8 AS INT), CAST(10 AS INT)), CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN avg(ss_quantity) WHEN CAST(8 AS INT) THEN avg(ss_quantity) WHEN CAST(10 AS INT) THEN avg(ss_quantity) END), aggif(valid_tid(6,8,10) IN (CAST(6 AS INT), CAST(8 AS INT), CAST(10 AS INT)), CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN avg(ss_list_price) WHEN CAST(8 AS INT) THEN avg(ss_list_price) WHEN CAST(10 AS INT) THEN avg(ss_list_price) END), aggif(valid_tid(6,8,10) IN (CAST(6 AS INT), CAST(8 AS INT), CAST(10 AS INT)), CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN avg(ss_coupon_amt) WHEN CAST(8 AS INT) THEN avg(ss_coupon_amt) WHEN CAST(10 AS INT) THEN avg(ss_coupon_amt) END), aggif(valid_tid(6,8,10) IN (CAST(6 AS INT), CAST(8 AS INT), CAST(10 AS INT)), CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN avg(ss_sales_price) WHEN CAST(8 AS INT) THEN avg(ss_sales_price) WHEN CAST(10 AS INT) THEN avg(ss_sales_price) END)
+|  group by: CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN i_item_id WHEN CAST(8 AS INT) THEN i_item_id WHEN CAST(10 AS INT) THEN NULL END, CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN s_state WHEN CAST(8 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL END, CASE valid_tid(6,8,10) WHEN CAST(6 AS INT) THEN CAST(6 AS INT) WHEN CAST(8 AS INT) THEN CAST(8 AS INT) WHEN CAST(10 AS INT) THEN CAST(10 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11 row-size=61B cardinality=17.71K
+|  in pipelines: 10(GETNEXT), 17(OPEN)
+|
+17:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
+|    group by: i_item_id, s_state
+|  Class 1
+|    output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
+|    group by: i_item_id, NULL
+|  Class 2
+|    output: avg:merge(ss_quantity), avg:merge(ss_list_price), avg:merge(ss_coupon_amt), avg:merge(ss_sales_price)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=7.69MB thread-reservation=0
+|  tuple-ids=6N,8N,10N row-size=202B cardinality=17.71K
+|  in pipelines: 17(GETNEXT), 00(OPEN)
+|
+16:EXCHANGE [HASH(CASE valid_tid(5,7,9) WHEN 5 THEN murmur_hash(i_item_id) WHEN 7 THEN murmur_hash(i_item_id) WHEN 9 THEN murmur_hash(NULL) END,CASE valid_tid(5,7,9) WHEN 5 THEN murmur_hash(s_state) WHEN 7 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) END)]
+|  mem-estimate=1.76MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5N,7N,9N row-size=202B cardinality=17.71K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=165.85MB mem-reservation=30.31MB thread-reservation=2 runtime-filters-memory=4.00MB
+09:AGGREGATE [STREAMING]
+|  Class 0
+|    output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|    group by: i_item_id, s_state
+|  Class 1
+|    output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|    group by: i_item_id, NULL
+|  Class 2
+|    output: avg(CAST(ss_quantity AS BIGINT)), avg(ss_list_price), avg(ss_coupon_amt), avg(ss_sales_price)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=8.00MB thread-reservation=0
+|  tuple-ids=5N,7N,9N row-size=202B cardinality=17.71K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3,4 row-size=150B cardinality=263.34K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=36B cardinality=18.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=36B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=114B cardinality=263.34K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=18B cardinality=12
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_state IN ('TN')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_state IN ('TN')
+|     parquet dictionary predicates: s_state IN ('TN')
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=18B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
+|  runtime filters: RF004[bloom] <- cd_demo_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=96B cardinality=263.34K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=4.84MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=52B cardinality=97.40K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     parquet dictionary predicates: cd_marital_status = 'S', cd_gender = 'M', cd_education_status = 'College'
+|     mem-estimate=64.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=1 row-size=52B cardinality=97.40K
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=44B cardinality=589.03K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2002 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2002 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2002 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_store_sk, RF004[bloom] -> ss_cdemo_sk, RF006[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=112.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q28.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q28.test
new file mode 100644
index 0000000..4728e74
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q28.test
@@ -0,0 +1,1071 @@
+# TPCDS-Q28
+SELECT *
+FROM
+  (SELECT avg(ss_list_price) B1_LP,
+          count(ss_list_price) B1_CNT,
+          count(DISTINCT ss_list_price) B1_CNTD
+   FROM store_sales
+   WHERE ss_quantity BETWEEN 0 AND 5
+     AND (ss_list_price BETWEEN 8 AND 8+10
+          OR ss_coupon_amt BETWEEN 459 AND 459+1000
+          OR ss_wholesale_cost BETWEEN 57 AND 57+20)) B1,
+  (SELECT avg(ss_list_price) B2_LP,
+          count(ss_list_price) B2_CNT,
+          count(DISTINCT ss_list_price) B2_CNTD
+   FROM store_sales
+   WHERE ss_quantity BETWEEN 6 AND 10
+     AND (ss_list_price BETWEEN 90 AND 90+10
+          OR ss_coupon_amt BETWEEN 2323 AND 2323+1000
+          OR ss_wholesale_cost BETWEEN 31 AND 31+20)) B2,
+  (SELECT avg(ss_list_price) B3_LP,
+          count(ss_list_price) B3_CNT,
+          count(DISTINCT ss_list_price) B3_CNTD
+   FROM store_sales
+   WHERE ss_quantity BETWEEN 11 AND 15
+     AND (ss_list_price BETWEEN 142 AND 142+10
+          OR ss_coupon_amt BETWEEN 12214 AND 12214+1000
+          OR ss_wholesale_cost BETWEEN 79 AND 79+20)) B3,
+  (SELECT avg(ss_list_price) B4_LP,
+          count(ss_list_price) B4_CNT,
+          count(DISTINCT ss_list_price) B4_CNTD
+   FROM store_sales
+   WHERE ss_quantity BETWEEN 16 AND 20
+     AND (ss_list_price BETWEEN 135 AND 135+10
+          OR ss_coupon_amt BETWEEN 6071 AND 6071+1000
+          OR ss_wholesale_cost BETWEEN 38 AND 38+20)) B4,
+  (SELECT avg(ss_list_price) B5_LP,
+          count(ss_list_price) B5_CNT,
+          count(DISTINCT ss_list_price) B5_CNTD
+   FROM store_sales
+   WHERE ss_quantity BETWEEN 21 AND 25
+     AND (ss_list_price BETWEEN 122 AND 122+10
+          OR ss_coupon_amt BETWEEN 836 AND 836+1000
+          OR ss_wholesale_cost BETWEEN 17 AND 17+20)) B5,
+  (SELECT avg(ss_list_price) B6_LP,
+          count(ss_list_price) B6_CNT,
+          count(DISTINCT ss_list_price) B6_CNTD
+   FROM store_sales
+   WHERE ss_quantity BETWEEN 26 AND 30
+     AND (ss_list_price BETWEEN 154 AND 154+10
+          OR ss_coupon_amt BETWEEN 7326 AND 7326+1000
+          OR ss_wholesale_cost BETWEEN 7 AND 7+20)) B6
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=23.62MB Threads=7
+Per-Host Resource Estimates: Memory=444MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=444.00MB mem-reservation=23.62MB thread-reservation=7
+PLAN-ROOT SINK
+|  output exprs: avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+22:NESTED LOOP JOIN [CROSS JOIN]
+|  limit: 100
+|  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34 row-size=144B cardinality=1
+|  in pipelines: 02(GETNEXT), 17(OPEN)
+|
+|--17:AGGREGATE [FINALIZE]
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34 row-size=24B cardinality=1
+|  |  in pipelines: 17(GETNEXT), 16(OPEN)
+|  |
+|  16:AGGREGATE
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=31 row-size=20B cardinality=20.23K
+|  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |
+|  15:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(30 AS INT), ss_quantity >= CAST(26 AS INT), (ss_list_price >= CAST(154 AS DECIMAL(5,0)) AND ss_list_price <= CAST(164 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(7326 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(8326 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(7 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(27 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(30 AS INT), ss_quantity >= CAST(26 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(30 AS INT), ss_quantity >= CAST(26 AS INT)
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=30 row-size=16B cardinality=288.04K
+|     in pipelines: 15(GETNEXT)
+|
+21:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28 row-size=120B cardinality=1
+|  in pipelines: 02(GETNEXT), 14(OPEN)
+|
+|--14:AGGREGATE [FINALIZE]
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=24B cardinality=1
+|  |  in pipelines: 14(GETNEXT), 13(OPEN)
+|  |
+|  13:AGGREGATE
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=20B cardinality=20.23K
+|  |  in pipelines: 13(GETNEXT), 12(OPEN)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(25 AS INT), ss_quantity >= CAST(21 AS INT), (ss_list_price >= CAST(122 AS DECIMAL(3,0)) AND ss_list_price <= CAST(132 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(836 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(1836 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(17 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(37 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(25 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(25 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=24 row-size=16B cardinality=288.04K
+|     in pipelines: 12(GETNEXT)
+|
+20:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22 row-size=96B cardinality=1
+|  in pipelines: 02(GETNEXT), 11(OPEN)
+|
+|--11:AGGREGATE [FINALIZE]
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=22 row-size=24B cardinality=1
+|  |  in pipelines: 11(GETNEXT), 10(OPEN)
+|  |
+|  10:AGGREGATE
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19 row-size=20B cardinality=20.23K
+|  |  in pipelines: 10(GETNEXT), 09(OPEN)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(16 AS INT), (ss_list_price >= CAST(135 AS DECIMAL(5,0)) AND ss_list_price <= CAST(145 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(6071 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(7071 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(38 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(58 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(16 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(16 AS INT)
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=18 row-size=16B cardinality=288.04K
+|     in pipelines: 09(GETNEXT)
+|
+19:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16 row-size=72B cardinality=1
+|  in pipelines: 02(GETNEXT), 08(OPEN)
+|
+|--08:AGGREGATE [FINALIZE]
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=24B cardinality=1
+|  |  in pipelines: 08(GETNEXT), 07(OPEN)
+|  |
+|  07:AGGREGATE
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=20B cardinality=20.23K
+|  |  in pipelines: 07(GETNEXT), 06(OPEN)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(15 AS INT), ss_quantity >= CAST(11 AS INT), (ss_list_price >= CAST(142 AS DECIMAL(5,0)) AND ss_list_price <= CAST(152 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(12214 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(13214 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(79 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(99 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(15 AS INT), ss_quantity >= CAST(11 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(15 AS INT), ss_quantity >= CAST(11 AS INT)
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=12 row-size=16B cardinality=288.04K
+|     in pipelines: 06(GETNEXT)
+|
+18:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10 row-size=48B cardinality=1
+|  in pipelines: 02(GETNEXT), 05(OPEN)
+|
+|--05:AGGREGATE [FINALIZE]
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=24B cardinality=1
+|  |  in pipelines: 05(GETNEXT), 04(OPEN)
+|  |
+|  04:AGGREGATE
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=20.23K
+|  |  in pipelines: 04(GETNEXT), 03(OPEN)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(10 AS INT), ss_quantity >= CAST(6 AS INT), (ss_list_price >= CAST(90 AS DECIMAL(3,0)) AND ss_list_price <= CAST(100 AS DECIMAL(3,0)) OR ss_coupon_amt >= CAST(2323 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(3323 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(31 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(51 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(10 AS INT), ss_quantity >= CAST(6 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(10 AS INT), ss_quantity >= CAST(6 AS INT)
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=6 row-size=16B cardinality=288.04K
+|     in pipelines: 03(GETNEXT)
+|
+02:AGGREGATE [FINALIZE]
+|  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=1
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+01:AGGREGATE
+|  output: avg(ss_list_price), count(ss_list_price)
+|  group by: ss_list_price
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1 row-size=20B cardinality=20.23K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_quantity <= CAST(5 AS INT), ss_quantity >= CAST(0 AS INT), (ss_list_price >= CAST(8 AS DECIMAL(3,0)) AND ss_list_price <= CAST(18 AS DECIMAL(3,0)) OR ss_coupon_amt >= CAST(459 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(1459 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(57 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(77 AS DECIMAL(3,0)))
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   parquet statistics predicates: ss_quantity <= CAST(5 AS INT), ss_quantity >= CAST(0 AS INT)
+   parquet dictionary predicates: ss_quantity <= CAST(5 AS INT), ss_quantity >= CAST(0 AS INT)
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=288.04K
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=35.62MB Threads=24
+Per-Host Resource Estimates: Memory=624MB
+F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.09MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+22:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  limit: 100
+|  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34 row-size=144B cardinality=1
+|  in pipelines: 26(GETNEXT), 50(OPEN)
+|
+|--51:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=34 row-size=24B cardinality=1
+|  |  in pipelines: 50(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  50:AGGREGATE [FINALIZE]
+|  |  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34 row-size=24B cardinality=1
+|  |  in pipelines: 50(GETNEXT), 17(OPEN)
+|  |
+|  49:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=33 row-size=24B cardinality=1
+|  |  in pipelines: 17(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  17:AGGREGATE
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=33 row-size=24B cardinality=1
+|  |  in pipelines: 17(GETNEXT), 48(OPEN)
+|  |
+|  48:AGGREGATE
+|  |  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=31 row-size=20B cardinality=20.23K
+|  |  in pipelines: 48(GETNEXT), 15(OPEN)
+|  |
+|  47:EXCHANGE [HASH(ss_list_price)]
+|  |  mem-estimate=203.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=31 row-size=20B cardinality=20.23K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=74.00MB mem-reservation=4.00MB thread-reservation=2
+|  16:AGGREGATE [STREAMING]
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=31 row-size=20B cardinality=20.23K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  15:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(30 AS INT), ss_quantity >= CAST(26 AS INT), (ss_list_price >= CAST(154 AS DECIMAL(5,0)) AND ss_list_price <= CAST(164 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(7326 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(8326 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(7 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(27 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(30 AS INT), ss_quantity >= CAST(26 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(30 AS INT), ss_quantity >= CAST(26 AS INT)
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=30 row-size=16B cardinality=288.04K
+|     in pipelines: 15(GETNEXT)
+|
+21:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28 row-size=120B cardinality=1
+|  in pipelines: 26(GETNEXT), 45(OPEN)
+|
+|--46:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=24B cardinality=1
+|  |  in pipelines: 45(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  45:AGGREGATE [FINALIZE]
+|  |  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=24B cardinality=1
+|  |  in pipelines: 45(GETNEXT), 14(OPEN)
+|  |
+|  44:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=27 row-size=24B cardinality=1
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  14:AGGREGATE
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=27 row-size=24B cardinality=1
+|  |  in pipelines: 14(GETNEXT), 43(OPEN)
+|  |
+|  43:AGGREGATE
+|  |  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=20B cardinality=20.23K
+|  |  in pipelines: 43(GETNEXT), 12(OPEN)
+|  |
+|  42:EXCHANGE [HASH(ss_list_price)]
+|  |  mem-estimate=203.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25 row-size=20B cardinality=20.23K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=74.00MB mem-reservation=4.00MB thread-reservation=2
+|  13:AGGREGATE [STREAMING]
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=20B cardinality=20.23K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(25 AS INT), ss_quantity >= CAST(21 AS INT), (ss_list_price >= CAST(122 AS DECIMAL(3,0)) AND ss_list_price <= CAST(132 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(836 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(1836 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(17 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(37 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(25 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(25 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=24 row-size=16B cardinality=288.04K
+|     in pipelines: 12(GETNEXT)
+|
+20:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22 row-size=96B cardinality=1
+|  in pipelines: 26(GETNEXT), 40(OPEN)
+|
+|--41:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=22 row-size=24B cardinality=1
+|  |  in pipelines: 40(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  40:AGGREGATE [FINALIZE]
+|  |  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=22 row-size=24B cardinality=1
+|  |  in pipelines: 40(GETNEXT), 11(OPEN)
+|  |
+|  39:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=21 row-size=24B cardinality=1
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  11:AGGREGATE
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=21 row-size=24B cardinality=1
+|  |  in pipelines: 11(GETNEXT), 38(OPEN)
+|  |
+|  38:AGGREGATE
+|  |  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19 row-size=20B cardinality=20.23K
+|  |  in pipelines: 38(GETNEXT), 09(OPEN)
+|  |
+|  37:EXCHANGE [HASH(ss_list_price)]
+|  |  mem-estimate=203.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=20B cardinality=20.23K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=74.00MB mem-reservation=4.00MB thread-reservation=2
+|  10:AGGREGATE [STREAMING]
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19 row-size=20B cardinality=20.23K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(16 AS INT), (ss_list_price >= CAST(135 AS DECIMAL(5,0)) AND ss_list_price <= CAST(145 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(6071 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(7071 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(38 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(58 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(16 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(16 AS INT)
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=18 row-size=16B cardinality=288.04K
+|     in pipelines: 09(GETNEXT)
+|
+19:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16 row-size=72B cardinality=1
+|  in pipelines: 26(GETNEXT), 35(OPEN)
+|
+|--36:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=24B cardinality=1
+|  |  in pipelines: 35(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  35:AGGREGATE [FINALIZE]
+|  |  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=24B cardinality=1
+|  |  in pipelines: 35(GETNEXT), 08(OPEN)
+|  |
+|  34:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=24B cardinality=1
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  08:AGGREGATE
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=24B cardinality=1
+|  |  in pipelines: 08(GETNEXT), 33(OPEN)
+|  |
+|  33:AGGREGATE
+|  |  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=20B cardinality=20.23K
+|  |  in pipelines: 33(GETNEXT), 06(OPEN)
+|  |
+|  32:EXCHANGE [HASH(ss_list_price)]
+|  |  mem-estimate=203.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=20B cardinality=20.23K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=74.00MB mem-reservation=4.00MB thread-reservation=2
+|  07:AGGREGATE [STREAMING]
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=20B cardinality=20.23K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(15 AS INT), ss_quantity >= CAST(11 AS INT), (ss_list_price >= CAST(142 AS DECIMAL(5,0)) AND ss_list_price <= CAST(152 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(12214 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(13214 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(79 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(99 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(15 AS INT), ss_quantity >= CAST(11 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(15 AS INT), ss_quantity >= CAST(11 AS INT)
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=12 row-size=16B cardinality=288.04K
+|     in pipelines: 06(GETNEXT)
+|
+18:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10 row-size=48B cardinality=1
+|  in pipelines: 26(GETNEXT), 30(OPEN)
+|
+|--31:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=24B cardinality=1
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  30:AGGREGATE [FINALIZE]
+|  |  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=24B cardinality=1
+|  |  in pipelines: 30(GETNEXT), 05(OPEN)
+|  |
+|  29:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=24B cardinality=1
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  05:AGGREGATE
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=9 row-size=24B cardinality=1
+|  |  in pipelines: 05(GETNEXT), 28(OPEN)
+|  |
+|  28:AGGREGATE
+|  |  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=20.23K
+|  |  in pipelines: 28(GETNEXT), 03(OPEN)
+|  |
+|  27:EXCHANGE [HASH(ss_list_price)]
+|  |  mem-estimate=203.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=20.23K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=74.00MB mem-reservation=4.00MB thread-reservation=2
+|  04:AGGREGATE [STREAMING]
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=20.23K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(10 AS INT), ss_quantity >= CAST(6 AS INT), (ss_list_price >= CAST(90 AS DECIMAL(3,0)) AND ss_list_price <= CAST(100 AS DECIMAL(3,0)) OR ss_coupon_amt >= CAST(2323 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(3323 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(31 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(51 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(10 AS INT), ss_quantity >= CAST(6 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(10 AS INT), ss_quantity >= CAST(6 AS INT)
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=6 row-size=16B cardinality=288.04K
+|     in pipelines: 03(GETNEXT)
+|
+26:AGGREGATE [FINALIZE]
+|  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=1
+|  in pipelines: 26(GETNEXT), 02(OPEN)
+|
+25:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=24B cardinality=1
+|  in pipelines: 02(GETNEXT)
+|
+F01:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+02:AGGREGATE
+|  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=24B cardinality=1
+|  in pipelines: 02(GETNEXT), 24(OPEN)
+|
+24:AGGREGATE
+|  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  group by: ss_list_price
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1 row-size=20B cardinality=20.23K
+|  in pipelines: 24(GETNEXT), 00(OPEN)
+|
+23:EXCHANGE [HASH(ss_list_price)]
+|  mem-estimate=203.72KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1 row-size=20B cardinality=20.23K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=74.00MB mem-reservation=4.00MB thread-reservation=2
+01:AGGREGATE [STREAMING]
+|  output: avg(ss_list_price), count(ss_list_price)
+|  group by: ss_list_price
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1 row-size=20B cardinality=20.23K
+|  in pipelines: 00(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_quantity <= CAST(5 AS INT), ss_quantity >= CAST(0 AS INT), (ss_list_price >= CAST(8 AS DECIMAL(3,0)) AND ss_list_price <= CAST(18 AS DECIMAL(3,0)) OR ss_coupon_amt >= CAST(459 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(1459 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(57 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(77 AS DECIMAL(3,0)))
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   parquet statistics predicates: ss_quantity <= CAST(5 AS INT), ss_quantity >= CAST(0 AS INT)
+   parquet dictionary predicates: ss_quantity <= CAST(5 AS INT), ss_quantity >= CAST(0 AS INT)
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=288.04K
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=71.25MB Threads=35
+Per-Host Resource Estimates: Memory=612MB
+F02:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price), avg(ss_list_price), zeroifnull(count(ss_list_price)), count(ss_list_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+22:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 00
+|  limit: 100
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34 row-size=144B cardinality=1
+|  in pipelines: 26(GETNEXT), 50(OPEN)
+|
+|--F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  |
+|  51:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=34 row-size=24B cardinality=1
+|  |  in pipelines: 50(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  50:AGGREGATE [FINALIZE]
+|  |  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34 row-size=24B cardinality=1
+|  |  in pipelines: 50(GETNEXT), 17(OPEN)
+|  |
+|  49:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=33 row-size=24B cardinality=1
+|  |  in pipelines: 17(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  17:AGGREGATE
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=33 row-size=24B cardinality=1
+|  |  in pipelines: 17(GETNEXT), 48(OPEN)
+|  |
+|  48:AGGREGATE
+|  |  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=31 row-size=20B cardinality=20.23K
+|  |  in pipelines: 48(GETNEXT), 15(OPEN)
+|  |
+|  47:EXCHANGE [HASH(ss_list_price)]
+|  |  mem-estimate=275.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=31 row-size=20B cardinality=20.23K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+|  16:AGGREGATE [STREAMING]
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=31 row-size=20B cardinality=20.23K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  15:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(30 AS INT), ss_quantity >= CAST(26 AS INT), (ss_list_price >= CAST(154 AS DECIMAL(5,0)) AND ss_list_price <= CAST(164 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(7326 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(8326 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(7 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(27 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(30 AS INT), ss_quantity >= CAST(26 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(30 AS INT), ss_quantity >= CAST(26 AS INT)
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=30 row-size=16B cardinality=288.04K
+|     in pipelines: 15(GETNEXT)
+|
+21:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 01
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28 row-size=120B cardinality=1
+|  in pipelines: 26(GETNEXT), 45(OPEN)
+|
+|--F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  |
+|  46:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=24B cardinality=1
+|  |  in pipelines: 45(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  45:AGGREGATE [FINALIZE]
+|  |  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=24B cardinality=1
+|  |  in pipelines: 45(GETNEXT), 14(OPEN)
+|  |
+|  44:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=27 row-size=24B cardinality=1
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  14:AGGREGATE
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=27 row-size=24B cardinality=1
+|  |  in pipelines: 14(GETNEXT), 43(OPEN)
+|  |
+|  43:AGGREGATE
+|  |  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=20B cardinality=20.23K
+|  |  in pipelines: 43(GETNEXT), 12(OPEN)
+|  |
+|  42:EXCHANGE [HASH(ss_list_price)]
+|  |  mem-estimate=275.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25 row-size=20B cardinality=20.23K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+|  13:AGGREGATE [STREAMING]
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=20B cardinality=20.23K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(25 AS INT), ss_quantity >= CAST(21 AS INT), (ss_list_price >= CAST(122 AS DECIMAL(3,0)) AND ss_list_price <= CAST(132 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(836 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(1836 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(17 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(37 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(25 AS INT), ss_quantity >= CAST(21 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(25 AS INT), ss_quantity >= CAST(21 AS INT)
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=24 row-size=16B cardinality=288.04K
+|     in pipelines: 12(GETNEXT)
+|
+20:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 02
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22 row-size=96B cardinality=1
+|  in pipelines: 26(GETNEXT), 40(OPEN)
+|
+|--F20:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  |
+|  41:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=22 row-size=24B cardinality=1
+|  |  in pipelines: 40(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  40:AGGREGATE [FINALIZE]
+|  |  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=22 row-size=24B cardinality=1
+|  |  in pipelines: 40(GETNEXT), 11(OPEN)
+|  |
+|  39:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=21 row-size=24B cardinality=1
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  11:AGGREGATE
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=21 row-size=24B cardinality=1
+|  |  in pipelines: 11(GETNEXT), 38(OPEN)
+|  |
+|  38:AGGREGATE
+|  |  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19 row-size=20B cardinality=20.23K
+|  |  in pipelines: 38(GETNEXT), 09(OPEN)
+|  |
+|  37:EXCHANGE [HASH(ss_list_price)]
+|  |  mem-estimate=275.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=20B cardinality=20.23K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+|  10:AGGREGATE [STREAMING]
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19 row-size=20B cardinality=20.23K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(16 AS INT), (ss_list_price >= CAST(135 AS DECIMAL(5,0)) AND ss_list_price <= CAST(145 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(6071 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(7071 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(38 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(58 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(16 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(20 AS INT), ss_quantity >= CAST(16 AS INT)
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=18 row-size=16B cardinality=288.04K
+|     in pipelines: 09(GETNEXT)
+|
+19:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 03
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16 row-size=72B cardinality=1
+|  in pipelines: 26(GETNEXT), 35(OPEN)
+|
+|--F21:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  |
+|  36:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=24B cardinality=1
+|  |  in pipelines: 35(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  35:AGGREGATE [FINALIZE]
+|  |  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=24B cardinality=1
+|  |  in pipelines: 35(GETNEXT), 08(OPEN)
+|  |
+|  34:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=24B cardinality=1
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  08:AGGREGATE
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=24B cardinality=1
+|  |  in pipelines: 08(GETNEXT), 33(OPEN)
+|  |
+|  33:AGGREGATE
+|  |  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=20B cardinality=20.23K
+|  |  in pipelines: 33(GETNEXT), 06(OPEN)
+|  |
+|  32:EXCHANGE [HASH(ss_list_price)]
+|  |  mem-estimate=275.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=20B cardinality=20.23K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+|  07:AGGREGATE [STREAMING]
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=20B cardinality=20.23K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(15 AS INT), ss_quantity >= CAST(11 AS INT), (ss_list_price >= CAST(142 AS DECIMAL(5,0)) AND ss_list_price <= CAST(152 AS DECIMAL(5,0)) OR ss_coupon_amt >= CAST(12214 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(13214 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(79 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(99 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(15 AS INT), ss_quantity >= CAST(11 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(15 AS INT), ss_quantity >= CAST(11 AS INT)
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=12 row-size=16B cardinality=288.04K
+|     in pipelines: 06(GETNEXT)
+|
+18:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 04
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10 row-size=48B cardinality=1
+|  in pipelines: 26(GETNEXT), 30(OPEN)
+|
+|--F22:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  mem-estimate=24B mem-reservation=0B thread-reservation=0
+|  |
+|  31:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=24B cardinality=1
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  30:AGGREGATE [FINALIZE]
+|  |  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=24B cardinality=1
+|  |  in pipelines: 30(GETNEXT), 05(OPEN)
+|  |
+|  29:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=24B cardinality=1
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+|  05:AGGREGATE
+|  |  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=9 row-size=24B cardinality=1
+|  |  in pipelines: 05(GETNEXT), 28(OPEN)
+|  |
+|  28:AGGREGATE
+|  |  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=20.23K
+|  |  in pipelines: 28(GETNEXT), 03(OPEN)
+|  |
+|  27:EXCHANGE [HASH(ss_list_price)]
+|  |  mem-estimate=275.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=20.23K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+|  04:AGGREGATE [STREAMING]
+|  |  output: avg(ss_list_price), count(ss_list_price)
+|  |  group by: ss_list_price
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=20.23K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_quantity <= CAST(10 AS INT), ss_quantity >= CAST(6 AS INT), (ss_list_price >= CAST(90 AS DECIMAL(3,0)) AND ss_list_price <= CAST(100 AS DECIMAL(3,0)) OR ss_coupon_amt >= CAST(2323 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(3323 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(31 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(51 AS DECIMAL(3,0)))
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_quantity <= CAST(10 AS INT), ss_quantity >= CAST(6 AS INT)
+|     parquet dictionary predicates: ss_quantity <= CAST(10 AS INT), ss_quantity >= CAST(6 AS INT)
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=6 row-size=16B cardinality=288.04K
+|     in pipelines: 03(GETNEXT)
+|
+26:AGGREGATE [FINALIZE]
+|  output: count:merge(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=1
+|  in pipelines: 26(GETNEXT), 02(OPEN)
+|
+25:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=24B cardinality=1
+|  in pipelines: 02(GETNEXT)
+|
+F01:PLAN FRAGMENT [HASH(ss_list_price)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+02:AGGREGATE
+|  output: count(ss_list_price), avg:merge(ss_list_price), count:merge(ss_list_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=24B cardinality=1
+|  in pipelines: 02(GETNEXT), 24(OPEN)
+|
+24:AGGREGATE
+|  output: avg:merge(ss_list_price), count:merge(ss_list_price)
+|  group by: ss_list_price
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1 row-size=20B cardinality=20.23K
+|  in pipelines: 24(GETNEXT), 00(OPEN)
+|
+23:EXCHANGE [HASH(ss_list_price)]
+|  mem-estimate=275.72KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=1 row-size=20B cardinality=20.23K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+01:AGGREGATE [STREAMING]
+|  output: avg(ss_list_price), count(ss_list_price)
+|  group by: ss_list_price
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1 row-size=20B cardinality=20.23K
+|  in pipelines: 00(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_quantity <= CAST(5 AS INT), ss_quantity >= CAST(0 AS INT), (ss_list_price >= CAST(8 AS DECIMAL(3,0)) AND ss_list_price <= CAST(18 AS DECIMAL(3,0)) OR ss_coupon_amt >= CAST(459 AS DECIMAL(5,0)) AND ss_coupon_amt <= CAST(1459 AS DECIMAL(5,0)) OR ss_wholesale_cost >= CAST(57 AS DECIMAL(3,0)) AND ss_wholesale_cost <= CAST(77 AS DECIMAL(3,0)))
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   parquet statistics predicates: ss_quantity <= CAST(5 AS INT), ss_quantity >= CAST(0 AS INT)
+   parquet dictionary predicates: ss_quantity <= CAST(5 AS INT), ss_quantity >= CAST(0 AS INT)
+   mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=0 row-size=16B cardinality=288.04K
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q29.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q29.test
new file mode 100644
index 0000000..1329900
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q29.test
@@ -0,0 +1,786 @@
+# TPCDS-Q29
+SELECT i_item_id,
+       i_item_desc,
+       s_store_id,
+       s_store_name,
+       sum(ss_quantity) AS store_sales_quantity,
+       sum(sr_return_quantity) AS store_returns_quantity,
+       sum(cs_quantity) AS catalog_sales_quantity
+FROM store_sales,
+     store_returns,
+     catalog_sales,
+     date_dim d1,
+     date_dim d2,
+     date_dim d3,
+     store,
+     item
+WHERE d1.d_moy = 9
+  AND d1.d_year = 1999
+  AND d1.d_date_sk = ss_sold_date_sk
+  AND i_item_sk = ss_item_sk
+  AND s_store_sk = ss_store_sk
+  AND ss_customer_sk = sr_customer_sk
+  AND ss_item_sk = sr_item_sk
+  AND ss_ticket_number = sr_ticket_number
+  AND sr_returned_date_sk = d2.d_date_sk
+  AND d2.d_moy BETWEEN 9 AND 9 + 3
+  AND d2.d_year = 1999
+  AND sr_customer_sk = cs_bill_customer_sk
+  AND sr_item_sk = cs_item_sk
+  AND cs_sold_date_sk = d3.d_date_sk
+  AND d3.d_year IN (1999,
+                    1999+1,
+                    1999+2)
+GROUP BY i_item_id,
+         i_item_desc,
+         s_store_id,
+         s_store_name
+ORDER BY i_item_id,
+         i_item_desc,
+         s_store_id,
+         s_store_name
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=49.27MB Threads=9
+Per-Host Resource Estimates: Memory=634MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=633.75MB mem-reservation=49.27MB thread-reservation=9 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, s_store_id, s_store_name, sum(ss_quantity), sum(sr_return_quantity), sum(cs_quantity)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+16:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC, i_item_desc ASC, s_store_id ASC, s_store_name ASC
+|  mem-estimate=20.38KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=209B cardinality=100
+|  in pipelines: 16(GETNEXT), 15(OPEN)
+|
+15:AGGREGATE [FINALIZE]
+|  output: sum(CAST(ss_quantity AS BIGINT)), sum(CAST(sr_return_quantity AS BIGINT)), sum(CAST(cs_quantity AS BIGINT))
+|  group by: i_item_id, i_item_desc, s_store_id, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=209B cardinality=4.25K
+|  in pipelines: 15(GETNEXT), 07(OPEN)
+|
+14:HASH JOIN [INNER JOIN]
+|  hash predicates: i_item_sk = ss_item_sk
+|  fk/pk conjuncts: i_item_sk = ss_item_sk
+|  runtime filters: RF000[bloom] <- ss_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,2,1,0,3,4,5,6 row-size=309B cardinality=4.25K
+|  in pipelines: 07(GETNEXT), 02(OPEN)
+|
+|--13:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF002[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,1,0,3,4,5,6 row-size=160B cardinality=4.25K
+|  |  in pipelines: 02(GETNEXT), 06(OPEN)
+|  |
+|  |--06:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=48B cardinality=12
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d3.d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d3.d_date_sk
+|  |  runtime filters: RF004[bloom] <- d3.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,1,0,3,4,5 row-size=112B cardinality=4.25K
+|  |  in pipelines: 02(GETNEXT), 05(OPEN)
+|  |
+|  |--05:SCAN HDFS [tpcds_parquet.date_dim d3]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d3.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d3.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|  |     parquet dictionary predicates: d3.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=8B cardinality=1.12K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  11:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  |  fk/pk conjuncts: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  |  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,1,0,3,4 row-size=104B cardinality=6.94K
+|  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |
+|  |--10:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  |  |  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d2.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=1,0,3,4 row-size=84B cardinality=7.43K
+|  |  |  in pipelines: 01(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--04:SCAN HDFS [tpcds_parquet.date_dim d2]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d2.d_year = CAST(1999 AS INT), d2.d_moy <= CAST(12 AS INT), d2.d_moy >= CAST(9 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d2.d_year = CAST(1999 AS INT), d2.d_moy <= CAST(12 AS INT), d2.d_moy >= CAST(9 AS INT)
+|  |  |     parquet dictionary predicates: d2.d_year = CAST(1999 AS INT), d2.d_moy <= CAST(12 AS INT), d2.d_moy >= CAST(9 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=4 row-size=12B cardinality=118
+|  |  |     in pipelines: 04(GETNEXT)
+|  |  |
+|  |  09:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: sr_customer_sk = ss_customer_sk, sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  fk/pk conjuncts: sr_customer_sk = ss_customer_sk, sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  runtime filters: RF012[bloom] <- ss_customer_sk, RF013[bloom] <- ss_item_sk, RF014[bloom] <- ss_ticket_number
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |  tuple-ids=1,0,3 row-size=72B cardinality=125.43K
+|  |  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--08:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  |  runtime filters: RF018[bloom] <- d1.d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=0,3 row-size=44B cardinality=170.55K
+|  |  |  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |  |  |
+|  |  |  |--03:SCAN HDFS [tpcds_parquet.date_dim d1]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: d1.d_year = CAST(1999 AS INT), d1.d_moy = CAST(9 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: d1.d_year = CAST(1999 AS INT), d1.d_moy = CAST(9 AS INT)
+|  |  |  |     parquet dictionary predicates: d1.d_year = CAST(1999 AS INT), d1.d_moy = CAST(9 AS INT)
+|  |  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=3 row-size=12B cardinality=108
+|  |  |  |     in pipelines: 03(GETNEXT)
+|  |  |  |
+|  |  |  00:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     runtime filters: RF002[bloom] -> ss_store_sk, RF018[bloom] -> ss_sold_date_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=0 row-size=32B cardinality=2.88M
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  01:SCAN HDFS [tpcds_parquet.store_returns]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     runtime filters: RF010[bloom] -> sr_returned_date_sk, RF012[bloom] -> sr_customer_sk, RF013[bloom] -> sr_item_sk, RF014[bloom] -> sr_ticket_number
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=120.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=28B cardinality=287.51K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> cs_sold_date_sk, RF006[bloom] -> cs_bill_customer_sk, RF007[bloom] -> cs_item_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=2 row-size=20B cardinality=1.44M
+|     in pipelines: 02(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.item]
+   HDFS partitions=1/1 files=1 size=1.73MB
+   runtime filters: RF000[bloom] -> i_item_sk
+   stored statistics:
+     table: rows=18.00K size=1.73MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=18.00K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=7 row-size=148B cardinality=18.00K
+   in pipelines: 07(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=61.84MB Threads=20
+Per-Host Resource Estimates: Memory=686MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=69.10KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, s_store_id, s_store_name, sum(ss_quantity), sum(sr_return_quantity), sum(cs_quantity)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+28:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC, i_item_desc ASC, s_store_id ASC, s_store_name ASC
+|  limit: 100
+|  mem-estimate=69.10KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=209B cardinality=100
+|  in pipelines: 16(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,s_store_id,s_store_name)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.91MB mem-reservation=1.94MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC, i_item_desc ASC, s_store_id ASC, s_store_name ASC
+|  mem-estimate=20.38KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=209B cardinality=100
+|  in pipelines: 16(GETNEXT), 27(OPEN)
+|
+27:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_quantity), sum:merge(sr_return_quantity), sum:merge(cs_quantity)
+|  group by: i_item_id, i_item_desc, s_store_id, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=209B cardinality=4.25K
+|  in pipelines: 27(GETNEXT), 02(OPEN)
+|
+26:EXCHANGE [HASH(i_item_id,i_item_desc,s_store_id,s_store_name)]
+|  mem-estimate=926.83KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=209B cardinality=4.25K
+|  in pipelines: 02(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=16.40MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+15:AGGREGATE [STREAMING]
+|  output: sum(CAST(ss_quantity AS BIGINT)), sum(CAST(sr_return_quantity AS BIGINT)), sum(CAST(cs_quantity AS BIGINT))
+|  group by: i_item_id, i_item_desc, s_store_id, s_store_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=209B cardinality=4.25K
+|  in pipelines: 02(GETNEXT)
+|
+14:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6,7 row-size=309B cardinality=4.25K
+|  in pipelines: 02(GETNEXT), 07(OPEN)
+|
+|--25:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=2.70MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=148B cardinality=18.00K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  07:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=7 row-size=148B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+24:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=786.50KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=160B cardinality=4.25K
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=203.74MB mem-reservation=18.81MB thread-reservation=2 runtime-filters-memory=5.00MB
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=160B cardinality=4.25K
+|  in pipelines: 02(GETNEXT), 06(OPEN)
+|
+|--23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=48B cardinality=12
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=2
+|  06:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=6 row-size=48B cardinality=12
+|     in pipelines: 06(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d3.d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d3.d_date_sk
+|  runtime filters: RF004[bloom] <- d3.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5 row-size=112B cardinality=4.25K
+|  in pipelines: 02(GETNEXT), 05(OPEN)
+|
+|--22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=20.73KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=1.12K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d3.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d3.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     parquet dictionary predicates: d3.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=1.12K
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4 row-size=104B cardinality=6.94K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=909.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=84B cardinality=7.43K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=20.95MB mem-reservation=10.69MB thread-reservation=1 runtime-filters-memory=4.00MB
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  |  runtime filters: RF010[bloom] <- d2.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=84B cardinality=7.43K
+|  |  in pipelines: 00(GETNEXT), 04(OPEN)
+|  |
+|  |--20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=12B cardinality=118
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d2.d_year = CAST(1999 AS INT), d2.d_moy <= CAST(12 AS INT), d2.d_moy >= CAST(9 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d2.d_year = CAST(1999 AS INT), d2.d_moy <= CAST(12 AS INT), d2.d_moy >= CAST(9 AS INT)
+|  |     parquet dictionary predicates: d2.d_year = CAST(1999 AS INT), d2.d_moy <= CAST(12 AS INT), d2.d_moy >= CAST(9 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=12B cardinality=118
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  runtime filters: RF012[bloom] <- sr_customer_sk, RF013[bloom] <- sr_item_sk, RF014[bloom] <- sr_ticket_number
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1 row-size=72B cardinality=125.43K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--19:EXCHANGE [HASH(sr_customer_sk,sr_item_sk,sr_ticket_number)]
+|  |  |  mem-estimate=7.71MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=28B cardinality=287.51K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=122.00MB mem-reservation=10.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.store_returns.sr_item_sk, RF010[bloom] -> sr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=120.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=28B cardinality=287.51K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  18:EXCHANGE [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)]
+|  |  mem-estimate=2.54MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3 row-size=44B cardinality=170.55K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=87.95MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=6.00MB
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  runtime filters: RF018[bloom] <- d1.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3 row-size=44B cardinality=170.55K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--17:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year = CAST(1999 AS INT), d1.d_moy = CAST(9 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year = CAST(1999 AS INT), d1.d_moy = CAST(9 AS INT)
+|  |     parquet dictionary predicates: d1.d_year = CAST(1999 AS INT), d1.d_moy = CAST(9 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=12B cardinality=108
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_store_sk, RF012[bloom] -> ss_customer_sk, RF013[bloom] -> ss_item_sk, RF014[bloom] -> ss_ticket_number, RF018[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=0 row-size=32B cardinality=2.88M
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF004[bloom] -> cs_sold_date_sk, RF006[bloom] -> cs_bill_customer_sk, RF007[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=2 row-size=20B cardinality=1.44M
+   in pipelines: 02(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=98.40MB Threads=26
+Per-Host Resource Estimates: Memory=360MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=131.42KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, s_store_id, s_store_name, sum(ss_quantity), sum(sr_return_quantity), sum(cs_quantity)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+28:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC, i_item_desc ASC, s_store_id ASC, s_store_name ASC
+|  limit: 100
+|  mem-estimate=131.42KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=209B cardinality=100
+|  in pipelines: 16(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,s_store_id,s_store_name)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.53MB mem-reservation=1.94MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC, i_item_desc ASC, s_store_id ASC, s_store_name ASC
+|  mem-estimate=20.38KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=209B cardinality=100
+|  in pipelines: 16(GETNEXT), 27(OPEN)
+|
+27:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_quantity), sum:merge(sr_return_quantity), sum:merge(cs_quantity)
+|  group by: i_item_id, i_item_desc, s_store_id, s_store_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=209B cardinality=4.25K
+|  in pipelines: 27(GETNEXT), 02(OPEN)
+|
+26:EXCHANGE [HASH(i_item_id,i_item_desc,s_store_id,s_store_name)]
+|  mem-estimate=1.53MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=209B cardinality=4.25K
+|  in pipelines: 02(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.32MB mem-reservation=2.00MB thread-reservation=1
+15:AGGREGATE [STREAMING]
+|  output: sum(CAST(ss_quantity AS BIGINT)), sum(CAST(sr_return_quantity AS BIGINT)), sum(CAST(cs_quantity AS BIGINT))
+|  group by: i_item_id, i_item_desc, s_store_id, s_store_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=209B cardinality=4.25K
+|  in pipelines: 02(GETNEXT)
+|
+14:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6,7 row-size=309B cardinality=4.25K
+|  in pipelines: 02(GETNEXT), 07(OPEN)
+|
+|--F12:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=5.63MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF000[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  25:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=2.70MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=148B cardinality=18.00K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  07:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=7 row-size=148B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+24:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=1.32MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=160B cardinality=4.25K
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5,6 row-size=160B cardinality=4.25K
+|  in pipelines: 02(GETNEXT), 06(OPEN)
+|
+|--F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF002[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=48B cardinality=12
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  06:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|     tuple-ids=6 row-size=48B cardinality=12
+|     in pipelines: 06(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: cs_sold_date_sk = d3.d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d3.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4,5 row-size=112B cardinality=4.25K
+|  in pipelines: 02(GETNEXT), 05(OPEN)
+|
+|--F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: d3.d_date_sk
+|  |  runtime filters: RF004[bloom] <- d3.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=20.73KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=1.12K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d3.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d3.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     parquet dictionary predicates: d3.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=5 row-size=8B cardinality=1.12K
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = sr_customer_sk, cs_item_sk = sr_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,1,4 row-size=104B cardinality=6.94K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=7.06MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: sr_customer_sk, sr_item_sk
+|  |  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.18MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=84B cardinality=7.43K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=2.69MB mem-reservation=0B thread-reservation=1
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1,4 row-size=84B cardinality=7.43K
+|  |  in pipelines: 00(GETNEXT), 04(OPEN)
+|  |
+|  |--F16:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: d2.d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d2.d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=12B cardinality=118
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d2.d_year = CAST(1999 AS INT), d2.d_moy <= CAST(12 AS INT), d2.d_moy >= CAST(9 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d2.d_year = CAST(1999 AS INT), d2.d_moy <= CAST(12 AS INT), d2.d_moy >= CAST(9 AS INT)
+|  |     parquet dictionary predicates: d2.d_year = CAST(1999 AS INT), d2.d_moy <= CAST(12 AS INT), d2.d_moy >= CAST(9 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=4 row-size=12B cardinality=118
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=05
+|  |  hash predicates: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1 row-size=72B cardinality=125.43K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--F17:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=13.58MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: sr_customer_sk, sr_item_sk, sr_ticket_number
+|  |  |  runtime filters: RF012[bloom] <- sr_customer_sk, RF013[bloom] <- sr_item_sk, RF014[bloom] <- sr_ticket_number
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  19:EXCHANGE [HASH(sr_customer_sk,sr_item_sk,sr_ticket_number)]
+|  |  |  mem-estimate=7.71MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=28B cardinality=287.51K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.store_returns.sr_item_sk, RF010[bloom] -> sr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=24.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=1 row-size=28B cardinality=287.51K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  18:EXCHANGE [HASH(ss_customer_sk,ss_item_sk,ss_ticket_number)]
+|  |  mem-estimate=2.69MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,3 row-size=44B cardinality=170.55K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=6.00MB mem-reservation=6.00MB thread-reservation=0 runtime-filters-memory=6.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3 row-size=44B cardinality=170.55K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=02
+|  |  |  build expressions: d1.d_date_sk
+|  |  |  runtime filters: RF018[bloom] <- d1.d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  17:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year = CAST(1999 AS INT), d1.d_moy = CAST(9 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year = CAST(1999 AS INT), d1.d_moy = CAST(9 AS INT)
+|  |     parquet dictionary predicates: d1.d_year = CAST(1999 AS INT), d1.d_moy = CAST(9 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=12B cardinality=108
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_store_sk, RF012[bloom] -> ss_customer_sk, RF013[bloom] -> ss_item_sk, RF014[bloom] -> ss_ticket_number, RF018[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=0 row-size=32B cardinality=2.88M
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF004[bloom] -> cs_sold_date_sk, RF006[bloom] -> cs_bill_customer_sk, RF007[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=2 row-size=20B cardinality=1.44M
+   in pipelines: 02(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q30.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q30.test
new file mode 100644
index 0000000..22f2f0f
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q30.test
@@ -0,0 +1,868 @@
+# TPCDS-Q30
+WITH customer_total_return AS
+  (SELECT wr_returning_customer_sk AS ctr_customer_sk,
+          ca_state AS ctr_state,
+          sum(wr_return_amt) AS ctr_total_return
+   FROM web_returns,
+        date_dim,
+        customer_address
+   WHERE wr_returned_date_sk = d_date_sk
+     AND d_year = 2002
+     AND wr_returning_addr_sk = ca_address_sk
+   GROUP BY wr_returning_customer_sk,
+            ca_state)
+SELECT c_customer_id,
+       c_salutation,
+       c_first_name,
+       c_last_name,
+       c_preferred_cust_flag,
+       c_birth_day,
+       c_birth_month,
+       c_birth_year,
+       c_birth_country,
+       c_login,
+       c_email_address,
+       c_last_review_date,
+       ctr_total_return
+FROM customer_total_return ctr1,
+     customer_address,
+     customer
+WHERE ctr1.ctr_total_return >
+    (SELECT avg(ctr_total_return)*1.2
+     FROM customer_total_return ctr2
+     WHERE ctr1.ctr_state = ctr2.ctr_state)
+  AND ca_address_sk = c_current_addr_sk
+  AND ca_state = 'GA'
+  AND ctr1.ctr_customer_sk = c_customer_sk
+ORDER BY c_customer_id,
+         c_salutation,
+         c_first_name,
+         c_last_name,
+         c_preferred_cust_flag,
+         c_birth_day,
+         c_birth_month,
+         c_birth_year,
+         c_birth_country,
+         c_login,
+         c_email_address,
+         c_last_review_date,
+         ctr_total_return
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=27.44MB Threads=9
+Per-Host Resource Estimates: Memory=429MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=428.81MB mem-reservation=27.44MB thread-reservation=9 runtime-filters-memory=7.00MB
+PLAN-ROOT SINK
+|  output exprs: c_customer_id, c_salutation, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_day, c_birth_month, c_birth_year, c_birth_country, c_login, c_email_address, c_last_review_date, ctr_total_return
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC, c_salutation ASC, c_first_name ASC, c_last_name ASC, c_preferred_cust_flag ASC, c_birth_day ASC, c_birth_month ASC, c_birth_year ASC, c_birth_country ASC, c_login ASC, c_email_address ASC, c_last_review_date ASC, ctr_total_return ASC
+|  mem-estimate=20.64KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=211B cardinality=100
+|  in pipelines: 18(GETNEXT), 07(OPEN)
+|
+17:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: ca_state = ctr2.ctr_state
+|  other join predicates: sum(wr_return_amt) > avg(ctr_total_return) * CAST(1.2 AS DECIMAL(2,1))
+|  runtime filters: RF000[bloom] <- ctr2.ctr_state
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,5,3 row-size=255B cardinality=3.26K
+|  in pipelines: 07(GETNEXT), 14(OPEN)
+|
+|--14:AGGREGATE [FINALIZE]
+|  |  output: avg(sum(wr_return_amt))
+|  |  group by: ca_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=30B cardinality=51
+|  |  in pipelines: 14(GETNEXT), 13(OPEN)
+|  |
+|  13:AGGREGATE [FINALIZE]
+|  |  output: sum(wr_return_amt)
+|  |  group by: wr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=12.83K
+|  |  in pipelines: 13(GETNEXT), 10(OPEN)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ca_address_sk = wr_returning_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = wr_returning_addr_sk
+|  |  runtime filters: RF010[bloom] <- wr_returning_addr_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,7,8 row-size=42B cardinality=12.83K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  |--11:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: wr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: wr_returned_date_sk = d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=7,8 row-size=24B cardinality=12.83K
+|  |  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |  |
+|  |  |--09:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=8 row-size=8B cardinality=373
+|  |  |     in pipelines: 09(GETNEXT)
+|  |  |
+|  |  08:SCAN HDFS [tpcds_parquet.web_returns]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF012[bloom] -> wr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=64.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=7 row-size=16B cardinality=71.76K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF010[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=9 row-size=18B cardinality=50.00K
+|     in pipelines: 10(GETNEXT)
+|
+16:HASH JOIN [INNER JOIN]
+|  hash predicates: c_customer_sk = wr_returning_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- wr_returning_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,5,3 row-size=255B cardinality=3.26K
+|  in pipelines: 07(GETNEXT), 05(OPEN)
+|
+|--05:AGGREGATE [FINALIZE]
+|  |  output: sum(wr_return_amt)
+|  |  group by: wr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=34B cardinality=12.83K
+|  |  in pipelines: 05(GETNEXT), 02(OPEN)
+|  |
+|  04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ca_address_sk = wr_returning_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = wr_returning_addr_sk
+|  |  runtime filters: RF006[bloom] <- wr_returning_addr_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=42B cardinality=12.83K
+|  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |
+|  |--03:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: wr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: wr_returned_date_sk = d_date_sk
+|  |  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=24B cardinality=12.83K
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--01:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=8B cardinality=373
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.web_returns]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF008[bloom] -> wr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=64.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=16B cardinality=71.76K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer_address.ca_state, RF006[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=18B cardinality=50.00K
+|     in pipelines: 02(GETNEXT)
+|
+15:HASH JOIN [INNER JOIN]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF004[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,5 row-size=221B cardinality=2.27K
+|  in pipelines: 07(GETNEXT), 06(OPEN)
+|
+|--06:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_state = 'GA'
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_state = 'GA'
+|     parquet dictionary predicates: ca_state = 'GA'
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=5 row-size=18B cardinality=980
+|     in pipelines: 06(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.customer]
+   HDFS partitions=1/1 files=1 size=5.49MB
+   runtime filters: RF002[bloom] -> c_customer_sk, RF004[bloom] -> c_current_addr_sk
+   stored statistics:
+     table: rows=100.00K size=5.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=100.00K
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=6 row-size=203B cardinality=100.00K
+   in pipelines: 07(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=45.12MB Threads=20
+Per-Host Resource Estimates: Memory=500MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=41.67KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_customer_id, c_salutation, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_day, c_birth_month, c_birth_year, c_birth_country, c_login, c_email_address, c_last_review_date, ctr_total_return
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+32:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_customer_id ASC, c_salutation ASC, c_first_name ASC, c_last_name ASC, c_preferred_cust_flag ASC, c_birth_day ASC, c_birth_month ASC, c_birth_year ASC, c_birth_country ASC, c_login ASC, c_email_address ASC, c_last_review_date ASC, ctr_total_return ASC
+|  limit: 100
+|  mem-estimate=41.67KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=211B cardinality=100
+|  in pipelines: 18(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Resources: mem-estimate=137.32MB mem-reservation=16.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+18:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC, c_salutation ASC, c_first_name ASC, c_last_name ASC, c_preferred_cust_flag ASC, c_birth_day ASC, c_birth_month ASC, c_birth_year ASC, c_birth_country ASC, c_login ASC, c_email_address ASC, c_last_review_date ASC, ctr_total_return ASC
+|  mem-estimate=20.64KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=211B cardinality=100
+|  in pipelines: 18(GETNEXT), 07(OPEN)
+|
+17:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: ca_state = ctr2.ctr_state
+|  other join predicates: sum(wr_return_amt) > avg(ctr_total_return) * CAST(1.2 AS DECIMAL(2,1))
+|  runtime filters: RF000[bloom] <- ctr2.ctr_state
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,5,3 row-size=255B cardinality=3.26K
+|  in pipelines: 07(GETNEXT), 30(OPEN)
+|
+|--31:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=30B cardinality=51
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [HASH(ctr2.ctr_state)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  30:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ctr_total_return)
+|  |  group by: ctr2.ctr_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=30B cardinality=51
+|  |  in pipelines: 30(GETNEXT), 28(OPEN)
+|  |
+|  29:EXCHANGE [HASH(ctr2.ctr_state)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=30B cardinality=51
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(wr_returning_customer_sk,ca_state)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=20.45MB mem-reservation=3.94MB thread-reservation=1
+|  14:AGGREGATE [STREAMING]
+|  |  output: avg(sum(wr_return_amt))
+|  |  group by: ca_state
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12 row-size=30B cardinality=51
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  28:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(wr_return_amt)
+|  |  group by: wr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=12.83K
+|  |  in pipelines: 28(GETNEXT), 10(OPEN)
+|  |
+|  27:EXCHANGE [HASH(wr_returning_customer_sk,ca_state)]
+|  |  mem-estimate=464.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=12.83K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=45.26MB mem-reservation=5.19MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  13:AGGREGATE [STREAMING]
+|  |  output: sum(wr_return_amt)
+|  |  group by: wr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=12.83K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ca_address_sk = wr_returning_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = wr_returning_addr_sk
+|  |  runtime filters: RF010[bloom] <- wr_returning_addr_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,7,8 row-size=42B cardinality=12.83K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  |--26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=332.77KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7,8 row-size=24B cardinality=12.83K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=66.95MB mem-reservation=3.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: wr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: wr_returned_date_sk = d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=7,8 row-size=24B cardinality=12.83K
+|  |  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |  |
+|  |  |--25:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=8 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 09(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  09:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=8 row-size=8B cardinality=373
+|  |  |     in pipelines: 09(GETNEXT)
+|  |  |
+|  |  08:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF012[bloom] -> wr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=64.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=7 row-size=16B cardinality=71.76K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF010[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=9 row-size=18B cardinality=50.00K
+|     in pipelines: 10(GETNEXT)
+|
+16:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: c_customer_sk = wr_returning_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- wr_returning_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,5,3 row-size=255B cardinality=3.26K
+|  in pipelines: 07(GETNEXT), 23(OPEN)
+|
+|--24:EXCHANGE [BROADCAST]
+|  |  mem-estimate=464.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=34B cardinality=12.83K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [HASH(wr_returning_customer_sk,ca_state)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.45MB mem-reservation=1.94MB thread-reservation=1
+|  23:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(wr_return_amt)
+|  |  group by: wr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=34B cardinality=12.83K
+|  |  in pipelines: 23(GETNEXT), 02(OPEN)
+|  |
+|  22:EXCHANGE [HASH(wr_returning_customer_sk,ca_state)]
+|  |  mem-estimate=464.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=34B cardinality=12.83K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=46.26MB mem-reservation=6.19MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  05:AGGREGATE [STREAMING]
+|  |  output: sum(wr_return_amt)
+|  |  group by: wr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=34B cardinality=12.83K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ca_address_sk = wr_returning_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = wr_returning_addr_sk
+|  |  runtime filters: RF006[bloom] <- wr_returning_addr_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=42B cardinality=12.83K
+|  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |
+|  |--21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=332.77KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=24B cardinality=12.83K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=66.95MB mem-reservation=3.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  03:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: wr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: wr_returned_date_sk = d_date_sk
+|  |  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=24B cardinality=12.83K
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--20:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=1 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=8B cardinality=373
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF008[bloom] -> wr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=64.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=16B cardinality=71.76K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer_address.ca_state, RF006[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=18B cardinality=50.00K
+|     in pipelines: 02(GETNEXT)
+|
+15:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF004[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,5 row-size=221B cardinality=2.27K
+|  in pipelines: 07(GETNEXT), 06(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=38.28KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=18B cardinality=980
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  06:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_state = 'GA'
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_state = 'GA'
+|     parquet dictionary predicates: ca_state = 'GA'
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=5 row-size=18B cardinality=980
+|     in pipelines: 06(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+   HDFS partitions=1/1 files=1 size=5.49MB
+   runtime filters: RF002[bloom] -> c_customer_sk, RF004[bloom] -> c_current_addr_sk
+   stored statistics:
+     table: rows=100.00K size=5.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=100.00K
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=6 row-size=203B cardinality=100.00K
+   in pipelines: 07(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=64.69MB Threads=19
+Per-Host Resource Estimates: Memory=231MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=41.67KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_customer_id, c_salutation, c_first_name, c_last_name, c_preferred_cust_flag, c_birth_day, c_birth_month, c_birth_year, c_birth_country, c_login, c_email_address, c_last_review_date, ctr_total_return
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+32:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_customer_id ASC, c_salutation ASC, c_first_name ASC, c_last_name ASC, c_preferred_cust_flag ASC, c_birth_day ASC, c_birth_month ASC, c_birth_year ASC, c_birth_country ASC, c_login ASC, c_email_address ASC, c_last_review_date ASC, ctr_total_return ASC
+|  limit: 100
+|  mem-estimate=41.67KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=211B cardinality=100
+|  in pipelines: 18(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=16.02MB mem-reservation=8.00MB thread-reservation=1
+18:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC, c_salutation ASC, c_first_name ASC, c_last_name ASC, c_preferred_cust_flag ASC, c_birth_day ASC, c_birth_month ASC, c_birth_year ASC, c_birth_country ASC, c_login ASC, c_email_address ASC, c_last_review_date ASC, ctr_total_return ASC
+|  mem-estimate=20.64KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=211B cardinality=100
+|  in pipelines: 18(GETNEXT), 07(OPEN)
+|
+17:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ca_state = ctr2.ctr_state
+|  other join predicates: sum(wr_return_amt) > avg(ctr_total_return) * CAST(1.2 AS DECIMAL(2,1))
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,5,3 row-size=255B cardinality=3.26K
+|  in pipelines: 07(GETNEXT), 30(OPEN)
+|
+|--F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: ctr2.ctr_state
+|  |  runtime filters: RF000[bloom] <- ctr2.ctr_state
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  31:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=30B cardinality=51
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [HASH(ctr2.ctr_state)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  30:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ctr_total_return)
+|  |  group by: ctr2.ctr_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=30B cardinality=51
+|  |  in pipelines: 30(GETNEXT), 28(OPEN)
+|  |
+|  29:EXCHANGE [HASH(ctr2.ctr_state)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=30B cardinality=51
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(wr_returning_customer_sk,ca_state)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=20.45MB mem-reservation=3.94MB thread-reservation=1
+|  14:AGGREGATE [STREAMING]
+|  |  output: avg(sum(wr_return_amt))
+|  |  group by: ca_state
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12 row-size=30B cardinality=51
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  28:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(wr_return_amt)
+|  |  group by: wr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=12.83K
+|  |  in pipelines: 28(GETNEXT), 10(OPEN)
+|  |
+|  27:EXCHANGE [HASH(wr_returning_customer_sk,ca_state)]
+|  |  mem-estimate=464.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=12.83K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.25MB thread-reservation=1
+|  13:AGGREGATE [STREAMING]
+|  |  output: sum(wr_return_amt)
+|  |  group by: wr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=12.83K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ca_address_sk = wr_returning_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = wr_returning_addr_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,7,8 row-size=42B cardinality=12.83K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  |--F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=5.20MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: wr_returning_addr_sk
+|  |  |  runtime filters: RF010[bloom] <- wr_returning_addr_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=332.77KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7,8 row-size=24B cardinality=12.83K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: wr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: wr_returned_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=7,8 row-size=24B cardinality=12.83K
+|  |  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |  |
+|  |  |--F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  25:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=8 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 09(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  09:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=8 row-size=8B cardinality=373
+|  |  |     in pipelines: 09(GETNEXT)
+|  |  |
+|  |  08:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF012[bloom] -> wr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=7 row-size=16B cardinality=71.76K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF010[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=9 row-size=18B cardinality=50.00K
+|     in pipelines: 10(GETNEXT)
+|
+16:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: c_customer_sk = wr_returning_customer_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,5,3 row-size=255B cardinality=3.26K
+|  in pipelines: 07(GETNEXT), 23(OPEN)
+|
+|--F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=5.33MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: wr_returning_customer_sk
+|  |  runtime filters: RF002[bloom] <- wr_returning_customer_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  24:EXCHANGE [BROADCAST]
+|  |  mem-estimate=464.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=34B cardinality=12.83K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [HASH(wr_returning_customer_sk,ca_state)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.45MB mem-reservation=1.94MB thread-reservation=1
+|  23:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(wr_return_amt)
+|  |  group by: wr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=34B cardinality=12.83K
+|  |  in pipelines: 23(GETNEXT), 02(OPEN)
+|  |
+|  22:EXCHANGE [HASH(wr_returning_customer_sk,ca_state)]
+|  |  mem-estimate=464.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=34B cardinality=12.83K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.25MB thread-reservation=1
+|  05:AGGREGATE [STREAMING]
+|  |  output: sum(wr_return_amt)
+|  |  group by: wr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=34B cardinality=12.83K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ca_address_sk = wr_returning_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = wr_returning_addr_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=42B cardinality=12.83K
+|  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |
+|  |--F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=5.20MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=04
+|  |  |  build expressions: wr_returning_addr_sk
+|  |  |  runtime filters: RF006[bloom] <- wr_returning_addr_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=332.77KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=24B cardinality=12.83K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  03:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=05
+|  |  |  hash predicates: wr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: wr_returned_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=24B cardinality=12.83K
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=05 plan-id=06 cohort-id=05
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  20:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=1 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=1 row-size=8B cardinality=373
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF008[bloom] -> wr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=0 row-size=16B cardinality=71.76K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer_address.ca_state, RF006[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=2 row-size=18B cardinality=50.00K
+|     in pipelines: 02(GETNEXT)
+|
+15:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=06
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,5 row-size=221B cardinality=2.27K
+|  in pipelines: 07(GETNEXT), 06(OPEN)
+|
+|--F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.91MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: ca_address_sk
+|  |  runtime filters: RF004[bloom] <- ca_address_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=38.28KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=18B cardinality=980
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  06:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_state = 'GA'
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_state = 'GA'
+|     parquet dictionary predicates: ca_state = 'GA'
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=5 row-size=18B cardinality=980
+|     in pipelines: 06(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+   HDFS partitions=1/1 files=1 size=5.49MB
+   runtime filters: RF002[bloom] -> c_customer_sk, RF004[bloom] -> c_current_addr_sk
+   stored statistics:
+     table: rows=100.00K size=5.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=100.00K
+   mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=6 row-size=203B cardinality=100.00K
+   in pipelines: 07(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q31.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q31.test
new file mode 100644
index 0000000..5295047
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q31.test
@@ -0,0 +1,1875 @@
+# TPCDS-Q31
+WITH ss AS
+  (SELECT ca_county,
+          d_qoy,
+          d_year,
+          sum(ss_ext_sales_price) AS store_sales
+   FROM store_sales,
+        date_dim,
+        customer_address
+   WHERE ss_sold_date_sk = d_date_sk
+     AND ss_addr_sk=ca_address_sk
+   GROUP BY ca_county,
+            d_qoy,
+            d_year),
+     ws AS
+  (SELECT ca_county,
+          d_qoy,
+          d_year,
+          sum(ws_ext_sales_price) AS web_sales
+   FROM web_sales,
+        date_dim,
+        customer_address
+   WHERE ws_sold_date_sk = d_date_sk
+     AND ws_bill_addr_sk=ca_address_sk
+   GROUP BY ca_county,
+            d_qoy,
+            d_year)
+SELECT ss1.ca_county ,
+       ss1.d_year ,
+       (ws2.web_sales*1.0000)/ws1.web_sales web_q1_q2_increase ,
+       (ss2.store_sales*1.0000)/ss1.store_sales store_q1_q2_increase ,
+       (ws3.web_sales*1.0000)/ws2.web_sales web_q2_q3_increase ,
+       (ss3.store_sales*1.0000)/ss2.store_sales store_q2_q3_increase
+FROM ss ss1 ,
+     ss ss2 ,
+     ss ss3 ,
+     ws ws1 ,
+     ws ws2 ,
+     ws ws3
+WHERE ss1.d_qoy = 1
+  AND ss1.d_year = 2000
+  AND ss1.ca_county = ss2.ca_county
+  AND ss2.d_qoy = 2
+  AND ss2.d_year = 2000
+  AND ss2.ca_county = ss3.ca_county
+  AND ss3.d_qoy = 3
+  AND ss3.d_year = 2000
+  AND ss1.ca_county = ws1.ca_county
+  AND ws1.d_qoy = 1
+  AND ws1.d_year = 2000
+  AND ws1.ca_county = ws2.ca_county
+  AND ws2.d_qoy = 2
+  AND ws2.d_year = 2000
+  AND ws1.ca_county = ws3.ca_county
+  AND ws3.d_qoy = 3
+  AND ws3.d_year = 2000
+  AND CASE
+          WHEN ws1.web_sales > 0 THEN (ws2.web_sales*1.0000)/ws1.web_sales
+          ELSE NULL
+      END > CASE
+                WHEN ss1.store_sales > 0 THEN (ss2.store_sales*1.0000)/ss1.store_sales
+                ELSE NULL
+            END
+  AND CASE
+          WHEN ws2.web_sales > 0 THEN (ws3.web_sales*1.0000)/ws2.web_sales
+          ELSE NULL
+      END > CASE
+                WHEN ss2.store_sales > 0 THEN (ss3.store_sales*1.0000)/ss2.store_sales
+                ELSE NULL
+            END
+ORDER BY ss1.ca_county;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=153.50MB Threads=19
+Per-Host Resource Estimates: Memory=240.18GB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=240.18GB mem-reservation=153.50MB thread-reservation=19 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: ca_county, d_year, (web_sales * CAST(1.0000 AS DECIMAL(5,4))) / web_sales, (store_sales * CAST(1.0000 AS DECIMAL(5,4))) / store_sales, (web_sales * CAST(1.0000 AS DECIMAL(5,4))) / web_sales, (store_sales * CAST(1.0000 AS DECIMAL(5,4))) / store_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+41:SORT
+|  order by: ca_county ASC
+|  mem-estimate=240.10GB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=30 row-size=126B cardinality=503.21T
+|  in pipelines: 41(GETNEXT), 05(OPEN)
+|
+40:HASH JOIN [INNER JOIN]
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  other predicates: CASE WHEN sum(ws_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ws_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ws_ext_sales_price) ELSE NULL END > CASE WHEN sum(ss_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ss_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ss_ext_sales_price) ELSE NULL END
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=3,18,23,28,8,13 row-size=300B cardinality=503.21T
+|  in pipelines: 05(GETNEXT), 17(OPEN)
+|
+|--17:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=50B cardinality=293.73K
+|  |  in pipelines: 17(GETNEXT), 12(OPEN)
+|  |
+|  16:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=10,11,12 row-size=54B cardinality=293.73K
+|  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |
+|  |--14:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=30B cardinality=50.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  15:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF032[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,11 row-size=24B cardinality=293.73K
+|  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |
+|  |--13:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=186
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF032[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=10 row-size=12B cardinality=2.88M
+|     in pipelines: 12(GETNEXT)
+|
+39:HASH JOIN [INNER JOIN]
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  other predicates: CASE WHEN sum(ws_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ws_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ws_ext_sales_price) ELSE NULL END > CASE WHEN sum(ss_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ss_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ss_ext_sales_price) ELSE NULL END
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=3,18,23,28,8 row-size=250B cardinality=3.13T
+|  in pipelines: 05(GETNEXT), 11(OPEN)
+|
+|--11:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=8 row-size=50B cardinality=293.73K
+|  |  in pipelines: 11(GETNEXT), 06(OPEN)
+|  |
+|  10:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=5,6,7 row-size=54B cardinality=293.73K
+|  |  in pipelines: 06(GETNEXT), 08(OPEN)
+|  |
+|  |--08:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=30B cardinality=50.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF028[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=24B cardinality=293.73K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--07:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=12B cardinality=186
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF028[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=5 row-size=12B cardinality=2.88M
+|     in pipelines: 06(GETNEXT)
+|
+38:HASH JOIN [INNER JOIN]
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=3,18,23,28 row-size=200B cardinality=19.43G
+|  in pipelines: 05(GETNEXT), 35(OPEN)
+|
+|--35:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=73.80K
+|  |  in pipelines: 35(GETNEXT), 30(OPEN)
+|  |
+|  34:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF022[bloom] <- ca_address_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=25,26,27 row-size=54B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT), 32(OPEN)
+|  |
+|  |--32:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=27 row-size=30B cardinality=50.00K
+|  |     in pipelines: 32(GETNEXT)
+|  |
+|  33:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF024[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25,26 row-size=24B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT), 31(OPEN)
+|  |
+|  |--31:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=26 row-size=12B cardinality=186
+|  |     in pipelines: 31(GETNEXT)
+|  |
+|  30:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF024[bloom] -> ws_sold_date_sk, RF022[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=25 row-size=12B cardinality=719.38K
+|     in pipelines: 30(GETNEXT)
+|
+37:HASH JOIN [INNER JOIN]
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=3,18,23 row-size=150B cardinality=480.37M
+|  in pipelines: 05(GETNEXT), 29(OPEN)
+|
+|--29:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=23 row-size=50B cardinality=73.80K
+|  |  in pipelines: 29(GETNEXT), 24(OPEN)
+|  |
+|  28:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF018[bloom] <- ca_address_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=20,21,22 row-size=54B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--26:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=22 row-size=30B cardinality=50.00K
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=20,21 row-size=24B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--25:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=21 row-size=12B cardinality=186
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF020[bloom] -> ws_sold_date_sk, RF018[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=20 row-size=12B cardinality=719.38K
+|     in pipelines: 24(GETNEXT)
+|
+36:HASH JOIN [INNER JOIN]
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=3,18 row-size=100B cardinality=11.88M
+|  in pipelines: 05(GETNEXT), 23(OPEN)
+|
+|--23:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=18 row-size=50B cardinality=73.80K
+|  |  in pipelines: 23(GETNEXT), 18(OPEN)
+|  |
+|  22:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF014[bloom] <- ca_address_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=15,16,17 row-size=54B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT), 20(OPEN)
+|  |
+|  |--20:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=17 row-size=30B cardinality=50.00K
+|  |     in pipelines: 20(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=15,16 row-size=24B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT), 19(OPEN)
+|  |
+|  |--19:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=16 row-size=12B cardinality=186
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  18:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF016[bloom] -> ws_sold_date_sk, RF014[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=15 row-size=12B cardinality=719.38K
+|     in pipelines: 18(GETNEXT)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: ca_county, d_qoy, d_year
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=3 row-size=50B cardinality=293.73K
+|  in pipelines: 05(GETNEXT), 00(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  runtime filters: RF010[bloom] <- ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=54B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=30B cardinality=50.00K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF012[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=186
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> ss_sold_date_sk, RF010[bloom] -> ss_addr_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=174.56MB Threads=47
+Per-Host Resource Estimates: Memory=241.19GB
+F28:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=30.38MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: ca_county, d_year, (web_sales * CAST(1.0000 AS DECIMAL(5,4))) / web_sales, (store_sales * CAST(1.0000 AS DECIMAL(5,4))) / store_sales, (web_sales * CAST(1.0000 AS DECIMAL(5,4))) / web_sales, (store_sales * CAST(1.0000 AS DECIMAL(5,4))) / store_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+75:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: ca_county ASC
+|  mem-estimate=30.38MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=30 row-size=126B cardinality=503.21T
+|  in pipelines: 41(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(ca_county)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=240.13GB mem-reservation=37.62MB thread-reservation=1
+41:SORT
+|  order by: ca_county ASC
+|  mem-estimate=240.10GB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=30 row-size=126B cardinality=503.21T
+|  in pipelines: 41(GETNEXT), 45(OPEN)
+|
+40:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  other predicates: CASE WHEN sum(ws_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ws_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ws_ext_sales_price) ELSE NULL END > CASE WHEN sum(ss_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ss_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ss_ext_sales_price) ELSE NULL END
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=3,18,23,28,8,13 row-size=300B cardinality=503.21T
+|  in pipelines: 45(GETNEXT), 73(OPEN)
+|
+|--74:EXCHANGE [HASH(ca_county)]
+|  |  mem-estimate=4.82MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=50B cardinality=293.73K
+|  |  in pipelines: 73(GETNEXT)
+|  |
+|  F27:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=14.82MB mem-reservation=2.88MB thread-reservation=1
+|  73:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=50B cardinality=293.73K
+|  |  in pipelines: 73(GETNEXT), 12(OPEN)
+|  |
+|  72:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  |  mem-estimate=4.82MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=50B cardinality=293.73K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=49.29MB mem-reservation=15.81MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  17:AGGREGATE [STREAMING]
+|  |  output: sum(ss_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=50B cardinality=293.73K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=10,11,12 row-size=54B cardinality=293.73K
+|  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |
+|  |--71:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=30B cardinality=50.00K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  14:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=30B cardinality=50.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF032[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,11 row-size=24B cardinality=293.73K
+|  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |
+|  |--70:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=12B cardinality=186
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F25:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=186
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF032[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=10 row-size=12B cardinality=2.88M
+|     in pipelines: 12(GETNEXT)
+|
+39:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  other predicates: CASE WHEN sum(ws_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ws_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ws_ext_sales_price) ELSE NULL END > CASE WHEN sum(ss_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ss_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ss_ext_sales_price) ELSE NULL END
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=3,18,23,28,8 row-size=250B cardinality=3.13T
+|  in pipelines: 45(GETNEXT), 68(OPEN)
+|
+|--69:EXCHANGE [HASH(ca_county)]
+|  |  mem-estimate=4.82MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=50B cardinality=293.73K
+|  |  in pipelines: 68(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=14.82MB mem-reservation=2.88MB thread-reservation=1
+|  68:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=50B cardinality=293.73K
+|  |  in pipelines: 68(GETNEXT), 06(OPEN)
+|  |
+|  67:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  |  mem-estimate=4.82MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=50B cardinality=293.73K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=49.29MB mem-reservation=15.81MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  11:AGGREGATE [STREAMING]
+|  |  output: sum(ss_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=50B cardinality=293.73K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=5,6,7 row-size=54B cardinality=293.73K
+|  |  in pipelines: 06(GETNEXT), 08(OPEN)
+|  |
+|  |--66:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=30B cardinality=50.00K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F22:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  08:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=30B cardinality=50.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF028[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=24B cardinality=293.73K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--65:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=12B cardinality=186
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=12B cardinality=186
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF028[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=5 row-size=12B cardinality=2.88M
+|     in pipelines: 06(GETNEXT)
+|
+38:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=3,18,23,28 row-size=200B cardinality=19.43G
+|  in pipelines: 45(GETNEXT), 63(OPEN)
+|
+|--64:EXCHANGE [HASH(ca_county)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=73.80K
+|  |  in pipelines: 63(GETNEXT)
+|  |
+|  F19:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=11.86MB mem-reservation=4.75MB thread-reservation=1
+|  63:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=73.80K
+|  |  in pipelines: 63(GETNEXT), 30(OPEN)
+|  |
+|  62:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [HASH(ws_bill_addr_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=15.31MB mem-reservation=7.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  35:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  34:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF022[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25,26,27 row-size=54B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT), 32(OPEN)
+|  |
+|  |--61:EXCHANGE [HASH(ca_address_sk)]
+|  |  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=27 row-size=30B cardinality=50.00K
+|  |  |  in pipelines: 32(GETNEXT)
+|  |  |
+|  |  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  32:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=27 row-size=30B cardinality=50.00K
+|  |     in pipelines: 32(GETNEXT)
+|  |
+|  60:EXCHANGE [HASH(ws_bill_addr_sk)]
+|  |  mem-estimate=928.89KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25,26 row-size=24B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=99.95MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  33:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF024[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25,26 row-size=24B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT), 31(OPEN)
+|  |
+|  |--59:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=26 row-size=12B cardinality=186
+|  |  |  in pipelines: 31(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  31:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=26 row-size=12B cardinality=186
+|  |     in pipelines: 31(GETNEXT)
+|  |
+|  30:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF024[bloom] -> ws_sold_date_sk, RF022[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=25 row-size=12B cardinality=719.38K
+|     in pipelines: 30(GETNEXT)
+|
+37:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=3,18,23 row-size=150B cardinality=480.37M
+|  in pipelines: 45(GETNEXT), 57(OPEN)
+|
+|--58:EXCHANGE [HASH(ca_county)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23 row-size=50B cardinality=73.80K
+|  |  in pipelines: 57(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=11.86MB mem-reservation=4.75MB thread-reservation=1
+|  57:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=23 row-size=50B cardinality=73.80K
+|  |  in pipelines: 57(GETNEXT), 24(OPEN)
+|  |
+|  56:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23 row-size=50B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [HASH(ws_bill_addr_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=15.31MB mem-reservation=7.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  29:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=23 row-size=50B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF018[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=20,21,22 row-size=54B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--55:EXCHANGE [HASH(ca_address_sk)]
+|  |  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=22 row-size=30B cardinality=50.00K
+|  |  |  in pipelines: 26(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  26:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=22 row-size=30B cardinality=50.00K
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  54:EXCHANGE [HASH(ws_bill_addr_sk)]
+|  |  mem-estimate=928.89KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20,21 row-size=24B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=99.95MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=20,21 row-size=24B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--53:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21 row-size=12B cardinality=186
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=21 row-size=12B cardinality=186
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF020[bloom] -> ws_sold_date_sk, RF018[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=20 row-size=12B cardinality=719.38K
+|     in pipelines: 24(GETNEXT)
+|
+36:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=3,18 row-size=100B cardinality=11.88M
+|  in pipelines: 45(GETNEXT), 50(OPEN)
+|
+|--52:EXCHANGE [HASH(ca_county)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=50B cardinality=73.80K
+|  |  in pipelines: 50(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=11.86MB mem-reservation=4.75MB thread-reservation=1
+|  50:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=18 row-size=50B cardinality=73.80K
+|  |  in pipelines: 50(GETNEXT), 18(OPEN)
+|  |
+|  49:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=50B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(ws_bill_addr_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=15.31MB mem-reservation=7.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  23:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=18 row-size=50B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF014[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=15,16,17 row-size=54B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT), 20(OPEN)
+|  |
+|  |--48:EXCHANGE [HASH(ca_address_sk)]
+|  |  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=17 row-size=30B cardinality=50.00K
+|  |  |  in pipelines: 20(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  20:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=17 row-size=30B cardinality=50.00K
+|  |     in pipelines: 20(GETNEXT)
+|  |
+|  47:EXCHANGE [HASH(ws_bill_addr_sk)]
+|  |  mem-estimate=928.89KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15,16 row-size=24B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=99.95MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=15,16 row-size=24B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT), 19(OPEN)
+|  |
+|  |--46:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=16 row-size=12B cardinality=186
+|  |  |  in pipelines: 19(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  19:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=16 row-size=12B cardinality=186
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  18:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF016[bloom] -> ws_sold_date_sk, RF014[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=15 row-size=12B cardinality=719.38K
+|     in pipelines: 18(GETNEXT)
+|
+51:EXCHANGE [HASH(ca_county)]
+|  mem-estimate=4.82MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=50B cardinality=293.73K
+|  in pipelines: 45(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=14.82MB mem-reservation=2.88MB thread-reservation=1
+45:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: ca_county, d_qoy, d_year
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=3 row-size=50B cardinality=293.73K
+|  in pipelines: 45(GETNEXT), 00(OPEN)
+|
+44:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  mem-estimate=4.82MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=50B cardinality=293.73K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=50.29MB mem-reservation=16.81MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: ca_county, d_qoy, d_year
+|  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=3 row-size=50B cardinality=293.73K
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  runtime filters: RF010[bloom] <- ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=54B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--43:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=30B cardinality=50.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=30B cardinality=50.00K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF012[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--42:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=186
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=186
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> ss_sold_date_sk, RF010[bloom] -> ss_addr_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=227.81MB Threads=58
+Per-Host Resource Estimates: Memory=480.99GB
+F28:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=60.76MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: ca_county, d_year, (web_sales * CAST(1.0000 AS DECIMAL(5,4))) / web_sales, (store_sales * CAST(1.0000 AS DECIMAL(5,4))) / store_sales, (web_sales * CAST(1.0000 AS DECIMAL(5,4))) / web_sales, (store_sales * CAST(1.0000 AS DECIMAL(5,4))) / store_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+75:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: ca_county ASC
+|  mem-estimate=60.76MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=30 row-size=126B cardinality=503.21T
+|  in pipelines: 41(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(ca_county)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=240.11GB mem-reservation=12.00MB thread-reservation=1
+41:SORT
+|  order by: ca_county ASC
+|  mem-estimate=240.10GB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=30 row-size=126B cardinality=503.21T
+|  in pipelines: 41(GETNEXT), 45(OPEN)
+|
+40:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  other predicates: CASE WHEN sum(ws_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ws_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ws_ext_sales_price) ELSE NULL END > CASE WHEN sum(ss_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ss_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ss_ext_sales_price) ELSE NULL END
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=3,18,23,28,8,13 row-size=300B cardinality=503.21T
+|  in pipelines: 45(GETNEXT), 73(OPEN)
+|
+|--F29:PLAN FRAGMENT [HASH(ca_county)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=9.73MB mem-reservation=4.75MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: ca_county
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  74:EXCHANGE [HASH(ca_county)]
+|  |  mem-estimate=4.98MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=50B cardinality=293.73K
+|  |  in pipelines: 73(GETNEXT)
+|  |
+|  F27:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=14.98MB mem-reservation=1.94MB thread-reservation=1
+|  73:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=50B cardinality=293.73K
+|  |  in pipelines: 73(GETNEXT), 12(OPEN)
+|  |
+|  72:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  |  mem-estimate=4.98MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=50B cardinality=293.73K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+|  17:AGGREGATE [STREAMING]
+|  |  output: sum(ss_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=50B cardinality=293.73K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ss_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=10,11,12 row-size=54B cardinality=293.73K
+|  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |
+|  |--F30:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=7.21MB mem-reservation=5.75MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: ca_address_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  71:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=30B cardinality=50.00K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  14:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=12 row-size=30B cardinality=50.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,11 row-size=24B cardinality=293.73K
+|  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |
+|  |--F31:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF032[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  70:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=12B cardinality=186
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F25:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=11 row-size=12B cardinality=186
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF032[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=10 row-size=12B cardinality=2.88M
+|     in pipelines: 12(GETNEXT)
+|
+39:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=03
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  other predicates: CASE WHEN sum(ws_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ws_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ws_ext_sales_price) ELSE NULL END > CASE WHEN sum(ss_ext_sales_price) > CAST(0 AS DECIMAL(3,0)) THEN (sum(ss_ext_sales_price) * CAST(1.0000 AS DECIMAL(5,4))) / sum(ss_ext_sales_price) ELSE NULL END
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=3,18,23,28,8 row-size=250B cardinality=3.13T
+|  in pipelines: 45(GETNEXT), 68(OPEN)
+|
+|--F32:PLAN FRAGMENT [HASH(ca_county)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=9.73MB mem-reservation=4.75MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: ca_county
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  69:EXCHANGE [HASH(ca_county)]
+|  |  mem-estimate=4.98MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=50B cardinality=293.73K
+|  |  in pipelines: 68(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=14.98MB mem-reservation=1.94MB thread-reservation=1
+|  68:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=50B cardinality=293.73K
+|  |  in pipelines: 68(GETNEXT), 06(OPEN)
+|  |
+|  67:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  |  mem-estimate=4.98MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=50B cardinality=293.73K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+|  11:AGGREGATE [STREAMING]
+|  |  output: sum(ss_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=50B cardinality=293.73K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ss_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=5,6,7 row-size=54B cardinality=293.73K
+|  |  in pipelines: 06(GETNEXT), 08(OPEN)
+|  |
+|  |--F33:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=7.21MB mem-reservation=5.75MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=03
+|  |  |  build expressions: ca_address_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  66:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=30B cardinality=50.00K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F22:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  08:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=7 row-size=30B cardinality=50.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=24B cardinality=293.73K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--F34:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF028[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  65:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=12B cardinality=186
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=6 row-size=12B cardinality=186
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF028[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=5 row-size=12B cardinality=2.88M
+|     in pipelines: 06(GETNEXT)
+|
+38:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=06
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,18,23,28 row-size=200B cardinality=19.43G
+|  in pipelines: 45(GETNEXT), 63(OPEN)
+|
+|--F35:PLAN FRAGMENT [HASH(ca_county)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=3.80MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: ca_county
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  64:EXCHANGE [HASH(ca_county)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=73.80K
+|  |  in pipelines: 63(GETNEXT)
+|  |
+|  F19:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=11.86MB mem-reservation=4.75MB thread-reservation=1
+|  63:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=73.80K
+|  |  in pipelines: 63(GETNEXT), 30(OPEN)
+|  |
+|  62:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [HASH(ws_bill_addr_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=10.91MB mem-reservation=5.00MB thread-reservation=1
+|  35:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=28 row-size=50B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  34:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=07
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25,26,27 row-size=54B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT), 32(OPEN)
+|  |
+|  |--F36:PLAN FRAGMENT [HASH(ws_bill_addr_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.40MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=04
+|  |  |  build expressions: ca_address_sk
+|  |  |  runtime filters: RF022[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  61:EXCHANGE [HASH(ca_address_sk)]
+|  |  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=27 row-size=30B cardinality=50.00K
+|  |  |  in pipelines: 32(GETNEXT)
+|  |  |
+|  |  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  32:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=27 row-size=30B cardinality=50.00K
+|  |     in pipelines: 32(GETNEXT)
+|  |
+|  60:EXCHANGE [HASH(ws_bill_addr_sk)]
+|  |  mem-estimate=928.89KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25,26 row-size=24B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  33:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=08
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25,26 row-size=24B cardinality=73.80K
+|  |  in pipelines: 30(GETNEXT), 31(OPEN)
+|  |
+|  |--F37:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=08 plan-id=09 cohort-id=04
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF024[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  59:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=26 row-size=12B cardinality=186
+|  |  |  in pipelines: 31(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  31:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(3 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=26 row-size=12B cardinality=186
+|  |     in pipelines: 31(GETNEXT)
+|  |
+|  30:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF024[bloom] -> ws_sold_date_sk, RF022[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=25 row-size=12B cardinality=719.38K
+|     in pipelines: 30(GETNEXT)
+|
+37:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=09
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,18,23 row-size=150B cardinality=480.37M
+|  in pipelines: 45(GETNEXT), 57(OPEN)
+|
+|--F38:PLAN FRAGMENT [HASH(ca_county)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=3.80MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  build expressions: ca_county
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  58:EXCHANGE [HASH(ca_county)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23 row-size=50B cardinality=73.80K
+|  |  in pipelines: 57(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=11.86MB mem-reservation=4.75MB thread-reservation=1
+|  57:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=23 row-size=50B cardinality=73.80K
+|  |  in pipelines: 57(GETNEXT), 24(OPEN)
+|  |
+|  56:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23 row-size=50B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [HASH(ws_bill_addr_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=10.91MB mem-reservation=5.00MB thread-reservation=1
+|  29:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=23 row-size=50B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=10
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=20,21,22 row-size=54B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--F39:PLAN FRAGMENT [HASH(ws_bill_addr_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.40MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=10 plan-id=11 cohort-id=05
+|  |  |  build expressions: ca_address_sk
+|  |  |  runtime filters: RF018[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  55:EXCHANGE [HASH(ca_address_sk)]
+|  |  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=22 row-size=30B cardinality=50.00K
+|  |  |  in pipelines: 26(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  26:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=22 row-size=30B cardinality=50.00K
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  54:EXCHANGE [HASH(ws_bill_addr_sk)]
+|  |  mem-estimate=928.89KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20,21 row-size=24B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=11
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=20,21 row-size=24B cardinality=73.80K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--F40:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=11 plan-id=12 cohort-id=05
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  53:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21 row-size=12B cardinality=186
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(2 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=21 row-size=12B cardinality=186
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF020[bloom] -> ws_sold_date_sk, RF018[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=20 row-size=12B cardinality=719.38K
+|     in pipelines: 24(GETNEXT)
+|
+36:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=12
+|  hash predicates: ca_county = ca_county
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,18 row-size=100B cardinality=11.88M
+|  in pipelines: 45(GETNEXT), 50(OPEN)
+|
+|--F41:PLAN FRAGMENT [HASH(ca_county)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=3.80MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=12 plan-id=13 cohort-id=01
+|  |  build expressions: ca_county
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  52:EXCHANGE [HASH(ca_county)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=50B cardinality=73.80K
+|  |  in pipelines: 50(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=11.86MB mem-reservation=4.75MB thread-reservation=1
+|  50:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=18 row-size=50B cardinality=73.80K
+|  |  in pipelines: 50(GETNEXT), 18(OPEN)
+|  |
+|  49:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  |  mem-estimate=1.86MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=50B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(ws_bill_addr_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=10.91MB mem-reservation=5.00MB thread-reservation=1
+|  23:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: ca_county, d_qoy, d_year
+|  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=18 row-size=50B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=13
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=15,16,17 row-size=54B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT), 20(OPEN)
+|  |
+|  |--F42:PLAN FRAGMENT [HASH(ws_bill_addr_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.40MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=13 plan-id=14 cohort-id=06
+|  |  |  build expressions: ca_address_sk
+|  |  |  runtime filters: RF014[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  48:EXCHANGE [HASH(ca_address_sk)]
+|  |  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=17 row-size=30B cardinality=50.00K
+|  |  |  in pipelines: 20(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  20:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=17 row-size=30B cardinality=50.00K
+|  |     in pipelines: 20(GETNEXT)
+|  |
+|  47:EXCHANGE [HASH(ws_bill_addr_sk)]
+|  |  mem-estimate=928.89KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15,16 row-size=24B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=14
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=15,16 row-size=24B cardinality=73.80K
+|  |  in pipelines: 18(GETNEXT), 19(OPEN)
+|  |
+|  |--F43:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=14 plan-id=15 cohort-id=06
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  46:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=16 row-size=12B cardinality=186
+|  |  |  in pipelines: 19(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  19:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=16 row-size=12B cardinality=186
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  18:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF016[bloom] -> ws_sold_date_sk, RF014[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=15 row-size=12B cardinality=719.38K
+|     in pipelines: 18(GETNEXT)
+|
+51:EXCHANGE [HASH(ca_county)]
+|  mem-estimate=4.98MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=50B cardinality=293.73K
+|  in pipelines: 45(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ca_county,d_qoy,d_year)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=14.98MB mem-reservation=1.94MB thread-reservation=1
+45:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: ca_county, d_qoy, d_year
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=50B cardinality=293.73K
+|  in pipelines: 45(GETNEXT), 00(OPEN)
+|
+44:EXCHANGE [HASH(ca_county,d_qoy,d_year)]
+|  mem-estimate=4.98MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=50B cardinality=293.73K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: ca_county, d_qoy, d_year
+|  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=3 row-size=50B cardinality=293.73K
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=15
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=54B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F44:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=8.21MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=15 plan-id=16 cohort-id=01
+|  |  build expressions: ca_address_sk
+|  |  runtime filters: RF010[bloom] <- ca_address_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  43:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=30B cardinality=50.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=30B cardinality=50.00K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=16
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=293.73K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F45:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=16 plan-id=17 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  42:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=186
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT), tpcds_parquet.date_dim.d_qoy = CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=1 row-size=12B cardinality=186
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> ss_sold_date_sk, RF010[bloom] -> ss_addr_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q32.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q32.test
new file mode 100644
index 0000000..ce57195
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q32.test
@@ -0,0 +1,523 @@
+# TPCDS-Q32
+SELECT sum(cs_ext_discount_amt) AS "excess discount amount"
+FROM catalog_sales ,
+     item ,
+     date_dim
+WHERE i_manufact_id = 977
+  AND i_item_sk = cs_item_sk
+  AND d_date BETWEEN '2000-01-27' AND cast('2000-04-26' AS date)
+  AND d_date_sk = cs_sold_date_sk
+  AND cs_ext_discount_amt >
+    ( SELECT 1.3 * avg(cs_ext_discount_amt)
+     FROM catalog_sales ,
+          date_dim
+     WHERE cs_item_sk = i_item_sk
+       AND d_date BETWEEN '2000-01-27' AND cast('2000-04-26' AS date)
+       AND d_date_sk = cs_sold_date_sk )
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=28.75MB Threads=6
+Per-Host Resource Estimates: Memory=392MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=391.88MB mem-reservation=28.75MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: sum(cs_ext_discount_amt)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum(cs_ext_discount_amt)
+|  limit: 100
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 10(GETNEXT), 06(OPEN)
+|
+09:HASH JOIN [RIGHT SEMI JOIN]
+|  hash predicates: cs_item_sk = i_item_sk
+|  other join predicates: cs_ext_discount_amt > CAST(1.3 AS DECIMAL(2,1)) * avg(cs_ext_discount_amt)
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=54B cardinality=1.52K
+|  in pipelines: 06(GETNEXT), 02(OPEN)
+|
+|--08:HASH JOIN [INNER JOIN]
+|  |  hash predicates: d_date_sk = cs_sold_date_sk
+|  |  fk/pk conjuncts: d_date_sk = cs_sold_date_sk
+|  |  runtime filters: RF004[bloom] <- cs_sold_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=54B cardinality=1.52K
+|  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |
+|  |--07:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  |  runtime filters: RF006[bloom] <- i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=28B cardinality=1.52K
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--01:SCAN HDFS [tpcds_parquet.item]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     predicates: i_manufact_id = CAST(977 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     parquet statistics predicates: i_manufact_id = CAST(977 AS INT)
+|  |  |     parquet dictionary predicates: i_manufact_id = CAST(977 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=12B cardinality=19
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF006[bloom] -> cs_item_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=16B cardinality=1.44M
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     runtime filters: RF004[bloom] -> d_date_sk
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+06:AGGREGATE [FINALIZE]
+|  output: avg(cs_ext_discount_amt)
+|  group by: cs_item_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=16B cardinality=17.98K
+|  in pipelines: 06(GETNEXT), 03(OPEN)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,4 row-size=42B cardinality=1.44M
+|  in pipelines: 03(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=26B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+03:SCAN HDFS [tpcds_parquet.catalog_sales]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF002[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=3 row-size=16B cardinality=1.44M
+   in pipelines: 03(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=35.94MB Threads=13
+Per-Host Resource Estimates: Memory=438MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: sum(cs_ext_discount_amt)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+19:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_ext_discount_amt)
+|  limit: 100
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 19(GETNEXT), 10(OPEN)
+|
+18:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 10(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=22.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+10:AGGREGATE
+|  output: sum(cs_ext_discount_amt)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 10(GETNEXT), 13(OPEN)
+|
+09:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash predicates: cs_item_sk = i_item_sk
+|  other join predicates: cs_ext_discount_amt > CAST(1.3 AS DECIMAL(2,1)) * avg(cs_ext_discount_amt)
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=54B cardinality=1.52K
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+|--17:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=224.75KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,1,2 row-size=54B cardinality=1.52K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [HASH(cs_sold_date_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=3.27MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1,2 row-size=54B cardinality=1.52K
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--16:EXCHANGE [HASH(d_date_sk)]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=2 row-size=26B cardinality=7.30K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  15:EXCHANGE [HASH(cs_sold_date_sk)]
+|  |  mem-estimate=121.87KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,1 row-size=28B cardinality=1.52K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=147.95MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  runtime filters: RF006[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=28B cardinality=1.52K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--14:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=12B cardinality=19
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_manufact_id = CAST(977 AS INT)
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_manufact_id = CAST(977 AS INT)
+|  |     parquet dictionary predicates: i_manufact_id = CAST(977 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=1 row-size=12B cardinality=19
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> cs_sold_date_sk, RF006[bloom] -> cs_item_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=0 row-size=16B cardinality=1.44M
+|     in pipelines: 00(GETNEXT)
+|
+13:AGGREGATE [FINALIZE]
+|  output: avg:merge(cs_ext_discount_amt)
+|  group by: cs_item_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=16B cardinality=17.98K
+|  in pipelines: 13(GETNEXT), 03(OPEN)
+|
+12:EXCHANGE [HASH(cs_item_sk)]
+|  mem-estimate=153.62KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=16B cardinality=17.98K
+|  in pipelines: 03(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=158.15MB mem-reservation=13.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+06:AGGREGATE [STREAMING]
+|  output: avg(cs_ext_discount_amt)
+|  group by: cs_item_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=16B cardinality=17.98K
+|  in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,4 row-size=42B cardinality=1.44M
+|  in pipelines: 03(GETNEXT), 04(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=26B cardinality=7.30K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=26B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+03:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF002[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=3 row-size=16B cardinality=1.44M
+   in pipelines: 03(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=41.81MB Threads=12
+Per-Host Resource Estimates: Memory=204MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: sum(cs_ext_discount_amt)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+19:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_ext_discount_amt)
+|  limit: 100
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 19(GETNEXT), 10(OPEN)
+|
+18:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 10(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+10:AGGREGATE
+|  output: sum(cs_ext_discount_amt)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 10(GETNEXT), 13(OPEN)
+|
+09:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: cs_item_sk = i_item_sk
+|  other join predicates: cs_ext_discount_amt > CAST(1.3 AS DECIMAL(2,1)) * avg(cs_ext_discount_amt)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=54B cardinality=1.52K
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+|--F08:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.16MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF000[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  17:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=224.75KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,1,2 row-size=54B cardinality=1.52K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [HASH(cs_sold_date_sk)] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=121.87KB mem-reservation=0B thread-reservation=1
+|  08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1,2 row-size=54B cardinality=1.52K
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--F09:PLAN FRAGMENT [HASH(cs_sold_date_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.15MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  16:EXCHANGE [HASH(d_date_sk)]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=2 row-size=26B cardinality=7.30K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  15:EXCHANGE [HASH(cs_sold_date_sk)]
+|  |  mem-estimate=121.87KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,1 row-size=28B cardinality=1.52K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=28B cardinality=1.52K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF006[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  14:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=12B cardinality=19
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_manufact_id = CAST(977 AS INT)
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_manufact_id = CAST(977 AS INT)
+|  |     parquet dictionary predicates: i_manufact_id = CAST(977 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=1 row-size=12B cardinality=19
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> cs_sold_date_sk, RF006[bloom] -> cs_item_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=0 row-size=16B cardinality=1.44M
+|     in pipelines: 00(GETNEXT)
+|
+13:AGGREGATE [FINALIZE]
+|  output: avg:merge(cs_ext_discount_amt)
+|  group by: cs_item_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=16B cardinality=17.98K
+|  in pipelines: 13(GETNEXT), 03(OPEN)
+|
+12:EXCHANGE [HASH(cs_item_sk)]
+|  mem-estimate=153.62KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=16B cardinality=17.98K
+|  in pipelines: 03(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=58.00MB mem-reservation=10.00MB thread-reservation=1
+06:AGGREGATE [STREAMING]
+|  output: avg(cs_ext_discount_amt)
+|  group by: cs_item_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=16B cardinality=17.98K
+|  in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,4 row-size=42B cardinality=1.44M
+|  in pipelines: 03(GETNEXT), 04(OPEN)
+|
+|--F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.09MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=26B cardinality=7.30K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=4 row-size=26B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+03:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF002[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=3 row-size=16B cardinality=1.44M
+   in pipelines: 03(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q33.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q33.test
new file mode 100644
index 0000000..421247d
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q33.test
@@ -0,0 +1,879 @@
+# TPCDS-Q33
+with ss as (
+ select
+          i_manufact_id,sum(ss_ext_sales_price) total_sales
+ from
+  store_sales,
+  date_dim,
+         customer_address,
+         item
+ where
+         i_manufact_id in (select
+  i_manufact_id
+from
+ item
+where i_category in ('Electronics'))
+ and     ss_item_sk              = i_item_sk
+ and     ss_sold_date_sk         = d_date_sk
+ and     d_year                  = 1998
+ and     d_moy                   = 5
+ and     ss_addr_sk              = ca_address_sk
+ and     ca_gmt_offset           = -5
+ group by i_manufact_id),
+ cs as (
+ select
+          i_manufact_id,sum(cs_ext_sales_price) total_sales
+ from
+  catalog_sales,
+  date_dim,
+         customer_address,
+         item
+ where
+         i_manufact_id               in (select
+  i_manufact_id
+from
+ item
+where i_category in ('Electronics'))
+ and     cs_item_sk              = i_item_sk
+ and     cs_sold_date_sk         = d_date_sk
+ and     d_year                  = 1998
+ and     d_moy                   = 5
+ and     cs_bill_addr_sk         = ca_address_sk
+ and     ca_gmt_offset           = -5
+ group by i_manufact_id),
+ ws as (
+ select
+          i_manufact_id,sum(ws_ext_sales_price) total_sales
+ from
+  web_sales,
+  date_dim,
+         customer_address,
+         item
+ where
+         i_manufact_id               in (select
+  i_manufact_id
+from
+ item
+where i_category in ('Electronics'))
+ and     ws_item_sk              = i_item_sk
+ and     ws_sold_date_sk         = d_date_sk
+ and     d_year                  = 1998
+ and     d_moy                   = 5
+ and     ws_bill_addr_sk         = ca_address_sk
+ and     ca_gmt_offset           = -5
+ group by i_manufact_id)
+  select  i_manufact_id ,sum(total_sales) total_sales
+ from  (select * from ss
+        union all
+        select * from cs
+        union all
+        select * from ws) tmp1
+ group by i_manufact_id
+ order by total_sales
+limit 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=29.62MB Threads=6
+Per-Host Resource Estimates: Memory=364MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=363.75MB mem-reservation=29.62MB thread-reservation=6 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: i_manufact_id, sum(total_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+32:TOP-N [LIMIT=100]
+|  order by: sum(total_sales) ASC
+|  mem-estimate=1.95KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=20B cardinality=100
+|  in pipelines: 32(GETNEXT), 31(OPEN)
+|
+31:AGGREGATE [FINALIZE]
+|  output: sum(total_sales)
+|  group by: i_manufact_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=20B cardinality=2.83K
+|  in pipelines: 31(GETNEXT), 10(OPEN), 20(OPEN), 30(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=20B cardinality=2.83K
+|  in pipelines: 10(GETNEXT), 20(GETNEXT), 30(GETNEXT)
+|
+|--30:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: i_manufact_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=20B cardinality=944
+|  |  in pipelines: 30(GETNEXT), 21(OPEN)
+|  |
+|  29:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: i_manufact_id = i_manufact_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19 row-size=52B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 25(OPEN)
+|  |
+|  |--25:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category IN ('Electronics')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category IN ('Electronics')
+|  |     parquet dictionary predicates: i_category IN ('Electronics')
+|  |     mem-estimate=32.00MB mem-reservation=128.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=22B cardinality=1.80K
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19 row-size=52B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 24(OPEN)
+|  |
+|  |--24:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=12B cardinality=18.00K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF020[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=40B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 23(OPEN)
+|  |
+|  |--23:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=8B cardinality=8.33K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF022[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17 row-size=32B cardinality=42.85K
+|  |  in pipelines: 21(GETNEXT), 22(OPEN)
+|  |
+|  |--22:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=17 row-size=12B cardinality=108
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  21:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF022[bloom] -> ws_sold_date_sk, RF020[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=16 row-size=20B cardinality=719.38K
+|     in pipelines: 21(GETNEXT)
+|
+|--20:AGGREGATE [FINALIZE]
+|  |  output: sum(cs_ext_sales_price)
+|  |  group by: i_manufact_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=20B cardinality=944
+|  |  in pipelines: 20(GETNEXT), 11(OPEN)
+|  |
+|  19:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: i_manufact_id = i_manufact_id
+|  |  runtime filters: RF008[bloom] <- i_manufact_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11 row-size=52B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 15(OPEN)
+|  |
+|  |--15:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category IN ('Electronics')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category IN ('Electronics')
+|  |     parquet dictionary predicates: i_category IN ('Electronics')
+|  |     mem-estimate=32.00MB mem-reservation=128.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=22B cardinality=1.80K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  runtime filters: RF010[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11 row-size=52B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 14(OPEN)
+|  |
+|  |--14:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF008[bloom] -> i_manufact_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=18.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  17:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: cs_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=40B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |
+|  |--13:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=8B cardinality=8.33K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=32B cardinality=85.31K
+|  |  in pipelines: 11(GETNEXT), 12(OPEN)
+|  |
+|  |--12:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=12B cardinality=108
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF014[bloom] -> cs_sold_date_sk, RF012[bloom] -> cs_bill_addr_sk, RF010[bloom] -> cs_item_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=8 row-size=20B cardinality=1.44M
+|     in pipelines: 11(GETNEXT)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_manufact_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=20B cardinality=944
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+09:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: i_manufact_id = i_manufact_id
+|  runtime filters: RF000[bloom] <- i_manufact_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=52B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Electronics')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Electronics')
+|     parquet dictionary predicates: i_category IN ('Electronics')
+|     mem-estimate=32.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=4 row-size=22B cardinality=1.80K
+|     in pipelines: 05(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=52B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> i_manufact_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  runtime filters: RF004[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=40B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=8.33K
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=32B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=108
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_addr_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=69.50MB Threads=35
+Per-Host Resource Estimates: Memory=898MB
+F22:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_manufact_id, sum(total_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+55:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(total_sales) ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=20B cardinality=100
+|  in pipelines: 32(GETNEXT)
+|
+F21:PLAN FRAGMENT [HASH(i_manufact_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.09MB mem-reservation=1.94MB thread-reservation=1
+32:TOP-N [LIMIT=100]
+|  order by: sum(total_sales) ASC
+|  mem-estimate=1.95KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=20B cardinality=100
+|  in pipelines: 32(GETNEXT), 54(OPEN)
+|
+54:AGGREGATE [FINALIZE]
+|  output: sum:merge(total_sales)
+|  group by: i_manufact_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=20B cardinality=2.83K
+|  in pipelines: 54(GETNEXT), 38(OPEN), 45(OPEN), 52(OPEN)
+|
+53:EXCHANGE [HASH(i_manufact_id)]
+|  mem-estimate=90.44KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=26 row-size=20B cardinality=2.83K
+|  in pipelines: 38(GETNEXT), 45(GETNEXT), 52(GETNEXT)
+|
+F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=20.07MB mem-reservation=3.94MB thread-reservation=1
+31:AGGREGATE [STREAMING]
+|  output: sum(total_sales)
+|  group by: i_manufact_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=20B cardinality=2.83K
+|  in pipelines: 38(GETNEXT), 45(GETNEXT), 52(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=20B cardinality=2.83K
+|  in pipelines: 38(GETNEXT), 45(GETNEXT), 52(GETNEXT)
+|
+|--52:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: i_manufact_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=20B cardinality=944
+|  |  in pipelines: 52(GETNEXT), 21(OPEN)
+|  |
+|  51:EXCHANGE [HASH(i_manufact_id)]
+|  |  mem-estimate=53.47KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=22 row-size=20B cardinality=944
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [HASH(ws_item_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=14.45MB mem-reservation=5.88MB thread-reservation=1
+|  30:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: i_manufact_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=20B cardinality=944
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  29:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: i_manufact_id = i_manufact_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19 row-size=52B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 25(OPEN)
+|  |
+|  |--50:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=64.38KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20 row-size=22B cardinality=1.80K
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=128.00KB thread-reservation=2
+|  |  25:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category IN ('Electronics')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category IN ('Electronics')
+|  |     parquet dictionary predicates: i_category IN ('Electronics')
+|  |     mem-estimate=32.00MB mem-reservation=128.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=22B cardinality=1.80K
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19 row-size=52B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 24(OPEN)
+|  |
+|  |--49:EXCHANGE [HASH(i_item_sk)]
+|  |  |  mem-estimate=226.94KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=12B cardinality=18.00K
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  24:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=12B cardinality=18.00K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  48:EXCHANGE [HASH(ws_item_sk)]
+|  |  mem-estimate=295.62KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=40B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=133.97MB mem-reservation=13.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF020[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=40B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 23(OPEN)
+|  |
+|  |--47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  23:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=8B cardinality=8.33K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF022[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17 row-size=32B cardinality=42.85K
+|  |  in pipelines: 21(GETNEXT), 22(OPEN)
+|  |
+|  |--46:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=17 row-size=12B cardinality=108
+|  |  |  in pipelines: 22(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  22:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=17 row-size=12B cardinality=108
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  21:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF022[bloom] -> ws_sold_date_sk, RF020[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=16 row-size=20B cardinality=719.38K
+|     in pipelines: 21(GETNEXT)
+|
+|--45:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_ext_sales_price)
+|  |  group by: i_manufact_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=20B cardinality=944
+|  |  in pipelines: 45(GETNEXT), 11(OPEN)
+|  |
+|  44:EXCHANGE [HASH(i_manufact_id)]
+|  |  mem-estimate=72.52KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=20B cardinality=944
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=16.50MB mem-reservation=7.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  20:AGGREGATE [STREAMING]
+|  |  output: sum(cs_ext_sales_price)
+|  |  group by: i_manufact_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=20B cardinality=944
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  19:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: i_manufact_id = i_manufact_id
+|  |  runtime filters: RF008[bloom] <- i_manufact_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11 row-size=52B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 15(OPEN)
+|  |
+|  |--43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=64.38KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=22B cardinality=1.80K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=128.00KB thread-reservation=2
+|  |  15:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category IN ('Electronics')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category IN ('Electronics')
+|  |     parquet dictionary predicates: i_category IN ('Electronics')
+|  |     mem-estimate=32.00MB mem-reservation=128.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=22B cardinality=1.80K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  runtime filters: RF010[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11 row-size=52B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 14(OPEN)
+|  |
+|  |--42:EXCHANGE [HASH(i_item_sk)]
+|  |  |  mem-estimate=226.94KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=12B cardinality=18.00K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.25MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  14:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF008[bloom] -> i_manufact_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=18.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  41:EXCHANGE [HASH(cs_item_sk)]
+|  |  mem-estimate=348.84KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=40B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=198.97MB mem-reservation=14.88MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  17:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: cs_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=40B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |
+|  |--40:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  13:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=8B cardinality=8.33K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=32B cardinality=85.31K
+|  |  in pipelines: 11(GETNEXT), 12(OPEN)
+|  |
+|  |--39:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=12B cardinality=108
+|  |  |  in pipelines: 12(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  12:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=12B cardinality=108
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF014[bloom] -> cs_sold_date_sk, RF012[bloom] -> cs_bill_addr_sk, RF010[bloom] -> cs_item_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=8 row-size=20B cardinality=1.44M
+|     in pipelines: 11(GETNEXT)
+|
+38:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_manufact_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=20B cardinality=944
+|  in pipelines: 38(GETNEXT), 01(OPEN)
+|
+37:EXCHANGE [HASH(i_manufact_id)]
+|  mem-estimate=72.52KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=20B cardinality=944
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=70.13MB mem-reservation=15.75MB thread-reservation=2 runtime-filters-memory=4.00MB
+10:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_manufact_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=20B cardinality=944
+|  in pipelines: 01(GETNEXT)
+|
+09:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: i_manufact_id = i_manufact_id
+|  runtime filters: RF000[bloom] <- i_manufact_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=52B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=64.38KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=22B cardinality=1.80K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=128.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Electronics')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Electronics')
+|     parquet dictionary predicates: i_category IN ('Electronics')
+|     mem-estimate=32.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=4 row-size=22B cardinality=1.80K
+|     in pipelines: 05(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=52B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--35:EXCHANGE [BROADCAST]
+|  |  mem-estimate=226.94KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=18.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.25MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  04:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> i_manufact_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  runtime filters: RF004[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=40B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--34:EXCHANGE [BROADCAST]
+|  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=8.33K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=8.33K
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=32B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--33:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=108
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(5 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=108
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_addr_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q34.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q34.test
new file mode 100644
index 0000000..7266357
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q34.test
@@ -0,0 +1,540 @@
+# TPCDS-Q34
+select
+  c_last_name,
+  c_first_name,
+  c_salutation,
+  c_preferred_cust_flag,
+  ss_ticket_number,
+  cnt
+from
+  (select
+    ss_ticket_number,
+    ss_customer_sk,
+    count(*) cnt
+  from
+    store_sales,
+    date_dim,
+    store,
+    household_demographics
+  where
+    store_sales.ss_sold_date_sk = date_dim.d_date_sk
+    and store_sales.ss_store_sk = store.s_store_sk
+    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+    and (date_dim.d_dom between 1 and 3
+      or date_dim.d_dom between 25 and 28)
+    and (household_demographics.hd_buy_potential = '>10000'
+      or household_demographics.hd_buy_potential = 'unknown')
+    and household_demographics.hd_vehicle_count > 0
+    and (case when household_demographics.hd_vehicle_count > 0 then household_demographics.hd_dep_count / household_demographics.hd_vehicle_count else null end) > 1.2
+    and date_dim.d_year in (1998, 1998 + 1, 1998 + 2)
+    and store.s_county in ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
+  group by
+    ss_ticket_number,
+    ss_customer_sk
+  ) dn,
+  customer
+where
+  ss_customer_sk = c_customer_sk
+  and cnt between 15 and 20
+order by
+  c_last_name,
+  c_first_name,
+  c_salutation,
+  c_preferred_cust_flag desc
+limit 100000
+---- PLAN
+Max Per-Host Resource Reservation: Memory=14.75MB Threads=6
+Per-Host Resource Estimates: Memory=298MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=297.81MB mem-reservation=14.75MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+10:TOP-N [LIMIT=100000]
+|  order by: c_last_name ASC, c_first_name ASC, c_salutation ASC, c_preferred_cust_flag DESC
+|  mem-estimate=246.96KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=80B cardinality=3.15K
+|  in pipelines: 10(GETNEXT), 08(OPEN)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: c_customer_sk = ss_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- ss_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,4 row-size=88B cardinality=3.15K
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+|--07:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  group by: ss_ticket_number, ss_customer_sk
+|  |  having: count(*) <= CAST(20 AS BIGINT), count(*) >= CAST(15 AS BIGINT)
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=20B cardinality=3.15K
+|  |  in pipelines: 07(GETNEXT), 00(OPEN)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  |  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  |  runtime filters: RF002[bloom] <- store.s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1,2 row-size=101B cardinality=31.53K
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
+|  |     parquet dictionary predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=33B cardinality=12
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN]
+|  |  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  |  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  |  runtime filters: RF004[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1 row-size=68B cardinality=31.53K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--01:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: date_dim.d_year IN (CAST(1998 AS INT), CAST(1999 AS INT), CAST(2000 AS INT)), (date_dim.d_dom >= CAST(1 AS INT) AND date_dim.d_dom <= CAST(3 AS INT) OR date_dim.d_dom >= CAST(25 AS INT) AND date_dim.d_dom <= CAST(28 AS INT))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: date_dim.d_year IN (CAST(1998 AS INT), CAST(1999 AS INT), CAST(2000 AS INT))
+|  |     parquet dictionary predicates: date_dim.d_year IN (CAST(1998 AS INT), CAST(1999 AS INT), CAST(2000 AS INT)), (date_dim.d_dom >= CAST(1 AS INT) AND date_dim.d_dom <= CAST(3 AS INT) OR date_dim.d_dom >= CAST(25 AS INT) AND date_dim.d_dom <= CAST(28 AS INT))
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=1 row-size=12B cardinality=354
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  runtime filters: RF006[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3 row-size=56B cardinality=162.45K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown'), (CASE WHEN household_demographics.hd_vehicle_count > CAST(0 AS INT) THEN CAST(household_demographics.hd_dep_count AS DOUBLE) / CAST(household_demographics.hd_vehicle_count AS DOUBLE) ELSE NULL END) > CAST(1.2 AS DOUBLE)
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     parquet statistics predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|  |     parquet dictionary predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|  |     mem-estimate=64.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=32B cardinality=416
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF002[bloom] -> store_sales.ss_store_sk, RF004[bloom] -> store_sales.ss_sold_date_sk, RF006[bloom] -> store_sales.ss_hdemo_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=0 row-size=24B cardinality=2.88M
+|     in pipelines: 00(GETNEXT)
+|
+08:SCAN HDFS [tpcds_parquet.customer]
+   HDFS partitions=1/1 files=1 size=5.49MB
+   runtime filters: RF000[bloom] -> c_customer_sk
+   stored statistics:
+     table: rows=100.00K size=5.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=100.00K
+   mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=6 row-size=68B cardinality=100.00K
+   in pipelines: 08(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=26.83MB Threads=13
+Per-Host Resource Estimates: Memory=335MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=331.17KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_last_name ASC, c_first_name ASC, c_salutation ASC, c_preferred_cust_flag DESC
+|  limit: 100000
+|  mem-estimate=331.17KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=80B cardinality=3.15K
+|  in pipelines: 10(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=16.17MB mem-reservation=9.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+10:TOP-N [LIMIT=100000]
+|  order by: c_last_name ASC, c_first_name ASC, c_salutation ASC, c_preferred_cust_flag DESC
+|  mem-estimate=246.96KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=80B cardinality=3.15K
+|  in pipelines: 10(GETNEXT), 15(OPEN)
+|
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- c_customer_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=4,6 row-size=88B cardinality=3.15K
+|  in pipelines: 15(GETNEXT), 08(OPEN)
+|
+|--17:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=6.58MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=68B cardinality=100.00K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=2
+|  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=6 row-size=68B cardinality=100.00K
+|     in pipelines: 08(GETNEXT)
+|
+16:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=92.53KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=3.15K
+|  in pipelines: 15(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.27MB mem-reservation=1.94MB thread-reservation=1
+15:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: ss_ticket_number, ss_customer_sk
+|  having: count(*) <= CAST(20 AS BIGINT), count(*) >= CAST(15 AS BIGINT)
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=3.15K
+|  in pipelines: 15(GETNEXT), 00(OPEN)
+|
+14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk)]
+|  mem-estimate=277.27KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=31.53K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=83.87MB mem-reservation=13.81MB thread-reservation=2 runtime-filters-memory=4.00MB
+07:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: ss_ticket_number, ss_customer_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=31.53K
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  runtime filters: RF002[bloom] <- store.s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=101B cardinality=31.53K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=33B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
+|     parquet dictionary predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=33B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  runtime filters: RF004[bloom] <- date_dim.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=68B cardinality=31.53K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=354
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: date_dim.d_year IN (CAST(1998 AS INT), CAST(1999 AS INT), CAST(2000 AS INT)), (date_dim.d_dom >= CAST(1 AS INT) AND date_dim.d_dom <= CAST(3 AS INT) OR date_dim.d_dom >= CAST(25 AS INT) AND date_dim.d_dom <= CAST(28 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: date_dim.d_year IN (CAST(1998 AS INT), CAST(1999 AS INT), CAST(2000 AS INT))
+|     parquet dictionary predicates: date_dim.d_year IN (CAST(1998 AS INT), CAST(1999 AS INT), CAST(2000 AS INT)), (date_dim.d_dom >= CAST(1 AS INT) AND date_dim.d_dom <= CAST(3 AS INT) OR date_dim.d_dom >= CAST(25 AS INT) AND date_dim.d_dom <= CAST(28 AS INT))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=354
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  runtime filters: RF006[bloom] <- household_demographics.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=56B cardinality=162.45K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=27.22KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=32B cardinality=416
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=64.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown'), (CASE WHEN household_demographics.hd_vehicle_count > CAST(0 AS INT) THEN CAST(household_demographics.hd_dep_count AS DOUBLE) / CAST(household_demographics.hd_vehicle_count AS DOUBLE) ELSE NULL END) > CAST(1.2 AS DOUBLE)
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|     parquet dictionary predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|     mem-estimate=64.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=3 row-size=32B cardinality=416
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF002[bloom] -> store_sales.ss_store_sk, RF004[bloom] -> store_sales.ss_sold_date_sk, RF006[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=24B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=41.58MB Threads=14
+Per-Host Resource Estimates: Memory=172MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=331.17KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_last_name ASC, c_first_name ASC, c_salutation ASC, c_preferred_cust_flag DESC
+|  limit: 100000
+|  mem-estimate=331.17KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=80B cardinality=3.15K
+|  in pipelines: 10(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=411.49KB mem-reservation=0B thread-reservation=1
+10:TOP-N [LIMIT=100000]
+|  order by: c_last_name ASC, c_first_name ASC, c_salutation ASC, c_preferred_cust_flag DESC
+|  mem-estimate=246.96KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=80B cardinality=3.15K
+|  in pipelines: 10(GETNEXT), 15(OPEN)
+|
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=4,6 row-size=88B cardinality=3.15K
+|  in pipelines: 15(GETNEXT), 08(OPEN)
+|
+|--F08:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.08MB mem-reservation=9.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF000[bloom] <- c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |
+|  17:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=6.58MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=68B cardinality=100.00K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=6 row-size=68B cardinality=100.00K
+|     in pipelines: 08(GETNEXT)
+|
+16:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=164.53KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=3.15K
+|  in pipelines: 15(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.34MB mem-reservation=1.94MB thread-reservation=1
+15:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: ss_ticket_number, ss_customer_sk
+|  having: count(*) <= CAST(20 AS BIGINT), count(*) >= CAST(15 AS BIGINT)
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=3.15K
+|  in pipelines: 15(GETNEXT), 00(OPEN)
+|
+14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk)]
+|  mem-estimate=349.27KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=31.53K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: ss_ticket_number, ss_customer_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=31.53K
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=101B cardinality=31.53K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: store.s_store_sk
+|  |  runtime filters: RF002[bloom] <- store.s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=33B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
+|     parquet dictionary predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County', 'Fairfield County', 'Raleigh County', 'Ziebach County', 'Williamson County')
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=2 row-size=33B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=68B cardinality=31.53K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: date_dim.d_date_sk
+|  |  runtime filters: RF004[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=354
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: date_dim.d_year IN (CAST(1998 AS INT), CAST(1999 AS INT), CAST(2000 AS INT)), (date_dim.d_dom >= CAST(1 AS INT) AND date_dim.d_dom <= CAST(3 AS INT) OR date_dim.d_dom >= CAST(25 AS INT) AND date_dim.d_dom <= CAST(28 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: date_dim.d_year IN (CAST(1998 AS INT), CAST(1999 AS INT), CAST(2000 AS INT))
+|     parquet dictionary predicates: date_dim.d_year IN (CAST(1998 AS INT), CAST(1999 AS INT), CAST(2000 AS INT)), (date_dim.d_dom >= CAST(1 AS INT) AND date_dim.d_dom <= CAST(3 AS INT) OR date_dim.d_dom >= CAST(25 AS INT) AND date_dim.d_dom <= CAST(28 AS INT))
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=1 row-size=12B cardinality=354
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=56B cardinality=162.45K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: household_demographics.hd_demo_sk
+|  |  runtime filters: RF006[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=27.22KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=32B cardinality=416
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown'), (CASE WHEN household_demographics.hd_vehicle_count > CAST(0 AS INT) THEN CAST(household_demographics.hd_dep_count AS DOUBLE) / CAST(household_demographics.hd_vehicle_count AS DOUBLE) ELSE NULL END) > CAST(1.2 AS DOUBLE)
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|     parquet dictionary predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=3 row-size=32B cardinality=416
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF002[bloom] -> store_sales.ss_store_sk, RF004[bloom] -> store_sales.ss_sold_date_sk, RF006[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=0 row-size=24B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q35a.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q35a.test
new file mode 100644
index 0000000..361a554
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q35a.test
@@ -0,0 +1,833 @@
+# TPCDS-Q35a variant of q35 without multiple subqueries in OR predicate
+SELECT ca_state,
+       cd_gender,
+       cd_marital_status,
+       cd_dep_count,
+       count(*) cnt1,
+       min(cd_dep_count),
+       max(cd_dep_count),
+       avg(cd_dep_count),
+       cd_dep_employed_count,
+       count(*) cnt2,
+       min(cd_dep_employed_count),
+       max(cd_dep_employed_count),
+       avg(cd_dep_employed_count),
+       cd_dep_college_count,
+       count(*) cnt3,
+       min(cd_dep_college_count),
+       max(cd_dep_college_count),
+       avg(cd_dep_college_count)
+FROM customer c,
+     customer_address ca,
+     customer_demographics
+ WHERE
+  c.c_current_addr_sk = ca.ca_address_sk and
+  cd_demo_sk = c.c_current_cdemo_sk and
+  EXISTS (SELECT *
+          from store_sales,date_dim
+          WHERE c.c_customer_sk = ss_customer_sk and
+                ss_sold_date_sk = d_date_sk and
+                d_year = 2002 and
+                d_qoy < 4) and
+   EXISTS (SELECT * from
+    (SELECT ws_bill_customer_sk customsk
+            from web_sales,date_dim
+            WHERE
+                  ws_sold_date_sk = d_date_sk and
+                  d_year = 2002 and
+                  d_qoy < 4
+       UNION ALL
+          SELECT cs_ship_customer_sk customsk
+            FROM catalog_sales,date_dim
+            WHERE
+                  cs_sold_date_sk = d_date_sk and
+                  d_year = 2002 and
+                  d_qoy < 4)x
+           WHERE x.customsk = c.c_customer_sk)
+ GROUP BY ca_state,
+          cd_gender,
+          cd_marital_status,
+          cd_dep_count,
+          cd_dep_employed_count,
+          cd_dep_college_count
+ ORDER BY ca_state,
+          cd_gender,
+          cd_marital_status,
+          cd_dep_count,
+          cd_dep_employed_count,
+          cd_dep_college_count
+LIMIT 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=43.50MB Threads=8
+Per-Host Resource Estimates: Memory=402MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=401.62MB mem-reservation=43.50MB thread-reservation=8 runtime-filters-memory=7.00MB
+PLAN-ROOT SINK
+|  output exprs: ca_state, cd_gender, cd_marital_status, cd_dep_count, count(*), min(cd_dep_count), max(cd_dep_count), avg(cd_dep_count), cd_dep_employed_count, count(*), min(cd_dep_employed_count), max(cd_dep_employed_count), avg(cd_dep_employed_count), cd_dep_college_count, count(*), min(cd_dep_college_count), max(cd_dep_college_count), avg(cd_dep_college_count)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:TOP-N [LIMIT=100]
+|  order by: ca_state ASC, cd_gender ASC, cd_marital_status ASC, cd_dep_count ASC, cd_dep_employed_count ASC, cd_dep_college_count ASC
+|  mem-estimate=10.55KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=108B cardinality=100
+|  in pipelines: 18(GETNEXT), 17(OPEN)
+|
+17:AGGREGATE [FINALIZE]
+|  output: count(*), min(cd_dep_count), max(cd_dep_count), avg(CAST(cd_dep_count AS BIGINT)), min(cd_dep_employed_count), max(cd_dep_employed_count), avg(CAST(cd_dep_employed_count AS BIGINT)), min(cd_dep_college_count), max(cd_dep_college_count), avg(CAST(cd_dep_college_count AS BIGINT))
+|  group by: ca_state, cd_gender, cd_marital_status, cd_dep_count, cd_dep_employed_count, cd_dep_college_count
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=14 row-size=108B cardinality=90.63K
+|  in pipelines: 17(GETNEXT), 02(OPEN)
+|
+16:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: c.c_customer_sk = customsk
+|  runtime filters: RF000[bloom] <- customsk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=72B cardinality=90.63K
+|  in pipelines: 02(GETNEXT), 07(OPEN), 10(OPEN)
+|
+|--06:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=4B cardinality=140.03K
+|  |  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|  |
+|  |--12:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9 row-size=20B cardinality=93.21K
+|  |  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |  |
+|  |  |--11:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=9 row-size=12B cardinality=118
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  10:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF012[bloom] -> cs_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=8 row-size=8B cardinality=1.44M
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7 row-size=20B cardinality=46.82K
+|  |  in pipelines: 07(GETNEXT), 08(OPEN)
+|  |
+|  |--08:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=12B cardinality=118
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF010[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=6 row-size=8B cardinality=719.38K
+|     in pipelines: 07(GETNEXT)
+|
+15:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: c.c_customer_sk = ss_customer_sk
+|  runtime filters: RF002[bloom] <- ss_customer_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=72B cardinality=90.63K
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--05:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |
+|  |--04:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=12B cardinality=118
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=2.88M
+|     in pipelines: 03(GETNEXT)
+|
+14:HASH JOIN [INNER JOIN]
+|  hash predicates: c.c_current_addr_sk = ca.ca_address_sk
+|  fk/pk conjuncts: c.c_current_addr_sk = ca.ca_address_sk
+|  runtime filters: RF004[bloom] <- ca.ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=72B cardinality=100.00K
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.customer_address ca]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=18B cardinality=50.00K
+|     in pipelines: 01(GETNEXT)
+|
+13:HASH JOIN [INNER JOIN]
+|  hash predicates: cd_demo_sk = c.c_current_cdemo_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF006[bloom] <- c.c_current_cdemo_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=2,0 row-size=54B cardinality=100.00K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.customer c]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c.c_customer_sk, RF002[bloom] -> c.c_customer_sk, RF004[bloom] -> c.c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=0 row-size=12B cardinality=100.00K
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.customer_demographics]
+   HDFS partitions=1/1 files=1 size=7.49MB
+   runtime filters: RF006[bloom] -> cd_demo_sk
+   stored statistics:
+     table: rows=1.92M size=7.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=1.92M
+   mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=2 row-size=42B cardinality=1.92M
+   in pipelines: 02(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=85.94MB Threads=19
+Per-Host Resource Estimates: Memory=515MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=21.48KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: ca_state, cd_gender, cd_marital_status, cd_dep_count, count(*), min(cd_dep_count), max(cd_dep_count), avg(cd_dep_count), cd_dep_employed_count, count(*), min(cd_dep_employed_count), max(cd_dep_employed_count), avg(cd_dep_employed_count), cd_dep_college_count, count(*), min(cd_dep_college_count), max(cd_dep_college_count), avg(cd_dep_college_count)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+29:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: ca_state ASC, cd_gender ASC, cd_marital_status ASC, cd_dep_count ASC, cd_dep_employed_count ASC, cd_dep_college_count ASC
+|  limit: 100
+|  mem-estimate=21.48KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=108B cardinality=100
+|  in pipelines: 18(GETNEXT)
+|
+F11:PLAN FRAGMENT [HASH(ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=26.44MB mem-reservation=17.00MB thread-reservation=1
+18:TOP-N [LIMIT=100]
+|  order by: ca_state ASC, cd_gender ASC, cd_marital_status ASC, cd_dep_count ASC, cd_dep_employed_count ASC, cd_dep_college_count ASC
+|  mem-estimate=10.55KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=108B cardinality=100
+|  in pipelines: 18(GETNEXT), 28(OPEN)
+|
+28:AGGREGATE [FINALIZE]
+|  output: count:merge(*), min:merge(cd_dep_count), max:merge(cd_dep_count), avg:merge(cd_dep_count), min:merge(cd_dep_employed_count), max:merge(cd_dep_employed_count), avg:merge(cd_dep_employed_count), min:merge(cd_dep_college_count), max:merge(cd_dep_college_count), avg:merge(cd_dep_college_count)
+|  group by: ca_state, cd_gender, cd_marital_status, cd_dep_count, cd_dep_employed_count, cd_dep_college_count
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=14 row-size=108B cardinality=90.63K
+|  in pipelines: 28(GETNEXT), 07(OPEN), 10(OPEN)
+|
+27:EXCHANGE [HASH(ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count)]
+|  mem-estimate=9.44MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=108B cardinality=90.63K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=37.47MB mem-reservation=36.00MB thread-reservation=1 runtime-filters-memory=2.00MB
+17:AGGREGATE [STREAMING]
+|  output: count(*), min(cd_dep_count), max(cd_dep_count), avg(CAST(cd_dep_count AS BIGINT)), min(cd_dep_employed_count), max(cd_dep_employed_count), avg(CAST(cd_dep_employed_count AS BIGINT)), min(cd_dep_college_count), max(cd_dep_college_count), avg(CAST(cd_dep_college_count AS BIGINT))
+|  group by: ca_state, cd_gender, cd_marital_status, cd_dep_count, cd_dep_employed_count, cd_dep_college_count
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=13 row-size=108B cardinality=90.63K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+16:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash predicates: customsk = c.c_customer_sk
+|  runtime filters: RF000[bloom] <- c.c_customer_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=72B cardinality=90.63K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT), 03(OPEN)
+|
+|--15:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  |  hash predicates: ss_customer_sk = c.c_customer_sk
+|  |  runtime filters: RF006[bloom] <- c.c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=72B cardinality=90.63K
+|  |  in pipelines: 03(GETNEXT), 02(OPEN)
+|  |
+|  |--25:EXCHANGE [HASH(c.c_customer_sk)]
+|  |  |  mem-estimate=6.95MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=72B cardinality=100.00K
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=104.85MB mem-reservation=14.81MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  fk/pk conjuncts: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  runtime filters: RF010[bloom] <- ca.ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=72B cardinality=100.00K
+|  |  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--23:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=900.91KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=1 row-size=18B cardinality=50.00K
+|  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  01:SCAN HDFS [tpcds_parquet.customer_address ca, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=18B cardinality=50.00K
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: cd_demo_sk = c.c_current_cdemo_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  runtime filters: RF012[bloom] <- c.c_current_cdemo_sk
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0 row-size=54B cardinality=100.00K
+|  |  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--22:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.16MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |  |  in pipelines: 00(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=49.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  |  00:SCAN HDFS [tpcds_parquet.customer c, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     runtime filters: RF010[bloom] -> c.c_current_addr_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  02:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |     runtime filters: RF012[bloom] -> cd_demo_sk
+|  |     stored statistics:
+|  |       table: rows=1.92M size=7.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=2 row-size=42B cardinality=1.92M
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  24:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=1.27MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=19.95MB mem-reservation=4.44MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |
+|  |--21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=12B cardinality=118
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=12B cardinality=118
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_customer_sk, RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=2.88M
+|     in pipelines: 03(GETNEXT)
+|
+26:EXCHANGE [HASH(customsk)]
+|  mem-estimate=206.33KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=4B cardinality=140.03K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+F04:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=100.95MB mem-reservation=8.94MB thread-reservation=2 runtime-filters-memory=3.00MB
+06:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=4B cardinality=140.03K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+|--12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=20B cardinality=93.21K
+|  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |
+|  |--20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=12B cardinality=118
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  11:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=12B cardinality=118
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_ship_customer_sk, RF004[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=8 row-size=8B cardinality=1.44M
+|     in pipelines: 10(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,7 row-size=20B cardinality=46.82K
+|  in pipelines: 07(GETNEXT), 08(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=12B cardinality=118
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  08:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=7 row-size=12B cardinality=118
+|     in pipelines: 08(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.web_sales.ws_bill_customer_sk, RF002[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=6 row-size=8B cardinality=719.38K
+   in pipelines: 07(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=103.00MB Threads=19
+Per-Host Resource Estimates: Memory=282MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=21.48KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: ca_state, cd_gender, cd_marital_status, cd_dep_count, count(*), min(cd_dep_count), max(cd_dep_count), avg(cd_dep_count), cd_dep_employed_count, count(*), min(cd_dep_employed_count), max(cd_dep_employed_count), avg(cd_dep_employed_count), cd_dep_college_count, count(*), min(cd_dep_college_count), max(cd_dep_college_count), avg(cd_dep_college_count)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+29:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: ca_state ASC, cd_gender ASC, cd_marital_status ASC, cd_dep_count ASC, cd_dep_employed_count ASC, cd_dep_college_count ASC
+|  limit: 100
+|  mem-estimate=21.48KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=108B cardinality=100
+|  in pipelines: 18(GETNEXT)
+|
+F11:PLAN FRAGMENT [HASH(ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=26.44MB mem-reservation=17.00MB thread-reservation=1
+18:TOP-N [LIMIT=100]
+|  order by: ca_state ASC, cd_gender ASC, cd_marital_status ASC, cd_dep_count ASC, cd_dep_employed_count ASC, cd_dep_college_count ASC
+|  mem-estimate=10.55KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=108B cardinality=100
+|  in pipelines: 18(GETNEXT), 28(OPEN)
+|
+28:AGGREGATE [FINALIZE]
+|  output: count:merge(*), min:merge(cd_dep_count), max:merge(cd_dep_count), avg:merge(cd_dep_count), min:merge(cd_dep_employed_count), max:merge(cd_dep_employed_count), avg:merge(cd_dep_employed_count), min:merge(cd_dep_college_count), max:merge(cd_dep_college_count), avg:merge(cd_dep_college_count)
+|  group by: ca_state, cd_gender, cd_marital_status, cd_dep_count, cd_dep_employed_count, cd_dep_college_count
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=14 row-size=108B cardinality=90.63K
+|  in pipelines: 28(GETNEXT), 07(OPEN), 10(OPEN)
+|
+27:EXCHANGE [HASH(ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count)]
+|  mem-estimate=9.44MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=108B cardinality=90.63K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=17.20MB mem-reservation=17.00MB thread-reservation=1
+17:AGGREGATE [STREAMING]
+|  output: count(*), min(cd_dep_count), max(cd_dep_count), avg(CAST(cd_dep_count AS BIGINT)), min(cd_dep_employed_count), max(cd_dep_employed_count), avg(CAST(cd_dep_employed_count AS BIGINT)), min(cd_dep_college_count), max(cd_dep_college_count), avg(CAST(cd_dep_college_count AS BIGINT))
+|  group by: ca_state, cd_gender, cd_marital_status, cd_dep_count, cd_dep_employed_count, cd_dep_college_count
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=13 row-size=108B cardinality=90.63K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+16:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: customsk = c.c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=72B cardinality=90.63K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT), 03(OPEN)
+|
+|--F13:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=10.85MB mem-reservation=9.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: c.c_customer_sk
+|  |  runtime filters: RF000[bloom] <- c.c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |
+|  15:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: ss_customer_sk = c.c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=72B cardinality=90.63K
+|  |  in pipelines: 03(GETNEXT), 02(OPEN)
+|  |
+|  |--F14:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.45MB mem-reservation=9.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: c.c_customer_sk
+|  |  |  runtime filters: RF006[bloom] <- c.c_customer_sk
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |
+|  |  25:EXCHANGE [HASH(c.c_customer_sk)]
+|  |  |  mem-estimate=6.95MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=72B cardinality=100.00K
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  fk/pk conjuncts: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=72B cardinality=100.00K
+|  |  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=5.75MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: ca.ca_address_sk
+|  |  |  |  runtime filters: RF010[bloom] <- ca.ca_address_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  23:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=900.91KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=1 row-size=18B cardinality=50.00K
+|  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  01:SCAN HDFS [tpcds_parquet.customer_address ca, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=1 row-size=18B cardinality=50.00K
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=03
+|  |  |  hash predicates: cd_demo_sk = c.c_current_cdemo_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0 row-size=54B cardinality=100.00K
+|  |  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=7.91MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=03 plan-id=04 cohort-id=03
+|  |  |  |  build expressions: c.c_current_cdemo_sk
+|  |  |  |  runtime filters: RF012[bloom] <- c.c_current_cdemo_sk
+|  |  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |
+|  |  |  22:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=1.16MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |  |  in pipelines: 00(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  00:SCAN HDFS [tpcds_parquet.customer c, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |     runtime filters: RF010[bloom] -> c.c_current_addr_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=100.00K size=5.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |  |     tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  02:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |     runtime filters: RF012[bloom] -> cd_demo_sk
+|  |     stored statistics:
+|  |       table: rows=1.92M size=7.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=2 row-size=42B cardinality=1.92M
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  24:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=1.35MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |
+|  |--F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=12B cardinality=118
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=4 row-size=12B cardinality=118
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_customer_sk, RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=8B cardinality=2.88M
+|     in pipelines: 03(GETNEXT)
+|
+26:EXCHANGE [HASH(customsk)]
+|  mem-estimate=206.33KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=4B cardinality=140.03K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+F04:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+06:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=4B cardinality=140.03K
+|  in pipelines: 07(GETNEXT), 10(GETNEXT)
+|
+|--12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=20B cardinality=93.21K
+|  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |
+|  |--F19:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=12B cardinality=118
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  11:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=9 row-size=12B cardinality=118
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_ship_customer_sk, RF004[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=8 row-size=8B cardinality=1.44M
+|     in pipelines: 10(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=05
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,7 row-size=20B cardinality=46.82K
+|  in pipelines: 07(GETNEXT), 08(OPEN)
+|
+|--F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=12B cardinality=118
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  08:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2002 AS INT), d_qoy < CAST(4 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=7 row-size=12B cardinality=118
+|     in pipelines: 08(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.web_sales.ws_bill_customer_sk, RF002[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=6 row-size=8B cardinality=719.38K
+   in pipelines: 07(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q36.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q36.test
new file mode 100644
index 0000000..4673d24
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q36.test
@@ -0,0 +1,332 @@
+# TPCDS-Q36
+select
+    sum(ss_net_profit)/sum(ss_ext_sales_price) as gross_margin
+   ,i_category
+   ,i_class
+   ,grouping(i_category)+grouping(i_class) as lochierarchy
+   ,rank() over (
+        partition by grouping(i_category)+grouping(i_class),
+        case when grouping(i_class) = 0 then i_category end
+        order by sum(ss_net_profit)/sum(ss_ext_sales_price) asc) as rank_within_parent
+ from
+    store_sales
+   ,date_dim       d1
+   ,item
+   ,store
+ where
+    d1.d_year = 2001
+ and d1.d_date_sk = ss_sold_date_sk
+ and i_item_sk  = ss_item_sk
+ and s_store_sk  = ss_store_sk
+ and s_state in ('TN')
+ group by rollup(i_category,i_class)
+ order by
+   lochierarchy desc
+  -- Modified from original because Impala does not allow aliases within order by
+  -- expressions, except at the top level.
+  ,case when grouping(i_category)+grouping(i_class) = 0 then i_category end
+  ,rank_within_parent
+  limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=20.94MB Threads=5
+Per-Host Resource Estimates: Memory=189MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=188.81MB mem-reservation=20.94MB thread-reservation=5 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END) / aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END), CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END, CASE valid_tid(4,5,6) WHEN 4 THEN i_class WHEN 5 THEN NULL WHEN 6 THEN NULL END, CAST(aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) AS SMALLINT) + CAST(aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) AS SMALLINT), rank()
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:TOP-N [LIMIT=100]
+|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END ASC, rank() ASC
+|  mem-estimate=6.45KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=66B cardinality=100
+|  in pipelines: 11(GETNEXT), 09(OPEN)
+|
+10:ANALYTIC
+|  functions: rank()
+|  partition by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END), CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END
+|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END) / aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END) ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=17,16 row-size=70B cardinality=1.00K
+|  in pipelines: 09(GETNEXT)
+|
+09:SORT
+|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END) / aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END) ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=17 row-size=62B cardinality=1.00K
+|  in pipelines: 09(GETNEXT), 08(OPEN)
+|
+08:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(4,5,6) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT)), CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN sum(ss_net_profit) WHEN CAST(5 AS INT) THEN sum(ss_net_profit) WHEN CAST(6 AS INT) THEN sum(ss_net_profit) END), aggif(valid_tid(4,5,6) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT)), CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN sum(ss_ext_sales_price) WHEN CAST(5 AS INT) THEN sum(ss_ext_sales_price) WHEN CAST(6 AS INT) THEN sum(ss_ext_sales_price) END), aggif(valid_tid(4,5,6) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT)), CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(5 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(6 AS INT) THEN CAST(1 AS TINYINT) END), aggif(valid_tid(4,5,6) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT)), CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(5 AS INT) THEN CAST(1 AS TINYINT) WHEN CAST(6 AS INT) THEN CAST(1 AS TINYINT) END)
+|  group by: CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN i_category WHEN CAST(5 AS INT) THEN i_category WHEN CAST(6 AS INT) THEN NULL END, CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN i_class WHEN CAST(5 AS INT) THEN NULL WHEN CAST(6 AS INT) THEN NULL END, CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN CAST(4 AS INT) WHEN CAST(5 AS INT) THEN CAST(5 AS INT) WHEN CAST(6 AS INT) THEN CAST(6 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=62B cardinality=1.00K
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+07:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
+|    group by: i_category, i_class
+|  Class 1
+|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
+|    group by: i_category, NULL
+|  Class 2
+|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=5.81MB thread-reservation=0
+|  tuple-ids=4N,5N,6N row-size=188B cardinality=1.00K
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=96B cardinality=589.03K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_state IN ('TN')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_state IN ('TN')
+|     parquet dictionary predicates: s_state IN ('TN')
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=18B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=589.03K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=46B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  runtime filters: RF004[bloom] <- d1.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=32B cardinality=589.03K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim d1]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d1.d_year = CAST(2001 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d1.d_year = CAST(2001 AS INT)
+|     parquet dictionary predicates: d1.d_year = CAST(2001 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=373
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_item_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=24B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=41.33MB Threads=11
+Per-Host Resource Estimates: Memory=272MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=22.66KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END) / aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END), CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END, CASE valid_tid(4,5,6) WHEN 4 THEN i_class WHEN 5 THEN NULL WHEN 6 THEN NULL END, CAST(aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) AS SMALLINT) + CAST(aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) AS SMALLINT), rank()
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END ASC, rank() ASC
+|  limit: 100
+|  mem-estimate=22.66KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=66B cardinality=100
+|  in pipelines: 11(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END),CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=16.21MB mem-reservation=16.00MB thread-reservation=1
+11:TOP-N [LIMIT=100]
+|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END ASC, rank() ASC
+|  mem-estimate=6.45KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=66B cardinality=100
+|  in pipelines: 11(GETNEXT), 09(OPEN)
+|
+10:ANALYTIC
+|  functions: rank()
+|  partition by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END), CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END
+|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END) / aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END) ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=17,16 row-size=70B cardinality=1.00K
+|  in pipelines: 09(GETNEXT)
+|
+09:SORT
+|  order by: aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_net_profit) WHEN 5 THEN sum(ss_net_profit) WHEN 6 THEN sum(ss_net_profit) END) / aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN sum(ss_ext_sales_price) WHEN 5 THEN sum(ss_ext_sales_price) WHEN 6 THEN sum(ss_ext_sales_price) END) ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=17 row-size=62B cardinality=1.00K
+|  in pipelines: 09(GETNEXT), 08(OPEN)
+|
+17:EXCHANGE [HASH(aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 0 WHEN 6 THEN 1 END) + aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END),CASE WHEN aggif(valid_tid(4,5,6) IN (4, 5, 6), CASE valid_tid(4,5,6) WHEN 4 THEN 0 WHEN 5 THEN 1 WHEN 6 THEN 1 END) = 0 THEN CASE valid_tid(4,5,6) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN NULL END END)]
+|  mem-estimate=213.75KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=62B cardinality=1.00K
+|  in pipelines: 08(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(CASE valid_tid(4,5,6) WHEN 4 THEN murmur_hash(i_category) WHEN 5 THEN murmur_hash(i_category) WHEN 6 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6) WHEN 4 THEN murmur_hash(i_class) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=40.00MB mem-reservation=7.75MB thread-reservation=1
+08:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(4,5,6) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT)), CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN sum(ss_net_profit) WHEN CAST(5 AS INT) THEN sum(ss_net_profit) WHEN CAST(6 AS INT) THEN sum(ss_net_profit) END), aggif(valid_tid(4,5,6) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT)), CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN sum(ss_ext_sales_price) WHEN CAST(5 AS INT) THEN sum(ss_ext_sales_price) WHEN CAST(6 AS INT) THEN sum(ss_ext_sales_price) END), aggif(valid_tid(4,5,6) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT)), CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(5 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(6 AS INT) THEN CAST(1 AS TINYINT) END), aggif(valid_tid(4,5,6) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT)), CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(5 AS INT) THEN CAST(1 AS TINYINT) WHEN CAST(6 AS INT) THEN CAST(1 AS TINYINT) END)
+|  group by: CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN i_category WHEN CAST(5 AS INT) THEN i_category WHEN CAST(6 AS INT) THEN NULL END, CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN i_class WHEN CAST(5 AS INT) THEN NULL WHEN CAST(6 AS INT) THEN NULL END, CASE valid_tid(4,5,6) WHEN CAST(4 AS INT) THEN CAST(4 AS INT) WHEN CAST(5 AS INT) THEN CAST(5 AS INT) WHEN CAST(6 AS INT) THEN CAST(6 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=62B cardinality=1.00K
+|  in pipelines: 08(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum:merge(ss_net_profit), sum:merge(ss_ext_sales_price)
+|    group by: i_category, i_class
+|  Class 1
+|    output: sum:merge(ss_net_profit), sum:merge(ss_ext_sales_price)
+|    group by: i_category, NULL
+|  Class 2
+|    output: sum:merge(ss_net_profit), sum:merge(ss_ext_sales_price)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=5.81MB thread-reservation=0
+|  tuple-ids=4N,5N,6N row-size=188B cardinality=1.00K
+|  in pipelines: 16(GETNEXT), 00(OPEN)
+|
+15:EXCHANGE [HASH(CASE valid_tid(4,5,6) WHEN 4 THEN murmur_hash(i_category) WHEN 5 THEN murmur_hash(i_category) WHEN 6 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6) WHEN 4 THEN murmur_hash(i_class) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) END)]
+|  mem-estimate=646.37KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4N,5N,6N row-size=188B cardinality=1.00K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=103.68MB mem-reservation=16.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+07:AGGREGATE [STREAMING]
+|  Class 0
+|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
+|    group by: i_category, i_class
+|  Class 1
+|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
+|    group by: i_category, NULL
+|  Class 2
+|    output: sum(ss_net_profit), sum(ss_ext_sales_price)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=6.00MB thread-reservation=0
+|  tuple-ids=4N,5N,6N row-size=188B cardinality=1.00K
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=96B cardinality=589.03K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=18B cardinality=12
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_state IN ('TN')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_state IN ('TN')
+|     parquet dictionary predicates: s_state IN ('TN')
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=18B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=589.03K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=852.50KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=46B cardinality=18.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=46B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  runtime filters: RF004[bloom] <- d1.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=32B cardinality=589.03K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=373
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d1.d_year = CAST(2001 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d1.d_year = CAST(2001 AS INT)
+|     parquet dictionary predicates: d1.d_year = CAST(2001 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=373
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_item_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=24B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q37.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q37.test
new file mode 100644
index 0000000..2ee4047
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q37.test
@@ -0,0 +1,436 @@
+# TPCDS-Q37
+SELECT i_item_id,
+       i_item_desc,
+       i_current_price
+FROM item,
+     inventory,
+     date_dim,
+     catalog_sales
+WHERE i_current_price BETWEEN 68 AND 68 + 30
+  AND inv_item_sk = i_item_sk
+  AND d_date_sk=inv_date_sk
+  AND d_date BETWEEN cast('2000-02-01' AS date) AND cast('2000-04-01' AS date)
+  AND i_manufact_id IN (677,
+                        940,
+                        694,
+                        808)
+  AND inv_quantity_on_hand BETWEEN 100 AND 500
+  AND cs_item_sk = i_item_sk
+GROUP BY i_item_id,
+         i_item_desc,
+         i_current_price
+ORDER BY i_item_id
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=40.94MB Threads=5
+Per-Host Resource Estimates: Memory=263MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=262.88MB mem-reservation=40.94MB thread-reservation=5 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+08:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=14.11KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=144B cardinality=100
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+07:AGGREGATE [FINALIZE]
+|  group by: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=125.59K
+|  in pipelines: 07(GETNEXT), 03(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,1,0,2 row-size=206B cardinality=125.59K
+|  in pipelines: 03(GETNEXT), 01(OPEN)
+|
+|--05:HASH JOIN [INNER JOIN]
+|  |  hash predicates: inv_date_sk = d_date_sk
+|  |  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,0,2 row-size=198B cardinality=1.57K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '2000-04-01', CAST(d_date AS DATE) >= DATE '2000-02-01'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-01', CAST(d_date AS DATE) >= DATE '2000-02-01'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-01', CAST(d_date AS DATE) >= DATE '2000-02-01'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=2 row-size=26B cardinality=7.30K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: inv_item_sk = i_item_sk
+|  |  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  |  runtime filters: RF004[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,0 row-size=172B cardinality=1.57K
+|  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |
+|  |--00:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_current_price <= CAST(98 AS DECIMAL(3,0)), i_current_price >= CAST(68 AS DECIMAL(3,0)), i_manufact_id IN (CAST(677 AS INT), CAST(940 AS INT), CAST(694 AS INT), CAST(808 AS INT))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_current_price <= CAST(98 AS DECIMAL(3,0)), i_current_price >= CAST(68 AS DECIMAL(3,0)), i_manufact_id IN (CAST(677 AS INT), CAST(940 AS INT), CAST(694 AS INT), CAST(808 AS INT))
+|  |     parquet dictionary predicates: i_current_price <= CAST(98 AS DECIMAL(3,0)), i_current_price >= CAST(68 AS DECIMAL(3,0)), i_manufact_id IN (CAST(677 AS INT), CAST(940 AS INT), CAST(694 AS INT), CAST(808 AS INT))
+|  |     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=156B cardinality=24
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.inventory]
+|     HDFS partitions=1/1 files=2 size=34.09MB
+|     predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+|     runtime filters: RF002[bloom] -> inv_date_sk, RF004[bloom] -> inv_item_sk
+|     stored statistics:
+|       table: rows=11.74M size=34.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6.66M
+|     parquet statistics predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+|     parquet dictionary predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+|     mem-estimate=96.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=1 row-size=16B cardinality=1.17M
+|     in pipelines: 01(GETNEXT)
+|
+03:SCAN HDFS [tpcds_parquet.catalog_sales]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=3 row-size=8B cardinality=1.44M
+   in pipelines: 03(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=64.81MB Threads=11
+Per-Host Resource Estimates: Memory=310MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=36.04KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+15:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC
+|  limit: 100
+|  mem-estimate=36.04KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=144B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,i_current_price)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=25.94MB mem-reservation=17.00MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=14.11KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=144B cardinality=100
+|  in pipelines: 08(GETNEXT), 14(OPEN)
+|
+14:AGGREGATE [FINALIZE]
+|  group by: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=125.59K
+|  in pipelines: 14(GETNEXT), 03(OPEN)
+|
+13:EXCHANGE [HASH(i_item_id,i_item_desc,i_current_price)]
+|  mem-estimate=8.94MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=125.59K
+|  in pipelines: 03(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=68.64MB mem-reservation=21.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+07:AGGREGATE [STREAMING]
+|  group by: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=125.59K
+|  in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,1,0,2 row-size=206B cardinality=125.59K
+|  in pipelines: 03(GETNEXT), 01(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=724.34KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1,0,2 row-size=198B cardinality=1.57K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [HASH(inv_date_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=3.63MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  05:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: inv_date_sk = d_date_sk
+|  |  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,0,2 row-size=198B cardinality=1.57K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--11:EXCHANGE [HASH(d_date_sk)]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '2000-04-01', CAST(d_date AS DATE) >= DATE '2000-02-01'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-01', CAST(d_date AS DATE) >= DATE '2000-02-01'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-01', CAST(d_date AS DATE) >= DATE '2000-02-01'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=2 row-size=26B cardinality=7.30K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  10:EXCHANGE [HASH(inv_date_sk)]
+|  |  mem-estimate=492.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1,0 row-size=172B cardinality=1.57K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=99.95MB mem-reservation=19.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: inv_item_sk = i_item_sk
+|  |  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  |  runtime filters: RF004[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,0 row-size=172B cardinality=1.57K
+|  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |
+|  |--09:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=156B cardinality=24
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_current_price <= CAST(98 AS DECIMAL(3,0)), i_current_price >= CAST(68 AS DECIMAL(3,0)), i_manufact_id IN (CAST(677 AS INT), CAST(940 AS INT), CAST(694 AS INT), CAST(808 AS INT))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_current_price <= CAST(98 AS DECIMAL(3,0)), i_current_price >= CAST(68 AS DECIMAL(3,0)), i_manufact_id IN (CAST(677 AS INT), CAST(940 AS INT), CAST(694 AS INT), CAST(808 AS INT))
+|  |     parquet dictionary predicates: i_current_price <= CAST(98 AS DECIMAL(3,0)), i_current_price >= CAST(68 AS DECIMAL(3,0)), i_manufact_id IN (CAST(677 AS INT), CAST(940 AS INT), CAST(694 AS INT), CAST(808 AS INT))
+|  |     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=156B cardinality=24
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+|     HDFS partitions=1/1 files=2 size=34.09MB
+|     predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+|     runtime filters: RF002[bloom] -> inv_date_sk, RF004[bloom] -> inv_item_sk
+|     stored statistics:
+|       table: rows=11.74M size=34.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6.66M
+|     parquet statistics predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+|     parquet dictionary predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+|     mem-estimate=96.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=1 row-size=16B cardinality=1.17M
+|     in pipelines: 01(GETNEXT)
+|
+03:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=3 row-size=8B cardinality=1.44M
+   in pipelines: 03(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=70.69MB Threads=10
+Per-Host Resource Estimates: Memory=172MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=36.04KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+15:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC
+|  limit: 100
+|  mem-estimate=36.04KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=144B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,i_current_price)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=25.94MB mem-reservation=17.00MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=14.11KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=144B cardinality=100
+|  in pipelines: 08(GETNEXT), 14(OPEN)
+|
+14:AGGREGATE [FINALIZE]
+|  group by: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=125.59K
+|  in pipelines: 14(GETNEXT), 03(OPEN)
+|
+13:EXCHANGE [HASH(i_item_id,i_item_desc,i_current_price)]
+|  mem-estimate=8.94MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=125.59K
+|  in pipelines: 03(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+Per-Instance Resources: mem-estimate=65.00MB mem-reservation=19.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  group by: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=125.59K
+|  in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,1,0,2 row-size=206B cardinality=125.59K
+|  in pipelines: 03(GETNEXT), 01(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=5.58MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF000[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=724.34KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1,0,2 row-size=198B cardinality=1.57K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [HASH(inv_date_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=492.72KB mem-reservation=0B thread-reservation=1
+|  05:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: inv_date_sk = d_date_sk
+|  |  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,0,2 row-size=198B cardinality=1.57K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--F08:PLAN FRAGMENT [HASH(inv_date_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=3.15MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  11:EXCHANGE [HASH(d_date_sk)]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '2000-04-01', CAST(d_date AS DATE) >= DATE '2000-02-01'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-01', CAST(d_date AS DATE) >= DATE '2000-02-01'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-01', CAST(d_date AS DATE) >= DATE '2000-02-01'
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=2 row-size=26B cardinality=7.30K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  10:EXCHANGE [HASH(inv_date_sk)]
+|  |  mem-estimate=492.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1,0 row-size=172B cardinality=1.57K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=1
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: inv_item_sk = i_item_sk
+|  |  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,0 row-size=172B cardinality=1.57K
+|  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |
+|  |--F09:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF004[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  09:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=156B cardinality=24
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_current_price <= CAST(98 AS DECIMAL(3,0)), i_current_price >= CAST(68 AS DECIMAL(3,0)), i_manufact_id IN (CAST(677 AS INT), CAST(940 AS INT), CAST(694 AS INT), CAST(808 AS INT))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_current_price <= CAST(98 AS DECIMAL(3,0)), i_current_price >= CAST(68 AS DECIMAL(3,0)), i_manufact_id IN (CAST(677 AS INT), CAST(940 AS INT), CAST(694 AS INT), CAST(808 AS INT))
+|  |     parquet dictionary predicates: i_current_price <= CAST(98 AS DECIMAL(3,0)), i_current_price >= CAST(68 AS DECIMAL(3,0)), i_manufact_id IN (CAST(677 AS INT), CAST(940 AS INT), CAST(694 AS INT), CAST(808 AS INT))
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=0 row-size=156B cardinality=24
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+|     HDFS partitions=1/1 files=2 size=34.09MB
+|     predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+|     runtime filters: RF002[bloom] -> inv_date_sk, RF004[bloom] -> inv_item_sk
+|     stored statistics:
+|       table: rows=11.74M size=34.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6.66M
+|     parquet statistics predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+|     parquet dictionary predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+|     mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=1 row-size=16B cardinality=1.17M
+|     in pipelines: 01(GETNEXT)
+|
+03:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=3 row-size=8B cardinality=1.44M
+   in pipelines: 03(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q38.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q38.test
new file mode 100644
index 0000000..ec3a3af
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q38.test
@@ -0,0 +1,536 @@
+# TPCDS-Q38
+SELECT count(*)
+FROM
+  (SELECT DISTINCT c_last_name,
+                   c_first_name,
+                   d_date
+   FROM store_sales,
+        date_dim,
+        customer
+   WHERE store_sales.ss_sold_date_sk = date_dim.d_date_sk
+     AND store_sales.ss_customer_sk = customer.c_customer_sk
+     AND d_month_seq BETWEEN 1200 AND 1200 + 11 INTERSECT
+     SELECT DISTINCT c_last_name,
+                     c_first_name,
+                     d_date
+     FROM catalog_sales,
+          date_dim,
+          customer WHERE catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+     AND catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+     AND d_month_seq BETWEEN 1200 AND 1200 + 11 INTERSECT
+     SELECT DISTINCT c_last_name,
+                     c_first_name,
+                     d_date
+     FROM web_sales,
+          date_dim,
+          customer WHERE web_sales.ws_sold_date_sk = date_dim.d_date_sk
+     AND web_sales.ws_bill_customer_sk = customer.c_customer_sk
+     AND d_month_seq BETWEEN 1200 AND 1200 + 11 ) hot_cust
+LIMIT 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=187.19MB Threads=10
+Per-Host Resource Estimates: Memory=573MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=573.21MB mem-reservation=187.19MB thread-reservation=10 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+20:AGGREGATE [FINALIZE]
+|  output: count(*)
+|  limit: 100
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=8B cardinality=1
+|  in pipelines: 20(GETNEXT), 05(OPEN)
+|
+19:HASH JOIN [INNER JOIN]
+|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF000[bloom] <- c_first_name, RF001[bloom] <- c_last_name, RF002[bloom] <- d_date
+|  mem-estimate=43.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3,8,13 row-size=174B cardinality=2.88M
+|  in pipelines: 05(GETNEXT), 17(OPEN)
+|
+|--17:AGGREGATE [FINALIZE]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=43.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=58B cardinality=719.38K
+|  |  in pipelines: 17(GETNEXT), 12(OPEN)
+|  |
+|  16:HASH JOIN [INNER JOIN]
+|  |  hash predicates: web_sales.ws_bill_customer_sk = customer.c_customer_sk
+|  |  fk/pk conjuncts: web_sales.ws_bill_customer_sk = customer.c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=10,11,12 row-size=78B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |
+|  |--14:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=40B cardinality=100.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  15:HASH JOIN [INNER JOIN]
+|  |  hash predicates: web_sales.ws_sold_date_sk = date_dim.d_date_sk
+|  |  fk/pk conjuncts: web_sales.ws_sold_date_sk = date_dim.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,11 row-size=38B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |
+|  |--13:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=30B cardinality=7.30K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=8B cardinality=719.38K
+|     in pipelines: 12(GETNEXT)
+|
+18:HASH JOIN [INNER JOIN]
+|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF006[bloom] <- c_first_name, RF007[bloom] <- c_last_name, RF008[bloom] <- d_date
+|  mem-estimate=87.66MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3,8 row-size=116B cardinality=2.88M
+|  in pipelines: 05(GETNEXT), 11(OPEN)
+|
+|--11:AGGREGATE [FINALIZE]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=87.66MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=8 row-size=58B cardinality=1.44M
+|  |  in pipelines: 11(GETNEXT), 06(OPEN)
+|  |
+|  10:HASH JOIN [INNER JOIN]
+|  |  hash predicates: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+|  |  fk/pk conjuncts: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+|  |  runtime filters: RF016[bloom] <- customer.c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=5,6,7 row-size=78B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT), 08(OPEN)
+|  |
+|  |--08:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=7 row-size=40B cardinality=100.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN]
+|  |  hash predicates: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+|  |  fk/pk conjuncts: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+|  |  runtime filters: RF018[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=38B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--07:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=30B cardinality=7.30K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF016[bloom] -> catalog_sales.cs_bill_customer_sk, RF018[bloom] -> catalog_sales.cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=1.44M
+|     in pipelines: 06(GETNEXT)
+|
+05:AGGREGATE [FINALIZE]
+|  group by: c_last_name, c_first_name, d_date
+|  mem-estimate=175.15MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 05(GETNEXT), 00(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_customer_sk = customer.c_customer_sk
+|  fk/pk conjuncts: store_sales.ss_customer_sk = customer.c_customer_sk
+|  runtime filters: RF012[bloom] <- customer.c_customer_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_first_name, RF001[bloom] -> tpcds_parquet.customer.c_last_name, RF006[bloom] -> tpcds_parquet.customer.c_first_name, RF007[bloom] -> tpcds_parquet.customer.c_last_name
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=40B cardinality=100.00K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  runtime filters: RF014[bloom] <- date_dim.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=38B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     runtime filters: RF002[bloom] -> tpcds_parquet.date_dim.d_date, RF008[bloom] -> tpcds_parquet.date_dim.d_date
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=30B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> store_sales.ss_customer_sk, RF014[bloom] -> store_sales.ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=0 row-size=8B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=308.56MB Threads=22
+Per-Host Resource Estimates: Memory=955MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+36:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  limit: 100
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=8B cardinality=1
+|  in pipelines: 36(GETNEXT), 20(OPEN)
+|
+35:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=16 row-size=8B cardinality=1
+|  in pipelines: 20(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(c_last_name,c_first_name,d_date)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=175.06MB mem-reservation=91.00MB thread-reservation=1 runtime-filters-memory=6.00MB
+20:AGGREGATE
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=8B cardinality=1
+|  in pipelines: 20(GETNEXT), 24(OPEN)
+|
+19:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF000[bloom] <- c_first_name, RF001[bloom] <- c_last_name, RF002[bloom] <- d_date
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=3,8,13 row-size=174B cardinality=2.88M
+|  in pipelines: 24(GETNEXT), 33(OPEN)
+|
+|--34:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
+|  |  mem-estimate=10.12MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=58B cardinality=719.38K
+|  |  in pipelines: 33(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [HASH(c_last_name,c_first_name,d_date)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=44.12MB mem-reservation=34.00MB thread-reservation=1
+|  33:AGGREGATE [FINALIZE]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=58B cardinality=719.38K
+|  |  in pipelines: 33(GETNEXT), 12(OPEN)
+|  |
+|  32:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
+|  |  mem-estimate=10.12MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=58B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=108.78MB mem-reservation=44.69MB thread-reservation=2
+|  17:AGGREGATE [STREAMING]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=58B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: web_sales.ws_bill_customer_sk = customer.c_customer_sk
+|  |  fk/pk conjuncts: web_sales.ws_bill_customer_sk = customer.c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=10,11,12 row-size=78B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |
+|  |--31:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=40B cardinality=100.00K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  14:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=40B cardinality=100.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: web_sales.ws_sold_date_sk = date_dim.d_date_sk
+|  |  fk/pk conjuncts: web_sales.ws_sold_date_sk = date_dim.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,11 row-size=38B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |
+|  |--30:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=248.01KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=30B cardinality=7.30K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=30B cardinality=7.30K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=8B cardinality=719.38K
+|     in pipelines: 12(GETNEXT)
+|
+18:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF006[bloom] <- c_first_name, RF007[bloom] <- c_last_name, RF008[bloom] <- d_date
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3,8 row-size=116B cardinality=2.88M
+|  in pipelines: 24(GETNEXT), 28(OPEN)
+|
+|--29:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
+|  |  mem-estimate=10.18MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=58B cardinality=1.44M
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(c_last_name,c_first_name,d_date)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=54.01MB mem-reservation=34.00MB thread-reservation=1
+|  28:AGGREGATE [FINALIZE]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=43.83MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=8 row-size=58B cardinality=1.44M
+|  |  in pipelines: 28(GETNEXT), 06(OPEN)
+|  |
+|  27:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
+|  |  mem-estimate=10.18MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=58B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=152.61MB mem-reservation=46.69MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  11:AGGREGATE [STREAMING]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=43.83MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=8 row-size=58B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+|  |  fk/pk conjuncts: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+|  |  runtime filters: RF016[bloom] <- customer.c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=5,6,7 row-size=78B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT), 08(OPEN)
+|  |
+|  |--26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=40B cardinality=100.00K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=7 row-size=40B cardinality=100.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+|  |  fk/pk conjuncts: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+|  |  runtime filters: RF018[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=38B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=248.01KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=30B cardinality=7.30K
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=30B cardinality=7.30K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF016[bloom] -> catalog_sales.cs_bill_customer_sk, RF018[bloom] -> catalog_sales.cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=1.44M
+|     in pipelines: 06(GETNEXT)
+|
+24:AGGREGATE [FINALIZE]
+|  group by: c_last_name, c_first_name, d_date
+|  mem-estimate=87.57MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 24(GETNEXT), 00(OPEN)
+|
+23:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
+|  mem-estimate=10.18MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=116.36MB mem-reservation=43.19MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  group by: c_last_name, c_first_name, d_date
+|  mem-estimate=87.57MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_customer_sk = customer.c_customer_sk
+|  fk/pk conjuncts: store_sales.ss_customer_sk = customer.c_customer_sk
+|  runtime filters: RF012[bloom] <- customer.c_customer_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=40B cardinality=100.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=52.00MB mem-reservation=5.00MB thread-reservation=2 runtime-filters-memory=4.00MB
+|  02:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_first_name, RF001[bloom] -> tpcds_parquet.customer.c_last_name, RF006[bloom] -> tpcds_parquet.customer.c_first_name, RF007[bloom] -> tpcds_parquet.customer.c_last_name
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=40B cardinality=100.00K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  runtime filters: RF014[bloom] <- date_dim.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=38B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=248.01KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=30B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=50.00MB mem-reservation=4.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     runtime filters: RF002[bloom] -> tpcds_parquet.date_dim.d_date, RF008[bloom] -> tpcds_parquet.date_dim.d_date
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=30B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF012[bloom] -> store_sales.ss_customer_sk, RF014[bloom] -> store_sales.ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=0 row-size=8B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39a.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39a.test
new file mode 100644
index 0000000..65bb8ea
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39a.test
@@ -0,0 +1,832 @@
+# TPCDS-Q39a
+WITH inv AS
+  (SELECT w_warehouse_name,
+          w_warehouse_sk,
+          i_item_sk,
+          d_moy,
+          stdev,
+          mean,
+          CASE mean
+              WHEN 0 THEN NULL
+              ELSE stdev/mean
+          END cov
+   FROM
+     (SELECT w_warehouse_name,
+             w_warehouse_sk,
+             i_item_sk,
+             d_moy,
+             stddev_samp(inv_quantity_on_hand)*1.000 stdev,
+             avg(inv_quantity_on_hand) mean
+      FROM inventory,
+           item,
+           warehouse,
+           date_dim
+      WHERE inv_item_sk = i_item_sk
+        AND inv_warehouse_sk = w_warehouse_sk
+        AND inv_date_sk = d_date_sk
+        AND d_year =2001
+      GROUP BY w_warehouse_name,
+               w_warehouse_sk,
+               i_item_sk,
+               d_moy) foo
+   WHERE CASE mean
+             WHEN 0 THEN 0
+             ELSE stdev/mean
+         END > 1)
+SELECT inv1.w_warehouse_sk,
+       inv1.i_item_sk,
+       inv1.d_moy,
+       inv1.mean,
+       inv1.cov,
+       inv2.w_warehouse_sk,
+       inv2.i_item_sk,
+       inv2.d_moy,
+       inv2.mean,
+       inv2.cov
+FROM inv inv1,
+     inv inv2
+WHERE inv1.i_item_sk = inv2.i_item_sk
+  AND inv1.w_warehouse_sk = inv2.w_warehouse_sk
+  AND inv1.d_moy=1
+  AND inv2.d_moy=1+1
+ORDER BY inv1.w_warehouse_sk,
+         inv1.i_item_sk,
+         inv1.d_moy,
+         inv1.mean,
+         inv1.cov,
+         inv2.d_moy,
+         inv2.mean,
+         inv2.cov ;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=131.81MB Threads=9
+Per-Host Resource Estimates: Memory=832MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=832.27MB mem-reservation=131.81MB thread-reservation=9 runtime-filters-memory=8.00MB
+PLAN-ROOT SINK
+|  output exprs: w_warehouse_sk, i_item_sk, d_moy, mean, cov, w_warehouse_sk, i_item_sk, d_moy, mean, cov
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:SORT
+|  order by: w_warehouse_sk ASC, i_item_sk ASC, d_moy ASC, mean ASC, cov ASC, d_moy ASC, mean ASC, cov ASC
+|  mem-estimate=8.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=64B cardinality=431.40K
+|  in pipelines: 17(GETNEXT), 07(OPEN)
+|
+16:HASH JOIN [INNER JOIN]
+|  hash predicates: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF000[bloom] <- i_item_sk, RF001[bloom] <- w_warehouse_sk
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5,13 row-size=123B cardinality=431.40K
+|  in pipelines: 07(GETNEXT), 15(OPEN)
+|
+|--15:AGGREGATE [FINALIZE]
+|  |  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  |  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  |  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
+|  |  mem-estimate=278.32MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=62B cardinality=431.40K
+|  |  in pipelines: 15(GETNEXT), 08(OPEN)
+|  |
+|  14:HASH JOIN [INNER JOIN]
+|  |  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  |  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  |  runtime filters: RF010[bloom] <- w_warehouse_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9,10 row-size=74B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--10:SCAN HDFS [tpcds_parquet.warehouse]
+|  |     HDFS partitions=1/1 files=1 size=4.38KB
+|  |     stored statistics:
+|  |       table: rows=5 size=4.38KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=5
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=34B cardinality=5
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN]
+|  |  hash predicates: inv_item_sk = i_item_sk
+|  |  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  |  runtime filters: RF012[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9 row-size=40B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--09:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=8B cardinality=18.00K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: inv_date_sk = d_date_sk
+|  |  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11 row-size=32B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--11:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.inventory]
+|     HDFS partitions=1/1 files=2 size=34.09MB
+|     runtime filters: RF010[bloom] -> inv_warehouse_sk, RF012[bloom] -> inv_item_sk, RF014[bloom] -> inv_date_sk
+|     stored statistics:
+|       table: rows=11.74M size=34.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6.66M
+|     mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=8 row-size=20B cardinality=11.74M
+|     in pipelines: 08(GETNEXT)
+|
+07:AGGREGATE [FINALIZE]
+|  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
+|  mem-estimate=278.32MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5 row-size=62B cardinality=431.40K
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF004[bloom] <- w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=74B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.warehouse]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     runtime filters: RF001[bloom] -> tpcds_parquet.warehouse.w_warehouse_sk
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=34B cardinality=5
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  runtime filters: RF006[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=40B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  runtime filters: RF008[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=32B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.inventory]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.inventory.inv_item_sk, RF001[bloom] -> tpcds_parquet.inventory.inv_warehouse_sk, RF004[bloom] -> inv_warehouse_sk, RF006[bloom] -> inv_item_sk, RF008[bloom] -> inv_date_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=11.74M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=182.16MB Threads=20
+Per-Host Resource Estimates: Memory=1.02GB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=13.30MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_warehouse_sk, i_item_sk, d_moy, mean, cov, w_warehouse_sk, i_item_sk, d_moy, mean, cov
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+30:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_warehouse_sk ASC, i_item_sk ASC, d_moy ASC, mean ASC, cov ASC, d_moy ASC, mean ASC, cov ASC
+|  mem-estimate=13.30MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=16 row-size=64B cardinality=431.40K
+|  in pipelines: 17(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(i_item_sk,w_warehouse_sk)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=39.26MB mem-reservation=25.00MB thread-reservation=1 runtime-filters-memory=2.00MB
+17:SORT
+|  order by: w_warehouse_sk ASC, i_item_sk ASC, d_moy ASC, mean ASC, cov ASC, d_moy ASC, mean ASC, cov ASC
+|  mem-estimate=8.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=64B cardinality=431.40K
+|  in pipelines: 17(GETNEXT), 22(OPEN)
+|
+16:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF000[bloom] <- i_item_sk, RF001[bloom] <- w_warehouse_sk
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5,13 row-size=123B cardinality=431.40K
+|  in pipelines: 22(GETNEXT), 27(OPEN)
+|
+|--29:EXCHANGE [HASH(i_item_sk,w_warehouse_sk)]
+|  |  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=62B cardinality=431.40K
+|  |  in pipelines: 27(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=27.13MB mem-reservation=17.00MB thread-reservation=1
+|  27:AGGREGATE [FINALIZE]
+|  |  output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
+|  |  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  |  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=62B cardinality=431.40K
+|  |  in pipelines: 27(GETNEXT), 08(OPEN)
+|  |
+|  26:EXCHANGE [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)]
+|  |  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=62B cardinality=4.31M
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=370.37MB mem-reservation=58.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  15:AGGREGATE [STREAMING]
+|  |  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  |  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  |  mem-estimate=233.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=12 row-size=62B cardinality=4.31M
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  |  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  |  runtime filters: RF010[bloom] <- w_warehouse_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9,10 row-size=74B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=34B cardinality=5
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  10:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=4.38KB
+|  |     stored statistics:
+|  |       table: rows=5 size=4.38KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=5
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=34B cardinality=5
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: inv_item_sk = i_item_sk
+|  |  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  |  runtime filters: RF012[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9 row-size=40B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--24:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=152.62KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=8B cardinality=18.00K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  09:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=8B cardinality=18.00K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: inv_date_sk = d_date_sk
+|  |  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11 row-size=32B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=12B cardinality=108
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  11:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+|     HDFS partitions=1/1 files=2 size=34.09MB
+|     runtime filters: RF010[bloom] -> inv_warehouse_sk, RF012[bloom] -> inv_item_sk, RF014[bloom] -> inv_date_sk
+|     stored statistics:
+|       table: rows=11.74M size=34.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6.66M
+|     mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=8 row-size=20B cardinality=11.74M
+|     in pipelines: 08(GETNEXT)
+|
+28:EXCHANGE [HASH(i_item_sk,w_warehouse_sk)]
+|  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=62B cardinality=431.40K
+|  in pipelines: 22(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=27.13MB mem-reservation=17.00MB thread-reservation=1
+22:AGGREGATE [FINALIZE]
+|  output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
+|  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5 row-size=62B cardinality=431.40K
+|  in pipelines: 22(GETNEXT), 00(OPEN)
+|
+21:EXCHANGE [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)]
+|  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=62B cardinality=4.31M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=372.37MB mem-reservation=60.81MB thread-reservation=2 runtime-filters-memory=5.00MB
+07:AGGREGATE [STREAMING]
+|  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  mem-estimate=233.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=62B cardinality=4.31M
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF004[bloom] <- w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=74B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=34B cardinality=5
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.02MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  02:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     runtime filters: RF001[bloom] -> tpcds_parquet.warehouse.w_warehouse_sk
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=34B cardinality=5
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  runtime filters: RF006[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=40B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=152.62KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=17.00MB mem-reservation=1.25MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  runtime filters: RF008[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=32B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.inventory.inv_item_sk, RF001[bloom] -> tpcds_parquet.inventory.inv_warehouse_sk, RF004[bloom] -> inv_warehouse_sk, RF006[bloom] -> inv_item_sk, RF008[bloom] -> inv_date_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=11.74M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=199.78MB Threads=19
+Per-Host Resource Estimates: Memory=781MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=13.30MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_warehouse_sk, i_item_sk, d_moy, mean, cov, w_warehouse_sk, i_item_sk, d_moy, mean, cov
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+30:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_warehouse_sk ASC, i_item_sk ASC, d_moy ASC, mean ASC, cov ASC, d_moy ASC, mean ASC, cov ASC
+|  mem-estimate=13.30MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=16 row-size=64B cardinality=431.40K
+|  in pipelines: 17(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(i_item_sk,w_warehouse_sk)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=18.13MB mem-reservation=6.00MB thread-reservation=1
+17:SORT
+|  order by: w_warehouse_sk ASC, i_item_sk ASC, d_moy ASC, mean ASC, cov ASC, d_moy ASC, mean ASC, cov ASC
+|  mem-estimate=8.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=64B cardinality=431.40K
+|  in pipelines: 17(GETNEXT), 22(OPEN)
+|
+16:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5,13 row-size=123B cardinality=431.40K
+|  in pipelines: 22(GETNEXT), 27(OPEN)
+|
+|--F12:PLAN FRAGMENT [HASH(i_item_sk,w_warehouse_sk)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=29.13MB mem-reservation=19.00MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_sk, w_warehouse_sk
+|  |  runtime filters: RF000[bloom] <- i_item_sk, RF001[bloom] <- w_warehouse_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |
+|  29:EXCHANGE [HASH(i_item_sk,w_warehouse_sk)]
+|  |  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=62B cardinality=431.40K
+|  |  in pipelines: 27(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=27.13MB mem-reservation=17.00MB thread-reservation=1
+|  27:AGGREGATE [FINALIZE]
+|  |  output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
+|  |  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  |  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=62B cardinality=431.40K
+|  |  in pipelines: 27(GETNEXT), 08(OPEN)
+|  |
+|  26:EXCHANGE [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)]
+|  |  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=62B cardinality=4.31M
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=265.37MB mem-reservation=50.00MB thread-reservation=1
+|  15:AGGREGATE [STREAMING]
+|  |  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  |  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  |  mem-estimate=233.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=12 row-size=62B cardinality=4.31M
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  |  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9,10 row-size=74B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--F13:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: w_warehouse_sk
+|  |  |  runtime filters: RF010[bloom] <- w_warehouse_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=34B cardinality=5
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  10:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=4.38KB
+|  |     stored statistics:
+|  |       table: rows=5 size=4.38KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=5
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=10 row-size=34B cardinality=5
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: inv_item_sk = i_item_sk
+|  |  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9 row-size=40B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--F14:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=5.02MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF012[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  24:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=152.62KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=8B cardinality=18.00K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  09:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=9 row-size=8B cardinality=18.00K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: inv_date_sk = d_date_sk
+|  |  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11 row-size=32B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--F15:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=12B cardinality=108
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  11:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+|     HDFS partitions=1/1 files=2 size=34.09MB
+|     runtime filters: RF010[bloom] -> inv_warehouse_sk, RF012[bloom] -> inv_item_sk, RF014[bloom] -> inv_date_sk
+|     stored statistics:
+|       table: rows=11.74M size=34.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6.66M
+|     mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=8 row-size=20B cardinality=11.74M
+|     in pipelines: 08(GETNEXT)
+|
+28:EXCHANGE [HASH(i_item_sk,w_warehouse_sk)]
+|  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=62B cardinality=431.40K
+|  in pipelines: 22(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=27.13MB mem-reservation=17.00MB thread-reservation=1
+22:AGGREGATE [FINALIZE]
+|  output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
+|  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) * CAST(1.000 AS DOUBLE) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5 row-size=62B cardinality=431.40K
+|  in pipelines: 22(GETNEXT), 00(OPEN)
+|
+21:EXCHANGE [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)]
+|  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=62B cardinality=4.31M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+Per-Instance Resources: mem-estimate=265.37MB mem-reservation=50.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  mem-estimate=233.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=62B cardinality=4.31M
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=74B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F16:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: w_warehouse_sk
+|  |  runtime filters: RF004[bloom] <- w_warehouse_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=34B cardinality=5
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     runtime filters: RF001[bloom] -> tpcds_parquet.warehouse.w_warehouse_sk
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=2 row-size=34B cardinality=5
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=05
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=40B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F17:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=5.02MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF006[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=152.62KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=1 row-size=8B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=06
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=32B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F18:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.inventory.inv_item_sk, RF001[bloom] -> tpcds_parquet.inventory.inv_warehouse_sk, RF004[bloom] -> inv_warehouse_sk, RF006[bloom] -> inv_item_sk, RF008[bloom] -> inv_date_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+   tuple-ids=0 row-size=20B cardinality=11.74M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39b.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39b.test
new file mode 100644
index 0000000..24173b5
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q39b.test
@@ -0,0 +1,834 @@
+# TPCDS-Q39b
+WITH inv AS
+  (SELECT w_warehouse_name,
+          w_warehouse_sk,
+          i_item_sk,
+          d_moy,
+          stdev,
+          mean,
+          CASE mean
+              WHEN 0 THEN NULL
+              ELSE stdev/mean
+          END cov
+   FROM
+     (SELECT w_warehouse_name,
+             w_warehouse_sk,
+             i_item_sk,
+             d_moy,
+             stddev_samp(inv_quantity_on_hand) stdev,
+             avg(inv_quantity_on_hand) mean
+      FROM inventory,
+           item,
+           warehouse,
+           date_dim
+      WHERE inv_item_sk = i_item_sk
+        AND inv_warehouse_sk = w_warehouse_sk
+        AND inv_date_sk = d_date_sk
+        AND d_year =2001
+      GROUP BY w_warehouse_name,
+               w_warehouse_sk,
+               i_item_sk,
+               d_moy) foo
+   WHERE CASE mean
+             WHEN 0 THEN 0
+             ELSE stdev/mean
+         END > 1)
+SELECT inv1.w_warehouse_sk,
+       inv1.i_item_sk,
+       inv1.d_moy,
+       inv1.mean,
+       inv1.cov,
+       inv2.w_warehouse_sk,
+       inv2.i_item_sk,
+       inv2.d_moy,
+       inv2.mean,
+       inv2.cov
+FROM inv inv1,
+     inv inv2
+WHERE inv1.i_item_sk = inv2.i_item_sk
+  AND inv1.w_warehouse_sk = inv2.w_warehouse_sk
+  AND inv1.d_moy=1
+  AND inv2.d_moy=1+1
+  AND inv1.cov > 1.5
+ORDER BY inv1.w_warehouse_sk,
+         inv1.i_item_sk,
+         inv1.d_moy,
+         inv1.mean,
+         inv1.cov,
+         inv2.d_moy,
+         inv2.mean,
+         inv2.cov ;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=131.81MB Threads=9
+Per-Host Resource Estimates: Memory=832MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=832.27MB mem-reservation=131.81MB thread-reservation=9 runtime-filters-memory=8.00MB
+PLAN-ROOT SINK
+|  output exprs: w_warehouse_sk, i_item_sk, d_moy, mean, cov, w_warehouse_sk, i_item_sk, d_moy, mean, cov
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:SORT
+|  order by: w_warehouse_sk ASC, i_item_sk ASC, d_moy ASC, mean ASC, cov ASC, d_moy ASC, mean ASC, cov ASC
+|  mem-estimate=8.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=64B cardinality=431.40K
+|  in pipelines: 17(GETNEXT), 07(OPEN)
+|
+16:HASH JOIN [INNER JOIN]
+|  hash predicates: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF000[bloom] <- i_item_sk, RF001[bloom] <- w_warehouse_sk
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5,13 row-size=123B cardinality=431.40K
+|  in pipelines: 07(GETNEXT), 15(OPEN)
+|
+|--15:AGGREGATE [FINALIZE]
+|  |  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  |  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  |  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
+|  |  mem-estimate=278.32MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=62B cardinality=431.40K
+|  |  in pipelines: 15(GETNEXT), 08(OPEN)
+|  |
+|  14:HASH JOIN [INNER JOIN]
+|  |  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  |  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  |  runtime filters: RF010[bloom] <- w_warehouse_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9,10 row-size=74B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--10:SCAN HDFS [tpcds_parquet.warehouse]
+|  |     HDFS partitions=1/1 files=1 size=4.38KB
+|  |     stored statistics:
+|  |       table: rows=5 size=4.38KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=5
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=34B cardinality=5
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN]
+|  |  hash predicates: inv_item_sk = i_item_sk
+|  |  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  |  runtime filters: RF012[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9 row-size=40B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--09:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=8B cardinality=18.00K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: inv_date_sk = d_date_sk
+|  |  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11 row-size=32B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--11:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.inventory]
+|     HDFS partitions=1/1 files=2 size=34.09MB
+|     runtime filters: RF010[bloom] -> inv_warehouse_sk, RF012[bloom] -> inv_item_sk, RF014[bloom] -> inv_date_sk
+|     stored statistics:
+|       table: rows=11.74M size=34.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6.66M
+|     mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=8 row-size=20B cardinality=11.74M
+|     in pipelines: 08(GETNEXT)
+|
+07:AGGREGATE [FINALIZE]
+|  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE), CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN NULL ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1.5 AS DOUBLE)
+|  mem-estimate=278.32MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5 row-size=62B cardinality=431.40K
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF004[bloom] <- w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=74B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.warehouse]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     runtime filters: RF001[bloom] -> tpcds_parquet.warehouse.w_warehouse_sk
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=34B cardinality=5
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  runtime filters: RF006[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=40B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  runtime filters: RF008[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=32B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.inventory]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.inventory.inv_item_sk, RF001[bloom] -> tpcds_parquet.inventory.inv_warehouse_sk, RF004[bloom] -> inv_warehouse_sk, RF006[bloom] -> inv_item_sk, RF008[bloom] -> inv_date_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=11.74M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=182.16MB Threads=20
+Per-Host Resource Estimates: Memory=1.02GB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=13.30MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_warehouse_sk, i_item_sk, d_moy, mean, cov, w_warehouse_sk, i_item_sk, d_moy, mean, cov
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+30:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_warehouse_sk ASC, i_item_sk ASC, d_moy ASC, mean ASC, cov ASC, d_moy ASC, mean ASC, cov ASC
+|  mem-estimate=13.30MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=16 row-size=64B cardinality=431.40K
+|  in pipelines: 17(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(i_item_sk,w_warehouse_sk)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=39.26MB mem-reservation=25.00MB thread-reservation=1 runtime-filters-memory=2.00MB
+17:SORT
+|  order by: w_warehouse_sk ASC, i_item_sk ASC, d_moy ASC, mean ASC, cov ASC, d_moy ASC, mean ASC, cov ASC
+|  mem-estimate=8.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=64B cardinality=431.40K
+|  in pipelines: 17(GETNEXT), 22(OPEN)
+|
+16:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF000[bloom] <- i_item_sk, RF001[bloom] <- w_warehouse_sk
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5,13 row-size=123B cardinality=431.40K
+|  in pipelines: 22(GETNEXT), 27(OPEN)
+|
+|--29:EXCHANGE [HASH(i_item_sk,w_warehouse_sk)]
+|  |  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=62B cardinality=431.40K
+|  |  in pipelines: 27(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=27.13MB mem-reservation=17.00MB thread-reservation=1
+|  27:AGGREGATE [FINALIZE]
+|  |  output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
+|  |  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  |  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=62B cardinality=431.40K
+|  |  in pipelines: 27(GETNEXT), 08(OPEN)
+|  |
+|  26:EXCHANGE [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)]
+|  |  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=62B cardinality=4.31M
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=370.37MB mem-reservation=58.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  15:AGGREGATE [STREAMING]
+|  |  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  |  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  |  mem-estimate=233.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=12 row-size=62B cardinality=4.31M
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  |  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  |  runtime filters: RF010[bloom] <- w_warehouse_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9,10 row-size=74B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=34B cardinality=5
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  10:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=4.38KB
+|  |     stored statistics:
+|  |       table: rows=5 size=4.38KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=5
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=34B cardinality=5
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: inv_item_sk = i_item_sk
+|  |  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  |  runtime filters: RF012[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9 row-size=40B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--24:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=152.62KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=8B cardinality=18.00K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  09:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=8B cardinality=18.00K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: inv_date_sk = d_date_sk
+|  |  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11 row-size=32B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=12B cardinality=108
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  11:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+|     HDFS partitions=1/1 files=2 size=34.09MB
+|     runtime filters: RF010[bloom] -> inv_warehouse_sk, RF012[bloom] -> inv_item_sk, RF014[bloom] -> inv_date_sk
+|     stored statistics:
+|       table: rows=11.74M size=34.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6.66M
+|     mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=8 row-size=20B cardinality=11.74M
+|     in pipelines: 08(GETNEXT)
+|
+28:EXCHANGE [HASH(i_item_sk,w_warehouse_sk)]
+|  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=62B cardinality=431.40K
+|  in pipelines: 22(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=27.13MB mem-reservation=17.00MB thread-reservation=1
+22:AGGREGATE [FINALIZE]
+|  output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
+|  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE), CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN NULL ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1.5 AS DOUBLE)
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5 row-size=62B cardinality=431.40K
+|  in pipelines: 22(GETNEXT), 00(OPEN)
+|
+21:EXCHANGE [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)]
+|  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=62B cardinality=4.31M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=372.37MB mem-reservation=60.81MB thread-reservation=2 runtime-filters-memory=5.00MB
+07:AGGREGATE [STREAMING]
+|  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  mem-estimate=233.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=62B cardinality=4.31M
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF004[bloom] <- w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=74B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=34B cardinality=5
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.02MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  02:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     runtime filters: RF001[bloom] -> tpcds_parquet.warehouse.w_warehouse_sk
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=34B cardinality=5
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  runtime filters: RF006[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=40B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=152.62KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=17.00MB mem-reservation=1.25MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  runtime filters: RF008[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=32B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.inventory.inv_item_sk, RF001[bloom] -> tpcds_parquet.inventory.inv_warehouse_sk, RF004[bloom] -> inv_warehouse_sk, RF006[bloom] -> inv_item_sk, RF008[bloom] -> inv_date_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=11.74M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=199.78MB Threads=19
+Per-Host Resource Estimates: Memory=781MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=13.30MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_warehouse_sk, i_item_sk, d_moy, mean, cov, w_warehouse_sk, i_item_sk, d_moy, mean, cov
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+30:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_warehouse_sk ASC, i_item_sk ASC, d_moy ASC, mean ASC, cov ASC, d_moy ASC, mean ASC, cov ASC
+|  mem-estimate=13.30MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=16 row-size=64B cardinality=431.40K
+|  in pipelines: 17(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(i_item_sk,w_warehouse_sk)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=18.13MB mem-reservation=6.00MB thread-reservation=1
+17:SORT
+|  order by: w_warehouse_sk ASC, i_item_sk ASC, d_moy ASC, mean ASC, cov ASC, d_moy ASC, mean ASC, cov ASC
+|  mem-estimate=8.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=64B cardinality=431.40K
+|  in pipelines: 17(GETNEXT), 22(OPEN)
+|
+16:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: i_item_sk = i_item_sk, w_warehouse_sk = w_warehouse_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5,13 row-size=123B cardinality=431.40K
+|  in pipelines: 22(GETNEXT), 27(OPEN)
+|
+|--F12:PLAN FRAGMENT [HASH(i_item_sk,w_warehouse_sk)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=29.13MB mem-reservation=19.00MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_sk, w_warehouse_sk
+|  |  runtime filters: RF000[bloom] <- i_item_sk, RF001[bloom] <- w_warehouse_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |
+|  29:EXCHANGE [HASH(i_item_sk,w_warehouse_sk)]
+|  |  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=62B cardinality=431.40K
+|  |  in pipelines: 27(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=27.13MB mem-reservation=17.00MB thread-reservation=1
+|  27:AGGREGATE [FINALIZE]
+|  |  output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
+|  |  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  |  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE)
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=62B cardinality=431.40K
+|  |  in pipelines: 27(GETNEXT), 08(OPEN)
+|  |
+|  26:EXCHANGE [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)]
+|  |  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=62B cardinality=4.31M
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=265.37MB mem-reservation=50.00MB thread-reservation=1
+|  15:AGGREGATE [STREAMING]
+|  |  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  |  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  |  mem-estimate=233.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=12 row-size=62B cardinality=4.31M
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  |  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9,10 row-size=74B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--F13:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: w_warehouse_sk
+|  |  |  runtime filters: RF010[bloom] <- w_warehouse_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=34B cardinality=5
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  10:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=4.38KB
+|  |     stored statistics:
+|  |       table: rows=5 size=4.38KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=5
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=10 row-size=34B cardinality=5
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: inv_item_sk = i_item_sk
+|  |  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11,9 row-size=40B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--F14:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=5.02MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF012[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  24:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=152.62KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=8B cardinality=18.00K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  09:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=9 row-size=8B cardinality=18.00K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: inv_date_sk = d_date_sk
+|  |  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,11 row-size=32B cardinality=4.82M
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--F15:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=12B cardinality=108
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  11:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(2 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+|     HDFS partitions=1/1 files=2 size=34.09MB
+|     runtime filters: RF010[bloom] -> inv_warehouse_sk, RF012[bloom] -> inv_item_sk, RF014[bloom] -> inv_date_sk
+|     stored statistics:
+|       table: rows=11.74M size=34.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6.66M
+|     mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=8 row-size=20B cardinality=11.74M
+|     in pipelines: 08(GETNEXT)
+|
+28:EXCHANGE [HASH(i_item_sk,w_warehouse_sk)]
+|  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=62B cardinality=431.40K
+|  in pipelines: 22(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=27.13MB mem-reservation=17.00MB thread-reservation=1
+22:AGGREGATE [FINALIZE]
+|  output: stddev_samp:merge(inv_quantity_on_hand), avg:merge(inv_quantity_on_hand)
+|  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  having: CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN CAST(0 AS DOUBLE) ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1 AS DOUBLE), CASE avg(inv_quantity_on_hand) WHEN CAST(0 AS DOUBLE) THEN NULL ELSE stddev_samp(inv_quantity_on_hand) / avg(inv_quantity_on_hand) END > CAST(1.5 AS DOUBLE)
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5 row-size=62B cardinality=431.40K
+|  in pipelines: 22(GETNEXT), 00(OPEN)
+|
+21:EXCHANGE [HASH(w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy)]
+|  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=62B cardinality=4.31M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+Per-Instance Resources: mem-estimate=265.37MB mem-reservation=50.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  output: stddev_samp(inv_quantity_on_hand), avg(CAST(inv_quantity_on_hand AS BIGINT))
+|  group by: w_warehouse_name, w_warehouse_sk, i_item_sk, d_moy
+|  mem-estimate=233.37MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=62B cardinality=4.31M
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=74B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F16:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: w_warehouse_sk
+|  |  runtime filters: RF004[bloom] <- w_warehouse_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=34B cardinality=5
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     runtime filters: RF001[bloom] -> tpcds_parquet.warehouse.w_warehouse_sk
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=2 row-size=34B cardinality=5
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=05
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: inv_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=40B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F17:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=5.02MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF006[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=152.62KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=1 row-size=8B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=06
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=32B cardinality=4.82M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F18:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), tpcds_parquet.date_dim.d_moy = CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.inventory.inv_item_sk, RF001[bloom] -> tpcds_parquet.inventory.inv_warehouse_sk, RF004[bloom] -> inv_warehouse_sk, RF006[bloom] -> inv_item_sk, RF008[bloom] -> inv_date_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+   tuple-ids=0 row-size=20B cardinality=11.74M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q40.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q40.test
new file mode 100644
index 0000000..f232e8c
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q40.test
@@ -0,0 +1,494 @@
+# TPCDS-Q40
+SELECT w_state,
+       i_item_id,
+       sum(CASE
+               WHEN (cast(d_date AS date) < CAST ('2000-03-11' AS date)) THEN cs_sales_price - coalesce(cr_refunded_cash,0)
+               ELSE 0
+           END) AS sales_before,
+       sum(CASE
+               WHEN (cast(d_date AS date) >= CAST ('2000-03-11' AS date)) THEN cs_sales_price - coalesce(cr_refunded_cash,0)
+               ELSE 0
+           END) AS sales_after
+FROM catalog_sales
+LEFT OUTER JOIN catalog_returns ON (cs_order_number = cr_order_number
+                                    AND cs_item_sk = cr_item_sk) ,warehouse,
+                                                                  item,
+                                                                  date_dim
+WHERE i_current_price BETWEEN 0.99 AND 1.49
+  AND i_item_sk = cs_item_sk
+  AND cs_warehouse_sk = w_warehouse_sk
+  AND cs_sold_date_sk = d_date_sk
+  AND d_date BETWEEN CAST ('2000-02-10' AS date) AND CAST ('2000-04-10' AS date)
+GROUP BY w_state,
+         i_item_id
+ORDER BY w_state,
+         i_item_id
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=25.08MB Threads=6
+Per-Host Resource Estimates: Memory=438MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=437.56MB mem-reservation=25.08MB thread-reservation=6 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: w_state, i_item_id, sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, 0) ELSE 0 END), sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, 0) ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+10:TOP-N [LIMIT=100]
+|  order by: w_state ASC, i_item_id ASC
+|  mem-estimate=7.23KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=74B cardinality=100
+|  in pipelines: 10(GETNEXT), 09(OPEN)
+|
+09:AGGREGATE [FINALIZE]
+|  output: sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, CAST(0 AS DECIMAL(7,2))) ELSE CAST(0 AS DECIMAL(8,2)) END), sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, CAST(0 AS DECIMAL(7,2))) ELSE CAST(0 AS DECIMAL(8,2)) END)
+|  group by: w_state, i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=74B cardinality=8.85K
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,3,2,4 row-size=132B cardinality=144.16K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=26B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: cs_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF002[bloom] <- w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,3,2 row-size=106B cardinality=144.16K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.warehouse]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=18B cardinality=5
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  runtime filters: RF004[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,3 row-size=88B cardinality=144.16K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     parquet dictionary predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=40B cardinality=1.80K
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [LEFT OUTER JOIN]
+|  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,1N row-size=48B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.catalog_returns]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     runtime filters: RF004[bloom] -> tpcds_parquet.catalog_returns.cr_item_sk
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=72.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=144.07K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_sold_date_sk, RF002[bloom] -> cs_warehouse_sk, RF004[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=240.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=30.02MB Threads=12
+Per-Host Resource Estimates: Memory=462MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=25.26KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_state, i_item_id, sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, 0) ELSE 0 END), sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, 0) ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_state ASC, i_item_id ASC
+|  limit: 100
+|  mem-estimate=25.26KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=74B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(w_state,i_item_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.44MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: w_state ASC, i_item_id ASC
+|  mem-estimate=7.23KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=74B cardinality=100
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, 0) ELSE 0 END), sum:merge(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, 0) ELSE 0 END)
+|  group by: w_state, i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=74B cardinality=8.85K
+|  in pipelines: 16(GETNEXT), 00(OPEN)
+|
+15:EXCHANGE [HASH(w_state,i_item_id)]
+|  mem-estimate=447.28KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=74B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=266.67MB mem-reservation=23.56MB thread-reservation=2 runtime-filters-memory=3.00MB
+09:AGGREGATE [STREAMING]
+|  output: sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, CAST(0 AS DECIMAL(7,2))) ELSE CAST(0 AS DECIMAL(8,2)) END), sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, CAST(0 AS DECIMAL(7,2))) ELSE CAST(0 AS DECIMAL(8,2)) END)
+|  group by: w_state, i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=74B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,3,2,4 row-size=132B cardinality=144.16K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=26B cardinality=7.30K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=26B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: cs_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF002[bloom] <- w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,3,2 row-size=106B cardinality=144.16K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=18B cardinality=5
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=18B cardinality=5
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  runtime filters: RF004[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,3 row-size=88B cardinality=144.16K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=114.31KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=40B cardinality=1.80K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     parquet dictionary predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=40B cardinality=1.80K
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,1N row-size=48B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.77MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=20B cardinality=144.07K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=73.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  01:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     runtime filters: RF004[bloom] -> tpcds_parquet.catalog_returns.cr_item_sk
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=72.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=144.07K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_sold_date_sk, RF002[bloom] -> cs_warehouse_sk, RF004[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=240.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=43.58MB Threads=11
+Per-Host Resource Estimates: Memory=172MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=25.26KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_state, i_item_id, sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, 0) ELSE 0 END), sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, 0) ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_state ASC, i_item_id ASC
+|  limit: 100
+|  mem-estimate=25.26KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=74B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(w_state,i_item_id)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=10.44MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: w_state ASC, i_item_id ASC
+|  mem-estimate=7.23KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=74B cardinality=100
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, 0) ELSE 0 END), sum:merge(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, 0) ELSE 0 END)
+|  group by: w_state, i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=74B cardinality=8.85K
+|  in pipelines: 16(GETNEXT), 00(OPEN)
+|
+15:EXCHANGE [HASH(w_state,i_item_id)]
+|  mem-estimate=447.28KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=74B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=58.00MB mem-reservation=10.00MB thread-reservation=1
+09:AGGREGATE [STREAMING]
+|  output: sum(CASE WHEN (CAST(d_date AS DATE) < DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, CAST(0 AS DECIMAL(7,2))) ELSE CAST(0 AS DECIMAL(8,2)) END), sum(CASE WHEN (CAST(d_date AS DATE) >= DATE '2000-03-11') THEN cs_sales_price - coalesce(cr_refunded_cash, CAST(0 AS DECIMAL(7,2))) ELSE CAST(0 AS DECIMAL(8,2)) END)
+|  group by: w_state, i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=74B cardinality=8.85K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,3,2,4 row-size=132B cardinality=144.16K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.09MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=26B cardinality=7.30K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-10', CAST(d_date AS DATE) >= DATE '2000-02-10'
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=4 row-size=26B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: cs_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: cs_warehouse_sk = w_warehouse_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,3,2 row-size=106B cardinality=144.16K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: w_warehouse_sk
+|  |  runtime filters: RF002[bloom] <- w_warehouse_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=18B cardinality=5
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=2 row-size=18B cardinality=5
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,3 row-size=88B cardinality=144.16K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.99MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF004[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=114.31KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=40B cardinality=1.80K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     parquet dictionary predicates: i_current_price <= CAST(1.49 AS DECIMAL(3,2)), i_current_price >= CAST(0.99 AS DECIMAL(2,2))
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=40B cardinality=1.80K
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,1N row-size=48B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=12.27MB mem-reservation=9.50MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: cr_item_sk, cr_order_number
+|  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.77MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=20B cardinality=144.07K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     runtime filters: RF004[bloom] -> tpcds_parquet.catalog_returns.cr_item_sk
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=1 row-size=20B cardinality=144.07K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_sold_date_sk, RF002[bloom] -> cs_warehouse_sk, RF004[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=0 row-size=28B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q41.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q41.test
new file mode 100644
index 0000000..19b9011
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q41.test
@@ -0,0 +1,343 @@
+# TPCDS-Q41
+SELECT distinct(i_product_name)
+FROM item i1
+WHERE i_manufact_id BETWEEN 738 AND 738+40
+  AND
+    (SELECT count(*) AS item_cnt
+     FROM item
+     WHERE (i_manufact = i1.i_manufact
+            AND ((i_category = 'Women'
+                  AND (i_color = 'powder'
+                       OR i_color = 'khaki')
+                  AND (i_units = 'Ounce'
+                       OR i_units = 'Oz')
+                  AND (i_size = 'medium'
+                       OR i_size = 'extra large'))
+                 OR (i_category = 'Women'
+                     AND (i_color = 'brown'
+                          OR i_color = 'honeydew')
+                     AND (i_units = 'Bunch'
+                          OR i_units = 'Ton')
+                     AND (i_size = 'N/A'
+                          OR i_size = 'small'))
+                 OR (i_category = 'Men'
+                     AND (i_color = 'floral'
+                          OR i_color = 'deep')
+                     AND (i_units = 'N/A'
+                          OR i_units = 'Dozen')
+                     AND (i_size = 'petite'
+                          OR i_size = 'petite'))
+                 OR (i_category = 'Men'
+                     AND (i_color = 'light'
+                          OR i_color = 'cornflower')
+                     AND (i_units = 'Box'
+                          OR i_units = 'Pound')
+                     AND (i_size = 'medium'
+                          OR i_size = 'extra large'))))
+       OR (i_manufact = i1.i_manufact
+           AND ((i_category = 'Women'
+                 AND (i_color = 'midnight'
+                      OR i_color = 'snow')
+                 AND (i_units = 'Pallet'
+                      OR i_units = 'Gross')
+                 AND (i_size = 'medium'
+                      OR i_size = 'extra large'))
+                OR (i_category = 'Women'
+                    AND (i_color = 'cyan'
+                         OR i_color = 'papaya')
+                    AND (i_units = 'Cup'
+                         OR i_units = 'Dram')
+                    AND (i_size = 'N/A'
+                         OR i_size = 'small'))
+                OR (i_category = 'Men'
+                    AND (i_color = 'orange'
+                         OR i_color = 'frosted')
+                    AND (i_units = 'Each'
+                         OR i_units = 'Tbl')
+                    AND (i_size = 'petite'
+                         OR i_size = 'petite'))
+                OR (i_category = 'Men'
+                    AND (i_color = 'forest'
+                         OR i_color = 'ghost')
+                    AND (i_units = 'Lb'
+                         OR i_units = 'Bundle')
+                    AND (i_size = 'medium'
+                         OR i_size = 'extra large'))))) > 0
+ORDER BY i_product_name
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=4.38MB Threads=3
+Per-Host Resource Estimates: Memory=138MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=138.00MB mem-reservation=4.38MB thread-reservation=3
+PLAN-ROOT SINK
+|  output exprs: (i_product_name)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+05:TOP-N [LIMIT=100]
+|  order by: (i_product_name) ASC
+|  mem-estimate=2.93KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=30B cardinality=100
+|  in pipelines: 05(GETNEXT), 04(OPEN)
+|
+04:AGGREGATE [FINALIZE]
+|  group by: (i_product_name)
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=30B cardinality=1.80K
+|  in pipelines: 04(GETNEXT), 00(OPEN)
+|
+03:HASH JOIN [LEFT OUTER JOIN]
+|  hash predicates: i1.i_manufact = i_manufact
+|  fk/pk conjuncts: none
+|  other predicates: zeroifnull(count(*)) > CAST(0 AS BIGINT)
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2N row-size=89B cardinality=1.80K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  group by: i_manufact
+|  |  having: zeroifnull(count(*)) > CAST(0 AS BIGINT)
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2 row-size=31B cardinality=1
+|  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category = 'Women' AND ((i_color IN ('powder', 'khaki') AND i_units IN ('Ounce', 'Oz') AND i_size IN ('medium', 'extra large')) OR (i_color IN ('brown', 'honeydew') AND i_units IN ('Bunch', 'Ton') AND i_size IN ('N/A', 'small'))) OR (i_category = 'Men' AND i_color IN ('floral', 'deep') AND i_units IN ('N/A', 'Dozen') AND i_size = 'petite') OR (i_category = 'Men' AND i_color IN ('light', 'cornflower') AND i_units IN ('Box', 'Pound') AND i_size IN ('medium', 'extra large'))) OR (i_category = 'Women' AND ((i_color IN ('midnight', 'snow') AND i_units IN ('Pallet', 'Gross') AND i_size IN ('medium', 'extra large')) OR (i_color IN ('cyan', 'papaya') AND i_units IN ('Cup', 'Dram') AND i_size IN ('N/A', 'small'))) OR (i_category = 'Men' AND i_color IN ('orange', 'frosted') AND i_units IN ('Each', 'Tbl') AND i_size = 'petite') OR (i_category = 'Men' AND i_color IN ('forest', 'ghost') AND i_units IN ('Lb', 'Bundle') AND i_size IN ('medium', 'extra large'))))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=1 row-size=91B cardinality=8
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.item i1]
+   HDFS partitions=1/1 files=1 size=1.73MB
+   predicates: i_manufact_id <= CAST(778 AS INT), i_manufact_id >= CAST(738 AS INT)
+   stored statistics:
+     table: rows=18.00K size=1.73MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=18.00K
+   parquet statistics predicates: i_manufact_id <= CAST(778 AS INT), i_manufact_id >= CAST(738 AS INT)
+   parquet dictionary predicates: i_manufact_id <= CAST(778 AS INT), i_manufact_id >= CAST(738 AS INT)
+   mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=0 row-size=57B cardinality=1.80K
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=10.44MB Threads=7
+Per-Host Resource Estimates: Memory=170MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: (i_product_name)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: (i_product_name) ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=30B cardinality=100
+|  in pipelines: 05(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH((i_product_name))] hosts=1 instances=1
+Per-Host Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reservation=1
+05:TOP-N [LIMIT=100]
+|  order by: (i_product_name) ASC
+|  mem-estimate=2.93KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=30B cardinality=100
+|  in pipelines: 05(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  group by: (i_product_name)
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=30B cardinality=1.80K
+|  in pipelines: 10(GETNEXT), 00(OPEN)
+|
+09:EXCHANGE [HASH((i_product_name))]
+|  mem-estimate=86.84KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=30B cardinality=1.80K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Resources: mem-estimate=59.95MB mem-reservation=4.44MB thread-reservation=2
+04:AGGREGATE [STREAMING]
+|  group by: (i_product_name)
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=30B cardinality=1.80K
+|  in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash predicates: i1.i_manufact = i_manufact
+|  fk/pk conjuncts: none
+|  other predicates: zeroifnull(count(*)) > CAST(0 AS BIGINT)
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2N row-size=89B cardinality=1.80K
+|  in pipelines: 00(GETNEXT), 07(OPEN)
+|
+|--08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=31B cardinality=1
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [HASH(i_manufact)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  07:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  group by: i_manufact
+|  |  having: zeroifnull(count(*)) > CAST(0 AS BIGINT)
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2 row-size=31B cardinality=1
+|  |  in pipelines: 07(GETNEXT), 01(OPEN)
+|  |
+|  06:EXCHANGE [HASH(i_manufact)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=31B cardinality=8
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=90.00MB mem-reservation=2.12MB thread-reservation=2
+|  02:AGGREGATE [STREAMING]
+|  |  output: count(*)
+|  |  group by: i_manufact
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2 row-size=31B cardinality=8
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category = 'Women' AND ((i_color IN ('powder', 'khaki') AND i_units IN ('Ounce', 'Oz') AND i_size IN ('medium', 'extra large')) OR (i_color IN ('brown', 'honeydew') AND i_units IN ('Bunch', 'Ton') AND i_size IN ('N/A', 'small'))) OR (i_category = 'Men' AND i_color IN ('floral', 'deep') AND i_units IN ('N/A', 'Dozen') AND i_size = 'petite') OR (i_category = 'Men' AND i_color IN ('light', 'cornflower') AND i_units IN ('Box', 'Pound') AND i_size IN ('medium', 'extra large'))) OR (i_category = 'Women' AND ((i_color IN ('midnight', 'snow') AND i_units IN ('Pallet', 'Gross') AND i_size IN ('medium', 'extra large')) OR (i_color IN ('cyan', 'papaya') AND i_units IN ('Cup', 'Dram') AND i_size IN ('N/A', 'small'))) OR (i_category = 'Men' AND i_color IN ('orange', 'frosted') AND i_units IN ('Each', 'Tbl') AND i_size = 'petite') OR (i_category = 'Men' AND i_color IN ('forest', 'ghost') AND i_units IN ('Lb', 'Bundle') AND i_size IN ('medium', 'extra large'))))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=128.00KB thread-reservation=1
+|     tuple-ids=1 row-size=91B cardinality=8
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.item i1, RANDOM]
+   HDFS partitions=1/1 files=1 size=1.73MB
+   predicates: i_manufact_id <= CAST(778 AS INT), i_manufact_id >= CAST(738 AS INT)
+   stored statistics:
+     table: rows=18.00K size=1.73MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=18.00K
+   parquet statistics predicates: i_manufact_id <= CAST(778 AS INT), i_manufact_id >= CAST(738 AS INT)
+   parquet dictionary predicates: i_manufact_id <= CAST(778 AS INT), i_manufact_id >= CAST(738 AS INT)
+   mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=0 row-size=57B cardinality=1.80K
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=12.38MB Threads=6
+Per-Host Resource Estimates: Memory=76MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: (i_product_name)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: (i_product_name) ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=30B cardinality=100
+|  in pipelines: 05(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH((i_product_name))] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reservation=1
+05:TOP-N [LIMIT=100]
+|  order by: (i_product_name) ASC
+|  mem-estimate=2.93KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=30B cardinality=100
+|  in pipelines: 05(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  group by: (i_product_name)
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=30B cardinality=1.80K
+|  in pipelines: 10(GETNEXT), 00(OPEN)
+|
+09:EXCHANGE [HASH((i_product_name))]
+|  mem-estimate=86.84KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=30B cardinality=1.80K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.50MB thread-reservation=1
+04:AGGREGATE [STREAMING]
+|  group by: (i_product_name)
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=30B cardinality=1.80K
+|  in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: i1.i_manufact = i_manufact
+|  fk/pk conjuncts: none
+|  other predicates: zeroifnull(count(*)) > CAST(0 AS BIGINT)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2N row-size=89B cardinality=1.80K
+|  in pipelines: 00(GETNEXT), 07(OPEN)
+|
+|--F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_manufact
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=31B cardinality=1
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [HASH(i_manufact)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  07:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  group by: i_manufact
+|  |  having: zeroifnull(count(*)) > CAST(0 AS BIGINT)
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2 row-size=31B cardinality=1
+|  |  in pipelines: 07(GETNEXT), 01(OPEN)
+|  |
+|  06:EXCHANGE [HASH(i_manufact)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=31B cardinality=8
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.12MB thread-reservation=1
+|  02:AGGREGATE [STREAMING]
+|  |  output: count(*)
+|  |  group by: i_manufact
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2 row-size=31B cardinality=8
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category = 'Women' AND ((i_color IN ('powder', 'khaki') AND i_units IN ('Ounce', 'Oz') AND i_size IN ('medium', 'extra large')) OR (i_color IN ('brown', 'honeydew') AND i_units IN ('Bunch', 'Ton') AND i_size IN ('N/A', 'small'))) OR (i_category = 'Men' AND i_color IN ('floral', 'deep') AND i_units IN ('N/A', 'Dozen') AND i_size = 'petite') OR (i_category = 'Men' AND i_color IN ('light', 'cornflower') AND i_units IN ('Box', 'Pound') AND i_size IN ('medium', 'extra large'))) OR (i_category = 'Women' AND ((i_color IN ('midnight', 'snow') AND i_units IN ('Pallet', 'Gross') AND i_size IN ('medium', 'extra large')) OR (i_color IN ('cyan', 'papaya') AND i_units IN ('Cup', 'Dram') AND i_size IN ('N/A', 'small'))) OR (i_category = 'Men' AND i_color IN ('orange', 'frosted') AND i_units IN ('Each', 'Tbl') AND i_size = 'petite') OR (i_category = 'Men' AND i_color IN ('forest', 'ghost') AND i_units IN ('Lb', 'Bundle') AND i_size IN ('medium', 'extra large'))))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=128.00KB thread-reservation=0
+|     tuple-ids=1 row-size=91B cardinality=8
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.item i1, RANDOM]
+   HDFS partitions=1/1 files=1 size=1.73MB
+   predicates: i_manufact_id <= CAST(778 AS INT), i_manufact_id >= CAST(738 AS INT)
+   stored statistics:
+     table: rows=18.00K size=1.73MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=18.00K
+   parquet statistics predicates: i_manufact_id <= CAST(778 AS INT), i_manufact_id >= CAST(738 AS INT)
+   parquet dictionary predicates: i_manufact_id <= CAST(778 AS INT), i_manufact_id >= CAST(738 AS INT)
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+   tuple-ids=0 row-size=57B cardinality=1.80K
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q42.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q42.test
new file mode 100644
index 0000000..e6b811b
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q42.test
@@ -0,0 +1,343 @@
+# TPCDS-Q42
+select
+  dt.d_year,
+  item.i_category_id,
+  item.i_category,
+  sum(ss_ext_sales_price)
+from
+  date_dim dt,
+  store_sales,
+  item
+where
+  dt.d_date_sk = store_sales.ss_sold_date_sk
+  and store_sales.ss_item_sk = item.i_item_sk
+  and item.i_manager_id = 1
+  and dt.d_moy = 12
+  and dt.d_year = 1998
+group by
+  dt.d_year,
+  item.i_category_id,
+  item.i_category
+order by
+  sum(ss_ext_sales_price) desc,
+  dt.d_year,
+  item.i_category_id,
+  item.i_category
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=8.81MB Threads=4
+Per-Host Resource Estimates: Memory=150MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=149.88MB mem-reservation=8.81MB thread-reservation=4 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: dt.d_year, item.i_category_id, item.i_category, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+06:TOP-N [LIMIT=100]
+|  order by: sum(ss_ext_sales_price) DESC, dt.d_year ASC, item.i_category_id ASC, item.i_category ASC
+|  mem-estimate=4.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=42B cardinality=100
+|  in pipelines: 06(GETNEXT), 05(OPEN)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_category_id, item.i_category
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=42B cardinality=1.73K
+|  in pipelines: 05(GETNEXT), 01(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  runtime filters: RF000[bloom] <- dt.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=62B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.date_dim dt]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=0 row-size=12B cardinality=108
+|     in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
+|  fk/pk conjuncts: store_sales.ss_item_sk = item.i_item_sk
+|  runtime filters: RF002[bloom] <- item.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=50B cardinality=29.12K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: item.i_manager_id = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: item.i_manager_id = CAST(1 AS INT)
+|     parquet dictionary predicates: item.i_manager_id = CAST(1 AS INT)
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=34B cardinality=182
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> store_sales.ss_sold_date_sk, RF002[bloom] -> store_sales.ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=11.56MB Threads=8
+Per-Host Resource Estimates: Memory=170MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: dt.d_year, item.i_category_id, item.i_category, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(ss_ext_sales_price) DESC, dt.d_year ASC, item.i_category_id ASC, item.i_category ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=42B cardinality=100
+|  in pipelines: 06(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(dt.d_year,item.i_category_id,item.i_category)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.16MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: sum(ss_ext_sales_price) DESC, dt.d_year ASC, item.i_category_id ASC, item.i_category ASC
+|  mem-estimate=4.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=42B cardinality=100
+|  in pipelines: 06(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_category_id, item.i_category
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=42B cardinality=1.73K
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+09:EXCHANGE [HASH(dt.d_year,item.i_category_id,item.i_category)]
+|  mem-estimate=161.21KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=42B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=47.91MB mem-reservation=8.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_category_id, item.i_category
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=42B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  runtime filters: RF000[bloom] <- dt.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=62B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=12B cardinality=108
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.date_dim dt, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=0 row-size=12B cardinality=108
+|     in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
+|  fk/pk conjuncts: store_sales.ss_item_sk = item.i_item_sk
+|  runtime filters: RF002[bloom] <- item.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=50B cardinality=29.12K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=34B cardinality=182
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: item.i_manager_id = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: item.i_manager_id = CAST(1 AS INT)
+|     parquet dictionary predicates: item.i_manager_id = CAST(1 AS INT)
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=34B cardinality=182
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> store_sales.ss_sold_date_sk, RF002[bloom] -> store_sales.ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=22.38MB Threads=9
+Per-Host Resource Estimates: Memory=116MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=28.26KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: dt.d_year, item.i_category_id, item.i_category, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(ss_ext_sales_price) DESC, dt.d_year ASC, item.i_category_id ASC, item.i_category ASC
+|  limit: 100
+|  mem-estimate=28.26KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=42B cardinality=100
+|  in pipelines: 06(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(dt.d_year,item.i_category_id,item.i_category)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.29MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: sum(ss_ext_sales_price) DESC, dt.d_year ASC, item.i_category_id ASC, item.i_category ASC
+|  mem-estimate=4.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=42B cardinality=100
+|  in pipelines: 06(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_category_id, item.i_category
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=42B cardinality=1.73K
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+09:EXCHANGE [HASH(dt.d_year,item.i_category_id,item.i_category)]
+|  mem-estimate=298.90KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=42B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_category_id, item.i_category
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=42B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=62B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: dt.d_date_sk
+|  |  runtime filters: RF000[bloom] <- dt.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=12B cardinality=108
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.date_dim dt, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=0 row-size=12B cardinality=108
+|     in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
+|  fk/pk conjuncts: store_sales.ss_item_sk = item.i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=50B cardinality=29.12K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: item.i_item_sk
+|  |  runtime filters: RF002[bloom] <- item.i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=34B cardinality=182
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: item.i_manager_id = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: item.i_manager_id = CAST(1 AS INT)
+|     parquet dictionary predicates: item.i_manager_id = CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=2 row-size=34B cardinality=182
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> store_sales.ss_sold_date_sk, RF002[bloom] -> store_sales.ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q43.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q43.test
new file mode 100644
index 0000000..f58ec83
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q43.test
@@ -0,0 +1,351 @@
+# TPCDS-Q43
+select
+  s_store_name,
+  s_store_id,
+  sum(case when (d_day_name = 'Sunday') then ss_sales_price else null end) sun_sales,
+  sum(case when (d_day_name = 'Monday') then ss_sales_price else null end) mon_sales,
+  sum(case when (d_day_name = 'Tuesday') then ss_sales_price else null end) tue_sales,
+  sum(case when (d_day_name = 'Wednesday') then ss_sales_price else null end) wed_sales,
+  sum(case when (d_day_name = 'Thursday') then ss_sales_price else null end) thu_sales,
+  sum(case when (d_day_name = 'Friday') then ss_sales_price else null end) fri_sales,
+  sum(case when (d_day_name = 'Saturday') then ss_sales_price else null end) sat_sales
+from
+  date_dim,
+  store_sales,
+  store
+where
+  d_date_sk = ss_sold_date_sk
+  and s_store_sk = ss_store_sk
+  and s_gmt_offset = -5
+  and d_year = 1998
+group by
+  s_store_name,
+  s_store_id
+order by
+  s_store_name,
+  s_store_id,
+  sun_sales,
+  mon_sales,
+  tue_sales,
+  wed_sales,
+  thu_sales,
+  fri_sales,
+  sat_sales
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=8.31MB Threads=4
+Per-Host Resource Estimates: Memory=150MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=149.88MB mem-reservation=8.31MB thread-reservation=4 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: s_store_name, s_store_id, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+06:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC, s_store_id ASC, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END) ASC
+|  mem-estimate=7.32KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=156B cardinality=48
+|  in pipelines: 06(GETNEXT), 05(OPEN)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  group by: s_store_name, s_store_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=156B cardinality=48
+|  in pipelines: 05(GETNEXT), 01(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=91B cardinality=589.03K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=2 row-size=52B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=39B cardinality=589.03K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=0 row-size=27B cardinality=373
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=1 row-size=12B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=10.84MB Threads=8
+Per-Host Resource Estimates: Memory=170MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=24.98KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: s_store_name, s_store_id, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: s_store_name ASC, s_store_id ASC, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END) ASC
+|  limit: 100
+|  mem-estimate=24.98KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=156B cardinality=48
+|  in pipelines: 06(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(s_store_name,s_store_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC, s_store_id ASC, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END) ASC
+|  mem-estimate=7.32KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=156B cardinality=48
+|  in pipelines: 06(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  group by: s_store_name, s_store_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=156B cardinality=48
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+09:EXCHANGE [HASH(s_store_name,s_store_id)]
+|  mem-estimate=24.98KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=156B cardinality=48
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=47.91MB mem-reservation=8.38MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  group by: s_store_name, s_store_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=156B cardinality=48
+|  in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=91B cardinality=589.03K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=52B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=2 row-size=52B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=39B cardinality=589.03K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=21.23KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=27B cardinality=373
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=0 row-size=27B cardinality=373
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=1 row-size=12B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=21.16MB Threads=9
+Per-Host Resource Estimates: Memory=116MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=47.51KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: s_store_name, s_store_id, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: s_store_name ASC, s_store_id ASC, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END) ASC
+|  limit: 100
+|  mem-estimate=47.51KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=156B cardinality=48
+|  in pipelines: 06(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(s_store_name,s_store_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.05MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC, s_store_id ASC, sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END) ASC, sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END) ASC
+|  mem-estimate=7.32KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=156B cardinality=48
+|  in pipelines: 06(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  group by: s_store_name, s_store_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=156B cardinality=48
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+09:EXCHANGE [HASH(s_store_name,s_store_id)]
+|  mem-estimate=47.51KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=156B cardinality=48
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.50MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  group by: s_store_name, s_store_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=156B cardinality=48
+|  in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=91B cardinality=589.03K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF000[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=52B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=0
+|     tuple-ids=2 row-size=52B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=39B cardinality=589.03K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=21.23KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=27B cardinality=373
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=0 row-size=27B cardinality=373
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+   tuple-ids=1 row-size=12B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q44.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q44.test
new file mode 100644
index 0000000..47402c8
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q44.test
@@ -0,0 +1,975 @@
+# TPCDS-Q44
+SELECT asceding.rnk,
+       i1.i_product_name best_performing,
+       i2.i_product_name worst_performing
+FROM
+  (SELECT *
+   FROM
+     (SELECT item_sk,
+             rank() OVER (
+                          ORDER BY rank_col ASC) rnk
+      FROM
+        (SELECT ss_item_sk item_sk,
+                avg(ss_net_profit) rank_col
+         FROM store_sales ss1
+         WHERE ss_store_sk = 4
+         GROUP BY ss_item_sk
+         HAVING avg(ss_net_profit) > 0.9*
+           (SELECT avg(ss_net_profit) rank_col
+            FROM store_sales
+            WHERE ss_store_sk = 4
+              AND ss_addr_sk IS NULL
+            GROUP BY ss_store_sk))V1)V11
+   WHERE rnk < 11) asceding,
+  (SELECT *
+   FROM
+     (SELECT item_sk,
+             rank() OVER (
+                          ORDER BY rank_col DESC) rnk
+      FROM
+        (SELECT ss_item_sk item_sk,
+                avg(ss_net_profit) rank_col
+         FROM store_sales ss1
+         WHERE ss_store_sk = 4
+         GROUP BY ss_item_sk
+         HAVING avg(ss_net_profit) > 0.9*
+           (SELECT avg(ss_net_profit) rank_col
+            FROM store_sales
+            WHERE ss_store_sk = 4
+              AND ss_addr_sk IS NULL
+            GROUP BY ss_store_sk))V2)V21
+   WHERE rnk < 11) descending,
+     item i1,
+     item i2
+WHERE asceding.rnk = descending.rnk
+  AND i1.i_item_sk=asceding.item_sk
+  AND i2.i_item_sk=descending.item_sk
+ORDER BY asceding.rnk
+LIMIT 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=26.88MB Threads=7
+Per-Host Resource Estimates: Memory=306MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=306.00MB mem-reservation=26.88MB thread-reservation=7 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: rnk, i_product_name, i_product_name
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+23:TOP-N [LIMIT=100]
+|  order by: rnk ASC
+|  mem-estimate=6.65KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=28 row-size=68B cardinality=100
+|  in pipelines: 23(GETNEXT), 19(OPEN)
+|
+22:HASH JOIN [INNER JOIN]
+|  hash predicates: i2.i_item_sk = ss_item_sk
+|  fk/pk conjuncts: i2.i_item_sk = ss_item_sk
+|  runtime filters: RF000[bloom] <- ss_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=27,26,33,32,39,38 row-size=148B cardinality=1.80K
+|  in pipelines: 19(GETNEXT), 18(OPEN)
+|
+|--21:HASH JOIN [INNER JOIN]
+|  |  hash predicates: rank() = rank()
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=26,33,32,39,38 row-size=110B cardinality=1.80K
+|  |  in pipelines: 18(GETNEXT), 15(OPEN)
+|  |
+|  |--17:SELECT
+|  |  |  predicates: rank() < CAST(11 AS BIGINT)
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=39,38 row-size=36B cardinality=1.80K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  16:ANALYTIC
+|  |  |  functions: rank()
+|  |  |  order by: avg(ss_net_profit) DESC
+|  |  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=39,38 row-size=36B cardinality=17.98K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  15:SORT
+|  |  |  order by: avg(ss_net_profit) DESC
+|  |  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=39 row-size=28B cardinality=17.98K
+|  |  |  in pipelines: 15(GETNEXT), 10(OPEN)
+|  |  |
+|  |  14:NESTED LOOP JOIN [INNER JOIN]
+|  |  |  predicates: avg(ss_net_profit) > CAST(0.9 AS DECIMAL(1,1)) * avg(ss_net_profit)
+|  |  |  mem-estimate=12B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=15,19 row-size=28B cardinality=17.98K
+|  |  |  in pipelines: 10(GETNEXT), 13(OPEN)
+|  |  |
+|  |  |--13:CARDINALITY CHECK
+|  |  |  |  limit: 1
+|  |  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=19 row-size=12B cardinality=1
+|  |  |  |  in pipelines: 13(GETNEXT), 12(OPEN)
+|  |  |  |
+|  |  |  12:AGGREGATE [FINALIZE]
+|  |  |  |  output: avg(ss_net_profit)
+|  |  |  |  group by: ss_store_sk
+|  |  |  |  limit: 2
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=19 row-size=12B cardinality=2
+|  |  |  |  in pipelines: 12(GETNEXT), 11(OPEN)
+|  |  |  |
+|  |  |  11:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     predicates: ss_addr_sk IS NULL, ss_store_sk = CAST(4 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|  |  |     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=17 row-size=12B cardinality=53.06K
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  10:AGGREGATE [FINALIZE]
+|  |  |  output: avg(ss_net_profit)
+|  |  |  group by: ss_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=15 row-size=16B cardinality=17.98K
+|  |  |  in pipelines: 10(GETNEXT), 09(OPEN)
+|  |  |
+|  |  09:SCAN HDFS [tpcds_parquet.store_sales ss1]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     predicates: ss_store_sk = CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|  |     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=13 row-size=16B cardinality=480.07K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN]
+|  |  hash predicates: i1.i_item_sk = ss_item_sk
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF002[bloom] <- ss_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=26,33,32 row-size=74B cardinality=1.80K
+|  |  in pipelines: 18(GETNEXT), 06(OPEN)
+|  |
+|  |--08:SELECT
+|  |  |  predicates: rank() < CAST(11 AS BIGINT)
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=33,32 row-size=36B cardinality=1.80K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  07:ANALYTIC
+|  |  |  functions: rank()
+|  |  |  order by: avg(ss_net_profit) ASC
+|  |  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=33,32 row-size=36B cardinality=17.98K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  06:SORT
+|  |  |  order by: avg(ss_net_profit) ASC
+|  |  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=33 row-size=28B cardinality=17.98K
+|  |  |  in pipelines: 06(GETNEXT), 01(OPEN)
+|  |  |
+|  |  05:NESTED LOOP JOIN [INNER JOIN]
+|  |  |  predicates: avg(ss_net_profit) > CAST(0.9 AS DECIMAL(1,1)) * avg(ss_net_profit)
+|  |  |  mem-estimate=12B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2,6 row-size=28B cardinality=17.98K
+|  |  |  in pipelines: 01(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--04:CARDINALITY CHECK
+|  |  |  |  limit: 1
+|  |  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=12B cardinality=1
+|  |  |  |  in pipelines: 04(GETNEXT), 03(OPEN)
+|  |  |  |
+|  |  |  03:AGGREGATE [FINALIZE]
+|  |  |  |  output: avg(ss_net_profit)
+|  |  |  |  group by: ss_store_sk
+|  |  |  |  limit: 2
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=12B cardinality=2
+|  |  |  |  in pipelines: 03(GETNEXT), 02(OPEN)
+|  |  |  |
+|  |  |  02:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     predicates: ss_addr_sk IS NULL, ss_store_sk = CAST(4 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|  |  |     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=4 row-size=12B cardinality=53.06K
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  01:AGGREGATE [FINALIZE]
+|  |  |  output: avg(ss_net_profit)
+|  |  |  group by: ss_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2 row-size=16B cardinality=17.98K
+|  |  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.store_sales ss1]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     predicates: ss_store_sk = CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|  |     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=16B cardinality=480.07K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  18:SCAN HDFS [tpcds_parquet.item i1]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF002[bloom] -> i1.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=26 row-size=38B cardinality=18.00K
+|     in pipelines: 18(GETNEXT)
+|
+19:SCAN HDFS [tpcds_parquet.item i2]
+   HDFS partitions=1/1 files=1 size=1.73MB
+   runtime filters: RF000[bloom] -> i2.i_item_sk
+   stored statistics:
+     table: rows=18.00K size=1.73MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=18.00K
+   mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=27 row-size=38B cardinality=18.00K
+   in pipelines: 19(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=47.56MB Threads=21
+Per-Host Resource Estimates: Memory=365MB
+F14:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: rnk, i_product_name, i_product_name
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+41:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: rnk ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=28 row-size=68B cardinality=100
+|  in pipelines: 23(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Resources: mem-estimate=35.25MB mem-reservation=3.44MB thread-reservation=2 runtime-filters-memory=1.00MB
+23:TOP-N [LIMIT=100]
+|  order by: rnk ASC
+|  mem-estimate=6.65KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=28 row-size=68B cardinality=100
+|  in pipelines: 23(GETNEXT), 19(OPEN)
+|
+22:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: i2.i_item_sk = ss_item_sk
+|  fk/pk conjuncts: i2.i_item_sk = ss_item_sk
+|  runtime filters: RF000[bloom] <- ss_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=27,39,38,33,32,26 row-size=148B cardinality=1.80K
+|  in pipelines: 19(GETNEXT), 15(OPEN)
+|
+|--40:EXCHANGE [BROADCAST]
+|  |  mem-estimate=323.57KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=39,38,33,32,26 row-size=110B cardinality=1.80K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=6.40MB mem-reservation=5.94MB thread-reservation=1
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: rank() = rank()
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=39,38,33,32,26 row-size=110B cardinality=1.80K
+|  |  in pipelines: 15(GETNEXT), 06(OPEN)
+|  |
+|  |--39:EXCHANGE [UNPARTITIONED]
+|  |  |  mem-estimate=216.26KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=33,32,26 row-size=74B cardinality=1.80K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=6.89MB mem-reservation=5.94MB thread-reservation=1
+|  |  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_item_sk = i1.i_item_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=33,32,26 row-size=74B cardinality=1.80K
+|  |  |  in pipelines: 06(GETNEXT), 18(OPEN)
+|  |  |
+|  |  |--38:EXCHANGE [UNPARTITIONED]
+|  |  |  |  mem-estimate=710.69KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=26 row-size=38B cardinality=18.00K
+|  |  |  |  in pipelines: 18(GETNEXT)
+|  |  |  |
+|  |  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  18:SCAN HDFS [tpcds_parquet.item i1, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=26 row-size=38B cardinality=18.00K
+|  |  |     in pipelines: 18(GETNEXT)
+|  |  |
+|  |  08:SELECT
+|  |  |  predicates: rank() < CAST(11 AS BIGINT)
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=33,32 row-size=36B cardinality=1.80K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  07:ANALYTIC
+|  |  |  functions: rank()
+|  |  |  order by: avg(ss_net_profit) ASC
+|  |  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=33,32 row-size=36B cardinality=17.98K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  37:MERGING-EXCHANGE [UNPARTITIONED]
+|  |  |  order by: avg(ss_net_profit) ASC
+|  |  |  mem-estimate=259.83KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=33 row-size=28B cardinality=17.98K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=16.02MB mem-reservation=7.94MB thread-reservation=1
+|  |  06:SORT
+|  |  |  order by: avg(ss_net_profit) ASC
+|  |  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=33 row-size=28B cardinality=17.98K
+|  |  |  in pipelines: 06(GETNEXT), 32(OPEN)
+|  |  |
+|  |  05:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  |  |  predicates: avg(ss_net_profit) > CAST(0.9 AS DECIMAL(1,1)) * avg(ss_net_profit)
+|  |  |  mem-estimate=12B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2,6 row-size=28B cardinality=17.98K
+|  |  |  in pipelines: 32(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--36:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=12B cardinality=1
+|  |  |  |  in pipelines: 04(GETNEXT)
+|  |  |  |
+|  |  |  F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  |  04:CARDINALITY CHECK
+|  |  |  |  limit: 1
+|  |  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=12B cardinality=1
+|  |  |  |  in pipelines: 04(GETNEXT), 34(OPEN)
+|  |  |  |
+|  |  |  35:EXCHANGE [UNPARTITIONED]
+|  |  |  |  limit: 2
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=12B cardinality=2
+|  |  |  |  in pipelines: 34(GETNEXT)
+|  |  |  |
+|  |  |  F10:PLAN FRAGMENT [HASH(ss_store_sk)] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  34:AGGREGATE [FINALIZE]
+|  |  |  |  output: avg:merge(ss_net_profit)
+|  |  |  |  group by: ss_store_sk
+|  |  |  |  limit: 2
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=12B cardinality=2
+|  |  |  |  in pipelines: 34(GETNEXT), 02(OPEN)
+|  |  |  |
+|  |  |  33:EXCHANGE [HASH(ss_store_sk)]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=5 row-size=12B cardinality=6
+|  |  |  |  in pipelines: 02(GETNEXT)
+|  |  |  |
+|  |  |  F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Host Resources: mem-estimate=58.00MB mem-reservation=3.00MB thread-reservation=2
+|  |  |  03:AGGREGATE [STREAMING]
+|  |  |  |  output: avg(ss_net_profit)
+|  |  |  |  group by: ss_store_sk
+|  |  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=5 row-size=12B cardinality=6
+|  |  |  |  in pipelines: 02(GETNEXT)
+|  |  |  |
+|  |  |  02:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     predicates: ss_addr_sk IS NULL, ss_store_sk = CAST(4 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|  |  |     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=4 row-size=12B cardinality=53.06K
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  32:AGGREGATE [FINALIZE]
+|  |  |  output: avg:merge(ss_net_profit)
+|  |  |  group by: ss_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2 row-size=16B cardinality=17.98K
+|  |  |  in pipelines: 32(GETNEXT), 00(OPEN)
+|  |  |
+|  |  31:EXCHANGE [HASH(ss_item_sk)]
+|  |  |  mem-estimate=153.62KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=16B cardinality=17.98K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=58.00MB mem-reservation=3.00MB thread-reservation=2
+|  |  01:AGGREGATE [STREAMING]
+|  |  |  output: avg(ss_net_profit)
+|  |  |  group by: ss_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=1 row-size=16B cardinality=17.98K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.store_sales ss1, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     predicates: ss_store_sk = CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|  |     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=16B cardinality=480.07K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  17:SELECT
+|  |  predicates: rank() < CAST(11 AS BIGINT)
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=39,38 row-size=36B cardinality=1.80K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  16:ANALYTIC
+|  |  functions: rank()
+|  |  order by: avg(ss_net_profit) DESC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=39,38 row-size=36B cardinality=17.98K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  30:MERGING-EXCHANGE [UNPARTITIONED]
+|  |  order by: avg(ss_net_profit) DESC
+|  |  mem-estimate=259.83KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=39 row-size=28B cardinality=17.98K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=16.02MB mem-reservation=7.94MB thread-reservation=1
+|  15:SORT
+|  |  order by: avg(ss_net_profit) DESC
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=39 row-size=28B cardinality=17.98K
+|  |  in pipelines: 15(GETNEXT), 25(OPEN)
+|  |
+|  14:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  |  predicates: avg(ss_net_profit) > CAST(0.9 AS DECIMAL(1,1)) * avg(ss_net_profit)
+|  |  mem-estimate=12B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15,19 row-size=28B cardinality=17.98K
+|  |  in pipelines: 25(GETNEXT), 13(OPEN)
+|  |
+|  |--29:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=12B cardinality=1
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  13:CARDINALITY CHECK
+|  |  |  limit: 1
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=12B cardinality=1
+|  |  |  in pipelines: 13(GETNEXT), 27(OPEN)
+|  |  |
+|  |  28:EXCHANGE [UNPARTITIONED]
+|  |  |  limit: 2
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=12B cardinality=2
+|  |  |  in pipelines: 27(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [HASH(ss_store_sk)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  |  27:AGGREGATE [FINALIZE]
+|  |  |  output: avg:merge(ss_net_profit)
+|  |  |  group by: ss_store_sk
+|  |  |  limit: 2
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=19 row-size=12B cardinality=2
+|  |  |  in pipelines: 27(GETNEXT), 11(OPEN)
+|  |  |
+|  |  26:EXCHANGE [HASH(ss_store_sk)]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=12B cardinality=6
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=58.00MB mem-reservation=3.00MB thread-reservation=2
+|  |  12:AGGREGATE [STREAMING]
+|  |  |  output: avg(ss_net_profit)
+|  |  |  group by: ss_store_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=18 row-size=12B cardinality=6
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  11:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     predicates: ss_addr_sk IS NULL, ss_store_sk = CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|  |     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=17 row-size=12B cardinality=53.06K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  25:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  group by: ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=17.98K
+|  |  in pipelines: 25(GETNEXT), 09(OPEN)
+|  |
+|  24:EXCHANGE [HASH(ss_item_sk)]
+|  |  mem-estimate=153.62KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=16B cardinality=17.98K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=58.00MB mem-reservation=3.00MB thread-reservation=2
+|  10:AGGREGATE [STREAMING]
+|  |  output: avg(ss_net_profit)
+|  |  group by: ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=16B cardinality=17.98K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales ss1, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_store_sk = CAST(4 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=13 row-size=16B cardinality=480.07K
+|     in pipelines: 09(GETNEXT)
+|
+19:SCAN HDFS [tpcds_parquet.item i2, RANDOM]
+   HDFS partitions=1/1 files=1 size=1.73MB
+   runtime filters: RF000[bloom] -> i2.i_item_sk
+   stored statistics:
+     table: rows=18.00K size=1.73MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=18.00K
+   mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=27 row-size=38B cardinality=18.00K
+   in pipelines: 19(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=86.12MB Threads=28
+Per-Host Resource Estimates: Memory=368MB
+F14:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: rnk, i_product_name, i_product_name
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+41:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: rnk ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=28 row-size=68B cardinality=100
+|  in pipelines: 23(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+Per-Instance Resources: mem-estimate=16.01MB mem-reservation=512.00KB thread-reservation=1
+23:TOP-N [LIMIT=100]
+|  order by: rnk ASC
+|  mem-estimate=6.65KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=28 row-size=68B cardinality=100
+|  in pipelines: 23(GETNEXT), 19(OPEN)
+|
+22:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: i2.i_item_sk = ss_item_sk
+|  fk/pk conjuncts: i2.i_item_sk = ss_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=27,39,38,33,32,26 row-size=148B cardinality=1.80K
+|  in pipelines: 19(GETNEXT), 15(OPEN)
+|
+|--F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=5.19MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: ss_item_sk
+|  |  runtime filters: RF000[bloom] <- ss_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  40:EXCHANGE [BROADCAST]
+|  |  mem-estimate=323.57KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=39,38,33,32,26 row-size=110B cardinality=1.80K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=4.35MB mem-reservation=4.00MB thread-reservation=1
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: rank() = rank()
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=39,38,33,32,26 row-size=110B cardinality=1.80K
+|  |  in pipelines: 15(GETNEXT), 06(OPEN)
+|  |
+|  |--F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.09MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: rank()
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  39:EXCHANGE [UNPARTITIONED]
+|  |  |  mem-estimate=216.26KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=33,32,26 row-size=74B cardinality=1.80K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.35MB mem-reservation=4.00MB thread-reservation=1
+|  |  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: ss_item_sk = i1.i_item_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=33,32,26 row-size=74B cardinality=1.80K
+|  |  |  in pipelines: 06(GETNEXT), 18(OPEN)
+|  |  |
+|  |  |--F17:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.57MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: i1.i_item_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  38:EXCHANGE [UNPARTITIONED]
+|  |  |  |  mem-estimate=710.69KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=26 row-size=38B cardinality=18.00K
+|  |  |  |  in pipelines: 18(GETNEXT)
+|  |  |  |
+|  |  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  18:SCAN HDFS [tpcds_parquet.item i1, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=26 row-size=38B cardinality=18.00K
+|  |  |     in pipelines: 18(GETNEXT)
+|  |  |
+|  |  08:SELECT
+|  |  |  predicates: rank() < CAST(11 AS BIGINT)
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=33,32 row-size=36B cardinality=1.80K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  07:ANALYTIC
+|  |  |  functions: rank()
+|  |  |  order by: avg(ss_net_profit) ASC
+|  |  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=33,32 row-size=36B cardinality=17.98K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  37:MERGING-EXCHANGE [UNPARTITIONED]
+|  |  |  order by: avg(ss_net_profit) ASC
+|  |  |  mem-estimate=355.83KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=33 row-size=28B cardinality=17.98K
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=7.94MB thread-reservation=1
+|  |  06:SORT
+|  |  |  order by: avg(ss_net_profit) ASC
+|  |  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=33 row-size=28B cardinality=17.98K
+|  |  |  in pipelines: 06(GETNEXT), 32(OPEN)
+|  |  |
+|  |  05:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  |  |  join table id: 03
+|  |  |  predicates: avg(ss_net_profit) > CAST(0.9 AS DECIMAL(1,1)) * avg(ss_net_profit)
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2,6 row-size=28B cardinality=17.98K
+|  |  |  in pipelines: 32(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--F18:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=03 plan-id=04 cohort-id=03
+|  |  |  |  mem-estimate=12B mem-reservation=0B thread-reservation=0
+|  |  |  |
+|  |  |  36:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=12B cardinality=1
+|  |  |  |  in pipelines: 04(GETNEXT)
+|  |  |  |
+|  |  |  F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  |  04:CARDINALITY CHECK
+|  |  |  |  limit: 1
+|  |  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=12B cardinality=1
+|  |  |  |  in pipelines: 04(GETNEXT), 34(OPEN)
+|  |  |  |
+|  |  |  35:EXCHANGE [UNPARTITIONED]
+|  |  |  |  limit: 2
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=12B cardinality=2
+|  |  |  |  in pipelines: 34(GETNEXT)
+|  |  |  |
+|  |  |  F10:PLAN FRAGMENT [HASH(ss_store_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  34:AGGREGATE [FINALIZE]
+|  |  |  |  output: avg:merge(ss_net_profit)
+|  |  |  |  group by: ss_store_sk
+|  |  |  |  limit: 2
+|  |  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=12B cardinality=2
+|  |  |  |  in pipelines: 34(GETNEXT), 02(OPEN)
+|  |  |  |
+|  |  |  33:EXCHANGE [HASH(ss_store_sk)]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=5 row-size=12B cardinality=6
+|  |  |  |  in pipelines: 02(GETNEXT)
+|  |  |  |
+|  |  |  F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+|  |  |  03:AGGREGATE [STREAMING]
+|  |  |  |  output: avg(ss_net_profit)
+|  |  |  |  group by: ss_store_sk
+|  |  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=5 row-size=12B cardinality=6
+|  |  |  |  in pipelines: 02(GETNEXT)
+|  |  |  |
+|  |  |  02:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     predicates: ss_addr_sk IS NULL, ss_store_sk = CAST(4 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|  |  |     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |  |     tuple-ids=4 row-size=12B cardinality=53.06K
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  32:AGGREGATE [FINALIZE]
+|  |  |  output: avg:merge(ss_net_profit)
+|  |  |  group by: ss_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2 row-size=16B cardinality=17.98K
+|  |  |  in pipelines: 32(GETNEXT), 00(OPEN)
+|  |  |
+|  |  31:EXCHANGE [HASH(ss_item_sk)]
+|  |  |  mem-estimate=213.62KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=16B cardinality=17.98K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+|  |  01:AGGREGATE [STREAMING]
+|  |  |  output: avg(ss_net_profit)
+|  |  |  group by: ss_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=1 row-size=16B cardinality=17.98K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.store_sales ss1, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     predicates: ss_store_sk = CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|  |     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=0 row-size=16B cardinality=480.07K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  17:SELECT
+|  |  predicates: rank() < CAST(11 AS BIGINT)
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=39,38 row-size=36B cardinality=1.80K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  16:ANALYTIC
+|  |  functions: rank()
+|  |  order by: avg(ss_net_profit) DESC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=39,38 row-size=36B cardinality=17.98K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  30:MERGING-EXCHANGE [UNPARTITIONED]
+|  |  order by: avg(ss_net_profit) DESC
+|  |  mem-estimate=355.83KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=39 row-size=28B cardinality=17.98K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=7.94MB thread-reservation=1
+|  15:SORT
+|  |  order by: avg(ss_net_profit) DESC
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=39 row-size=28B cardinality=17.98K
+|  |  in pipelines: 15(GETNEXT), 25(OPEN)
+|  |
+|  14:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  |  join table id: 04
+|  |  predicates: avg(ss_net_profit) > CAST(0.9 AS DECIMAL(1,1)) * avg(ss_net_profit)
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15,19 row-size=28B cardinality=17.98K
+|  |  in pipelines: 25(GETNEXT), 13(OPEN)
+|  |
+|  |--F19:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  mem-estimate=12B mem-reservation=0B thread-reservation=0
+|  |  |
+|  |  29:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=12B cardinality=1
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  13:CARDINALITY CHECK
+|  |  |  limit: 1
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=12B cardinality=1
+|  |  |  in pipelines: 13(GETNEXT), 27(OPEN)
+|  |  |
+|  |  28:EXCHANGE [UNPARTITIONED]
+|  |  |  limit: 2
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=12B cardinality=2
+|  |  |  in pipelines: 27(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [HASH(ss_store_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  |  27:AGGREGATE [FINALIZE]
+|  |  |  output: avg:merge(ss_net_profit)
+|  |  |  group by: ss_store_sk
+|  |  |  limit: 2
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=19 row-size=12B cardinality=2
+|  |  |  in pipelines: 27(GETNEXT), 11(OPEN)
+|  |  |
+|  |  26:EXCHANGE [HASH(ss_store_sk)]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=12B cardinality=6
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+|  |  12:AGGREGATE [STREAMING]
+|  |  |  output: avg(ss_net_profit)
+|  |  |  group by: ss_store_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=18 row-size=12B cardinality=6
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  11:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     predicates: ss_addr_sk IS NULL, ss_store_sk = CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|  |     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=17 row-size=12B cardinality=53.06K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  25:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ss_net_profit)
+|  |  group by: ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=17.98K
+|  |  in pipelines: 25(GETNEXT), 09(OPEN)
+|  |
+|  24:EXCHANGE [HASH(ss_item_sk)]
+|  |  mem-estimate=213.62KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=16B cardinality=17.98K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+|  10:AGGREGATE [STREAMING]
+|  |  output: avg(ss_net_profit)
+|  |  group by: ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=16B cardinality=17.98K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  09:SCAN HDFS [tpcds_parquet.store_sales ss1, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_store_sk = CAST(4 AS INT)
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: ss_store_sk = CAST(4 AS INT)
+|     parquet dictionary predicates: ss_store_sk = CAST(4 AS INT)
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=13 row-size=16B cardinality=480.07K
+|     in pipelines: 09(GETNEXT)
+|
+19:SCAN HDFS [tpcds_parquet.item i2, RANDOM]
+   HDFS partitions=1/1 files=1 size=1.73MB
+   runtime filters: RF000[bloom] -> i2.i_item_sk
+   stored statistics:
+     table: rows=18.00K size=1.73MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=18.00K
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+   tuple-ids=27 row-size=38B cardinality=18.00K
+   in pipelines: 19(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q45.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q45.test
new file mode 100644
index 0000000..5a5b565
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q45.test
@@ -0,0 +1,391 @@
+# TPCDS-Q45
+SELECT ca_zip,
+       ca_city,
+       sum(ws_sales_price)
+FROM web_sales,
+     customer,
+     customer_address,
+     date_dim,
+     item
+WHERE ws_bill_customer_sk = c_customer_sk
+  AND c_current_addr_sk = ca_address_sk
+  AND ws_item_sk = i_item_sk
+  AND (SUBSTRING(ca_zip,1,5) IN ('85669',
+                              '86197',
+                              '88274',
+                              '83405',
+                              '86475',
+                              '85392',
+                              '85460',
+                              '80348',
+                              '81792')
+       OR i_item_id IN
+         (SELECT i_item_id
+          FROM item
+          WHERE i_item_sk IN (2,
+                              3,
+                              5,
+                              7,
+                              11,
+                              13,
+                              17,
+                              19,
+                              23,
+                              29) ))
+  AND ws_sold_date_sk = d_date_sk
+  AND d_qoy = 2
+  AND d_year = 2001
+GROUP BY ca_zip,
+         ca_city
+ORDER BY ca_zip,
+         ca_city
+LIMIT 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=27.38MB Threads=7
+Per-Host Resource Estimates: Memory=343MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=342.69MB mem-reservation=27.38MB thread-reservation=7 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: ca_zip, ca_city, sum(ws_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:TOP-N [LIMIT=100]
+|  order by: ca_zip ASC, ca_city ASC
+|  mem-estimate=5.27KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=54B cardinality=100
+|  in pipelines: 13(GETNEXT), 12(OPEN)
+|
+12:AGGREGATE [FINALIZE]
+|  output: sum(ws_sales_price)
+|  group by: ca_zip, ca_city
+|  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=8 row-size=54B cardinality=73.80K
+|  in pipelines: 12(GETNEXT), 00(OPEN)
+|
+11:HASH JOIN [LEFT OUTER JOIN]
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  other predicates: (substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792') OR i_item_id IS NOT NULL)
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2,4,6N row-size=146B cardinality=73.80K
+|  in pipelines: 00(GETNEXT), 06(OPEN)
+|
+|--06:AGGREGATE [FINALIZE]
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=28B cardinality=10
+|  |  in pipelines: 06(GETNEXT), 05(OPEN)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_item_sk IN (CAST(2 AS BIGINT), CAST(3 AS BIGINT), CAST(5 AS BIGINT), CAST(7 AS BIGINT), CAST(11 AS BIGINT), CAST(13 AS BIGINT), CAST(17 AS BIGINT), CAST(19 AS BIGINT), CAST(23 AS BIGINT), CAST(29 AS BIGINT))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_item_sk IN (CAST(2 AS BIGINT), CAST(3 AS BIGINT), CAST(5 AS BIGINT), CAST(7 AS BIGINT), CAST(11 AS BIGINT), CAST(13 AS BIGINT), CAST(17 AS BIGINT), CAST(19 AS BIGINT), CAST(23 AS BIGINT), CAST(29 AS BIGINT))
+|     parquet dictionary predicates: i_item_sk IN (CAST(2 AS BIGINT), CAST(3 AS BIGINT), CAST(5 AS BIGINT), CAST(7 AS BIGINT), CAST(11 AS BIGINT), CAST(13 AS BIGINT), CAST(17 AS BIGINT), CAST(19 AS BIGINT), CAST(23 AS BIGINT), CAST(29 AS BIGINT))
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=36B cardinality=10
+|     in pipelines: 05(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_item_sk = i_item_sk
+|  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2,4 row-size=118B cardinality=73.80K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=36B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF002[bloom] <- ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=82B cardinality=73.80K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=42B cardinality=50.00K
+|     in pipelines: 02(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  runtime filters: RF004[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=40B cardinality=73.80K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF002[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=32B cardinality=73.80K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=186
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_item_sk, RF004[bloom] -> ws_bill_customer_sk, RF006[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=40.38MB Threads=16
+Per-Host Resource Estimates: Memory=383MB
+F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: ca_zip, ca_city, sum(ws_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+24:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: ca_zip ASC, ca_city ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=54B cardinality=100
+|  in pipelines: 13(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(ca_zip,ca_city)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=12.01MB mem-reservation=4.75MB thread-reservation=1
+13:TOP-N [LIMIT=100]
+|  order by: ca_zip ASC, ca_city ASC
+|  mem-estimate=5.27KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=54B cardinality=100
+|  in pipelines: 13(GETNEXT), 23(OPEN)
+|
+23:AGGREGATE [FINALIZE]
+|  output: sum:merge(ws_sales_price)
+|  group by: ca_zip, ca_city
+|  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=8 row-size=54B cardinality=73.80K
+|  in pipelines: 23(GETNEXT), 00(OPEN)
+|
+22:EXCHANGE [HASH(ca_zip,ca_city)]
+|  mem-estimate=2.01MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=54B cardinality=73.80K
+|  in pipelines: 00(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=22.04MB mem-reservation=12.81MB thread-reservation=1 runtime-filters-memory=2.00MB
+12:AGGREGATE [STREAMING]
+|  output: sum(ws_sales_price)
+|  group by: ca_zip, ca_city
+|  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=8 row-size=54B cardinality=73.80K
+|  in pipelines: 00(GETNEXT)
+|
+11:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  other predicates: (substring(ca_zip, CAST(1 AS BIGINT), CAST(5 AS BIGINT)) IN ('85669', '86197', '88274', '83405', '86475', '85392', '85460', '80348', '81792') OR i_item_id IS NOT NULL)
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2,4,6N row-size=146B cardinality=73.80K
+|  in pipelines: 00(GETNEXT), 20(OPEN)
+|
+|--21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=28B cardinality=10
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(i_item_id)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  20:AGGREGATE [FINALIZE]
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=28B cardinality=10
+|  |  in pipelines: 20(GETNEXT), 05(OPEN)
+|  |
+|  19:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=28B cardinality=10
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=42.00MB mem-reservation=2.50MB thread-reservation=2
+|  06:AGGREGATE [STREAMING]
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=28B cardinality=10
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_item_sk IN (CAST(2 AS BIGINT), CAST(3 AS BIGINT), CAST(5 AS BIGINT), CAST(7 AS BIGINT), CAST(11 AS BIGINT), CAST(13 AS BIGINT), CAST(17 AS BIGINT), CAST(19 AS BIGINT), CAST(23 AS BIGINT), CAST(29 AS BIGINT))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_item_sk IN (CAST(2 AS BIGINT), CAST(3 AS BIGINT), CAST(5 AS BIGINT), CAST(7 AS BIGINT), CAST(11 AS BIGINT), CAST(13 AS BIGINT), CAST(17 AS BIGINT), CAST(19 AS BIGINT), CAST(23 AS BIGINT), CAST(29 AS BIGINT))
+|     parquet dictionary predicates: i_item_sk IN (CAST(2 AS BIGINT), CAST(3 AS BIGINT), CAST(5 AS BIGINT), CAST(7 AS BIGINT), CAST(11 AS BIGINT), CAST(13 AS BIGINT), CAST(17 AS BIGINT), CAST(19 AS BIGINT), CAST(23 AS BIGINT), CAST(29 AS BIGINT))
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=36B cardinality=10
+|     in pipelines: 05(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_item_sk = i_item_sk
+|  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2,4 row-size=118B cardinality=73.80K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=36B cardinality=18.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=36B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF002[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=82B cardinality=73.80K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--17:EXCHANGE [HASH(ca_address_sk)]
+|  |  mem-estimate=2.04MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=42B cardinality=50.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=42B cardinality=50.00K
+|     in pipelines: 02(GETNEXT)
+|
+16:EXCHANGE [HASH(c_current_addr_sk)]
+|  mem-estimate=1.51MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,1 row-size=40B cardinality=73.80K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=135.67MB mem-reservation=14.88MB thread-reservation=2 runtime-filters-memory=3.00MB
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  runtime filters: RF004[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=40B cardinality=73.80K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=100.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  01:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF002[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=100.00K
+|     in pipelines: 01(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=32B cardinality=73.80K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=186
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_qoy = CAST(2 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=186
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_item_sk, RF004[bloom] -> ws_bill_customer_sk, RF006[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q46.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q46.test
new file mode 100644
index 0000000..1eb9bec
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q46.test
@@ -0,0 +1,696 @@
+# TPCDS-Q46
+select
+  c_last_name,
+  c_first_name,
+  ca_city,
+  bought_city,
+  ss_ticket_number,
+  amt,
+  profit
+from
+  (select
+    ss_ticket_number,
+    ss_customer_sk,
+    ca_city bought_city,
+    sum(ss_coupon_amt) amt,
+    sum(ss_net_profit) profit
+  from
+    store_sales,
+    date_dim,
+    store,
+    household_demographics,
+    customer_address
+  where
+    store_sales.ss_sold_date_sk = date_dim.d_date_sk
+    and store_sales.ss_store_sk = store.s_store_sk
+    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+    and store_sales.ss_addr_sk = customer_address.ca_address_sk
+    and (household_demographics.hd_dep_count = 5
+      or household_demographics.hd_vehicle_count = 3)
+    and date_dim.d_dow in (6, 0)
+    and date_dim.d_year in (1999, 1999 + 1, 1999 + 2)
+    and store.s_city in ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
+  group by
+    ss_ticket_number,
+    ss_customer_sk,
+    ss_addr_sk,
+    ca_city
+  ) dn,
+  customer,
+  customer_address current_addr
+where
+  ss_customer_sk = c_customer_sk
+  and customer.c_current_addr_sk = current_addr.ca_address_sk
+  and current_addr.ca_city <> bought_city
+order by
+  c_last_name,
+  c_first_name,
+  ca_city,
+  bought_city,
+  ss_ticket_number
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=49.56MB Threads=8
+Per-Host Resource Estimates: Memory=394MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=394.06MB mem-reservation=49.56MB thread-reservation=8 runtime-filters-memory=6.00MB
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, amt, profit
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, c_first_name ASC, ca_city ASC, bought_city ASC, ss_ticket_number ASC
+|  mem-estimate=11.51KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=118B cardinality=100
+|  in pipelines: 14(GETNEXT), 09(OPEN)
+|
+13:HASH JOIN [INNER JOIN]
+|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  fk/pk conjuncts: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  other predicates: current_addr.ca_city != ca_city
+|  runtime filters: RF000[bloom] <- current_addr.ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,7,8 row-size=138B cardinality=230.45K
+|  in pipelines: 09(GETNEXT), 11(OPEN)
+|
+|--11:SCAN HDFS [tpcds_parquet.customer_address current_addr]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=8 row-size=25B cardinality=50.00K
+|     in pipelines: 11(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=5,7 row-size=113B cardinality=230.45K
+|  in pipelines: 09(GETNEXT), 10(OPEN)
+|
+|--10:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> customer.c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=7 row-size=44B cardinality=100.00K
+|     in pipelines: 10(GETNEXT)
+|
+09:AGGREGATE [FINALIZE]
+|  output: sum(ss_coupon_amt), sum(ss_net_profit)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5 row-size=69B cardinality=230.45K
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  fk/pk conjuncts: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  runtime filters: RF004[bloom] <- customer_address.ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2,4 row-size=107B cardinality=230.45K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=25B cardinality=50.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  runtime filters: RF006[bloom] <- store.s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=83B cardinality=230.45K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
+|     parquet dictionary predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=23B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  runtime filters: RF008[bloom] <- date_dim.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=60B cardinality=230.45K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: date_dim.d_dow IN (CAST(6 AS INT), CAST(0 AS INT)), date_dim.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: date_dim.d_dow IN (CAST(6 AS INT), CAST(0 AS INT)), date_dim.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     parquet dictionary predicates: date_dim.d_dow IN (CAST(6 AS INT), CAST(0 AS INT)), date_dim.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=598
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  runtime filters: RF010[bloom] <- household_demographics.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=48B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.household_demographics]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: (household_demographics.hd_dep_count = CAST(5 AS INT) OR household_demographics.hd_vehicle_count = CAST(3 AS INT))
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=1.80K
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF002[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF004[bloom] -> store_sales.ss_addr_sk, RF006[bloom] -> store_sales.ss_store_sk, RF008[bloom] -> store_sales.ss_sold_date_sk, RF010[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=112.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=47.52MB Threads=17
+Per-Host Resource Estimates: Memory=428MB
+F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=39.54KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, amt, profit
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+24:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_last_name ASC, c_first_name ASC, ca_city ASC, bought_city ASC, ss_ticket_number ASC
+|  limit: 100
+|  mem-estimate=39.54KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=118B cardinality=100
+|  in pipelines: 14(GETNEXT)
+|
+F07:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=18.47MB mem-reservation=7.75MB thread-reservation=1 runtime-filters-memory=2.00MB
+14:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, c_first_name ASC, ca_city ASC, bought_city ASC, ss_ticket_number ASC
+|  mem-estimate=11.51KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=118B cardinality=100
+|  in pipelines: 14(GETNEXT), 20(OPEN)
+|
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  fk/pk conjuncts: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  other predicates: current_addr.ca_city != ca_city
+|  runtime filters: RF000[bloom] <- current_addr.ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,7,8 row-size=138B cardinality=230.45K
+|  in pipelines: 20(GETNEXT), 11(OPEN)
+|
+|--23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=25B cardinality=50.00K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  11:SCAN HDFS [tpcds_parquet.customer_address current_addr, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=8 row-size=25B cardinality=50.00K
+|     in pipelines: 11(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,7 row-size=113B cardinality=230.45K
+|  in pipelines: 20(GETNEXT), 10(OPEN)
+|
+|--22:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=4.24MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=44B cardinality=100.00K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=65.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  10:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> customer.c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=7 row-size=44B cardinality=100.00K
+|     in pipelines: 10(GETNEXT)
+|
+21:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=5.26MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=69B cardinality=230.45K
+|  in pipelines: 20(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=15.26MB mem-reservation=8.50MB thread-reservation=1
+20:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_coupon_amt), sum:merge(ss_net_profit)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
+|  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=5 row-size=69B cardinality=230.45K
+|  in pipelines: 20(GETNEXT), 00(OPEN)
+|
+19:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)]
+|  mem-estimate=5.26MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=69B cardinality=230.45K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=136.97MB mem-reservation=26.69MB thread-reservation=2 runtime-filters-memory=5.00MB
+09:AGGREGATE [STREAMING]
+|  output: sum(ss_coupon_amt), sum(ss_net_profit)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
+|  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=5 row-size=69B cardinality=230.45K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  fk/pk conjuncts: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  runtime filters: RF004[bloom] <- customer_address.ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2,4 row-size=107B cardinality=230.45K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=25B cardinality=50.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=25B cardinality=50.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  runtime filters: RF006[bloom] <- store.s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=83B cardinality=230.45K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--17:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=23B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
+|     parquet dictionary predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=23B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  runtime filters: RF008[bloom] <- date_dim.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=60B cardinality=230.45K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--16:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=598
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: date_dim.d_dow IN (CAST(6 AS INT), CAST(0 AS INT)), date_dim.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: date_dim.d_dow IN (CAST(6 AS INT), CAST(0 AS INT)), date_dim.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     parquet dictionary predicates: date_dim.d_dow IN (CAST(6 AS INT), CAST(0 AS INT)), date_dim.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=598
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  runtime filters: RF010[bloom] <- household_demographics.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=48B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=37.09KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=1.80K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: (household_demographics.hd_dep_count = CAST(5 AS INT) OR household_demographics.hd_vehicle_count = CAST(3 AS INT))
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=1.80K
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF002[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF004[bloom] -> store_sales.ss_addr_sk, RF006[bloom] -> store_sales.ss_store_sk, RF008[bloom] -> store_sales.ss_sold_date_sk, RF010[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=112.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=71.08MB Threads=20
+Per-Host Resource Estimates: Memory=241MB
+F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=75.24KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, amt, profit
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+24:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_last_name ASC, c_first_name ASC, ca_city ASC, bought_city ASC, ss_ticket_number ASC
+|  limit: 100
+|  mem-estimate=75.24KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=118B cardinality=100
+|  in pipelines: 14(GETNEXT)
+|
+F07:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=5.49MB mem-reservation=0B thread-reservation=1
+14:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, c_first_name ASC, ca_city ASC, bought_city ASC, ss_ticket_number ASC
+|  mem-estimate=11.51KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=118B cardinality=100
+|  in pipelines: 14(GETNEXT), 20(OPEN)
+|
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  fk/pk conjuncts: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  other predicates: current_addr.ca_city != ca_city
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,7,8 row-size=138B cardinality=230.45K
+|  in pipelines: 20(GETNEXT), 11(OPEN)
+|
+|--F10:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=7.97MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: current_addr.ca_address_sk
+|  |  runtime filters: RF000[bloom] <- current_addr.ca_address_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=25B cardinality=50.00K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  11:SCAN HDFS [tpcds_parquet.customer_address current_addr, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=8 row-size=25B cardinality=50.00K
+|     in pipelines: 11(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=01
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5,7 row-size=113B cardinality=230.45K
+|  in pipelines: 20(GETNEXT), 10(OPEN)
+|
+|--F11:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=7.18MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF002[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  22:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=4.24MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=44B cardinality=100.00K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  10:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> customer.c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=7 row-size=44B cardinality=100.00K
+|     in pipelines: 10(GETNEXT)
+|
+21:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=5.48MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=69B cardinality=230.45K
+|  in pipelines: 20(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=15.48MB mem-reservation=4.75MB thread-reservation=1
+20:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_coupon_amt), sum:merge(ss_net_profit)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
+|  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=5 row-size=69B cardinality=230.45K
+|  in pipelines: 20(GETNEXT), 00(OPEN)
+|
+19:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)]
+|  mem-estimate=5.48MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=69B cardinality=230.45K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=9.00MB thread-reservation=1
+09:AGGREGATE [STREAMING]
+|  output: sum(ss_coupon_amt), sum(ss_net_profit)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
+|  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=5 row-size=69B cardinality=230.45K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  fk/pk conjuncts: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2,4 row-size=107B cardinality=230.45K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F12:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=7.97MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: customer_address.ca_address_sk
+|  |  runtime filters: RF004[bloom] <- customer_address.ca_address_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=25B cardinality=50.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=4 row-size=25B cardinality=50.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=83B cardinality=230.45K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: store.s_store_sk
+|  |  runtime filters: RF006[bloom] <- store.s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  17:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=23B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
+|     parquet dictionary predicates: store.s_city IN ('Midway', 'Concord', 'Spring Hill', 'Brownsville', 'Greenville')
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=2 row-size=23B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=60B cardinality=230.45K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: date_dim.d_date_sk
+|  |  runtime filters: RF008[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  16:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=598
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: date_dim.d_dow IN (CAST(6 AS INT), CAST(0 AS INT)), date_dim.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: date_dim.d_dow IN (CAST(6 AS INT), CAST(0 AS INT)), date_dim.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     parquet dictionary predicates: date_dim.d_dow IN (CAST(6 AS INT), CAST(0 AS INT)), date_dim.d_year IN (CAST(1999 AS INT), CAST(2000 AS INT), CAST(2001 AS INT))
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=1 row-size=12B cardinality=598
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=05
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=48B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.91MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: household_demographics.hd_demo_sk
+|  |  runtime filters: RF010[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=37.09KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=1.80K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: (household_demographics.hd_dep_count = CAST(5 AS INT) OR household_demographics.hd_vehicle_count = CAST(3 AS INT))
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=3 row-size=12B cardinality=1.80K
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF002[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF004[bloom] -> store_sales.ss_addr_sk, RF006[bloom] -> store_sales.ss_store_sk, RF008[bloom] -> store_sales.ss_sold_date_sk, RF010[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q47.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q47.test
new file mode 100644
index 0000000..a84459f
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q47.test
@@ -0,0 +1,1354 @@
+# TPCDS-Q47
+with v1 as (
+ select i_category, i_brand,
+        s_store_name, s_company_name,
+        d_year, d_moy,
+        sum(ss_sales_price) sum_sales,
+        avg(sum(ss_sales_price)) over
+          (partition by i_category, i_brand,
+                     s_store_name, s_company_name, d_year)
+          avg_monthly_sales,
+        rank() over
+          (partition by i_category, i_brand,
+                     s_store_name, s_company_name
+           order by d_year, d_moy) rn
+ from item, store_sales, date_dim, store
+ where ss_item_sk = i_item_sk and
+       ss_sold_date_sk = d_date_sk and
+       ss_store_sk = s_store_sk and
+       (
+         d_year = 2000 or
+         ( d_year = 2000-1 and d_moy =12) or
+         ( d_year = 2000+1 and d_moy =1)
+       )
+ group by i_category, i_brand,
+          s_store_name, s_company_name,
+          d_year, d_moy),
+ v2 as(
+ select v1.i_category, v1.i_brand
+        ,v1.d_year
+        ,v1.avg_monthly_sales
+        ,v1.sum_sales, v1_lag.sum_sales psum, v1_lead.sum_sales nsum
+ from v1, v1 v1_lag, v1 v1_lead
+ where v1.i_category = v1_lag.i_category and
+       v1.i_category = v1_lead.i_category and
+       v1.i_brand = v1_lag.i_brand and
+       v1.i_brand = v1_lead.i_brand and
+       v1.s_store_name = v1_lag.s_store_name and
+       v1.s_store_name = v1_lead.s_store_name and
+       v1.s_company_name = v1_lag.s_company_name and
+       v1.s_company_name = v1_lead.s_company_name and
+       v1.rn = v1_lag.rn + 1 and
+       v1.rn = v1_lead.rn - 1)
+ select * from ( select  *
+ from v2
+ where  d_year = 2000 and
+        avg_monthly_sales > 0 and
+        case when avg_monthly_sales > 0 then abs(sum_sales - avg_monthly_sales) / avg_monthly_sales else null end > 0.1
+ order by sum_sales - avg_monthly_sales, d_year
+ limit 100
+ ) as v3
+---- PLAN
+Max Per-Host Resource Reservation: Memory=163.00MB Threads=13
+Per-Host Resource Estimates: Memory=618MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=618.44MB mem-reservation=163.00MB thread-reservation=13 runtime-filters-memory=9.00MB
+PLAN-ROOT SINK
+|  output exprs: i_category, i_brand, d_year, avg_monthly_sales, sum_sales, psum, nsum
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+35:TOP-N [LIMIT=100]
+|  order by: sum_sales - avg_monthly_sales ASC, d_year ASC
+|  mem-estimate=11.14KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=114B cardinality=100
+|  in pipelines: 35(GETNEXT), 21(OPEN)
+|
+34:HASH JOIN [INNER JOIN]
+|  hash predicates: rank() = rank() - 1, s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=81.49MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=45,44,37,32,53,52 row-size=356B cardinality=1.09G
+|  in pipelines: 21(GETNEXT), 31(OPEN)
+|
+|--32:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, s_store_name, s_company_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=53,52 row-size=113B cardinality=685.36K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  31:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=53 row-size=105B cardinality=685.36K
+|  |  in pipelines: 31(GETNEXT), 30(OPEN)
+|  |
+|  30:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_sales_price)
+|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  |  mem-estimate=75.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=105B cardinality=685.36K
+|  |  in pipelines: 30(GETNEXT), 24(OPEN)
+|  |
+|  29:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF012[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16,19 row-size=125B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--26:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=39B cardinality=12
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16 row-size=86B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT), 23(OPEN)
+|  |
+|  |--23:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=16 row-size=54B cardinality=18.00K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18 row-size=32B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--25:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(2000 AS INT) OR (d_year = CAST(1999 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2001 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=12B cardinality=434
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF012[bloom] -> ss_store_sk, RF014[bloom] -> ss_item_sk, RF016[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=17 row-size=20B cardinality=2.88M
+|     in pipelines: 24(GETNEXT)
+|
+33:HASH JOIN [INNER JOIN]
+|  hash predicates: rank() + 1 = rank(), s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=45,44,37,32 row-size=243B cardinality=1.10M
+|  in pipelines: 21(GETNEXT), 10(OPEN)
+|
+|--12:SELECT
+|  |  predicates: d_year = CAST(2000 AS INT), avg(sum(ss_sales_price)) > CAST(0 AS DECIMAL(3,0)), CASE WHEN avg(sum(ss_sales_price)) > CAST(0 AS DECIMAL(3,0)) THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=37,32 row-size=129B cardinality=1.11K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  11:ANALYTIC
+|  |  functions: avg(sum(ss_sales_price))
+|  |  partition by: i_category, i_brand, s_store_name, s_company_name, d_year
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=37,32 row-size=129B cardinality=685.36K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  10:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC NULLS LAST
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=37 row-size=113B cardinality=685.36K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  09:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, s_store_name, s_company_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=35,34 row-size=113B cardinality=685.36K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  08:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=35 row-size=105B cardinality=685.36K
+|  |  in pipelines: 08(GETNEXT), 07(OPEN)
+|  |
+|  07:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_sales_price)
+|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  |  mem-estimate=75.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=4 row-size=105B cardinality=685.36K
+|  |  in pipelines: 07(GETNEXT), 01(OPEN)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF006[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0,3 row-size=125B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=39B cardinality=12
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0 row-size=86B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |
+|  |--00:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=0 row-size=54B cardinality=18.00K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=32B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(2000 AS INT) OR (d_year = CAST(1999 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2001 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=12B cardinality=434
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_store_sk, RF008[bloom] -> ss_item_sk, RF010[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=2.88M
+|     in pipelines: 01(GETNEXT)
+|
+22:ANALYTIC
+|  functions: rank()
+|  partition by: i_category, i_brand, s_store_name, s_company_name
+|  order by: d_year ASC, d_moy ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=45,44 row-size=113B cardinality=685.36K
+|  in pipelines: 21(GETNEXT)
+|
+21:SORT
+|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=45 row-size=105B cardinality=685.36K
+|  in pipelines: 21(GETNEXT), 20(OPEN)
+|
+20:AGGREGATE [FINALIZE]
+|  output: sum(ss_sales_price)
+|  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  mem-estimate=75.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=12 row-size=105B cardinality=685.36K
+|  in pipelines: 20(GETNEXT), 14(OPEN)
+|
+19:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8,11 row-size=125B cardinality=685.36K
+|  in pipelines: 14(GETNEXT), 16(OPEN)
+|
+|--16:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=11 row-size=39B cardinality=12
+|     in pipelines: 16(GETNEXT)
+|
+18:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8 row-size=86B cardinality=685.36K
+|  in pipelines: 14(GETNEXT), 13(OPEN)
+|
+|--13:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=8 row-size=54B cardinality=18.00K
+|     in pipelines: 13(GETNEXT)
+|
+17:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=32B cardinality=685.36K
+|  in pipelines: 14(GETNEXT), 15(OPEN)
+|
+|--15:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: (d_year = CAST(2000 AS INT) OR (d_year = CAST(1999 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2001 AS INT) AND d_moy = CAST(1 AS INT)))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=10 row-size=12B cardinality=434
+|     in pipelines: 15(GETNEXT)
+|
+14:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_item_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=9 row-size=20B cardinality=2.88M
+   in pipelines: 14(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=323.70MB Threads=29
+Per-Host Resource Estimates: Memory=942MB
+F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=38.31KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_category, i_brand, d_year, avg_monthly_sales, sum_sales, psum, nsum
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+54:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum_sales - avg_monthly_sales ASC, d_year ASC
+|  limit: 100
+|  mem-estimate=38.31KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=114B cardinality=100
+|  in pipelines: 35(GETNEXT)
+|
+F15:PLAN FRAGMENT [HASH(rank(),s_store_name,i_category,s_company_name,i_brand)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=55.11MB mem-reservation=34.00MB thread-reservation=1
+35:TOP-N [LIMIT=100]
+|  order by: sum_sales - avg_monthly_sales ASC, d_year ASC
+|  mem-estimate=11.14KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=114B cardinality=100
+|  in pipelines: 35(GETNEXT), 21(OPEN)
+|
+34:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: rank() = rank() - 1, s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=45,44,37,32,53,52 row-size=356B cardinality=1.09G
+|  in pipelines: 21(GETNEXT), 31(OPEN)
+|
+|--53:EXCHANGE [HASH(rank() - 1,s_store_name,i_category,s_company_name,i_brand)]
+|  |  mem-estimate=10.36MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=53,52 row-size=113B cardinality=685.36K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(i_category,i_brand,s_store_name,s_company_name)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=53.87MB mem-reservation=50.00MB thread-reservation=1
+|  32:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, s_store_name, s_company_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=53,52 row-size=113B cardinality=685.36K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  31:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=53 row-size=105B cardinality=685.36K
+|  |  in pipelines: 31(GETNEXT), 51(OPEN)
+|  |
+|  51:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_sales_price)
+|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  |  mem-estimate=37.87MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=105B cardinality=685.36K
+|  |  in pipelines: 51(GETNEXT), 24(OPEN)
+|  |
+|  50:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
+|  |  mem-estimate=10.32MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=105B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=95.70MB mem-reservation=43.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  30:AGGREGATE [STREAMING]
+|  |  output: sum(ss_sales_price)
+|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  |  mem-estimate=37.87MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=105B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF012[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16,19 row-size=125B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--49:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=39B cardinality=12
+|  |  |  in pipelines: 26(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=2
+|  |  26:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=39B cardinality=12
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16 row-size=86B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT), 23(OPEN)
+|  |
+|  |--48:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=16 row-size=54B cardinality=18.00K
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  23:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=16 row-size=54B cardinality=18.00K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18 row-size=32B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=12B cardinality=434
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(2000 AS INT) OR (d_year = CAST(1999 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2001 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=12B cardinality=434
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF012[bloom] -> ss_store_sk, RF014[bloom] -> ss_item_sk, RF016[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=17 row-size=20B cardinality=2.88M
+|     in pipelines: 24(GETNEXT)
+|
+52:EXCHANGE [HASH(rank(),s_store_name,i_category,s_company_name,i_brand)]
+|  mem-estimate=10.76MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=45,44,37,32 row-size=243B cardinality=1.10M
+|  in pipelines: 21(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_category,i_brand,s_store_name,s_company_name)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=56.34MB mem-reservation=51.94MB thread-reservation=1
+33:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: rank() + 1 = rank(), s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=45,44,37,32 row-size=243B cardinality=1.10M
+|  in pipelines: 21(GETNEXT), 10(OPEN)
+|
+|--46:EXCHANGE [BROADCAST]
+|  |  mem-estimate=551.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=37,32 row-size=129B cardinality=1.11K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(i_category,i_brand,s_store_name,s_company_name)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=57.87MB mem-reservation=54.00MB thread-reservation=1
+|  12:SELECT
+|  |  predicates: d_year = CAST(2000 AS INT), avg(sum(ss_sales_price)) > CAST(0 AS DECIMAL(3,0)), CASE WHEN avg(sum(ss_sales_price)) > CAST(0 AS DECIMAL(3,0)) THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=37,32 row-size=129B cardinality=1.11K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  11:ANALYTIC
+|  |  functions: avg(sum(ss_sales_price))
+|  |  partition by: i_category, i_brand, s_store_name, s_company_name, d_year
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=37,32 row-size=129B cardinality=685.36K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  10:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC NULLS LAST
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=37 row-size=113B cardinality=685.36K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  09:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, s_store_name, s_company_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=35,34 row-size=113B cardinality=685.36K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  08:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=35 row-size=105B cardinality=685.36K
+|  |  in pipelines: 08(GETNEXT), 45(OPEN)
+|  |
+|  45:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_sales_price)
+|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  |  mem-estimate=37.87MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=4 row-size=105B cardinality=685.36K
+|  |  in pipelines: 45(GETNEXT), 01(OPEN)
+|  |
+|  44:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
+|  |  mem-estimate=10.32MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=105B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=95.70MB mem-reservation=43.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  07:AGGREGATE [STREAMING]
+|  |  output: sum(ss_sales_price)
+|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  |  mem-estimate=37.87MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=4 row-size=105B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF006[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0,3 row-size=125B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |
+|  |--43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=39B cardinality=12
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=39B cardinality=12
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0 row-size=86B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |
+|  |--42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=54B cardinality=18.00K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=0 row-size=54B cardinality=18.00K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=32B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=12B cardinality=434
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(2000 AS INT) OR (d_year = CAST(1999 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2001 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=12B cardinality=434
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_store_sk, RF008[bloom] -> ss_item_sk, RF010[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=2.88M
+|     in pipelines: 01(GETNEXT)
+|
+22:ANALYTIC
+|  functions: rank()
+|  partition by: i_category, i_brand, s_store_name, s_company_name
+|  order by: d_year ASC, d_moy ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=45,44 row-size=113B cardinality=685.36K
+|  in pipelines: 21(GETNEXT)
+|
+21:SORT
+|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=45 row-size=105B cardinality=685.36K
+|  in pipelines: 21(GETNEXT), 40(OPEN)
+|
+40:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  mem-estimate=37.87MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=12 row-size=105B cardinality=685.36K
+|  in pipelines: 40(GETNEXT), 14(OPEN)
+|
+39:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
+|  mem-estimate=10.32MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=105B cardinality=685.36K
+|  in pipelines: 14(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=95.70MB mem-reservation=43.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+20:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  mem-estimate=37.87MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=12 row-size=105B cardinality=685.36K
+|  in pipelines: 14(GETNEXT)
+|
+19:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8,11 row-size=125B cardinality=685.36K
+|  in pipelines: 14(GETNEXT), 16(OPEN)
+|
+|--38:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=39B cardinality=12
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=2
+|  16:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=11 row-size=39B cardinality=12
+|     in pipelines: 16(GETNEXT)
+|
+18:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8 row-size=86B cardinality=685.36K
+|  in pipelines: 14(GETNEXT), 13(OPEN)
+|
+|--37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=54B cardinality=18.00K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=2
+|  13:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=8 row-size=54B cardinality=18.00K
+|     in pipelines: 13(GETNEXT)
+|
+17:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=32B cardinality=685.36K
+|  in pipelines: 14(GETNEXT), 15(OPEN)
+|
+|--36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=434
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  15:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: (d_year = CAST(2000 AS INT) OR (d_year = CAST(1999 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2001 AS INT) AND d_moy = CAST(1 AS INT)))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=10 row-size=12B cardinality=434
+|     in pipelines: 15(GETNEXT)
+|
+14:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_item_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=9 row-size=20B cardinality=2.88M
+   in pipelines: 14(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=611.07MB Threads=36
+Per-Host Resource Estimates: Memory=891MB
+F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=72.91KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_category, i_brand, d_year, avg_monthly_sales, sum_sales, psum, nsum
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+54:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum_sales - avg_monthly_sales ASC, d_year ASC
+|  limit: 100
+|  mem-estimate=72.91KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=114B cardinality=100
+|  in pipelines: 35(GETNEXT)
+|
+F15:PLAN FRAGMENT [HASH(rank(),s_store_name,i_category,s_company_name,i_brand)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.53MB mem-reservation=0B thread-reservation=1
+35:TOP-N [LIMIT=100]
+|  order by: sum_sales - avg_monthly_sales ASC, d_year ASC
+|  mem-estimate=11.14KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=114B cardinality=100
+|  in pipelines: 35(GETNEXT), 21(OPEN)
+|
+34:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: rank() = rank() - 1, s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=45,44,37,32,53,52 row-size=356B cardinality=1.09G
+|  in pipelines: 21(GETNEXT), 31(OPEN)
+|
+|--F17:PLAN FRAGMENT [HASH(rank(),s_store_name,i_category,s_company_name,i_brand)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=27.71MB mem-reservation=17.00MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: rank() - 1, s_store_name, i_category, s_company_name, i_brand
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |
+|  53:EXCHANGE [HASH(rank() - 1,s_store_name,i_category,s_company_name,i_brand)]
+|  |  mem-estimate=10.71MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=53,52 row-size=113B cardinality=685.36K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(i_category,i_brand,s_store_name,s_company_name)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=50.00MB mem-reservation=50.00MB thread-reservation=1
+|  32:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, s_store_name, s_company_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=53,52 row-size=113B cardinality=685.36K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  31:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=53 row-size=105B cardinality=685.36K
+|  |  in pipelines: 31(GETNEXT), 51(OPEN)
+|  |
+|  51:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_sales_price)
+|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=105B cardinality=685.36K
+|  |  in pipelines: 51(GETNEXT), 24(OPEN)
+|  |
+|  50:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
+|  |  mem-estimate=10.64MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=105B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=50.00MB mem-reservation=35.00MB thread-reservation=1
+|  30:AGGREGATE [STREAMING]
+|  |  output: sum(ss_sales_price)
+|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=105B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16,19 row-size=125B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: s_store_sk
+|  |  |  runtime filters: RF012[bloom] <- s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  49:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=39B cardinality=12
+|  |  |  in pipelines: 26(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  |  26:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|  |     tuple-ids=19 row-size=39B cardinality=12
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16 row-size=86B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT), 23(OPEN)
+|  |
+|  |--F19:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=5.86MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  48:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=16 row-size=54B cardinality=18.00K
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  23:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=16 row-size=54B cardinality=18.00K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18 row-size=32B cardinality=685.36K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=12B cardinality=434
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(2000 AS INT) OR (d_year = CAST(1999 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2001 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=18 row-size=12B cardinality=434
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF012[bloom] -> ss_store_sk, RF014[bloom] -> ss_item_sk, RF016[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=17 row-size=20B cardinality=2.88M
+|     in pipelines: 24(GETNEXT)
+|
+52:EXCHANGE [HASH(rank(),s_store_name,i_category,s_company_name,i_brand)]
+|  mem-estimate=11.52MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=45,44,37,32 row-size=243B cardinality=1.10M
+|  in pipelines: 21(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_category,i_brand,s_store_name,s_company_name)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=50.00MB mem-reservation=50.00MB thread-reservation=1
+33:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: rank() + 1 = rank(), s_store_name = s_store_name, i_category = i_category, s_company_name = s_company_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=45,44,37,32 row-size=243B cardinality=1.10M
+|  in pipelines: 21(GETNEXT), 10(OPEN)
+|
+|--F21:PLAN FRAGMENT [HASH(i_category,i_brand,s_store_name,s_company_name)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.82MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: rank(), s_store_name, i_category, s_company_name, i_brand
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  46:EXCHANGE [BROADCAST]
+|  |  mem-estimate=963.75KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=37,32 row-size=129B cardinality=1.11K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(i_category,i_brand,s_store_name,s_company_name)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=54.00MB mem-reservation=54.00MB thread-reservation=1
+|  12:SELECT
+|  |  predicates: d_year = CAST(2000 AS INT), avg(sum(ss_sales_price)) > CAST(0 AS DECIMAL(3,0)), CASE WHEN avg(sum(ss_sales_price)) > CAST(0 AS DECIMAL(3,0)) THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=37,32 row-size=129B cardinality=1.11K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  11:ANALYTIC
+|  |  functions: avg(sum(ss_sales_price))
+|  |  partition by: i_category, i_brand, s_store_name, s_company_name, d_year
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=37,32 row-size=129B cardinality=685.36K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  10:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC NULLS LAST
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=37 row-size=113B cardinality=685.36K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  09:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, s_store_name, s_company_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=35,34 row-size=113B cardinality=685.36K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  08:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=35 row-size=105B cardinality=685.36K
+|  |  in pipelines: 08(GETNEXT), 45(OPEN)
+|  |
+|  45:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_sales_price)
+|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=4 row-size=105B cardinality=685.36K
+|  |  in pipelines: 45(GETNEXT), 01(OPEN)
+|  |
+|  44:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
+|  |  mem-estimate=10.64MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=105B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=50.00MB mem-reservation=35.00MB thread-reservation=1
+|  07:AGGREGATE [STREAMING]
+|  |  output: sum(ss_sales_price)
+|  |  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=4 row-size=105B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0,3 row-size=125B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |
+|  |--F22:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  build expressions: s_store_sk
+|  |  |  runtime filters: RF006[bloom] <- s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=39B cardinality=12
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=39B cardinality=12
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0 row-size=86B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |
+|  |--F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=5.86MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=03
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=54B cardinality=18.00K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=0 row-size=54B cardinality=18.00K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=07
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=32B cardinality=685.36K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--F24:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=03
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=12B cardinality=434
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(2000 AS INT) OR (d_year = CAST(1999 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2001 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=2 row-size=12B cardinality=434
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_store_sk, RF008[bloom] -> ss_item_sk, RF010[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=1 row-size=20B cardinality=2.88M
+|     in pipelines: 01(GETNEXT)
+|
+22:ANALYTIC
+|  functions: rank()
+|  partition by: i_category, i_brand, s_store_name, s_company_name
+|  order by: d_year ASC, d_moy ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=45,44 row-size=113B cardinality=685.36K
+|  in pipelines: 21(GETNEXT)
+|
+21:SORT
+|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=45 row-size=105B cardinality=685.36K
+|  in pipelines: 21(GETNEXT), 40(OPEN)
+|
+40:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=12 row-size=105B cardinality=685.36K
+|  in pipelines: 40(GETNEXT), 14(OPEN)
+|
+39:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
+|  mem-estimate=10.64MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=105B cardinality=685.36K
+|  in pipelines: 14(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=50.00MB mem-reservation=35.00MB thread-reservation=1
+20:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: i_category, i_brand, s_store_name, s_company_name, d_year, d_moy
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=12 row-size=105B cardinality=685.36K
+|  in pipelines: 14(GETNEXT)
+|
+19:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=08
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8,11 row-size=125B cardinality=685.36K
+|  in pipelines: 14(GETNEXT), 16(OPEN)
+|
+|--F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=08 plan-id=09 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF000[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  38:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=39B cardinality=12
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  16:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|     tuple-ids=11 row-size=39B cardinality=12
+|     in pipelines: 16(GETNEXT)
+|
+18:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=09
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8 row-size=86B cardinality=685.36K
+|  in pipelines: 14(GETNEXT), 13(OPEN)
+|
+|--F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.86MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=54B cardinality=18.00K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  13:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=8 row-size=54B cardinality=18.00K
+|     in pipelines: 13(GETNEXT)
+|
+17:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=10
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=32B cardinality=685.36K
+|  in pipelines: 14(GETNEXT), 15(OPEN)
+|
+|--F27:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=434
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  15:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: (d_year = CAST(2000 AS INT) OR (d_year = CAST(1999 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2001 AS INT) AND d_moy = CAST(1 AS INT)))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=10 row-size=12B cardinality=434
+|     in pipelines: 15(GETNEXT)
+|
+14:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_item_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=9 row-size=20B cardinality=2.88M
+   in pipelines: 14(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q48.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q48.test
new file mode 100644
index 0000000..97d136c
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q48.test
@@ -0,0 +1,499 @@
+# TPCDS-Q48
+SELECT SUM (ss_quantity)
+FROM store_sales,
+     store,
+     customer_demographics,
+     customer_address,
+     date_dim
+WHERE s_store_sk = ss_store_sk
+  AND ss_sold_date_sk = d_date_sk
+  AND d_year = 2000
+  AND ((cd_demo_sk = ss_cdemo_sk
+        AND cd_marital_status = 'M'
+        AND cd_education_status = '4 yr Degree'
+        AND ss_sales_price BETWEEN 100.00 AND 150.00)
+       OR (cd_demo_sk = ss_cdemo_sk
+           AND cd_marital_status = 'D'
+           AND cd_education_status = '2 yr Degree'
+           AND ss_sales_price BETWEEN 50.00 AND 100.00)
+       OR (cd_demo_sk = ss_cdemo_sk
+           AND cd_marital_status = 'S'
+           AND cd_education_status = 'College'
+           AND ss_sales_price BETWEEN 150.00 AND 200.00))
+  AND ((ss_addr_sk = ca_address_sk
+        AND ca_country = 'United States'
+        AND ca_state IN ('CO',
+                         'OH',
+                         'TX')
+        AND ss_net_profit BETWEEN 0 AND 2000)
+       OR (ss_addr_sk = ca_address_sk
+           AND ca_country = 'United States'
+           AND ca_state IN ('OR',
+                            'MN',
+                            'KY')
+           AND ss_net_profit BETWEEN 150 AND 3000)
+       OR (ss_addr_sk = ca_address_sk
+           AND ca_country = 'United States'
+           AND ca_state IN ('VA',
+                            'CA',
+                            'MS')
+           AND ss_net_profit BETWEEN 50 AND 25000)) ;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=21.77MB Threads=6
+Per-Host Resource Estimates: Memory=250MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=249.81MB mem-reservation=21.77MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: sum(ss_quantity)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+09:AGGREGATE [FINALIZE]
+|  output: sum(CAST(ss_quantity AS BIGINT))
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5 row-size=8B cardinality=1
+|  in pipelines: 09(GETNEXT), 02(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,4,1 row-size=122B cardinality=8.70K
+|  in pipelines: 02(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=4B cardinality=12
+|     in pipelines: 01(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: cd_demo_sk = ss_cdemo_sk
+|  fk/pk conjuncts: cd_demo_sk = ss_cdemo_sk
+|  other predicates: cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_education_status = 'College', cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_marital_status = 'S', cd_marital_status = 'M' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_education_status = 'College', cd_education_status = '4 yr Degree' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  runtime filters: RF002[bloom] <- ss_cdemo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,3,4 row-size=118B cardinality=8.70K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,4 row-size=79B cardinality=10.43K
+|  |  in pipelines: 00(GETNEXT), 04(OPEN)
+|  |
+|  |--04:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=8B cardinality=373
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  |  other predicates: ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY') OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ca_state IN ('VA', 'CA', 'MS')
+|  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3 row-size=71B cardinality=50.98K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY', 'VA', 'CA', 'MS'), ca_country = 'United States'
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY', 'VA', 'CA', 'MS'), ca_country = 'United States'
+|  |     parquet dictionary predicates: ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY', 'VA', 'CA', 'MS'), ca_country = 'United States'
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=43B cardinality=8.82K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|     runtime filters: RF000[bloom] -> ss_store_sk, RF004[bloom] -> ss_sold_date_sk, RF006[bloom] -> ss_addr_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet dictionary predicates: ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=0 row-size=28B cardinality=288.04K
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.customer_demographics]
+   HDFS partitions=1/1 files=1 size=7.49MB
+   predicates: cd_marital_status = 'M' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College', cd_education_status = '4 yr Degree' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College'
+   runtime filters: RF002[bloom] -> cd_demo_sk
+   stored statistics:
+     table: rows=1.92M size=7.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=1.92M
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=2 row-size=39B cardinality=181.75K
+   in pipelines: 02(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=27.33MB Threads=12
+Per-Host Resource Estimates: Memory=278MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: sum(ss_quantity)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_quantity)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5 row-size=8B cardinality=1
+|  in pipelines: 16(GETNEXT), 09(OPEN)
+|
+15:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=8B cardinality=1
+|  in pipelines: 09(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_cdemo_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=19.22MB mem-reservation=8.69MB thread-reservation=1 runtime-filters-memory=2.00MB
+09:AGGREGATE
+|  output: sum(CAST(ss_quantity AS BIGINT))
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5 row-size=8B cardinality=1
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,4,2,1 row-size=122B cardinality=8.70K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=4B cardinality=12
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=4B cardinality=12
+|     in pipelines: 01(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
+|  other predicates: cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_education_status = 'College', cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_marital_status = 'S', cd_marital_status = 'M' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_education_status = 'College', cd_education_status = '4 yr Degree' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  runtime filters: RF002[bloom] <- cd_demo_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,3,4,2 row-size=118B cardinality=8.70K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--13:EXCHANGE [HASH(cd_demo_sk)]
+|  |  mem-estimate=6.73MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=39B cardinality=181.75K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'M' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College', cd_education_status = '4 yr Degree' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=2 row-size=39B cardinality=181.75K
+|     in pipelines: 02(GETNEXT)
+|
+12:EXCHANGE [HASH(ss_cdemo_sk)]
+|  mem-estimate=541.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,4 row-size=79B cardinality=10.43K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=104.30MB mem-reservation=9.88MB thread-reservation=2 runtime-filters-memory=4.00MB
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,4 row-size=79B cardinality=10.43K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=8B cardinality=373
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2000 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=8B cardinality=373
+|     in pipelines: 04(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  other predicates: ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY') OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ca_state IN ('VA', 'CA', 'MS')
+|  runtime filters: RF006[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=71B cardinality=50.98K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=417.54KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=43B cardinality=8.82K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY', 'VA', 'CA', 'MS'), ca_country = 'United States'
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY', 'VA', 'CA', 'MS'), ca_country = 'United States'
+|     parquet dictionary predicates: ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY', 'VA', 'CA', 'MS'), ca_country = 'United States'
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=3 row-size=43B cardinality=8.82K
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_cdemo_sk, RF004[bloom] -> ss_sold_date_sk, RF006[bloom] -> ss_addr_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   parquet dictionary predicates: ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+   mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=288.04K
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=39.14MB Threads=14
+Per-Host Resource Estimates: Memory=168MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: sum(ss_quantity)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_quantity)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5 row-size=8B cardinality=1
+|  in pipelines: 16(GETNEXT), 09(OPEN)
+|
+15:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=8B cardinality=1
+|  in pipelines: 09(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_cdemo_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.80MB mem-reservation=0B thread-reservation=1
+09:AGGREGATE
+|  output: sum(CAST(ss_quantity AS BIGINT))
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5 row-size=8B cardinality=1
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,4,2,1 row-size=122B cardinality=8.70K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F07:PLAN FRAGMENT [HASH(ss_cdemo_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF000[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=4B cardinality=12
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=1 row-size=4B cardinality=12
+|     in pipelines: 01(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=01
+|  hash predicates: ss_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: ss_cdemo_sk = cd_demo_sk
+|  other predicates: cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', cd_marital_status = 'M' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', cd_marital_status = 'M' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'D' OR cd_education_status = 'College', cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_marital_status = 'S', cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_marital_status = 'S', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_marital_status = 'S', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_marital_status = 'S', cd_marital_status = 'M' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_marital_status = 'M' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = 'College', cd_education_status = '4 yr Degree' OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd_education_status = 'College', ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_education_status = 'College', ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd_education_status = '2 yr Degree' OR cd_education_status = 'College', cd_education_status = '4 yr Degree' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd_education_status = '4 yr Degree' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,4,2 row-size=118B cardinality=8.70K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F08:PLAN FRAGMENT [HASH(ss_cdemo_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=10.60MB mem-reservation=3.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: cd_demo_sk
+|  |  runtime filters: RF002[bloom] <- cd_demo_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [HASH(cd_demo_sk)]
+|  |  mem-estimate=6.73MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=39B cardinality=181.75K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'M' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College', cd_education_status = '4 yr Degree' OR cd_marital_status = 'D' AND cd_education_status = '2 yr Degree' OR cd_marital_status = 'S' AND cd_education_status = 'College'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=2 row-size=39B cardinality=181.75K
+|     in pipelines: 02(GETNEXT)
+|
+12:EXCHANGE [HASH(ss_cdemo_sk)]
+|  mem-estimate=814.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,4 row-size=79B cardinality=10.43K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,4 row-size=79B cardinality=10.43K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=8B cardinality=373
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2000 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=4 row-size=8B cardinality=373
+|     in pipelines: 04(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  other predicates: ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY') OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY') OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ca_state IN ('CO', 'OH', 'TX') OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ca_state IN ('VA', 'CA', 'MS'), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ca_state IN ('OR', 'MN', 'KY') OR ca_state IN ('VA', 'CA', 'MS')
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=71B cardinality=50.98K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.28MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: ca_address_sk
+|  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=417.54KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=43B cardinality=8.82K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY', 'VA', 'CA', 'MS'), ca_country = 'United States'
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY', 'VA', 'CA', 'MS'), ca_country = 'United States'
+|     parquet dictionary predicates: ca_state IN ('CO', 'OH', 'TX', 'OR', 'MN', 'KY', 'VA', 'CA', 'MS'), ca_country = 'United States'
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=3 row-size=43B cardinality=8.82K
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_cdemo_sk, RF004[bloom] -> ss_sold_date_sk, RF006[bloom] -> ss_addr_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   parquet dictionary predicates: ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit <= CAST(2000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit <= CAST(3000 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit <= CAST(25000 AS DECIMAL(5,0)), ss_net_profit >= CAST(0 AS DECIMAL(3,0)) OR ss_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ss_net_profit >= CAST(50 AS DECIMAL(3,0)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ss_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ss_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ss_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+   mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=0 row-size=28B cardinality=288.04K
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q49.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q49.test
new file mode 100644
index 0000000..b8873c9
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q49.test
@@ -0,0 +1,1341 @@
+# TPCDS-Q49
+
+SELECT channel,
+       item,
+       return_ratio,
+       return_rank,
+       currency_rank
+FROM
+  (SELECT 'web' AS channel,
+          web.item,
+          web.return_ratio,
+          web.return_rank,
+          web.currency_rank
+   FROM
+     (SELECT item,
+             return_ratio,
+             currency_ratio,
+             rank() OVER (
+                          ORDER BY return_ratio) AS return_rank,
+                         rank() OVER (
+                                      ORDER BY currency_ratio) AS currency_rank
+      FROM
+        (SELECT ws.ws_item_sk AS item,
+                (cast(sum(coalesce(wr.wr_return_quantity,0)) AS decimal(15,4))/ cast(sum(coalesce(ws.ws_quantity,0)) AS decimal(15,4))) AS return_ratio,
+                (cast(sum(coalesce(wr.wr_return_amt,0)) AS decimal(15,4))/ cast(sum(coalesce(ws.ws_net_paid,0)) AS decimal(15,4))) AS currency_ratio
+         FROM web_sales ws
+         LEFT OUTER JOIN web_returns wr ON (ws.ws_order_number = wr.wr_order_number
+                                            AND ws.ws_item_sk = wr.wr_item_sk) ,date_dim
+         WHERE wr.wr_return_amt > 10000
+           AND ws.ws_net_profit > 1
+           AND ws.ws_net_paid > 0
+           AND ws.ws_quantity > 0
+           AND ws_sold_date_sk = d_date_sk
+           AND d_year = 2001
+           AND d_moy = 12
+         GROUP BY ws.ws_item_sk) in_web) web
+   WHERE (web.return_rank <= 10
+          OR web.currency_rank <= 10)
+   UNION SELECT 'catalog' AS channel,
+                catalog.item,
+                catalog.return_ratio,
+                catalog.return_rank,
+                catalog.currency_rank
+   FROM
+     (SELECT item,
+             return_ratio,
+             currency_ratio,
+             rank() OVER (
+                          ORDER BY return_ratio) AS return_rank,
+                         rank() OVER (
+                                      ORDER BY currency_ratio) AS currency_rank
+      FROM
+        (SELECT cs.cs_item_sk AS item,
+                (cast(sum(coalesce(cr.cr_return_quantity,0)) AS decimal(15,4))/ cast(sum(coalesce(cs.cs_quantity,0)) AS decimal(15,4))) AS return_ratio,
+                (cast(sum(coalesce(cr.cr_return_amount,0)) AS decimal(15,4))/ cast(sum(coalesce(cs.cs_net_paid,0)) AS decimal(15,4))) AS currency_ratio
+         FROM catalog_sales cs
+         LEFT OUTER JOIN catalog_returns cr ON (cs.cs_order_number = cr.cr_order_number
+                                                AND cs.cs_item_sk = cr.cr_item_sk) ,date_dim
+         WHERE cr.cr_return_amount > 10000
+           AND cs.cs_net_profit > 1
+           AND cs.cs_net_paid > 0
+           AND cs.cs_quantity > 0
+           AND cs_sold_date_sk = d_date_sk
+           AND d_year = 2001
+           AND d_moy = 12
+         GROUP BY cs.cs_item_sk) in_cat) CATALOG
+   WHERE (catalog.return_rank <= 10
+          OR catalog.currency_rank <=10)
+   UNION SELECT 'store' AS channel,
+                store.item,
+                store.return_ratio,
+                store.return_rank,
+                store.currency_rank
+   FROM
+     (SELECT item,
+             return_ratio,
+             currency_ratio,
+             rank() OVER (
+                          ORDER BY return_ratio) AS return_rank,
+                         rank() OVER (
+                                      ORDER BY currency_ratio) AS currency_rank
+      FROM
+        (SELECT sts.ss_item_sk AS item,
+                (cast(sum(coalesce(sr.sr_return_quantity,0)) AS decimal(15,4))/cast(sum(coalesce(sts.ss_quantity,0)) AS decimal(15,4))) AS return_ratio,
+                (cast(sum(coalesce(sr.sr_return_amt,0)) AS decimal(15,4))/cast(sum(coalesce(sts.ss_net_paid,0)) AS decimal(15,4))) AS currency_ratio
+         FROM store_sales sts
+         LEFT OUTER JOIN store_returns sr ON (sts.ss_ticket_number = sr.sr_ticket_number
+                                              AND sts.ss_item_sk = sr.sr_item_sk) ,date_dim
+         WHERE sr.sr_return_amt > 10000
+           AND sts.ss_net_profit > 1
+           AND sts.ss_net_paid > 0
+           AND sts.ss_quantity > 0
+           AND ss_sold_date_sk = d_date_sk
+           AND d_year = 2001
+           AND d_moy = 12
+         GROUP BY sts.ss_item_sk) in_store) store
+   WHERE (store.return_rank <= 10
+          OR store.currency_rank <= 10) ) sq1
+ORDER BY 1,
+         4,
+         5,
+         2
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=37.31MB Threads=4
+Per-Host Resource Estimates: Memory=457MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=456.88MB mem-reservation=37.31MB thread-reservation=4 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: channel, item, return_ratio, return_rank, currency_rank
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+35:TOP-N [LIMIT=100]
+|  order by: channel ASC, return_rank ASC, currency_rank ASC, item ASC
+|  mem-estimate=5.08KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=26 row-size=52B cardinality=100
+|  in pipelines: 35(GETNEXT), 34(OPEN)
+|
+34:AGGREGATE [FINALIZE]
+|  group by: channel, item, return_ratio, return_rank, currency_rank
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=24 row-size=52B cardinality=2.99K
+|  in pipelines: 34(GETNEXT), 09(OPEN), 20(OPEN), 31(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=52B cardinality=2.99K
+|  in pipelines: 09(GETNEXT), 20(GETNEXT), 31(GETNEXT)
+|
+|--33:SELECT
+|  |  predicates: (rank() <= CAST(10 AS BIGINT) OR rank() <= CAST(10 AS BIGINT))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=58,55 row-size=104B cardinality=1.71K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  32:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=58,55 row-size=104B cardinality=17.05K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  31:SORT
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(sr.sr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_net_paid, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=58 row-size=96B cardinality=17.05K
+|  |  in pipelines: 31(GETNEXT), 29(OPEN)
+|  |
+|  30:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=56,53 row-size=80B cardinality=17.05K
+|  |  in pipelines: 29(GETNEXT)
+|  |
+|  29:SORT
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(sr.sr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_quantity, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=56 row-size=72B cardinality=17.05K
+|  |  in pipelines: 29(GETNEXT), 28(OPEN)
+|  |
+|  28:AGGREGATE [FINALIZE]
+|  |  output: sum(CAST(coalesce(sr.sr_return_quantity, CAST(0 AS INT)) AS BIGINT)), sum(CAST(coalesce(sts.ss_quantity, CAST(0 AS INT)) AS BIGINT)), sum(coalesce(sr.sr_return_amt, CAST(0 AS DECIMAL(7,2)))), sum(coalesce(sts.ss_net_paid, CAST(0 AS DECIMAL(7,2))))
+|  |  group by: sts.ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19 row-size=56B cardinality=17.05K
+|  |  in pipelines: 28(GETNEXT), 23(OPEN)
+|  |
+|  27:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N,18 row-size=68B cardinality=17.05K
+|  |  in pipelines: 23(GETNEXT), 25(OPEN)
+|  |
+|  |--25:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=12B cardinality=108
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  26:HASH JOIN [LEFT OUTER JOIN]
+|  |  hash predicates: sts.ss_item_sk = sr.sr_item_sk, sts.ss_ticket_number = sr.sr_ticket_number
+|  |  fk/pk conjuncts: sts.ss_item_sk = sr.sr_item_sk, sts.ss_ticket_number = sr.sr_ticket_number
+|  |  other predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N row-size=56B cardinality=288.04K
+|  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |
+|  |--24:SCAN HDFS [tpcds_parquet.store_returns sr]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     parquet statistics predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |     parquet dictionary predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=17 row-size=24B cardinality=28.75K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.store_sales sts]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: sts.ss_net_paid > CAST(0 AS DECIMAL(3,0)), sts.ss_net_profit > CAST(1 AS DECIMAL(3,0)), sts.ss_quantity > CAST(0 AS INT)
+|     runtime filters: RF004[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: sts.ss_net_paid > CAST(0 AS DECIMAL(3,0)), sts.ss_net_profit > CAST(1 AS DECIMAL(3,0)), sts.ss_quantity > CAST(0 AS INT)
+|     parquet dictionary predicates: sts.ss_net_paid > CAST(0 AS DECIMAL(3,0)), sts.ss_net_profit > CAST(1 AS DECIMAL(3,0)), sts.ss_quantity > CAST(0 AS INT)
+|     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=16 row-size=32B cardinality=288.04K
+|     in pipelines: 23(GETNEXT)
+|
+|--22:SELECT
+|  |  predicates: (rank() <= CAST(10 AS BIGINT) OR rank() <= CAST(10 AS BIGINT))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=47,44 row-size=104B cardinality=853
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  21:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_amount, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=47,44 row-size=104B cardinality=8.53K
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  20:SORT
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_amount, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(cr.cr_return_amount, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_net_paid, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=47 row-size=96B cardinality=8.53K
+|  |  in pipelines: 20(GETNEXT), 18(OPEN)
+|  |
+|  19:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=45,42 row-size=80B cardinality=8.53K
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  18:SORT
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(cr.cr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_quantity, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=45 row-size=72B cardinality=8.53K
+|  |  in pipelines: 18(GETNEXT), 17(OPEN)
+|  |
+|  17:AGGREGATE [FINALIZE]
+|  |  output: sum(CAST(coalesce(cr.cr_return_quantity, CAST(0 AS INT)) AS BIGINT)), sum(CAST(coalesce(cs.cs_quantity, CAST(0 AS INT)) AS BIGINT)), sum(coalesce(cr.cr_return_amount, CAST(0 AS DECIMAL(7,2)))), sum(coalesce(cs.cs_net_paid, CAST(0 AS DECIMAL(7,2))))
+|  |  group by: cs.cs_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11 row-size=56B cardinality=8.53K
+|  |  in pipelines: 17(GETNEXT), 12(OPEN)
+|  |
+|  16:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N,10 row-size=68B cardinality=8.53K
+|  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |
+|  |--14:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=12B cardinality=108
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  15:HASH JOIN [LEFT OUTER JOIN]
+|  |  hash predicates: cs.cs_item_sk = cr.cr_item_sk, cs.cs_order_number = cr.cr_order_number
+|  |  fk/pk conjuncts: cs.cs_item_sk = cr.cr_item_sk, cs.cs_order_number = cr.cr_order_number
+|  |  other predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N row-size=56B cardinality=144.16K
+|  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |
+|  |--13:SCAN HDFS [tpcds_parquet.catalog_returns cr]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     parquet statistics predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |     parquet dictionary predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=9 row-size=24B cardinality=14.41K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.catalog_sales cs]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     predicates: cs.cs_net_paid > CAST(0 AS DECIMAL(3,0)), cs.cs_net_profit > CAST(1 AS DECIMAL(3,0)), cs.cs_quantity > CAST(0 AS INT)
+|     runtime filters: RF002[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     parquet statistics predicates: cs.cs_net_paid > CAST(0 AS DECIMAL(3,0)), cs.cs_net_profit > CAST(1 AS DECIMAL(3,0)), cs.cs_quantity > CAST(0 AS INT)
+|     parquet dictionary predicates: cs.cs_net_paid > CAST(0 AS DECIMAL(3,0)), cs.cs_net_profit > CAST(1 AS DECIMAL(3,0)), cs.cs_quantity > CAST(0 AS INT)
+|     mem-estimate=288.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=8 row-size=32B cardinality=144.16K
+|     in pipelines: 12(GETNEXT)
+|
+11:SELECT
+|  predicates: (rank() <= CAST(10 AS BIGINT) OR rank() <= CAST(10 AS BIGINT))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=36,33 row-size=104B cardinality=429
+|  in pipelines: 09(GETNEXT)
+|
+10:ANALYTIC
+|  functions: rank()
+|  order by: (CAST(sum(coalesce(wr.wr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=36,33 row-size=104B cardinality=4.29K
+|  in pipelines: 09(GETNEXT)
+|
+09:SORT
+|  order by: (CAST(sum(coalesce(wr.wr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  materialized: (CAST(sum(coalesce(wr.wr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_net_paid, 0)) AS DECIMAL(15,4)))
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=36 row-size=96B cardinality=4.29K
+|  in pipelines: 09(GETNEXT), 07(OPEN)
+|
+08:ANALYTIC
+|  functions: rank()
+|  order by: (CAST(sum(coalesce(wr.wr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=34,31 row-size=80B cardinality=4.29K
+|  in pipelines: 07(GETNEXT)
+|
+07:SORT
+|  order by: (CAST(sum(coalesce(wr.wr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  materialized: (CAST(sum(coalesce(wr.wr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_quantity, 0)) AS DECIMAL(15,4)))
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=34 row-size=72B cardinality=4.29K
+|  in pipelines: 07(GETNEXT), 06(OPEN)
+|
+06:AGGREGATE [FINALIZE]
+|  output: sum(CAST(coalesce(wr.wr_return_quantity, CAST(0 AS INT)) AS BIGINT)), sum(CAST(coalesce(ws.ws_quantity, CAST(0 AS INT)) AS BIGINT)), sum(coalesce(wr.wr_return_amt, CAST(0 AS DECIMAL(7,2)))), sum(coalesce(ws.ws_net_paid, CAST(0 AS DECIMAL(7,2))))
+|  group by: ws.ws_item_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=56B cardinality=4.29K
+|  in pipelines: 06(GETNEXT), 01(OPEN)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,2 row-size=68B cardinality=4.29K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+04:HASH JOIN [LEFT OUTER JOIN]
+|  hash predicates: ws.ws_item_sk = wr.wr_item_sk, ws.ws_order_number = wr.wr_order_number
+|  fk/pk conjuncts: ws.ws_item_sk = wr.wr_item_sk, ws.ws_order_number = wr.wr_order_number
+|  other predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N row-size=56B cardinality=71.94K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.web_returns wr]
+|     HDFS partitions=1/1 files=1 size=5.66MB
+|     predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|     stored statistics:
+|       table: rows=71.76K size=5.66MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|     parquet statistics predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|     parquet dictionary predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=24B cardinality=7.18K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.web_sales ws]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   predicates: ws.ws_net_paid > CAST(0 AS DECIMAL(3,0)), ws.ws_net_profit > CAST(1 AS DECIMAL(3,0)), ws.ws_quantity > CAST(0 AS INT)
+   runtime filters: RF000[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   parquet statistics predicates: ws.ws_net_paid > CAST(0 AS DECIMAL(3,0)), ws.ws_net_profit > CAST(1 AS DECIMAL(3,0)), ws.ws_quantity > CAST(0 AS INT)
+   parquet dictionary predicates: ws.ws_net_paid > CAST(0 AS DECIMAL(3,0)), ws.ws_net_profit > CAST(1 AS DECIMAL(3,0)), ws.ws_quantity > CAST(0 AS INT)
+   mem-estimate=192.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=32B cardinality=71.94K
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=107.88MB Threads=22
+Per-Host Resource Estimates: Memory=1.05GB
+F15:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=24.61MB mem-reservation=15.94MB thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: channel, item, return_ratio, return_rank, currency_rank
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+35:TOP-N [LIMIT=100]
+|  order by: channel ASC, return_rank ASC, currency_rank ASC, item ASC
+|  mem-estimate=5.08KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=26 row-size=52B cardinality=100
+|  in pipelines: 35(GETNEXT), 34(OPEN)
+|
+34:AGGREGATE [FINALIZE]
+|  group by: channel, item, return_ratio, return_rank, currency_rank
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=24 row-size=52B cardinality=2.99K
+|  in pipelines: 34(GETNEXT), 09(OPEN), 20(OPEN), 31(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=52B cardinality=2.99K
+|  in pipelines: 09(GETNEXT), 20(GETNEXT), 31(GETNEXT)
+|
+|--33:SELECT
+|  |  predicates: (rank() <= CAST(10 AS BIGINT) OR rank() <= CAST(10 AS BIGINT))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=58,55 row-size=104B cardinality=1.71K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  32:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=58,55 row-size=104B cardinality=17.05K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  31:SORT
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(sr.sr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_net_paid, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=58 row-size=96B cardinality=17.05K
+|  |  in pipelines: 31(GETNEXT), 29(OPEN)
+|  |
+|  30:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=56,53 row-size=80B cardinality=17.05K
+|  |  in pipelines: 29(GETNEXT)
+|  |
+|  50:MERGING-EXCHANGE [UNPARTITIONED]
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  mem-estimate=627.73KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=56 row-size=72B cardinality=17.05K
+|  |  in pipelines: 29(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [HASH(sts.ss_item_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=7.94MB thread-reservation=1
+|  29:SORT
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(sr.sr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_quantity, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=56 row-size=72B cardinality=17.05K
+|  |  in pipelines: 29(GETNEXT), 49(OPEN)
+|  |
+|  49:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(coalesce(sr.sr_return_quantity, 0)), sum:merge(coalesce(sts.ss_quantity, 0)), sum:merge(coalesce(sr.sr_return_amt, 0)), sum:merge(coalesce(sts.ss_net_paid, 0))
+|  |  group by: sts.ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19 row-size=56B cardinality=17.05K
+|  |  in pipelines: 49(GETNEXT), 23(OPEN)
+|  |
+|  48:EXCHANGE [HASH(sts.ss_item_sk)]
+|  |  mem-estimate=490.90KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=56B cardinality=17.05K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=95.58MB mem-reservation=10.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  28:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(coalesce(sr.sr_return_quantity, CAST(0 AS INT)) AS BIGINT)), sum(CAST(coalesce(sts.ss_quantity, CAST(0 AS INT)) AS BIGINT)), sum(coalesce(sr.sr_return_amt, CAST(0 AS DECIMAL(7,2)))), sum(coalesce(sts.ss_net_paid, CAST(0 AS DECIMAL(7,2))))
+|  |  group by: sts.ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19 row-size=56B cardinality=17.05K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N,18 row-size=68B cardinality=17.05K
+|  |  in pipelines: 23(GETNEXT), 25(OPEN)
+|  |
+|  |--47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=12B cardinality=108
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=12B cardinality=108
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  26:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  |  hash predicates: sts.ss_item_sk = sr.sr_item_sk, sts.ss_ticket_number = sr.sr_ticket_number
+|  |  fk/pk conjuncts: sts.ss_item_sk = sr.sr_item_sk, sts.ss_ticket_number = sr.sr_ticket_number
+|  |  other predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N row-size=56B cardinality=288.04K
+|  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |
+|  |--46:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=701.85KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=17 row-size=24B cardinality=28.75K
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  24:SCAN HDFS [tpcds_parquet.store_returns sr, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     parquet statistics predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |     parquet dictionary predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=17 row-size=24B cardinality=28.75K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.store_sales sts, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: sts.ss_net_paid > CAST(0 AS DECIMAL(3,0)), sts.ss_net_profit > CAST(1 AS DECIMAL(3,0)), sts.ss_quantity > CAST(0 AS INT)
+|     runtime filters: RF004[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: sts.ss_net_paid > CAST(0 AS DECIMAL(3,0)), sts.ss_net_profit > CAST(1 AS DECIMAL(3,0)), sts.ss_quantity > CAST(0 AS INT)
+|     parquet dictionary predicates: sts.ss_net_paid > CAST(0 AS DECIMAL(3,0)), sts.ss_net_profit > CAST(1 AS DECIMAL(3,0)), sts.ss_quantity > CAST(0 AS INT)
+|     mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=16 row-size=32B cardinality=288.04K
+|     in pipelines: 23(GETNEXT)
+|
+|--22:SELECT
+|  |  predicates: (rank() <= CAST(10 AS BIGINT) OR rank() <= CAST(10 AS BIGINT))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=47,44 row-size=104B cardinality=853
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  21:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_amount, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=47,44 row-size=104B cardinality=8.53K
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  20:SORT
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_amount, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(cr.cr_return_amount, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_net_paid, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=47 row-size=96B cardinality=8.53K
+|  |  in pipelines: 20(GETNEXT), 18(OPEN)
+|  |
+|  19:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=45,42 row-size=80B cardinality=8.53K
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  45:MERGING-EXCHANGE [UNPARTITIONED]
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  mem-estimate=427.95KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=45 row-size=72B cardinality=8.53K
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [HASH(cs.cs_item_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=7.94MB thread-reservation=1
+|  18:SORT
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(cr.cr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_quantity, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=45 row-size=72B cardinality=8.53K
+|  |  in pipelines: 18(GETNEXT), 44(OPEN)
+|  |
+|  44:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(coalesce(cr.cr_return_quantity, 0)), sum:merge(coalesce(cs.cs_quantity, 0)), sum:merge(coalesce(cr.cr_return_amount, 0)), sum:merge(coalesce(cs.cs_net_paid, 0))
+|  |  group by: cs.cs_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11 row-size=56B cardinality=8.53K
+|  |  in pipelines: 44(GETNEXT), 12(OPEN)
+|  |
+|  43:EXCHANGE [HASH(cs.cs_item_sk)]
+|  |  mem-estimate=335.51KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=56B cardinality=8.53K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=303.25MB mem-reservation=22.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  17:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(coalesce(cr.cr_return_quantity, CAST(0 AS INT)) AS BIGINT)), sum(CAST(coalesce(cs.cs_quantity, CAST(0 AS INT)) AS BIGINT)), sum(coalesce(cr.cr_return_amount, CAST(0 AS DECIMAL(7,2)))), sum(coalesce(cs.cs_net_paid, CAST(0 AS DECIMAL(7,2))))
+|  |  group by: cs.cs_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11 row-size=56B cardinality=8.53K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N,10 row-size=68B cardinality=8.53K
+|  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |
+|  |--42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=12B cardinality=108
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=12B cardinality=108
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  15:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  |  hash predicates: cs.cs_item_sk = cr.cr_item_sk, cs.cs_order_number = cr.cr_order_number
+|  |  fk/pk conjuncts: cs.cs_item_sk = cr.cr_item_sk, cs.cs_order_number = cr.cr_order_number
+|  |  other predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N row-size=56B cardinality=144.16K
+|  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |
+|  |--41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=365.66KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=24B cardinality=14.41K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  13:SCAN HDFS [tpcds_parquet.catalog_returns cr, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     parquet statistics predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |     parquet dictionary predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=9 row-size=24B cardinality=14.41K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.catalog_sales cs, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     predicates: cs.cs_net_paid > CAST(0 AS DECIMAL(3,0)), cs.cs_net_profit > CAST(1 AS DECIMAL(3,0)), cs.cs_quantity > CAST(0 AS INT)
+|     runtime filters: RF002[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     parquet statistics predicates: cs.cs_net_paid > CAST(0 AS DECIMAL(3,0)), cs.cs_net_profit > CAST(1 AS DECIMAL(3,0)), cs.cs_quantity > CAST(0 AS INT)
+|     parquet dictionary predicates: cs.cs_net_paid > CAST(0 AS DECIMAL(3,0)), cs.cs_net_profit > CAST(1 AS DECIMAL(3,0)), cs.cs_quantity > CAST(0 AS INT)
+|     mem-estimate=288.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=8 row-size=32B cardinality=144.16K
+|     in pipelines: 12(GETNEXT)
+|
+11:SELECT
+|  predicates: (rank() <= CAST(10 AS BIGINT) OR rank() <= CAST(10 AS BIGINT))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=36,33 row-size=104B cardinality=429
+|  in pipelines: 09(GETNEXT)
+|
+10:ANALYTIC
+|  functions: rank()
+|  order by: (CAST(sum(coalesce(wr.wr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=36,33 row-size=104B cardinality=4.29K
+|  in pipelines: 09(GETNEXT)
+|
+09:SORT
+|  order by: (CAST(sum(coalesce(wr.wr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  materialized: (CAST(sum(coalesce(wr.wr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_net_paid, 0)) AS DECIMAL(15,4)))
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=36 row-size=96B cardinality=4.29K
+|  in pipelines: 09(GETNEXT), 07(OPEN)
+|
+08:ANALYTIC
+|  functions: rank()
+|  order by: (CAST(sum(coalesce(wr.wr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=34,31 row-size=80B cardinality=4.29K
+|  in pipelines: 07(GETNEXT)
+|
+40:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: (CAST(sum(coalesce(wr.wr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  mem-estimate=302.68KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=34 row-size=72B cardinality=4.29K
+|  in pipelines: 07(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ws.ws_item_sk)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=16.00MB mem-reservation=7.94MB thread-reservation=1
+07:SORT
+|  order by: (CAST(sum(coalesce(wr.wr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  materialized: (CAST(sum(coalesce(wr.wr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_quantity, 0)) AS DECIMAL(15,4)))
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=34 row-size=72B cardinality=4.29K
+|  in pipelines: 07(GETNEXT), 39(OPEN)
+|
+39:AGGREGATE [FINALIZE]
+|  output: sum:merge(coalesce(wr.wr_return_quantity, 0)), sum:merge(coalesce(ws.ws_quantity, 0)), sum:merge(coalesce(wr.wr_return_amt, 0)), sum:merge(coalesce(ws.ws_net_paid, 0))
+|  group by: ws.ws_item_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=56B cardinality=4.29K
+|  in pipelines: 39(GETNEXT), 01(OPEN)
+|
+38:EXCHANGE [HASH(ws.ws_item_sk)]
+|  mem-estimate=237.20KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=56B cardinality=4.29K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=207.08MB mem-reservation=22.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+06:AGGREGATE [STREAMING]
+|  output: sum(CAST(coalesce(wr.wr_return_quantity, CAST(0 AS INT)) AS BIGINT)), sum(CAST(coalesce(ws.ws_quantity, CAST(0 AS INT)) AS BIGINT)), sum(coalesce(wr.wr_return_amt, CAST(0 AS DECIMAL(7,2)))), sum(coalesce(ws.ws_net_paid, CAST(0 AS DECIMAL(7,2))))
+|  group by: ws.ws_item_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=56B cardinality=4.29K
+|  in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,2 row-size=68B cardinality=4.29K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+04:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash predicates: ws.ws_item_sk = wr.wr_item_sk, ws.ws_order_number = wr.wr_order_number
+|  fk/pk conjuncts: ws.ws_item_sk = wr.wr_item_sk, ws.ws_order_number = wr.wr_order_number
+|  other predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N row-size=56B cardinality=71.94K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=196.19KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=24B cardinality=7.18K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.web_returns wr, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.66MB
+|     predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|     stored statistics:
+|       table: rows=71.76K size=5.66MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|     parquet statistics predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|     parquet dictionary predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=24B cardinality=7.18K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.web_sales ws, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   predicates: ws.ws_net_paid > CAST(0 AS DECIMAL(3,0)), ws.ws_net_profit > CAST(1 AS DECIMAL(3,0)), ws.ws_quantity > CAST(0 AS INT)
+   runtime filters: RF000[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   parquet statistics predicates: ws.ws_net_paid > CAST(0 AS DECIMAL(3,0)), ws.ws_net_profit > CAST(1 AS DECIMAL(3,0)), ws.ws_quantity > CAST(0 AS INT)
+   parquet dictionary predicates: ws.ws_net_paid > CAST(0 AS DECIMAL(3,0)), ws.ws_net_profit > CAST(1 AS DECIMAL(3,0)), ws.ws_quantity > CAST(0 AS INT)
+   mem-estimate=192.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=32B cardinality=71.94K
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=136.44MB Threads=21
+Per-Host Resource Estimates: Memory=383MB
+F15:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=24.84MB mem-reservation=15.94MB thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: channel, item, return_ratio, return_rank, currency_rank
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+35:TOP-N [LIMIT=100]
+|  order by: channel ASC, return_rank ASC, currency_rank ASC, item ASC
+|  mem-estimate=5.08KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=26 row-size=52B cardinality=100
+|  in pipelines: 35(GETNEXT), 34(OPEN)
+|
+34:AGGREGATE [FINALIZE]
+|  group by: channel, item, return_ratio, return_rank, currency_rank
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=24 row-size=52B cardinality=2.99K
+|  in pipelines: 34(GETNEXT), 09(OPEN), 20(OPEN), 31(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=52B cardinality=2.99K
+|  in pipelines: 09(GETNEXT), 20(GETNEXT), 31(GETNEXT)
+|
+|--33:SELECT
+|  |  predicates: (rank() <= CAST(10 AS BIGINT) OR rank() <= CAST(10 AS BIGINT))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=58,55 row-size=104B cardinality=1.71K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  32:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=58,55 row-size=104B cardinality=17.05K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  31:SORT
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(sr.sr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_net_paid, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=58 row-size=96B cardinality=17.05K
+|  |  in pipelines: 31(GETNEXT), 29(OPEN)
+|  |
+|  30:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=56,53 row-size=80B cardinality=17.05K
+|  |  in pipelines: 29(GETNEXT)
+|  |
+|  50:MERGING-EXCHANGE [UNPARTITIONED]
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  mem-estimate=855.73KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=56 row-size=72B cardinality=17.05K
+|  |  in pipelines: 29(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [HASH(sts.ss_item_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=7.94MB thread-reservation=1
+|  29:SORT
+|  |  order by: (CAST(sum(coalesce(sr.sr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(sr.sr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(sts.ss_quantity, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=56 row-size=72B cardinality=17.05K
+|  |  in pipelines: 29(GETNEXT), 49(OPEN)
+|  |
+|  49:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(coalesce(sr.sr_return_quantity, 0)), sum:merge(coalesce(sts.ss_quantity, 0)), sum:merge(coalesce(sr.sr_return_amt, 0)), sum:merge(coalesce(sts.ss_net_paid, 0))
+|  |  group by: sts.ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19 row-size=56B cardinality=17.05K
+|  |  in pipelines: 49(GETNEXT), 23(OPEN)
+|  |
+|  48:EXCHANGE [HASH(sts.ss_item_sk)]
+|  |  mem-estimate=670.90KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=56B cardinality=17.05K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+|  28:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(coalesce(sr.sr_return_quantity, CAST(0 AS INT)) AS BIGINT)), sum(CAST(coalesce(sts.ss_quantity, CAST(0 AS INT)) AS BIGINT)), sum(coalesce(sr.sr_return_amt, CAST(0 AS DECIMAL(7,2)))), sum(coalesce(sts.ss_net_paid, CAST(0 AS DECIMAL(7,2))))
+|  |  group by: sts.ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19 row-size=56B cardinality=17.05K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N,18 row-size=68B cardinality=17.05K
+|  |  in pipelines: 23(GETNEXT), 25(OPEN)
+|  |
+|  |--F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=03
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=12B cardinality=108
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=18 row-size=12B cardinality=108
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  26:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: sts.ss_item_sk = sr.sr_item_sk, sts.ss_ticket_number = sr.sr_ticket_number
+|  |  fk/pk conjuncts: sts.ss_item_sk = sr.sr_item_sk, sts.ss_ticket_number = sr.sr_ticket_number
+|  |  other predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N row-size=56B cardinality=288.04K
+|  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |
+|  |--F21:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.56MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  build expressions: sr.sr_item_sk, sr.sr_ticket_number
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  46:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=701.85KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=17 row-size=24B cardinality=28.75K
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  24:SCAN HDFS [tpcds_parquet.store_returns sr, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     parquet statistics predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |     parquet dictionary predicates: sr.sr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  |     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=17 row-size=24B cardinality=28.75K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.store_sales sts, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     predicates: sts.ss_net_paid > CAST(0 AS DECIMAL(3,0)), sts.ss_net_profit > CAST(1 AS DECIMAL(3,0)), sts.ss_quantity > CAST(0 AS INT)
+|     runtime filters: RF004[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     parquet statistics predicates: sts.ss_net_paid > CAST(0 AS DECIMAL(3,0)), sts.ss_net_profit > CAST(1 AS DECIMAL(3,0)), sts.ss_quantity > CAST(0 AS INT)
+|     parquet dictionary predicates: sts.ss_net_paid > CAST(0 AS DECIMAL(3,0)), sts.ss_net_profit > CAST(1 AS DECIMAL(3,0)), sts.ss_quantity > CAST(0 AS INT)
+|     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=16 row-size=32B cardinality=288.04K
+|     in pipelines: 23(GETNEXT)
+|
+|--22:SELECT
+|  |  predicates: (rank() <= CAST(10 AS BIGINT) OR rank() <= CAST(10 AS BIGINT))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=47,44 row-size=104B cardinality=853
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  21:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_amount, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=47,44 row-size=104B cardinality=8.53K
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  20:SORT
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_amount, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(cr.cr_return_amount, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_net_paid, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=47 row-size=96B cardinality=8.53K
+|  |  in pipelines: 20(GETNEXT), 18(OPEN)
+|  |
+|  19:ANALYTIC
+|  |  functions: rank()
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=45,42 row-size=80B cardinality=8.53K
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  45:MERGING-EXCHANGE [UNPARTITIONED]
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  mem-estimate=427.95KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=45 row-size=72B cardinality=8.53K
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [HASH(cs.cs_item_sk)] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=7.94MB thread-reservation=1
+|  18:SORT
+|  |  order by: (CAST(sum(coalesce(cr.cr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  |  materialized: (CAST(sum(coalesce(cr.cr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(cs.cs_quantity, 0)) AS DECIMAL(15,4)))
+|  |  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=45 row-size=72B cardinality=8.53K
+|  |  in pipelines: 18(GETNEXT), 44(OPEN)
+|  |
+|  44:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(coalesce(cr.cr_return_quantity, 0)), sum:merge(coalesce(cs.cs_quantity, 0)), sum:merge(coalesce(cr.cr_return_amount, 0)), sum:merge(coalesce(cs.cs_net_paid, 0))
+|  |  group by: cs.cs_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11 row-size=56B cardinality=8.53K
+|  |  in pipelines: 44(GETNEXT), 12(OPEN)
+|  |
+|  43:EXCHANGE [HASH(cs.cs_item_sk)]
+|  |  mem-estimate=335.51KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=56B cardinality=8.53K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=18.00MB thread-reservation=1
+|  17:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(coalesce(cr.cr_return_quantity, CAST(0 AS INT)) AS BIGINT)), sum(CAST(coalesce(cs.cs_quantity, CAST(0 AS INT)) AS BIGINT)), sum(coalesce(cr.cr_return_amount, CAST(0 AS DECIMAL(7,2)))), sum(coalesce(cs.cs_net_paid, CAST(0 AS DECIMAL(7,2))))
+|  |  group by: cs.cs_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11 row-size=56B cardinality=8.53K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N,10 row-size=68B cardinality=8.53K
+|  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |
+|  |--F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=12B cardinality=108
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=10 row-size=12B cardinality=108
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  15:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: cs.cs_item_sk = cr.cr_item_sk, cs.cs_order_number = cr.cr_order_number
+|  |  fk/pk conjuncts: cs.cs_item_sk = cr.cr_item_sk, cs.cs_order_number = cr.cr_order_number
+|  |  other predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N row-size=56B cardinality=144.16K
+|  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |
+|  |--F19:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.23MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: cr.cr_item_sk, cr.cr_order_number
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=365.66KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=24B cardinality=14.41K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  13:SCAN HDFS [tpcds_parquet.catalog_returns cr, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     parquet statistics predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |     parquet dictionary predicates: cr.cr_return_amount > CAST(10000 AS DECIMAL(5,0))
+|  |     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=9 row-size=24B cardinality=14.41K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.catalog_sales cs, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     predicates: cs.cs_net_paid > CAST(0 AS DECIMAL(3,0)), cs.cs_net_profit > CAST(1 AS DECIMAL(3,0)), cs.cs_quantity > CAST(0 AS INT)
+|     runtime filters: RF002[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     parquet statistics predicates: cs.cs_net_paid > CAST(0 AS DECIMAL(3,0)), cs.cs_net_profit > CAST(1 AS DECIMAL(3,0)), cs.cs_quantity > CAST(0 AS INT)
+|     parquet dictionary predicates: cs.cs_net_paid > CAST(0 AS DECIMAL(3,0)), cs.cs_net_profit > CAST(1 AS DECIMAL(3,0)), cs.cs_quantity > CAST(0 AS INT)
+|     mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=8 row-size=32B cardinality=144.16K
+|     in pipelines: 12(GETNEXT)
+|
+11:SELECT
+|  predicates: (rank() <= CAST(10 AS BIGINT) OR rank() <= CAST(10 AS BIGINT))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=36,33 row-size=104B cardinality=429
+|  in pipelines: 09(GETNEXT)
+|
+10:ANALYTIC
+|  functions: rank()
+|  order by: (CAST(sum(coalesce(wr.wr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=36,33 row-size=104B cardinality=4.29K
+|  in pipelines: 09(GETNEXT)
+|
+09:SORT
+|  order by: (CAST(sum(coalesce(wr.wr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_net_paid, 0)) AS DECIMAL(15,4))) ASC
+|  materialized: (CAST(sum(coalesce(wr.wr_return_amt, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_net_paid, 0)) AS DECIMAL(15,4)))
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=36 row-size=96B cardinality=4.29K
+|  in pipelines: 09(GETNEXT), 07(OPEN)
+|
+08:ANALYTIC
+|  functions: rank()
+|  order by: (CAST(sum(coalesce(wr.wr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=34,31 row-size=80B cardinality=4.29K
+|  in pipelines: 07(GETNEXT)
+|
+40:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: (CAST(sum(coalesce(wr.wr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  mem-estimate=302.68KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=34 row-size=72B cardinality=4.29K
+|  in pipelines: 07(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ws.ws_item_sk)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=7.94MB thread-reservation=1
+07:SORT
+|  order by: (CAST(sum(coalesce(wr.wr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_quantity, 0)) AS DECIMAL(15,4))) ASC
+|  materialized: (CAST(sum(coalesce(wr.wr_return_quantity, 0)) AS DECIMAL(15,4)) / CAST(sum(coalesce(ws.ws_quantity, 0)) AS DECIMAL(15,4)))
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=34 row-size=72B cardinality=4.29K
+|  in pipelines: 07(GETNEXT), 39(OPEN)
+|
+39:AGGREGATE [FINALIZE]
+|  output: sum:merge(coalesce(wr.wr_return_quantity, 0)), sum:merge(coalesce(ws.ws_quantity, 0)), sum:merge(coalesce(wr.wr_return_amt, 0)), sum:merge(coalesce(ws.ws_net_paid, 0))
+|  group by: ws.ws_item_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=56B cardinality=4.29K
+|  in pipelines: 39(GETNEXT), 01(OPEN)
+|
+38:EXCHANGE [HASH(ws.ws_item_sk)]
+|  mem-estimate=237.20KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=56B cardinality=4.29K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+Per-Instance Resources: mem-estimate=42.00MB mem-reservation=18.00MB thread-reservation=1
+06:AGGREGATE [STREAMING]
+|  output: sum(CAST(coalesce(wr.wr_return_quantity, CAST(0 AS INT)) AS BIGINT)), sum(CAST(coalesce(ws.ws_quantity, CAST(0 AS INT)) AS BIGINT)), sum(coalesce(wr.wr_return_amt, CAST(0 AS DECIMAL(7,2)))), sum(coalesce(ws.ws_net_paid, CAST(0 AS DECIMAL(7,2))))
+|  group by: ws.ws_item_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=56B cardinality=4.29K
+|  in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,2 row-size=68B cardinality=4.29K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--F16:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+04:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ws.ws_item_sk = wr.wr_item_sk, ws.ws_order_number = wr.wr_order_number
+|  fk/pk conjuncts: ws.ws_item_sk = wr.wr_item_sk, ws.ws_order_number = wr.wr_order_number
+|  other predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N row-size=56B cardinality=71.94K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F17:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.07MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: wr.wr_item_sk, wr.wr_order_number
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=196.19KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=24B cardinality=7.18K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.web_returns wr, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.66MB
+|     predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|     stored statistics:
+|       table: rows=71.76K size=5.66MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|     parquet statistics predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|     parquet dictionary predicates: wr.wr_return_amt > CAST(10000 AS DECIMAL(5,0))
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=1 row-size=24B cardinality=7.18K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.web_sales ws, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   predicates: ws.ws_net_paid > CAST(0 AS DECIMAL(3,0)), ws.ws_net_profit > CAST(1 AS DECIMAL(3,0)), ws.ws_quantity > CAST(0 AS INT)
+   runtime filters: RF000[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   parquet statistics predicates: ws.ws_net_paid > CAST(0 AS DECIMAL(3,0)), ws.ws_net_profit > CAST(1 AS DECIMAL(3,0)), ws.ws_quantity > CAST(0 AS INT)
+   parquet dictionary predicates: ws.ws_net_paid > CAST(0 AS DECIMAL(3,0)), ws.ws_net_profit > CAST(1 AS DECIMAL(3,0)), ws.ws_quantity > CAST(0 AS INT)
+   mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+   tuple-ids=0 row-size=32B cardinality=71.94K
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q50.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q50.test
new file mode 100644
index 0000000..ace53f3
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q50.test
@@ -0,0 +1,533 @@
+# TPCDS-Q50
+SELECT s_store_name,
+       s_company_id,
+       s_street_number,
+       s_street_name,
+       s_street_type,
+       s_suite_number,
+       s_city,
+       s_county,
+       s_state,
+       s_zip,
+       sum(CASE
+               WHEN (sr_returned_date_sk - ss_sold_date_sk <= 30) THEN 1
+               ELSE 0
+           END) AS "30 days",
+       sum(CASE
+               WHEN (sr_returned_date_sk - ss_sold_date_sk > 30)
+                    AND (sr_returned_date_sk - ss_sold_date_sk <= 60) THEN 1
+               ELSE 0
+           END) AS "31-60 days",
+       sum(CASE
+               WHEN (sr_returned_date_sk - ss_sold_date_sk > 60)
+                    AND (sr_returned_date_sk - ss_sold_date_sk <= 90) THEN 1
+               ELSE 0
+           END) AS "61-90 days",
+       sum(CASE
+               WHEN (sr_returned_date_sk - ss_sold_date_sk > 90)
+                    AND (sr_returned_date_sk - ss_sold_date_sk <= 120) THEN 1
+               ELSE 0
+           END) AS "91-120 days",
+       sum(CASE
+               WHEN (sr_returned_date_sk - ss_sold_date_sk > 120) THEN 1
+               ELSE 0
+           END) AS ">120 days"
+FROM store_sales,
+     store_returns,
+     store,
+     date_dim d1,
+     date_dim d2
+WHERE d2.d_year = 2001
+  AND d2.d_moy = 8
+  AND ss_ticket_number = sr_ticket_number
+  AND ss_item_sk = sr_item_sk
+  AND ss_sold_date_sk = d1.d_date_sk
+  AND sr_returned_date_sk = d2.d_date_sk
+  AND ss_customer_sk = sr_customer_sk
+  AND ss_store_sk = s_store_sk
+GROUP BY s_store_name,
+         s_company_id,
+         s_street_number,
+         s_street_name,
+         s_street_type,
+         s_suite_number,
+         s_city,
+         s_county,
+         s_state,
+         s_zip
+ORDER BY s_store_name,
+         s_company_id,
+         s_street_number,
+         s_street_name,
+         s_street_type,
+         s_suite_number,
+         s_city,
+         s_county,
+         s_state,
+         s_zip
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=56.31MB Threads=6
+Per-Host Resource Estimates: Memory=372MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=372.31MB mem-reservation=56.31MB thread-reservation=6 runtime-filters-memory=6.00MB
+PLAN-ROOT SINK
+|  output exprs: s_store_name, s_company_id, s_street_number, s_street_name, s_street_type, s_suite_number, s_city, s_county, s_state, s_zip, sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 30) AND (sr_returned_date_sk - ss_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 60) AND (sr_returned_date_sk - ss_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 90) AND (sr_returned_date_sk - ss_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+10:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC, s_company_id ASC, s_street_number ASC, s_street_name ASC, s_street_type ASC, s_suite_number ASC, s_city ASC, s_county ASC, s_state ASC, s_zip ASC
+|  mem-estimate=20.43KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=209B cardinality=100
+|  in pipelines: 10(GETNEXT), 09(OPEN)
+|
+09:AGGREGATE [FINALIZE]
+|  output: sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(30 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(30 AS BIGINT)) AND (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(60 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(60 AS BIGINT)) AND (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(90 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(90 AS BIGINT)) AND (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  group by: s_store_name, s_company_id, s_street_number, s_street_name, s_street_type, s_suite_number, s_city, s_county, s_state, s_zip
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5 row-size=209B cardinality=114.80K
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  runtime filters: RF000[bloom] <- d1.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,4,2,3 row-size=241B cardinality=114.80K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim d1]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=4B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,4,2 row-size=237B cardinality=114.80K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=128.00MB mem-reservation=88.00KB thread-reservation=1
+|     tuple-ids=2 row-size=173B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  runtime filters: RF004[bloom] <- d2.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,4 row-size=64B cardinality=114.80K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.date_dim d2]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy = CAST(8 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy = CAST(8 AS INT)
+|     parquet dictionary predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy = CAST(8 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=12B cardinality=108
+|     in pipelines: 04(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk, RF008[bloom] <- sr_ticket_number
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=52B cardinality=2.12M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.store_returns]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF004[bloom] -> sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=24B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_store_sk, RF006[bloom] -> ss_customer_sk, RF007[bloom] -> ss_item_sk, RF008[bloom] -> ss_ticket_number
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=47.34MB Threads=12
+Per-Host Resource Estimates: Memory=416MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=69.29KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: s_store_name, s_company_id, s_street_number, s_street_name, s_street_type, s_suite_number, s_city, s_county, s_state, s_zip, sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 30) AND (sr_returned_date_sk - ss_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 60) AND (sr_returned_date_sk - ss_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 90) AND (sr_returned_date_sk - ss_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: s_store_name ASC, s_company_id ASC, s_street_number ASC, s_street_name ASC, s_street_type ASC, s_suite_number ASC, s_city ASC, s_county ASC, s_state ASC, s_zip ASC
+|  limit: 100
+|  mem-estimate=69.29KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=209B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=18.26MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC, s_company_id ASC, s_street_number ASC, s_street_name ASC, s_street_type ASC, s_suite_number ASC, s_city ASC, s_county ASC, s_state ASC, s_zip ASC
+|  mem-estimate=20.43KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=209B cardinality=100
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 30) AND (sr_returned_date_sk - ss_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 60) AND (sr_returned_date_sk - ss_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 90) AND (sr_returned_date_sk - ss_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  group by: s_store_name, s_company_id, s_street_number, s_street_name, s_street_type, s_suite_number, s_city, s_county, s_state, s_zip
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=209B cardinality=114.80K
+|  in pipelines: 16(GETNEXT), 00(OPEN)
+|
+15:EXCHANGE [HASH(s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip)]
+|  mem-estimate=8.26MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=209B cardinality=114.80K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=108.24MB mem-reservation=39.31MB thread-reservation=2 runtime-filters-memory=6.00MB
+09:AGGREGATE [STREAMING]
+|  output: sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(30 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(30 AS BIGINT)) AND (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(60 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(60 AS BIGINT)) AND (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(90 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(90 AS BIGINT)) AND (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  group by: s_store_name, s_company_id, s_street_number, s_street_name, s_street_type, s_suite_number, s_city, s_county, s_state, s_zip
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5 row-size=209B cardinality=114.80K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  runtime filters: RF000[bloom] <- d1.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,4,2,3 row-size=241B cardinality=114.80K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=293.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=4B cardinality=73.05K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=4B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,4,2 row-size=237B cardinality=114.80K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=173B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=128.00MB mem-reservation=88.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=128.00MB mem-reservation=88.00KB thread-reservation=1
+|     tuple-ids=2 row-size=173B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  runtime filters: RF004[bloom] <- d2.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,4 row-size=64B cardinality=114.80K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=12B cardinality=108
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy = CAST(8 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy = CAST(8 AS INT)
+|     parquet dictionary predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy = CAST(8 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=12B cardinality=108
+|     in pipelines: 04(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk, RF008[bloom] <- sr_ticket_number
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=52B cardinality=2.12M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=6.61MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=24B cardinality=287.51K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=97.00MB mem-reservation=5.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF004[bloom] -> sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=24B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_store_sk, RF006[bloom] -> ss_customer_sk, RF007[bloom] -> ss_item_sk, RF008[bloom] -> ss_ticket_number
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=71.59MB Threads=13
+Per-Host Resource Estimates: Memory=209MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=131.76KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: s_store_name, s_company_id, s_street_number, s_street_name, s_street_type, s_suite_number, s_city, s_county, s_state, s_zip, sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 30) AND (sr_returned_date_sk - ss_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 60) AND (sr_returned_date_sk - ss_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 90) AND (sr_returned_date_sk - ss_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: s_store_name ASC, s_company_id ASC, s_street_number ASC, s_street_name ASC, s_street_type ASC, s_suite_number ASC, s_city ASC, s_county ASC, s_state ASC, s_zip ASC
+|  limit: 100
+|  mem-estimate=131.76KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=209B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=18.89MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC, s_company_id ASC, s_street_number ASC, s_street_name ASC, s_street_type ASC, s_suite_number ASC, s_city ASC, s_county ASC, s_state ASC, s_zip ASC
+|  mem-estimate=20.43KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=209B cardinality=100
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 30) AND (sr_returned_date_sk - ss_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 60) AND (sr_returned_date_sk - ss_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 90) AND (sr_returned_date_sk - ss_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (sr_returned_date_sk - ss_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  group by: s_store_name, s_company_id, s_street_number, s_street_name, s_street_type, s_suite_number, s_city, s_county, s_state, s_zip
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=209B cardinality=114.80K
+|  in pipelines: 16(GETNEXT), 00(OPEN)
+|
+15:EXCHANGE [HASH(s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip)]
+|  mem-estimate=8.89MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=209B cardinality=114.80K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=11.00MB thread-reservation=1
+09:AGGREGATE [STREAMING]
+|  output: sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(30 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(30 AS BIGINT)) AND (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(60 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(60 AS BIGINT)) AND (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(90 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(90 AS BIGINT)) AND (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) <= CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(sr_returned_date_sk AS BIGINT) - CAST(ss_sold_date_sk AS BIGINT) > CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  group by: s_store_name, s_company_id, s_street_number, s_street_name, s_street_type, s_suite_number, s_city, s_county, s_state, s_zip
+|  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=5 row-size=209B cardinality=114.80K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,4,2,3 row-size=241B cardinality=114.80K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.16MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d1.d_date_sk
+|  |  runtime filters: RF000[bloom] <- d1.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=293.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=4B cardinality=73.05K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=4B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,4,2 row-size=237B cardinality=114.80K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF002[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=173B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=88.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=88.00KB thread-reservation=0
+|     tuple-ids=2 row-size=173B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: sr_returned_date_sk = d2.d_date_sk
+|  fk/pk conjuncts: sr_returned_date_sk = d2.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,4 row-size=64B cardinality=114.80K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: d2.d_date_sk
+|  |  runtime filters: RF004[bloom] <- d2.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=12B cardinality=108
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy = CAST(8 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy = CAST(8 AS INT)
+|     parquet dictionary predicates: d2.d_year = CAST(2001 AS INT), d2.d_moy = CAST(8 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=4 row-size=12B cardinality=108
+|     in pipelines: 04(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_customer_sk = sr_customer_sk, ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=52B cardinality=2.12M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=26.61MB mem-reservation=20.00MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: sr_customer_sk, sr_item_sk, sr_ticket_number
+|  |  runtime filters: RF006[bloom] <- sr_customer_sk, RF007[bloom] <- sr_item_sk, RF008[bloom] <- sr_ticket_number
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=6.61MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=24B cardinality=287.51K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF004[bloom] -> sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=1 row-size=24B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_store_sk, RF006[bloom] -> ss_customer_sk, RF007[bloom] -> ss_item_sk, RF008[bloom] -> ss_ticket_number
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q51.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q51.test
new file mode 100644
index 0000000..9f8595a
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q51.test
@@ -0,0 +1,690 @@
+# TPCDS-Q51
+WITH web_v1 AS
+  (SELECT ws_item_sk item_sk,
+          d_date,
+          sum(sum(ws_sales_price)) OVER (PARTITION BY ws_item_sk
+                                         ORDER BY d_date ROWS BETWEEN unbounded preceding AND CURRENT ROW) cume_sales
+   FROM web_sales,
+        date_dim
+   WHERE ws_sold_date_sk=d_date_sk
+     AND d_month_seq BETWEEN 1200 AND 1200+11
+     AND ws_item_sk IS NOT NULL
+   GROUP BY ws_item_sk,
+            d_date),
+     store_v1 AS
+  (SELECT ss_item_sk item_sk,
+          d_date,
+          sum(sum(ss_sales_price)) OVER (PARTITION BY ss_item_sk
+                                         ORDER BY d_date ROWS BETWEEN unbounded preceding AND CURRENT ROW) cume_sales
+   FROM store_sales,
+        date_dim
+   WHERE ss_sold_date_sk=d_date_sk
+     AND d_month_seq BETWEEN 1200 AND 1200+11
+     AND ss_item_sk IS NOT NULL
+   GROUP BY ss_item_sk,
+            d_date)
+SELECT *
+FROM
+  (SELECT item_sk,
+          d_date,
+          web_sales,
+          store_sales,
+          max(web_sales) OVER (PARTITION BY item_sk
+                               ORDER BY d_date ROWS BETWEEN unbounded preceding AND CURRENT ROW) web_cumulative,
+                              max(store_sales) OVER (PARTITION BY item_sk
+                                                     ORDER BY d_date ROWS BETWEEN unbounded preceding AND CURRENT ROW) store_cumulative
+   FROM
+     (SELECT CASE
+                 WHEN web.item_sk IS NOT NULL THEN web.item_sk
+                 ELSE store.item_sk
+             END item_sk,
+             CASE
+                 WHEN web.d_date IS NOT NULL THEN web.d_date
+                 ELSE store.d_date
+             END d_date,
+             web.cume_sales web_sales,
+             store.cume_sales store_sales
+      FROM web_v1 web
+      FULL OUTER JOIN store_v1 store ON (web.item_sk = store.item_sk
+                                         AND web.d_date = store.d_date))x)y
+WHERE web_cumulative > store_cumulative
+ORDER BY item_sk,
+         d_date
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=106.00MB Threads=5
+Per-Host Resource Estimates: Memory=333MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=332.87MB mem-reservation=106.00MB thread-reservation=5 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: item_sk, d_date, web_sales, store_sales, web_cumulative, store_cumulative
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+16:TOP-N [LIMIT=100]
+|  order by: item_sk ASC, d_date ASC
+|  mem-estimate=8.20KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=100
+|  in pipelines: 16(GETNEXT), 13(OPEN)
+|
+15:SELECT
+|  predicates: max(web_sales) > max(store_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=25,24 row-size=156B cardinality=359.98K
+|  in pipelines: 13(GETNEXT)
+|
+14:ANALYTIC
+|  functions: max(sum(sum(ws_sales_price))), max(sum(sum(ss_sales_price)))
+|  partition by: item_sk
+|  order by: CASE WHEN d_date IS NOT NULL THEN d_date ELSE d_date END ASC
+|  window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=25,24 row-size=156B cardinality=3.60M
+|  in pipelines: 13(GETNEXT)
+|
+13:SORT
+|  order by: CASE WHEN ws_item_sk IS NOT NULL THEN ws_item_sk ELSE ss_item_sk END ASC NULLS LAST, CASE WHEN d_date IS NOT NULL THEN d_date ELSE d_date END ASC
+|  mem-estimate=22.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=25 row-size=124B cardinality=3.60M
+|  in pipelines: 13(GETNEXT), 10(OPEN)
+|
+12:HASH JOIN [FULL OUTER JOIN]
+|  hash predicates: ss_item_sk = ws_item_sk, d_date = d_date
+|  fk/pk conjuncts: d_date = d_date
+|  mem-estimate=46.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=22N,21N,17N,16N row-size=124B cardinality=3.60M
+|  in pipelines: 10(GETNEXT), 04(OPEN)
+|
+|--05:ANALYTIC
+|  |  functions: sum(sum(ws_sales_price))
+|  |  partition by: ws_item_sk
+|  |  order by: d_date ASC
+|  |  window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17,16 row-size=62B cardinality=719.38K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  04:SORT
+|  |  order by: ws_item_sk ASC NULLS LAST, d_date ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17 row-size=46B cardinality=719.38K
+|  |  in pipelines: 04(GETNEXT), 03(OPEN)
+|  |
+|  03:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_sales_price)
+|  |  group by: ws_item_sk, d_date
+|  |  mem-estimate=34.71MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=2 row-size=46B cardinality=719.38K
+|  |  in pipelines: 03(GETNEXT), 00(OPEN)
+|  |
+|  02:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=46B cardinality=719.38K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--01:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=30B cardinality=7.30K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     predicates: ws_item_sk IS NOT NULL
+|     runtime filters: RF002[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     parquet dictionary predicates: ws_item_sk IS NOT NULL
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=0 row-size=16B cardinality=719.38K
+|     in pipelines: 00(GETNEXT)
+|
+11:ANALYTIC
+|  functions: sum(sum(ss_sales_price))
+|  partition by: ss_item_sk
+|  order by: d_date ASC
+|  window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=22,21 row-size=62B cardinality=2.88M
+|  in pipelines: 10(GETNEXT)
+|
+10:SORT
+|  order by: ss_item_sk ASC NULLS LAST, d_date ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=22 row-size=46B cardinality=2.88M
+|  in pipelines: 10(GETNEXT), 09(OPEN)
+|
+09:AGGREGATE [FINALIZE]
+|  output: sum(ss_sales_price)
+|  group by: ss_item_sk, d_date
+|  mem-estimate=139.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=46B cardinality=2.88M
+|  in pipelines: 09(GETNEXT), 06(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5,6 row-size=46B cardinality=2.88M
+|  in pipelines: 06(GETNEXT), 07(OPEN)
+|
+|--07:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=6 row-size=30B cardinality=7.30K
+|     in pipelines: 07(GETNEXT)
+|
+06:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_item_sk IS NOT NULL
+   runtime filters: RF000[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   parquet dictionary predicates: ss_item_sk IS NOT NULL
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=5 row-size=16B cardinality=2.88M
+   in pipelines: 06(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=232.88MB Threads=13
+Per-Host Resource Estimates: Memory=560MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=21.29KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: item_sk, d_date, web_sales, store_sales, web_cumulative, store_cumulative
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+26:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: item_sk ASC, d_date ASC
+|  limit: 100
+|  mem-estimate=21.29KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=100
+|  in pipelines: 16(GETNEXT)
+|
+F07:PLAN FRAGMENT [HASH(CASE WHEN ws_item_sk IS NOT NULL THEN ws_item_sk ELSE ss_item_sk END)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=36.27MB mem-reservation=16.00MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: item_sk ASC, d_date ASC
+|  mem-estimate=8.20KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=100
+|  in pipelines: 16(GETNEXT), 13(OPEN)
+|
+15:SELECT
+|  predicates: max(web_sales) > max(store_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=25,24 row-size=156B cardinality=359.98K
+|  in pipelines: 13(GETNEXT)
+|
+14:ANALYTIC
+|  functions: max(sum(sum(ws_sales_price))), max(sum(sum(ss_sales_price)))
+|  partition by: item_sk
+|  order by: CASE WHEN d_date IS NOT NULL THEN d_date ELSE d_date END ASC
+|  window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=25,24 row-size=156B cardinality=3.60M
+|  in pipelines: 13(GETNEXT)
+|
+13:SORT
+|  order by: CASE WHEN ws_item_sk IS NOT NULL THEN ws_item_sk ELSE ss_item_sk END ASC NULLS LAST, CASE WHEN d_date IS NOT NULL THEN d_date ELSE d_date END ASC
+|  mem-estimate=22.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=25 row-size=124B cardinality=3.60M
+|  in pipelines: 13(GETNEXT), 10(OPEN)
+|
+25:EXCHANGE [HASH(CASE WHEN ws_item_sk IS NOT NULL THEN ws_item_sk ELSE ss_item_sk END)]
+|  mem-estimate=10.27MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=22N,21N,17N,16N row-size=124B cardinality=3.60M
+|  in pipelines: 10(GETNEXT)
+|
+F06:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=54.34MB mem-reservation=34.00MB thread-reservation=1
+12:HASH JOIN [FULL OUTER JOIN, PARTITIONED]
+|  hash predicates: ss_item_sk = ws_item_sk, d_date = d_date
+|  fk/pk conjuncts: d_date = d_date
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=22N,21N,17N,16N row-size=124B cardinality=3.60M
+|  in pipelines: 10(GETNEXT), 04(OPEN)
+|
+|--24:EXCHANGE [HASH(ws_item_sk,d_date)]
+|  |  mem-estimate=10.14MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17,16 row-size=62B cardinality=719.38K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [HASH(ws_item_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=50.00MB mem-reservation=50.00MB thread-reservation=1
+|  05:ANALYTIC
+|  |  functions: sum(sum(ws_sales_price))
+|  |  partition by: ws_item_sk
+|  |  order by: d_date ASC
+|  |  window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17,16 row-size=62B cardinality=719.38K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  04:SORT
+|  |  order by: ws_item_sk ASC NULLS LAST, d_date ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17 row-size=46B cardinality=719.38K
+|  |  in pipelines: 04(GETNEXT), 22(OPEN)
+|  |
+|  22:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_sales_price)
+|  |  group by: ws_item_sk, d_date
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=2 row-size=46B cardinality=719.38K
+|  |  in pipelines: 22(GETNEXT), 00(OPEN)
+|  |
+|  21:EXCHANGE [HASH(ws_item_sk)]
+|  |  mem-estimate=10.10MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=46B cardinality=719.38K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=133.18MB mem-reservation=40.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  03:AGGREGATE [STREAMING]
+|  |  output: sum(ws_sales_price)
+|  |  group by: ws_item_sk, d_date
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=2 row-size=46B cardinality=719.38K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  02:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=46B cardinality=719.38K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=248.01KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=30B cardinality=7.30K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=30B cardinality=7.30K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     predicates: ws_item_sk IS NOT NULL
+|     runtime filters: RF002[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     parquet dictionary predicates: ws_item_sk IS NOT NULL
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=0 row-size=16B cardinality=719.38K
+|     in pipelines: 00(GETNEXT)
+|
+23:EXCHANGE [HASH(ss_item_sk,d_date)]
+|  mem-estimate=10.21MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=22,21 row-size=62B cardinality=2.88M
+|  in pipelines: 10(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=85.50MB mem-reservation=50.00MB thread-reservation=1
+11:ANALYTIC
+|  functions: sum(sum(ss_sales_price))
+|  partition by: ss_item_sk
+|  order by: d_date ASC
+|  window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=22,21 row-size=62B cardinality=2.88M
+|  in pipelines: 10(GETNEXT)
+|
+10:SORT
+|  order by: ss_item_sk ASC NULLS LAST, d_date ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=22 row-size=46B cardinality=2.88M
+|  in pipelines: 10(GETNEXT), 19(OPEN)
+|
+19:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: ss_item_sk, d_date
+|  mem-estimate=69.50MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=46B cardinality=2.88M
+|  in pipelines: 19(GETNEXT), 06(OPEN)
+|
+18:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=10.15MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=46B cardinality=2.88M
+|  in pipelines: 06(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=104.68MB mem-reservation=37.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+09:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: ss_item_sk, d_date
+|  mem-estimate=69.50MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=46B cardinality=2.88M
+|  in pipelines: 06(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5,6 row-size=46B cardinality=2.88M
+|  in pipelines: 06(GETNEXT), 07(OPEN)
+|
+|--17:EXCHANGE [BROADCAST]
+|  |  mem-estimate=248.01KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=30B cardinality=7.30K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  07:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=6 row-size=30B cardinality=7.30K
+|     in pipelines: 07(GETNEXT)
+|
+06:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_item_sk IS NOT NULL
+   runtime filters: RF000[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   parquet dictionary predicates: ss_item_sk IS NOT NULL
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=5 row-size=16B cardinality=2.88M
+   in pipelines: 06(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=323.75MB Threads=14
+Per-Host Resource Estimates: Memory=454MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=21.29KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: item_sk, d_date, web_sales, store_sales, web_cumulative, store_cumulative
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+26:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: item_sk ASC, d_date ASC
+|  limit: 100
+|  mem-estimate=21.29KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=100
+|  in pipelines: 16(GETNEXT)
+|
+F07:PLAN FRAGMENT [HASH(CASE WHEN ws_item_sk IS NOT NULL THEN ws_item_sk ELSE ss_item_sk END)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=36.27MB mem-reservation=16.00MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: item_sk ASC, d_date ASC
+|  mem-estimate=8.20KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=100
+|  in pipelines: 16(GETNEXT), 13(OPEN)
+|
+15:SELECT
+|  predicates: max(web_sales) > max(store_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=25,24 row-size=156B cardinality=359.98K
+|  in pipelines: 13(GETNEXT)
+|
+14:ANALYTIC
+|  functions: max(sum(sum(ws_sales_price))), max(sum(sum(ss_sales_price)))
+|  partition by: item_sk
+|  order by: CASE WHEN d_date IS NOT NULL THEN d_date ELSE d_date END ASC
+|  window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=25,24 row-size=156B cardinality=3.60M
+|  in pipelines: 13(GETNEXT)
+|
+13:SORT
+|  order by: CASE WHEN ws_item_sk IS NOT NULL THEN ws_item_sk ELSE ss_item_sk END ASC NULLS LAST, CASE WHEN d_date IS NOT NULL THEN d_date ELSE d_date END ASC
+|  mem-estimate=22.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=25 row-size=124B cardinality=3.60M
+|  in pipelines: 13(GETNEXT), 10(OPEN)
+|
+25:EXCHANGE [HASH(CASE WHEN ws_item_sk IS NOT NULL THEN ws_item_sk ELSE ss_item_sk END)]
+|  mem-estimate=10.27MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=22N,21N,17N,16N row-size=124B cardinality=3.60M
+|  in pipelines: 10(GETNEXT)
+|
+F06:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=10.41MB mem-reservation=0B thread-reservation=1
+12:HASH JOIN [FULL OUTER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: ss_item_sk = ws_item_sk, d_date = d_date
+|  fk/pk conjuncts: d_date = d_date
+|  mem-estimate=0B mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=22N,21N,17N,16N row-size=124B cardinality=3.60M
+|  in pipelines: 10(GETNEXT), 04(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=44.14MB mem-reservation=34.00MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: ws_item_sk, d_date
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |
+|  24:EXCHANGE [HASH(ws_item_sk,d_date)]
+|  |  mem-estimate=10.14MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17,16 row-size=62B cardinality=719.38K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [HASH(ws_item_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=50.00MB mem-reservation=50.00MB thread-reservation=1
+|  05:ANALYTIC
+|  |  functions: sum(sum(ws_sales_price))
+|  |  partition by: ws_item_sk
+|  |  order by: d_date ASC
+|  |  window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17,16 row-size=62B cardinality=719.38K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  04:SORT
+|  |  order by: ws_item_sk ASC NULLS LAST, d_date ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=17 row-size=46B cardinality=719.38K
+|  |  in pipelines: 04(GETNEXT), 22(OPEN)
+|  |
+|  22:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_sales_price)
+|  |  group by: ws_item_sk, d_date
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=2 row-size=46B cardinality=719.38K
+|  |  in pipelines: 22(GETNEXT), 00(OPEN)
+|  |
+|  21:EXCHANGE [HASH(ws_item_sk)]
+|  |  mem-estimate=10.10MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=46B cardinality=719.38K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=66.00MB mem-reservation=38.00MB thread-reservation=1
+|  03:AGGREGATE [STREAMING]
+|  |  output: sum(ws_sales_price)
+|  |  group by: ws_item_sk, d_date
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=2 row-size=46B cardinality=719.38K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  02:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=46B cardinality=719.38K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--F10:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=5.12MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=248.01KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=30B cardinality=7.30K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=1 row-size=30B cardinality=7.30K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     predicates: ws_item_sk IS NOT NULL
+|     runtime filters: RF002[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     parquet dictionary predicates: ws_item_sk IS NOT NULL
+|     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=0 row-size=16B cardinality=719.38K
+|     in pipelines: 00(GETNEXT)
+|
+23:EXCHANGE [HASH(ss_item_sk,d_date)]
+|  mem-estimate=10.41MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=22,21 row-size=62B cardinality=2.88M
+|  in pipelines: 10(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=50.75MB mem-reservation=50.00MB thread-reservation=1
+11:ANALYTIC
+|  functions: sum(sum(ss_sales_price))
+|  partition by: ss_item_sk
+|  order by: d_date ASC
+|  window: ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=22,21 row-size=62B cardinality=2.88M
+|  in pipelines: 10(GETNEXT)
+|
+10:SORT
+|  order by: ss_item_sk ASC NULLS LAST, d_date ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=22 row-size=46B cardinality=2.88M
+|  in pipelines: 10(GETNEXT), 19(OPEN)
+|
+19:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: ss_item_sk, d_date
+|  mem-estimate=34.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=46B cardinality=2.88M
+|  in pipelines: 19(GETNEXT), 06(OPEN)
+|
+18:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=10.29MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=46B cardinality=2.88M
+|  in pipelines: 06(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+Per-Instance Resources: mem-estimate=50.75MB mem-reservation=35.00MB thread-reservation=1
+09:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: ss_item_sk, d_date
+|  mem-estimate=34.75MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=46B cardinality=2.88M
+|  in pipelines: 06(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5,6 row-size=46B cardinality=2.88M
+|  in pipelines: 06(GETNEXT), 07(OPEN)
+|
+|--F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.12MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  17:EXCHANGE [BROADCAST]
+|  |  mem-estimate=248.01KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=30B cardinality=7.30K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  07:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=6 row-size=30B cardinality=7.30K
+|     in pipelines: 07(GETNEXT)
+|
+06:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_item_sk IS NOT NULL
+   runtime filters: RF000[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   parquet dictionary predicates: ss_item_sk IS NOT NULL
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=5 row-size=16B cardinality=2.88M
+   in pipelines: 06(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q52.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q52.test
new file mode 100644
index 0000000..2a1912e
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q52.test
@@ -0,0 +1,342 @@
+# TPCDS-Q52
+select
+  dt.d_year,
+  item.i_brand_id brand_id,
+  item.i_brand brand,
+  sum(ss_ext_sales_price) ext_price
+from
+  date_dim dt,
+  store_sales,
+  item
+where
+  dt.d_date_sk = store_sales.ss_sold_date_sk
+  and store_sales.ss_item_sk = item.i_item_sk
+  and item.i_manager_id = 1
+  and dt.d_moy = 12
+  and dt.d_year = 1998
+group by
+  dt.d_year,
+  item.i_brand,
+  item.i_brand_id
+order by
+  dt.d_year,
+  ext_price desc,
+  brand_id
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=8.81MB Threads=4
+Per-Host Resource Estimates: Memory=150MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=149.88MB mem-reservation=8.81MB thread-reservation=4 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: dt.d_year, item.i_brand_id, item.i_brand, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+06:TOP-N [LIMIT=100]
+|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
+|  mem-estimate=5.10KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=52B cardinality=100
+|  in pipelines: 06(GETNEXT), 05(OPEN)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_brand, item.i_brand_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=1.73K
+|  in pipelines: 05(GETNEXT), 01(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  runtime filters: RF000[bloom] <- dt.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=72B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.date_dim dt]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=0 row-size=12B cardinality=108
+|     in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
+|  fk/pk conjuncts: store_sales.ss_item_sk = item.i_item_sk
+|  runtime filters: RF002[bloom] <- item.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=60B cardinality=29.12K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: item.i_manager_id = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: item.i_manager_id = CAST(1 AS INT)
+|     parquet dictionary predicates: item.i_manager_id = CAST(1 AS INT)
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=44B cardinality=182
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> store_sales.ss_sold_date_sk, RF002[bloom] -> store_sales.ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=11.56MB Threads=8
+Per-Host Resource Estimates: Memory=170MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=18.16KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: dt.d_year, item.i_brand_id, item.i_brand, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
+|  limit: 100
+|  mem-estimate=18.16KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=52B cardinality=100
+|  in pipelines: 06(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(dt.d_year,item.i_brand,item.i_brand_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.19MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
+|  mem-estimate=5.10KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=52B cardinality=100
+|  in pipelines: 06(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_brand, item.i_brand_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=1.73K
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+09:EXCHANGE [HASH(dt.d_year,item.i_brand,item.i_brand_id)]
+|  mem-estimate=197.90KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=47.91MB mem-reservation=8.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_brand, item.i_brand_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  runtime filters: RF000[bloom] <- dt.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=72B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=12B cardinality=108
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.date_dim dt, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=0 row-size=12B cardinality=108
+|     in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
+|  fk/pk conjuncts: store_sales.ss_item_sk = item.i_item_sk
+|  runtime filters: RF002[bloom] <- item.i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=60B cardinality=29.12K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.42KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=44B cardinality=182
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: item.i_manager_id = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: item.i_manager_id = CAST(1 AS INT)
+|     parquet dictionary predicates: item.i_manager_id = CAST(1 AS INT)
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=44B cardinality=182
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> store_sales.ss_sold_date_sk, RF002[bloom] -> store_sales.ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=22.38MB Threads=9
+Per-Host Resource Estimates: Memory=117MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=34.63KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: dt.d_year, item.i_brand_id, item.i_brand, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
+|  limit: 100
+|  mem-estimate=34.63KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=52B cardinality=100
+|  in pipelines: 06(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(dt.d_year,item.i_brand,item.i_brand_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.36MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: dt.d_year ASC, sum(ss_ext_sales_price) DESC, item.i_brand_id ASC
+|  mem-estimate=5.10KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=52B cardinality=100
+|  in pipelines: 06(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_brand, item.i_brand_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=1.73K
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+09:EXCHANGE [HASH(dt.d_year,item.i_brand,item.i_brand_id)]
+|  mem-estimate=366.49KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: dt.d_year, item.i_brand, item.i_brand_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=52B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = dt.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=72B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: dt.d_date_sk
+|  |  runtime filters: RF000[bloom] <- dt.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=12B cardinality=108
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.date_dim dt, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: dt.d_year = CAST(1998 AS INT), dt.d_moy = CAST(12 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=0 row-size=12B cardinality=108
+|     in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: store_sales.ss_item_sk = item.i_item_sk
+|  fk/pk conjuncts: store_sales.ss_item_sk = item.i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=60B cardinality=29.12K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: item.i_item_sk
+|  |  runtime filters: RF002[bloom] <- item.i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.42KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=44B cardinality=182
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: item.i_manager_id = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: item.i_manager_id = CAST(1 AS INT)
+|     parquet dictionary predicates: item.i_manager_id = CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=2 row-size=44B cardinality=182
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> store_sales.ss_sold_date_sk, RF002[bloom] -> store_sales.ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q53.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q53.test
new file mode 100644
index 0000000..ce75dd6
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q53.test
@@ -0,0 +1,418 @@
+# TPCDS-Q53
+select
+  *
+from
+  (select
+    i_manufact_id,
+    sum(ss_sales_price) sum_sales
+  from
+    item,
+    store_sales,
+    date_dim,
+    store
+  where
+    ss_item_sk = i_item_sk
+    and ss_sold_date_sk = d_date_sk
+    and ss_store_sk = s_store_sk
+    and d_month_seq in (1212, 1212 + 1, 1212 + 2, 1212 + 3, 1212 + 4, 1212 + 5, 1212 + 6, 1212 + 7, 1212 + 8, 1212 + 9, 1212 + 10, 1212 + 11)
+    and ((i_category in ('Books', 'Children', 'Electronics')
+      and i_class in ('personal', 'portable', 'reference', 'self-help')
+      and i_brand in ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9'))
+    or (i_category in ('Women', 'Music', 'Men')
+      and i_class in ('accessories', 'classical', 'fragrances', 'pants')
+      and i_brand in ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
+  group by
+    i_manufact_id,
+    d_qoy
+  ) tmp1
+order by
+  sum_sales,
+  i_manufact_id
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=11.75MB Threads=5
+Per-Host Resource Estimates: Memory=201MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=200.81MB mem-reservation=11.75MB thread-reservation=5 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: i_manufact_id, sum_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+08:TOP-N [LIMIT=100]
+|  order by: sum_sales ASC, i_manufact_id ASC
+|  mem-estimate=1.88KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=20B cardinality=96
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+07:AGGREGATE [FINALIZE]
+|  output: sum(ss_sales_price)
+|  group by: i_manufact_id, d_qoy
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 07(GETNEXT), 01(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2,3 row-size=114B cardinality=96
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=4B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=110B cardinality=96
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     parquet dictionary predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=362
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF004[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=98B cardinality=481
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=0 row-size=78B cardinality=3
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=14.52MB Threads=10
+Per-Host Resource Estimates: Memory=221MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_manufact_id, sum_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum_sales ASC, i_manufact_id ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=20B cardinality=96
+|  in pipelines: 08(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_manufact_id,d_qoy)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: sum_sales ASC, i_manufact_id ASC
+|  mem-estimate=1.88KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=20B cardinality=96
+|  in pipelines: 08(GETNEXT), 13(OPEN)
+|
+13:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: i_manufact_id, d_qoy
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 13(GETNEXT), 01(OPEN)
+|
+12:EXCHANGE [HASH(i_manufact_id,d_qoy)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=66.86MB mem-reservation=11.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+07:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: i_manufact_id, d_qoy
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 01(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2,3 row-size=114B cardinality=96
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=4B cardinality=12
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=4B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=110B cardinality=96
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=362
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     parquet dictionary predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=362
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF004[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=98B cardinality=481
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=78B cardinality=3
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=80.00MB mem-reservation=256.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=0 row-size=78B cardinality=3
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=28.27MB Threads=11
+Per-Host Resource Estimates: Memory=138MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_manufact_id, sum_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum_sales ASC, i_manufact_id ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=20B cardinality=96
+|  in pipelines: 08(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_manufact_id,d_qoy)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: sum_sales ASC, i_manufact_id ASC
+|  mem-estimate=1.88KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=20B cardinality=96
+|  in pipelines: 08(GETNEXT), 13(OPEN)
+|
+13:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: i_manufact_id, d_qoy
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 13(GETNEXT), 01(OPEN)
+|
+12:EXCHANGE [HASH(i_manufact_id,d_qoy)]
+|  mem-estimate=16.50KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: i_manufact_id, d_qoy
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 01(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2,3 row-size=114B cardinality=96
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF000[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=4B cardinality=12
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=3 row-size=4B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=110B cardinality=96
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=362
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     parquet dictionary predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=12B cardinality=362
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=98B cardinality=481
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF004[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=78B cardinality=3
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'reference', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=0 row-size=78B cardinality=3
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=1 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q54.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q54.test
new file mode 100644
index 0000000..489d6da
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q54.test
@@ -0,0 +1,1257 @@
+# TPCDS-Q54
+WITH my_customers AS
+  (SELECT DISTINCT c_customer_sk,
+                   c_current_addr_sk
+   FROM
+     (SELECT cs_sold_date_sk sold_date_sk,
+             cs_bill_customer_sk customer_sk,
+             cs_item_sk item_sk
+      FROM catalog_sales
+      UNION ALL SELECT ws_sold_date_sk sold_date_sk,
+                       ws_bill_customer_sk customer_sk,
+                       ws_item_sk item_sk
+      FROM web_sales) cs_or_ws_sales,
+        item,
+        date_dim,
+        customer
+   WHERE sold_date_sk = d_date_sk
+     AND item_sk = i_item_sk
+     AND i_category = 'Women'
+     AND i_class = 'maternity'
+     AND c_customer_sk = cs_or_ws_sales.customer_sk
+     AND d_moy = 12
+     AND d_year = 1998 ),
+     my_revenue AS
+  (SELECT c_customer_sk,
+          sum(ss_ext_sales_price) AS revenue
+   FROM my_customers,
+        store_sales,
+        customer_address,
+        store,
+        date_dim
+   WHERE c_current_addr_sk = ca_address_sk
+     AND ca_county = s_county
+     AND ca_state = s_state
+     AND ss_sold_date_sk = d_date_sk
+     AND c_customer_sk = ss_customer_sk
+     AND d_month_seq BETWEEN
+       (SELECT DISTINCT d_month_seq+1
+        FROM date_dim
+        WHERE d_year = 1998
+          AND d_moy = 12) AND
+       (SELECT DISTINCT d_month_seq+3
+        FROM date_dim
+        WHERE d_year = 1998
+          AND d_moy = 12)
+   GROUP BY c_customer_sk),
+     segments AS
+  (SELECT cast((revenue/50) AS int) AS SEGMENT
+   FROM my_revenue)
+SELECT SEGMENT,
+       count(*) AS num_customers,
+       SEGMENT*50 AS segment_base
+FROM segments
+GROUP BY SEGMENT
+ORDER BY SEGMENT,
+         num_customers
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=91.02MB Threads=11
+Per-Host Resource Estimates: Memory=554MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=554.44MB mem-reservation=91.02MB thread-reservation=11 runtime-filters-memory=8.00MB
+PLAN-ROOT SINK
+|  output exprs: SEGMENT, count(*), CAST(SEGMENT AS BIGINT) * CAST(50 AS BIGINT)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+28:TOP-N [LIMIT=100]
+|  order by: SEGMENT ASC, count(*) ASC
+|  mem-estimate=1.17KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=23 row-size=12B cardinality=100
+|  in pipelines: 28(GETNEXT), 27(OPEN)
+|
+27:AGGREGATE [FINALIZE]
+|  output: count(*)
+|  group by: CAST((sum(ss_ext_sales_price) / CAST(50 AS DECIMAL(3,0))) AS INT)
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22 row-size=12B cardinality=18.94K
+|  in pipelines: 27(GETNEXT), 26(OPEN)
+|
+26:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: c_customer_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=19 row-size=20B cardinality=18.94K
+|  in pipelines: 26(GETNEXT), 10(OPEN)
+|
+25:NESTED LOOP JOIN [INNER JOIN]
+|  predicates: CAST(d_month_seq AS BIGINT) <= d_month_seq + 3
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9,7,10,11,12,14,17 row-size=131B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 19(OPEN)
+|
+|--19:CARDINALITY CHECK
+|  |  limit: 1
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=1
+|  |  in pipelines: 19(GETNEXT), 18(OPEN)
+|  |
+|  18:AGGREGATE [FINALIZE]
+|  |  group by: CAST(d_month_seq AS BIGINT) + CAST(3 AS BIGINT)
+|  |  limit: 2
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=2
+|  |  in pipelines: 18(GETNEXT), 17(OPEN)
+|  |
+|  17:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=16 row-size=12B cardinality=108
+|     in pipelines: 17(GETNEXT)
+|
+24:NESTED LOOP JOIN [INNER JOIN]
+|  predicates: CAST(d_month_seq AS BIGINT) >= d_month_seq + 1
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9,7,10,11,12,14 row-size=123B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+|--16:CARDINALITY CHECK
+|  |  limit: 1
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=1
+|  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |
+|  15:AGGREGATE [FINALIZE]
+|  |  group by: CAST(d_month_seq AS BIGINT) + CAST(1 AS BIGINT)
+|  |  limit: 2
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=2
+|  |  in pipelines: 15(GETNEXT), 14(OPEN)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=13 row-size=12B cardinality=108
+|     in pipelines: 14(GETNEXT)
+|
+23:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,7,10,11,12 row-size=115B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 13(OPEN)
+|
+|--13:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=12 row-size=8B cardinality=73.05K
+|     in pipelines: 13(GETNEXT)
+|
+22:HASH JOIN [INNER JOIN]
+|  hash predicates: ca_state = s_state, ca_county = s_county
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- s_state, RF003[bloom] <- s_county
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,7,10,11 row-size=107B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 12(OPEN)
+|
+|--12:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=11 row-size=43B cardinality=12
+|     in pipelines: 12(GETNEXT)
+|
+21:HASH JOIN [INNER JOIN]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF006[bloom] <- ca_address_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=9,7,10 row-size=64B cardinality=2.88M
+|  in pipelines: 10(GETNEXT), 11(OPEN)
+|
+|--11:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF002[bloom] -> ca_state, RF003[bloom] -> ca_county
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=10 row-size=44B cardinality=50.00K
+|     in pipelines: 11(GETNEXT)
+|
+20:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF008[bloom] <- c_customer_sk
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=9,7 row-size=20B cardinality=2.88M
+|  in pipelines: 10(GETNEXT), 09(OPEN)
+|
+|--09:AGGREGATE [FINALIZE]
+|  |  group by: c_customer_sk, c_current_addr_sk
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=7 row-size=8B cardinality=2.16M
+|  |  in pipelines: 09(GETNEXT), 01(OPEN), 02(OPEN)
+|  |
+|  08:HASH JOIN [INNER JOIN]
+|  |  hash predicates: customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF010[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,4,5,6 row-size=82B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT), 05(OPEN)
+|  |
+|  |--05:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF006[bloom] -> tpcds_parquet.customer.c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=8B cardinality=100.00K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN]
+|  |  hash predicates: sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,4,5 row-size=74B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT), 04(OPEN)
+|  |
+|  |--04:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=12B cardinality=108
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: item_sk = i_item_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,4 row-size=62B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Women', i_class = 'maternity'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Women', i_class = 'maternity'
+|  |     parquet dictionary predicates: i_category = 'Women', i_class = 'maternity'
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=46B cardinality=57
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:UNION
+|  |  pass-through-operands: all
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=16B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF010[bloom] -> tpcds_parquet.web_sales.ws_bill_customer_sk, RF012[bloom] -> tpcds_parquet.web_sales.ws_sold_date_sk, RF014[bloom] -> tpcds_parquet.web_sales.ws_item_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=16B cardinality=719.38K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF010[bloom] -> tpcds_parquet.catalog_sales.cs_bill_customer_sk, RF012[bloom] -> tpcds_parquet.catalog_sales.cs_sold_date_sk, RF014[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=0 row-size=16B cardinality=1.44M
+|     in pipelines: 01(GETNEXT)
+|
+10:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=9 row-size=12B cardinality=2.88M
+   in pipelines: 10(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=93.95MB Threads=30
+Per-Host Resource Estimates: Memory=688MB
+F21:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: SEGMENT, count(*), CAST(SEGMENT AS BIGINT) * CAST(50 AS BIGINT)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+52:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: SEGMENT ASC, count(*) ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=23 row-size=12B cardinality=100
+|  in pipelines: 28(GETNEXT)
+|
+F20:PLAN FRAGMENT [HASH(SEGMENT)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.12MB mem-reservation=1.94MB thread-reservation=1
+28:TOP-N [LIMIT=100]
+|  order by: SEGMENT ASC, count(*) ASC
+|  mem-estimate=1.17KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=23 row-size=12B cardinality=100
+|  in pipelines: 28(GETNEXT), 51(OPEN)
+|
+51:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: SEGMENT
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22 row-size=12B cardinality=18.94K
+|  in pipelines: 51(GETNEXT), 49(OPEN)
+|
+50:EXCHANGE [HASH(SEGMENT)]
+|  mem-estimate=121.98KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=22 row-size=12B cardinality=18.94K
+|  in pipelines: 49(GETNEXT)
+|
+F19:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=20.19MB mem-reservation=3.94MB thread-reservation=1
+27:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: CAST((sum(ss_ext_sales_price) / CAST(50 AS DECIMAL(3,0))) AS INT)
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22 row-size=12B cardinality=18.94K
+|  in pipelines: 49(GETNEXT)
+|
+49:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: c_customer_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=19 row-size=20B cardinality=18.94K
+|  in pipelines: 49(GETNEXT), 10(OPEN)
+|
+48:EXCHANGE [HASH(c_customer_sk)]
+|  mem-estimate=195.31KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=19 row-size=20B cardinality=18.94K
+|  in pipelines: 10(GETNEXT)
+|
+F12:PLAN FRAGMENT [HASH(ss_sold_date_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=14.54MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+26:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: c_customer_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=19 row-size=20B cardinality=18.94K
+|  in pipelines: 10(GETNEXT)
+|
+25:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  predicates: CAST(d_month_seq AS BIGINT) <= d_month_seq + 3
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9,7,10,11,12,14,17 row-size=131B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 19(OPEN)
+|
+|--47:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=1
+|  |  in pipelines: 19(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  19:CARDINALITY CHECK
+|  |  limit: 1
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=1
+|  |  in pipelines: 19(GETNEXT), 45(OPEN)
+|  |
+|  46:EXCHANGE [UNPARTITIONED]
+|  |  limit: 2
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=2
+|  |  in pipelines: 45(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [HASH(d_month_seq + 3)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  45:AGGREGATE [FINALIZE]
+|  |  group by: d_month_seq + 3
+|  |  limit: 2
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=2
+|  |  in pipelines: 45(GETNEXT), 17(OPEN)
+|  |
+|  44:EXCHANGE [HASH(d_month_seq + 3)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=108
+|  |  in pipelines: 17(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=58.00MB mem-reservation=2.25MB thread-reservation=2
+|  18:AGGREGATE [STREAMING]
+|  |  group by: CAST(d_month_seq AS BIGINT) + CAST(3 AS BIGINT)
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=108
+|  |  in pipelines: 17(GETNEXT)
+|  |
+|  17:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=16 row-size=12B cardinality=108
+|     in pipelines: 17(GETNEXT)
+|
+24:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  predicates: CAST(d_month_seq AS BIGINT) >= d_month_seq + 1
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9,7,10,11,12,14 row-size=123B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+|--43:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=1
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  16:CARDINALITY CHECK
+|  |  limit: 1
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=1
+|  |  in pipelines: 16(GETNEXT), 41(OPEN)
+|  |
+|  42:EXCHANGE [UNPARTITIONED]
+|  |  limit: 2
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=2
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(d_month_seq + 1)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  41:AGGREGATE [FINALIZE]
+|  |  group by: d_month_seq + 1
+|  |  limit: 2
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=2
+|  |  in pipelines: 41(GETNEXT), 14(OPEN)
+|  |
+|  40:EXCHANGE [HASH(d_month_seq + 1)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=108
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=58.00MB mem-reservation=2.25MB thread-reservation=2
+|  15:AGGREGATE [STREAMING]
+|  |  group by: CAST(d_month_seq AS BIGINT) + CAST(1 AS BIGINT)
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=108
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=13 row-size=12B cardinality=108
+|     in pipelines: 14(GETNEXT)
+|
+23:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,7,10,11,12 row-size=115B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 13(OPEN)
+|
+|--39:EXCHANGE [HASH(d_date_sk)]
+|  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=8B cardinality=73.05K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=12 row-size=8B cardinality=73.05K
+|     in pipelines: 13(GETNEXT)
+|
+38:EXCHANGE [HASH(ss_sold_date_sk)]
+|  mem-estimate=1.00MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9,7,10,11 row-size=107B cardinality=18.94K
+|  in pipelines: 10(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=36.92MB mem-reservation=19.19MB thread-reservation=1 runtime-filters-memory=4.00MB
+22:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ca_state = s_state, ca_county = s_county
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- s_state, RF003[bloom] <- s_county
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,7,10,11 row-size=107B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 12(OPEN)
+|
+|--37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=43B cardinality=12
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  12:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=11 row-size=43B cardinality=12
+|     in pipelines: 12(GETNEXT)
+|
+21:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF006[bloom] <- ca_address_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=9,7,10 row-size=64B cardinality=2.88M
+|  in pipelines: 10(GETNEXT), 11(OPEN)
+|
+|--36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.14MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=44B cardinality=50.00K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=50.00MB mem-reservation=2.50MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  11:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF002[bloom] -> ca_state, RF003[bloom] -> ca_county
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=10 row-size=44B cardinality=50.00K
+|     in pipelines: 11(GETNEXT)
+|
+20:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF008[bloom] <- c_customer_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=9,7 row-size=20B cardinality=2.88M
+|  in pipelines: 10(GETNEXT), 33(OPEN)
+|
+|--35:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=5.53MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=8B cardinality=2.16M
+|  |  in pipelines: 33(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(c_customer_sk,c_current_addr_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=22.53MB mem-reservation=17.00MB thread-reservation=1
+|  33:AGGREGATE [FINALIZE]
+|  |  group by: c_customer_sk, c_current_addr_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=7 row-size=8B cardinality=2.16M
+|  |  in pipelines: 33(GETNEXT), 01(OPEN), 02(OPEN)
+|  |
+|  32:EXCHANGE [HASH(c_customer_sk,c_current_addr_sk)]
+|  |  mem-estimate=5.53MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=8B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=170.62MB mem-reservation=29.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  09:AGGREGATE [STREAMING]
+|  |  group by: c_customer_sk, c_current_addr_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=7 row-size=8B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF010[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,4,5,6 row-size=82B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT), 05(OPEN)
+|  |
+|  |--31:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=8B cardinality=100.00K
+|  |  |  in pipelines: 05(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  05:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF006[bloom] -> tpcds_parquet.customer.c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=8B cardinality=100.00K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,4,5 row-size=74B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT), 04(OPEN)
+|  |
+|  |--30:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=12B cardinality=108
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=12B cardinality=108
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: item_sk = i_item_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,4 row-size=62B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT), 03(OPEN)
+|  |
+|  |--29:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=46B cardinality=57
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Women', i_class = 'maternity'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Women', i_class = 'maternity'
+|  |     parquet dictionary predicates: i_category = 'Women', i_class = 'maternity'
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=46B cardinality=57
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:UNION
+|  |  pass-through-operands: all
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=16B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF010[bloom] -> tpcds_parquet.web_sales.ws_bill_customer_sk, RF012[bloom] -> tpcds_parquet.web_sales.ws_sold_date_sk, RF014[bloom] -> tpcds_parquet.web_sales.ws_item_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=16B cardinality=719.38K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF010[bloom] -> tpcds_parquet.catalog_sales.cs_bill_customer_sk, RF012[bloom] -> tpcds_parquet.catalog_sales.cs_sold_date_sk, RF014[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=0 row-size=16B cardinality=1.44M
+|     in pipelines: 01(GETNEXT)
+|
+34:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=10.05MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=12B cardinality=2.88M
+|  in pipelines: 10(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=34.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+10:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=9 row-size=12B cardinality=2.88M
+   in pipelines: 10(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=123.27MB Threads=36
+Per-Host Resource Estimates: Memory=463MB
+F21:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: SEGMENT, count(*), CAST(SEGMENT AS BIGINT) * CAST(50 AS BIGINT)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+52:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: SEGMENT ASC, count(*) ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=23 row-size=12B cardinality=100
+|  in pipelines: 28(GETNEXT)
+|
+F20:PLAN FRAGMENT [HASH(SEGMENT)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.17MB mem-reservation=1.94MB thread-reservation=1
+28:TOP-N [LIMIT=100]
+|  order by: SEGMENT ASC, count(*) ASC
+|  mem-estimate=1.17KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=23 row-size=12B cardinality=100
+|  in pipelines: 28(GETNEXT), 51(OPEN)
+|
+51:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: SEGMENT
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22 row-size=12B cardinality=18.94K
+|  in pipelines: 51(GETNEXT), 49(OPEN)
+|
+50:EXCHANGE [HASH(SEGMENT)]
+|  mem-estimate=169.98KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=22 row-size=12B cardinality=18.94K
+|  in pipelines: 49(GETNEXT)
+|
+F19:PLAN FRAGMENT [HASH(c_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=20.26MB mem-reservation=3.94MB thread-reservation=1
+27:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: CAST((sum(ss_ext_sales_price) / CAST(50 AS DECIMAL(3,0))) AS INT)
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=22 row-size=12B cardinality=18.94K
+|  in pipelines: 49(GETNEXT)
+|
+49:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: c_customer_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=19 row-size=20B cardinality=18.94K
+|  in pipelines: 49(GETNEXT), 10(OPEN)
+|
+48:EXCHANGE [HASH(c_customer_sk)]
+|  mem-estimate=267.31KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=19 row-size=20B cardinality=18.94K
+|  in pipelines: 10(GETNEXT)
+|
+F12:PLAN FRAGMENT [HASH(ss_sold_date_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.36MB mem-reservation=2.00MB thread-reservation=1
+26:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: c_customer_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=19 row-size=20B cardinality=18.94K
+|  in pipelines: 10(GETNEXT)
+|
+25:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  join table id: 00
+|  predicates: CAST(d_month_seq AS BIGINT) <= d_month_seq + 3
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9,7,10,11,12,14,17 row-size=131B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 19(OPEN)
+|
+|--F22:PLAN FRAGMENT [HASH(ss_sold_date_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  47:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=1
+|  |  in pipelines: 19(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  19:CARDINALITY CHECK
+|  |  limit: 1
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=1
+|  |  in pipelines: 19(GETNEXT), 45(OPEN)
+|  |
+|  46:EXCHANGE [UNPARTITIONED]
+|  |  limit: 2
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=2
+|  |  in pipelines: 45(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [HASH(d_month_seq + 3)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  45:AGGREGATE [FINALIZE]
+|  |  group by: d_month_seq + 3
+|  |  limit: 2
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=2
+|  |  in pipelines: 45(GETNEXT), 17(OPEN)
+|  |
+|  44:EXCHANGE [HASH(d_month_seq + 3)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=108
+|  |  in pipelines: 17(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.25MB thread-reservation=1
+|  18:AGGREGATE [STREAMING]
+|  |  group by: CAST(d_month_seq AS BIGINT) + CAST(3 AS BIGINT)
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17 row-size=8B cardinality=108
+|  |  in pipelines: 17(GETNEXT)
+|  |
+|  17:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=16 row-size=12B cardinality=108
+|     in pipelines: 17(GETNEXT)
+|
+24:NESTED LOOP JOIN [INNER JOIN, BROADCAST]
+|  join table id: 01
+|  predicates: CAST(d_month_seq AS BIGINT) >= d_month_seq + 1
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9,7,10,11,12,14 row-size=123B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+|--F23:PLAN FRAGMENT [HASH(ss_sold_date_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  43:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=1
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  16:CARDINALITY CHECK
+|  |  limit: 1
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=1
+|  |  in pipelines: 16(GETNEXT), 41(OPEN)
+|  |
+|  42:EXCHANGE [UNPARTITIONED]
+|  |  limit: 2
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=2
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(d_month_seq + 1)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  41:AGGREGATE [FINALIZE]
+|  |  group by: d_month_seq + 1
+|  |  limit: 2
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=2
+|  |  in pipelines: 41(GETNEXT), 14(OPEN)
+|  |
+|  40:EXCHANGE [HASH(d_month_seq + 1)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=108
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.25MB thread-reservation=1
+|  15:AGGREGATE [STREAMING]
+|  |  group by: CAST(d_month_seq AS BIGINT) + CAST(1 AS BIGINT)
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=108
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=13 row-size=12B cardinality=108
+|     in pipelines: 14(GETNEXT)
+|
+23:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=02
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,7,10,11,12 row-size=115B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 13(OPEN)
+|
+|--F24:PLAN FRAGMENT [HASH(ss_sold_date_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=3.51MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  39:EXCHANGE [HASH(d_date_sk)]
+|  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=8B cardinality=73.05K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=12 row-size=8B cardinality=73.05K
+|     in pipelines: 13(GETNEXT)
+|
+38:EXCHANGE [HASH(ss_sold_date_sk)]
+|  mem-estimate=1.36MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9,7,10,11 row-size=107B cardinality=18.94K
+|  in pipelines: 10(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.09MB mem-reservation=0B thread-reservation=1
+22:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: ca_state = s_state, ca_county = s_county
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,7,10,11 row-size=107B cardinality=18.94K
+|  in pipelines: 10(GETNEXT), 12(OPEN)
+|
+|--F25:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.89MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: s_state, s_county
+|  |  runtime filters: RF002[bloom] <- s_state, RF003[bloom] <- s_county
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=43B cardinality=12
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  12:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=11 row-size=43B cardinality=12
+|     in pipelines: 12(GETNEXT)
+|
+21:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=9,7,10 row-size=64B cardinality=2.88M
+|  in pipelines: 10(GETNEXT), 11(OPEN)
+|
+|--F26:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=12.64MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: ca_address_sk
+|  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.14MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=44B cardinality=50.00K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  11:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF002[bloom] -> ca_state, RF003[bloom] -> ca_county
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=10 row-size=44B cardinality=50.00K
+|     in pipelines: 11(GETNEXT)
+|
+20:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=05
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=9,7 row-size=20B cardinality=2.88M
+|  in pipelines: 10(GETNEXT), 33(OPEN)
+|
+|--F27:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=11.28MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF008[bloom] <- c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  35:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=5.53MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=8B cardinality=2.16M
+|  |  in pipelines: 33(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(c_customer_sk,c_current_addr_sk)] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=22.53MB mem-reservation=17.00MB thread-reservation=1
+|  33:AGGREGATE [FINALIZE]
+|  |  group by: c_customer_sk, c_current_addr_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=7 row-size=8B cardinality=2.16M
+|  |  in pipelines: 33(GETNEXT), 01(OPEN), 02(OPEN)
+|  |
+|  32:EXCHANGE [HASH(c_customer_sk,c_current_addr_sk)]
+|  |  mem-estimate=5.53MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=8B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=65.00MB mem-reservation=21.00MB thread-reservation=1
+|  09:AGGREGATE [STREAMING]
+|  |  group by: c_customer_sk, c_current_addr_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=7 row-size=8B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,4,5,6 row-size=82B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT), 05(OPEN)
+|  |
+|  |--F28:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=5.65MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=02
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF010[bloom] <- c_customer_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  31:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=8B cardinality=100.00K
+|  |  |  in pipelines: 05(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  05:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF006[bloom] -> tpcds_parquet.customer.c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=6 row-size=8B cardinality=100.00K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=07
+|  |  hash predicates: sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,4,5 row-size=74B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT), 04(OPEN)
+|  |
+|  |--F29:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  30:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=12B cardinality=108
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(12 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=5 row-size=12B cardinality=108
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=08
+|  |  hash predicates: item_sk = i_item_sk
+|  |  fk/pk conjuncts: assumed fk/pk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,4 row-size=62B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT), 03(OPEN)
+|  |
+|  |--F30:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=08 plan-id=09 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  29:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=46B cardinality=57
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Women', i_class = 'maternity'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Women', i_class = 'maternity'
+|  |     parquet dictionary predicates: i_category = 'Women', i_class = 'maternity'
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=4 row-size=46B cardinality=57
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:UNION
+|  |  pass-through-operands: all
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=16B cardinality=2.16M
+|  |  in pipelines: 01(GETNEXT), 02(GETNEXT)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF010[bloom] -> tpcds_parquet.web_sales.ws_bill_customer_sk, RF012[bloom] -> tpcds_parquet.web_sales.ws_sold_date_sk, RF014[bloom] -> tpcds_parquet.web_sales.ws_item_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=1 row-size=16B cardinality=719.38K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF010[bloom] -> tpcds_parquet.catalog_sales.cs_bill_customer_sk, RF012[bloom] -> tpcds_parquet.catalog_sales.cs_sold_date_sk, RF014[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=0 row-size=16B cardinality=1.44M
+|     in pipelines: 01(GETNEXT)
+|
+34:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=10.09MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=12B cardinality=2.88M
+|  in pipelines: 10(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+10:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=9 row-size=12B cardinality=2.88M
+   in pipelines: 10(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q55.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q55.test
new file mode 100644
index 0000000..b349d0d
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q55.test
@@ -0,0 +1,339 @@
+# TPCDS-Q55
+select
+  i_brand_id brand_id,
+  i_brand brand,
+  sum(ss_ext_sales_price) ext_price
+from
+  date_dim,
+  store_sales,
+  item
+where
+  d_date_sk = ss_sold_date_sk
+  and ss_item_sk = i_item_sk
+  and i_manager_id = 36
+  and d_moy = 12
+  and d_year = 2001
+group by
+  i_brand,
+  i_brand_id
+order by
+  ext_price desc,
+  i_brand_id
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=8.81MB Threads=4
+Per-Host Resource Estimates: Memory=150MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=149.88MB mem-reservation=8.81MB thread-reservation=4 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: i_brand_id, i_brand, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+06:TOP-N [LIMIT=100]
+|  order by: sum(ss_ext_sales_price) DESC, i_brand_id ASC
+|  mem-estimate=4.71KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=48B cardinality=100
+|  in pipelines: 06(GETNEXT), 05(OPEN)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_brand, i_brand_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=48B cardinality=1.73K
+|  in pipelines: 05(GETNEXT), 01(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=72B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=0 row-size=12B cardinality=108
+|     in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=60B cardinality=29.12K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_manager_id = CAST(36 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_manager_id = CAST(36 AS INT)
+|     parquet dictionary predicates: i_manager_id = CAST(36 AS INT)
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=44B cardinality=182
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=11.56MB Threads=8
+Per-Host Resource Estimates: Memory=170MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.86KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_brand_id, i_brand, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(ss_ext_sales_price) DESC, i_brand_id ASC
+|  limit: 100
+|  mem-estimate=16.86KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=48B cardinality=100
+|  in pipelines: 06(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(i_brand,i_brand_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.18MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: sum(ss_ext_sales_price) DESC, i_brand_id ASC
+|  mem-estimate=4.71KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=48B cardinality=100
+|  in pipelines: 06(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_brand, i_brand_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=48B cardinality=1.73K
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+09:EXCHANGE [HASH(i_brand,i_brand_id)]
+|  mem-estimate=183.66KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=48B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=47.91MB mem-reservation=8.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_brand, i_brand_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=48B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=72B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=12B cardinality=108
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=0 row-size=12B cardinality=108
+|     in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=60B cardinality=29.12K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.42KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=44B cardinality=182
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_manager_id = CAST(36 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_manager_id = CAST(36 AS INT)
+|     parquet dictionary predicates: i_manager_id = CAST(36 AS INT)
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=44B cardinality=182
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=22.38MB Threads=9
+Per-Host Resource Estimates: Memory=116MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=32.15KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_brand_id, i_brand, sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(ss_ext_sales_price) DESC, i_brand_id ASC
+|  limit: 100
+|  mem-estimate=32.15KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=48B cardinality=100
+|  in pipelines: 06(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(i_brand,i_brand_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.33MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: sum(ss_ext_sales_price) DESC, i_brand_id ASC
+|  mem-estimate=4.71KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=48B cardinality=100
+|  in pipelines: 06(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_brand, i_brand_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=48B cardinality=1.73K
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+09:EXCHANGE [HASH(i_brand,i_brand_id)]
+|  mem-estimate=340.25KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=48B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_brand, i_brand_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=48B cardinality=1.73K
+|  in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,0 row-size=72B cardinality=1.73K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=12B cardinality=108
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(12 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=0 row-size=12B cardinality=108
+|     in pipelines: 00(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=60B cardinality=29.12K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.42KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=44B cardinality=182
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_manager_id = CAST(36 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_manager_id = CAST(36 AS INT)
+|     parquet dictionary predicates: i_manager_id = CAST(36 AS INT)
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=2 row-size=44B cardinality=182
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=1 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q56.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q56.test
new file mode 100644
index 0000000..f082ef4
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q56.test
@@ -0,0 +1,1484 @@
+# TPCDS-Q56
+WITH ss AS
+  (SELECT i_item_id,
+          sum(ss_ext_sales_price) total_sales
+   FROM store_sales,
+        date_dim,
+        customer_address,
+        item
+   WHERE i_item_id IN
+       (SELECT i_item_id
+        FROM item
+        WHERE i_color IN ('slate',
+                          'blanched',
+                          'burnished'))
+     AND ss_item_sk = i_item_sk
+     AND ss_sold_date_sk = d_date_sk
+     AND d_year = 2001
+     AND d_moy = 2
+     AND ss_addr_sk = ca_address_sk
+     AND ca_gmt_offset = -5
+   GROUP BY i_item_id),
+     cs AS
+  (SELECT i_item_id,
+          sum(cs_ext_sales_price) total_sales
+   FROM catalog_sales,
+        date_dim,
+        customer_address,
+        item
+   WHERE i_item_id IN
+       (SELECT i_item_id
+        FROM item
+        WHERE i_color IN ('slate',
+                          'blanched',
+                          'burnished'))
+     AND cs_item_sk = i_item_sk
+     AND cs_sold_date_sk = d_date_sk
+     AND d_year = 2001
+     AND d_moy = 2
+     AND cs_bill_addr_sk = ca_address_sk
+     AND ca_gmt_offset = -5
+   GROUP BY i_item_id),
+     ws AS
+  (SELECT i_item_id,
+          sum(ws_ext_sales_price) total_sales
+   FROM web_sales,
+        date_dim,
+        customer_address,
+        item
+   WHERE i_item_id IN
+       (SELECT i_item_id
+        FROM item
+        WHERE i_color IN ('slate',
+                          'blanched',
+                          'burnished'))
+     AND ws_item_sk = i_item_sk
+     AND ws_sold_date_sk = d_date_sk
+     AND d_year = 2001
+     AND d_moy = 2
+     AND ws_bill_addr_sk = ca_address_sk
+     AND ca_gmt_offset = -5
+   GROUP BY i_item_id)
+SELECT i_item_id,
+       sum(total_sales) total_sales
+FROM
+  (SELECT *
+   FROM ss
+   UNION ALL SELECT *
+   FROM cs
+   UNION ALL SELECT *
+   FROM ws) tmp1
+GROUP BY i_item_id
+ORDER BY total_sales,
+         i_item_id
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=28.44MB Threads=6
+Per-Host Resource Estimates: Memory=362MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=361.81MB mem-reservation=28.44MB thread-reservation=6 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_id, sum(total_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+32:TOP-N [LIMIT=100]
+|  order by: sum(total_sales) ASC, i_item_id ASC
+|  mem-estimate=4.30KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=44B cardinality=100
+|  in pipelines: 32(GETNEXT), 31(OPEN)
+|
+31:AGGREGATE [FINALIZE]
+|  output: sum(total_sales)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=44B cardinality=3.52K
+|  in pipelines: 31(GETNEXT), 10(OPEN), 20(OPEN), 30(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=44B cardinality=3.52K
+|  in pipelines: 10(GETNEXT), 20(GETNEXT), 30(GETNEXT)
+|
+|--30:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=44B cardinality=650
+|  |  in pipelines: 30(GETNEXT), 24(OPEN)
+|  |
+|  29:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: i_item_id = i_item_id
+|  |  runtime filters: RF016[bloom] <- i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19,16,17,18 row-size=76B cardinality=650
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--25:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     parquet dictionary predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=45B cardinality=587
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN]
+|  |  hash predicates: i_item_sk = ws_item_sk
+|  |  fk/pk conjuncts: i_item_sk = ws_item_sk
+|  |  runtime filters: RF018[bloom] <- ws_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19,16,17,18 row-size=76B cardinality=9.81K
+|  |  in pipelines: 24(GETNEXT), 21(OPEN)
+|  |
+|  |--27:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  |  runtime filters: RF020[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=16,17,18 row-size=40B cardinality=9.81K
+|  |  |  in pipelines: 21(GETNEXT), 23(OPEN)
+|  |  |
+|  |  |--23:SCAN HDFS [tpcds_parquet.customer_address]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=18 row-size=8B cardinality=8.33K
+|  |  |     in pipelines: 23(GETNEXT)
+|  |  |
+|  |  26:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF022[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=16,17 row-size=32B cardinality=42.85K
+|  |  |  in pipelines: 21(GETNEXT), 22(OPEN)
+|  |  |
+|  |  |--22:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=17 row-size=12B cardinality=108
+|  |  |     in pipelines: 22(GETNEXT)
+|  |  |
+|  |  21:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF022[bloom] -> ws_sold_date_sk, RF020[bloom] -> ws_bill_addr_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=16 row-size=20B cardinality=719.38K
+|  |     in pipelines: 21(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF016[bloom] -> i_item_id, RF018[bloom] -> i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=19 row-size=36B cardinality=18.00K
+|     in pipelines: 24(GETNEXT)
+|
+|--20:AGGREGATE [FINALIZE]
+|  |  output: sum(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=44B cardinality=982
+|  |  in pipelines: 20(GETNEXT), 14(OPEN)
+|  |
+|  19:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: i_item_id = i_item_id
+|  |  runtime filters: RF008[bloom] <- i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11,8,9,10 row-size=76B cardinality=982
+|  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |
+|  |--15:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     parquet dictionary predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=45B cardinality=587
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN]
+|  |  hash predicates: i_item_sk = cs_item_sk
+|  |  fk/pk conjuncts: i_item_sk = cs_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11,8,9,10 row-size=76B cardinality=14.81K
+|  |  in pipelines: 14(GETNEXT), 11(OPEN)
+|  |
+|  |--17:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_bill_addr_sk = ca_address_sk
+|  |  |  fk/pk conjuncts: cs_bill_addr_sk = ca_address_sk
+|  |  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9,10 row-size=40B cardinality=14.81K
+|  |  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |  |
+|  |  |--13:SCAN HDFS [tpcds_parquet.customer_address]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=10 row-size=8B cardinality=8.33K
+|  |  |     in pipelines: 13(GETNEXT)
+|  |  |
+|  |  16:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9 row-size=32B cardinality=85.31K
+|  |  |  in pipelines: 11(GETNEXT), 12(OPEN)
+|  |  |
+|  |  |--12:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=9 row-size=12B cardinality=108
+|  |  |     in pipelines: 12(GETNEXT)
+|  |  |
+|  |  11:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF014[bloom] -> cs_sold_date_sk, RF012[bloom] -> cs_bill_addr_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=8 row-size=20B cardinality=1.44M
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF008[bloom] -> i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=11 row-size=36B cardinality=18.00K
+|     in pipelines: 14(GETNEXT)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=44B cardinality=1.89K
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+09:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: i_item_id = i_item_id
+|  runtime filters: RF000[bloom] <- i_item_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=76B cardinality=1.89K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_color IN ('slate', 'blanched', 'burnished')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_color IN ('slate', 'blanched', 'burnished')
+|     parquet dictionary predicates: i_color IN ('slate', 'blanched', 'burnished')
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=4 row-size=45B cardinality=587
+|     in pipelines: 05(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=76B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=36B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  runtime filters: RF004[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=40B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=8.33K
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=32B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=108
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_addr_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=71.62MB Threads=36
+Per-Host Resource Estimates: Memory=901MB
+F23:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, sum(total_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+56:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(total_sales) ASC, i_item_id ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=44B cardinality=100
+|  in pipelines: 32(GETNEXT)
+|
+F22:PLAN FRAGMENT [HASH(i_item_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.19MB mem-reservation=1.94MB thread-reservation=1
+32:TOP-N [LIMIT=100]
+|  order by: sum(total_sales) ASC, i_item_id ASC
+|  mem-estimate=4.30KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=44B cardinality=100
+|  in pipelines: 32(GETNEXT), 55(OPEN)
+|
+55:AGGREGATE [FINALIZE]
+|  output: sum:merge(total_sales)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=44B cardinality=3.52K
+|  in pipelines: 55(GETNEXT), 39(OPEN), 46(OPEN), 53(OPEN)
+|
+54:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=194.45KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=26 row-size=44B cardinality=3.52K
+|  in pipelines: 39(GETNEXT), 46(GETNEXT), 53(GETNEXT)
+|
+F21:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=20.17MB mem-reservation=3.94MB thread-reservation=1
+31:AGGREGATE [STREAMING]
+|  output: sum(total_sales)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=44B cardinality=3.52K
+|  in pipelines: 39(GETNEXT), 46(GETNEXT), 53(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=44B cardinality=3.52K
+|  in pipelines: 39(GETNEXT), 46(GETNEXT), 53(GETNEXT)
+|
+|--53:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=44B cardinality=650
+|  |  in pipelines: 53(GETNEXT), 21(OPEN)
+|  |
+|  52:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=74.90KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=22 row-size=44B cardinality=650
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [HASH(ws_item_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=15.87MB mem-reservation=6.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  30:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=44B cardinality=650
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  29:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: i_item_id = i_item_id
+|  |  runtime filters: RF016[bloom] <- i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19 row-size=76B cardinality=650
+|  |  in pipelines: 21(GETNEXT), 25(OPEN)
+|  |
+|  |--51:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=54.33KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20 row-size=45B cardinality=587
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  25:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     parquet dictionary predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=45B cardinality=587
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19 row-size=76B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 24(OPEN)
+|  |
+|  |--50:EXCHANGE [HASH(i_item_sk)]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  24:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF016[bloom] -> i_item_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=36B cardinality=18.00K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  49:EXCHANGE [HASH(ws_item_sk)]
+|  |  mem-estimate=295.62KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=40B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=133.97MB mem-reservation=13.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF020[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=40B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 23(OPEN)
+|  |
+|  |--48:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  23:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=8B cardinality=8.33K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF022[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17 row-size=32B cardinality=42.85K
+|  |  in pipelines: 21(GETNEXT), 22(OPEN)
+|  |
+|  |--47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=17 row-size=12B cardinality=108
+|  |  |  in pipelines: 22(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  22:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=17 row-size=12B cardinality=108
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  21:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF022[bloom] -> ws_sold_date_sk, RF020[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=16 row-size=20B cardinality=719.38K
+|     in pipelines: 21(GETNEXT)
+|
+|--46:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=44B cardinality=982
+|  |  in pipelines: 46(GETNEXT), 11(OPEN)
+|  |
+|  45:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=152.16KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=44B cardinality=982
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=15.93MB mem-reservation=6.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  20:AGGREGATE [STREAMING]
+|  |  output: sum(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=44B cardinality=982
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  19:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: i_item_id = i_item_id
+|  |  runtime filters: RF008[bloom] <- i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11 row-size=76B cardinality=982
+|  |  in pipelines: 11(GETNEXT), 15(OPEN)
+|  |
+|  |--44:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=54.33KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=45B cardinality=587
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  15:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     parquet dictionary predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=45B cardinality=587
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11 row-size=76B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 14(OPEN)
+|  |
+|  |--43:EXCHANGE [HASH(i_item_sk)]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  14:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF008[bloom] -> i_item_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=36B cardinality=18.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  42:EXCHANGE [HASH(cs_item_sk)]
+|  |  mem-estimate=348.84KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=40B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=197.97MB mem-reservation=13.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  17:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: cs_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=40B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |
+|  |--41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  13:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=8B cardinality=8.33K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=32B cardinality=85.31K
+|  |  in pipelines: 11(GETNEXT), 12(OPEN)
+|  |
+|  |--40:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=12B cardinality=108
+|  |  |  in pipelines: 12(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  12:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=12B cardinality=108
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF014[bloom] -> cs_sold_date_sk, RF012[bloom] -> cs_bill_addr_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=8 row-size=20B cardinality=1.44M
+|     in pipelines: 11(GETNEXT)
+|
+39:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=44B cardinality=1.89K
+|  in pipelines: 39(GETNEXT), 01(OPEN)
+|
+38:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=171.07KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=44B cardinality=1.89K
+|  in pipelines: 01(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=17.10MB mem-reservation=7.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+10:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=44B cardinality=1.89K
+|  in pipelines: 01(GETNEXT)
+|
+09:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: i_item_id = i_item_id
+|  runtime filters: RF000[bloom] <- i_item_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=76B cardinality=1.89K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=54.33KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=45B cardinality=587
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_color IN ('slate', 'blanched', 'burnished')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_color IN ('slate', 'blanched', 'burnished')
+|     parquet dictionary predicates: i_color IN ('slate', 'blanched', 'burnished')
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=4 row-size=45B cardinality=587
+|     in pipelines: 05(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=76B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--36:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=36B cardinality=18.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  04:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=36B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+35:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=527.13KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,1,2 row-size=40B cardinality=28.50K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=54.97MB mem-reservation=8.88MB thread-reservation=2 runtime-filters-memory=3.00MB
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  runtime filters: RF004[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=40B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--34:EXCHANGE [BROADCAST]
+|  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=8.33K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=8.33K
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=32B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--33:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=108
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=108
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_addr_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=107.88MB Threads=38
+Per-Host Resource Estimates: Memory=474MB
+F23:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=29.56KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, sum(total_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+56:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(total_sales) ASC, i_item_id ASC
+|  limit: 100
+|  mem-estimate=29.56KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=44B cardinality=100
+|  in pipelines: 32(GETNEXT)
+|
+F22:PLAN FRAGMENT [HASH(i_item_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.33MB mem-reservation=1.94MB thread-reservation=1
+32:TOP-N [LIMIT=100]
+|  order by: sum(total_sales) ASC, i_item_id ASC
+|  mem-estimate=4.30KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=44B cardinality=100
+|  in pipelines: 32(GETNEXT), 55(OPEN)
+|
+55:AGGREGATE [FINALIZE]
+|  output: sum:merge(total_sales)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=44B cardinality=3.52K
+|  in pipelines: 55(GETNEXT), 39(OPEN), 46(OPEN), 53(OPEN)
+|
+54:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=338.45KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=26 row-size=44B cardinality=3.52K
+|  in pipelines: 39(GETNEXT), 46(GETNEXT), 53(GETNEXT)
+|
+F21:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=20.31MB mem-reservation=3.94MB thread-reservation=1
+31:AGGREGATE [STREAMING]
+|  output: sum(total_sales)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=44B cardinality=3.52K
+|  in pipelines: 39(GETNEXT), 46(GETNEXT), 53(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=44B cardinality=3.52K
+|  in pipelines: 39(GETNEXT), 46(GETNEXT), 53(GETNEXT)
+|
+|--53:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=44B cardinality=650
+|  |  in pipelines: 53(GETNEXT), 21(OPEN)
+|  |
+|  52:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=74.90KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=22 row-size=44B cardinality=650
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [HASH(ws_item_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=10.29MB mem-reservation=2.00MB thread-reservation=1
+|  30:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=44B cardinality=650
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  29:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=08
+|  |  hash predicates: i_item_id = i_item_id
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19 row-size=76B cardinality=650
+|  |  in pipelines: 21(GETNEXT), 25(OPEN)
+|  |
+|  |--F32:PLAN FRAGMENT [HASH(ws_item_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.93MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=08 plan-id=09 cohort-id=03
+|  |  |  build expressions: i_item_id
+|  |  |  runtime filters: RF016[bloom] <- i_item_id
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  51:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=54.33KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20 row-size=45B cardinality=587
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  25:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     parquet dictionary predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=20 row-size=45B cardinality=587
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=09
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19 row-size=76B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 24(OPEN)
+|  |
+|  |--F33:PLAN FRAGMENT [HASH(ws_item_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=2.59MB mem-reservation=1.94MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=09 plan-id=10 cohort-id=03
+|  |  |  build expressions: i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  50:EXCHANGE [HASH(i_item_sk)]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  24:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF016[bloom] -> i_item_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=19 row-size=36B cardinality=18.00K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  49:EXCHANGE [HASH(ws_item_sk)]
+|  |  mem-estimate=295.62KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=40B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=10
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=40B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 23(OPEN)
+|  |
+|  |--F34:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=10 plan-id=11 cohort-id=03
+|  |  |  build expressions: ca_address_sk
+|  |  |  runtime filters: RF020[bloom] <- ca_address_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  48:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  23:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=18 row-size=8B cardinality=8.33K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=11
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17 row-size=32B cardinality=42.85K
+|  |  in pipelines: 21(GETNEXT), 22(OPEN)
+|  |
+|  |--F35:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=11 plan-id=12 cohort-id=03
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF022[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=17 row-size=12B cardinality=108
+|  |  |  in pipelines: 22(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  22:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=17 row-size=12B cardinality=108
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  21:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF022[bloom] -> ws_sold_date_sk, RF020[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=16 row-size=20B cardinality=719.38K
+|     in pipelines: 21(GETNEXT)
+|
+|--46:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=44B cardinality=982
+|  |  in pipelines: 46(GETNEXT), 11(OPEN)
+|  |
+|  45:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=152.16KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=44B cardinality=982
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=10.34MB mem-reservation=2.00MB thread-reservation=1
+|  20:AGGREGATE [STREAMING]
+|  |  output: sum(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=44B cardinality=982
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  19:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: i_item_id = i_item_id
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11 row-size=76B cardinality=982
+|  |  in pipelines: 11(GETNEXT), 15(OPEN)
+|  |
+|  |--F28:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.93MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: i_item_id
+|  |  |  runtime filters: RF008[bloom] <- i_item_id
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  44:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=54.33KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=45B cardinality=587
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  15:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     parquet dictionary predicates: i_color IN ('slate', 'blanched', 'burnished')
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=12 row-size=45B cardinality=587
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=05
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11 row-size=76B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 14(OPEN)
+|  |
+|  |--F29:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=2.59MB mem-reservation=1.94MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  43:EXCHANGE [HASH(i_item_sk)]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  14:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF008[bloom] -> i_item_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=11 row-size=36B cardinality=18.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  42:EXCHANGE [HASH(cs_item_sk)]
+|  |  mem-estimate=348.84KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=40B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+|  17:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: cs_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: cs_bill_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=40B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |
+|  |--F30:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=02
+|  |  |  build expressions: ca_address_sk
+|  |  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  13:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=10 row-size=8B cardinality=8.33K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=07
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=32B cardinality=85.31K
+|  |  in pipelines: 11(GETNEXT), 12(OPEN)
+|  |
+|  |--F31:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  40:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=12B cardinality=108
+|  |  |  in pipelines: 12(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  12:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=9 row-size=12B cardinality=108
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF014[bloom] -> cs_sold_date_sk, RF012[bloom] -> cs_bill_addr_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=8 row-size=20B cardinality=1.44M
+|     in pipelines: 11(GETNEXT)
+|
+39:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=44B cardinality=1.89K
+|  in pipelines: 39(GETNEXT), 01(OPEN)
+|
+38:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=315.07KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=44B cardinality=1.89K
+|  in pipelines: 01(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.67MB mem-reservation=2.00MB thread-reservation=1
+10:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=44B cardinality=1.89K
+|  in pipelines: 01(GETNEXT)
+|
+09:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: i_item_id = i_item_id
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=76B cardinality=1.89K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--F24:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.93MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_id
+|  |  runtime filters: RF000[bloom] <- i_item_id
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=54.33KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=45B cardinality=587
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_color IN ('slate', 'blanched', 'burnished')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_color IN ('slate', 'blanched', 'burnished')
+|     parquet dictionary predicates: i_color IN ('slate', 'blanched', 'burnished')
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=4 row-size=45B cardinality=587
+|     in pipelines: 05(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=01
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=76B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--F25:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=3.59MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  36:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=36B cardinality=18.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=36B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+35:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=683.13KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,1,2 row-size=40B cardinality=28.50K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=40B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: ca_address_sk
+|  |  runtime filters: RF004[bloom] <- ca_address_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  34:EXCHANGE [BROADCAST]
+|  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=8.33K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=2 row-size=8B cardinality=8.33K
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=32B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F27:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  33:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=108
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy = CAST(2 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=1 row-size=12B cardinality=108
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_addr_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q57.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q57.test
new file mode 100644
index 0000000..209d745
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q57.test
@@ -0,0 +1,1361 @@
+# TPCDS-Q57
+WITH v1 AS
+  (SELECT i_category,
+          i_brand,
+          cc_name,
+          d_year,
+          d_moy,
+          sum(cs_sales_price) sum_sales,
+          avg(sum(cs_sales_price)) OVER (PARTITION BY i_category,
+                                                      i_brand,
+                                                      cc_name,
+                                                      d_year) avg_monthly_sales,
+                                        rank() OVER (PARTITION BY i_category,
+                                                                  i_brand,
+                                                                  cc_name
+                                                     ORDER BY d_year,
+                                                              d_moy) rn
+   FROM item,
+        catalog_sales,
+        date_dim,
+        call_center
+   WHERE cs_item_sk = i_item_sk
+     AND cs_sold_date_sk = d_date_sk
+     AND cc_call_center_sk= cs_call_center_sk
+     AND (d_year = 1999
+          OR (d_year = 1999-1
+              AND d_moy =12)
+          OR (d_year = 1999+1
+              AND d_moy =1))
+   GROUP BY i_category,
+            i_brand,
+            cc_name,
+            d_year,
+            d_moy),
+     v2 AS
+  (SELECT v1.i_category,
+          v1.i_brand,
+          v1.cc_name,
+          v1.d_year,
+          v1.d_moy,
+          v1.avg_monthly_sales,
+          v1.sum_sales,
+          v1_lag.sum_sales psum,
+          v1_lead.sum_sales nsum
+   FROM v1,
+        v1 v1_lag,
+        v1 v1_lead
+   WHERE v1.i_category = v1_lag.i_category
+     AND v1.i_category = v1_lead.i_category
+     AND v1.i_brand = v1_lag.i_brand
+     AND v1.i_brand = v1_lead.i_brand
+     AND v1. cc_name = v1_lag. cc_name
+     AND v1. cc_name = v1_lead. cc_name
+     AND v1.rn = v1_lag.rn + 1
+     AND v1.rn = v1_lead.rn - 1)
+SELECT *
+FROM v2
+WHERE d_year = 1999
+  AND avg_monthly_sales > 0
+  AND CASE
+          WHEN avg_monthly_sales > 0 THEN abs(sum_sales - avg_monthly_sales) / avg_monthly_sales
+          ELSE NULL
+      END > 0.1
+ORDER BY sum_sales - avg_monthly_sales
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=163.00MB Threads=13
+Per-Host Resource Estimates: Memory=1002MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=1002.44MB mem-reservation=163.00MB thread-reservation=13 runtime-filters-memory=9.00MB
+PLAN-ROOT SINK
+|  output exprs: i_category, i_brand, cc_name, d_year, d_moy, avg_monthly_sales, sum_sales, psum, nsum
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+35:TOP-N [LIMIT=100]
+|  order by: sum_sales - avg_monthly_sales ASC
+|  mem-estimate=13.86KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=142B cardinality=100
+|  in pipelines: 35(GETNEXT), 21(OPEN)
+|
+34:HASH JOIN [INNER JOIN]
+|  hash predicates: rank() = rank() - 1, i_category = i_category, cc_name = cc_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=36.65MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=44,43,36,31,52,51 row-size=322B cardinality=136.11M
+|  in pipelines: 21(GETNEXT), 31(OPEN)
+|
+|--32:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, cc_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=52,51 row-size=102B cardinality=342.81K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  31:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=52 row-size=94B cardinality=342.81K
+|  |  in pipelines: 31(GETNEXT), 30(OPEN)
+|  |
+|  30:AGGREGATE [FINALIZE]
+|  |  output: sum(cs_sales_price)
+|  |  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=94B cardinality=342.81K
+|  |  in pipelines: 30(GETNEXT), 24(OPEN)
+|  |
+|  29:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  |  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  |  runtime filters: RF012[bloom] <- cc_call_center_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16,19 row-size=114B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--26:SCAN HDFS [tpcds_parquet.call_center]
+|  |     HDFS partitions=1/1 files=1 size=10.28KB
+|  |     stored statistics:
+|  |       table: rows=6 size=10.28KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=6
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=28B cardinality=6
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16 row-size=86B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT), 23(OPEN)
+|  |
+|  |--23:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=16 row-size=54B cardinality=18.00K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18 row-size=32B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--25:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(1999 AS INT) OR (d_year = CAST(1998 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2000 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=12B cardinality=434
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF012[bloom] -> cs_call_center_sk, RF014[bloom] -> cs_item_sk, RF016[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=17 row-size=20B cardinality=1.44M
+|     in pipelines: 24(GETNEXT)
+|
+33:HASH JOIN [INNER JOIN]
+|  hash predicates: rank() + 1 = rank(), i_category = i_category, cc_name = cc_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=44,43,36,31 row-size=220B cardinality=274.35K
+|  in pipelines: 21(GETNEXT), 10(OPEN)
+|
+|--12:SELECT
+|  |  predicates: d_year = CAST(1999 AS INT), avg(sum(cs_sales_price)) > CAST(0 AS DECIMAL(3,0)), CASE WHEN avg(sum(cs_sales_price)) > CAST(0 AS DECIMAL(3,0)) THEN abs(sum(cs_sales_price) - avg(sum(cs_sales_price))) / avg(sum(cs_sales_price)) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=36,31 row-size=118B cardinality=553
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  11:ANALYTIC
+|  |  functions: avg(sum(cs_sales_price))
+|  |  partition by: i_category, i_brand, cc_name, d_year
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=36,31 row-size=118B cardinality=342.81K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  10:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC NULLS LAST
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=36 row-size=102B cardinality=342.81K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  09:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, cc_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34,33 row-size=102B cardinality=342.81K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  08:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34 row-size=94B cardinality=342.81K
+|  |  in pipelines: 08(GETNEXT), 07(OPEN)
+|  |
+|  07:AGGREGATE [FINALIZE]
+|  |  output: sum(cs_sales_price)
+|  |  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=4 row-size=94B cardinality=342.81K
+|  |  in pipelines: 07(GETNEXT), 01(OPEN)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  |  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  |  runtime filters: RF006[bloom] <- cc_call_center_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0,3 row-size=114B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.call_center]
+|  |     HDFS partitions=1/1 files=1 size=10.28KB
+|  |     stored statistics:
+|  |       table: rows=6 size=10.28KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=6
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=28B cardinality=6
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0 row-size=86B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |
+|  |--00:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=0 row-size=54B cardinality=18.00K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=32B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(1999 AS INT) OR (d_year = CAST(1998 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2000 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=12B cardinality=434
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF006[bloom] -> cs_call_center_sk, RF008[bloom] -> cs_item_sk, RF010[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=1.44M
+|     in pipelines: 01(GETNEXT)
+|
+22:ANALYTIC
+|  functions: rank()
+|  partition by: i_category, i_brand, cc_name
+|  order by: d_year ASC, d_moy ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=44,43 row-size=102B cardinality=342.81K
+|  in pipelines: 21(GETNEXT)
+|
+21:SORT
+|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=44 row-size=94B cardinality=342.81K
+|  in pipelines: 21(GETNEXT), 20(OPEN)
+|
+20:AGGREGATE [FINALIZE]
+|  output: sum(cs_sales_price)
+|  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=12 row-size=94B cardinality=342.81K
+|  in pipelines: 20(GETNEXT), 14(OPEN)
+|
+19:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  runtime filters: RF000[bloom] <- cc_call_center_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8,11 row-size=114B cardinality=342.81K
+|  in pipelines: 14(GETNEXT), 16(OPEN)
+|
+|--16:SCAN HDFS [tpcds_parquet.call_center]
+|     HDFS partitions=1/1 files=1 size=10.28KB
+|     stored statistics:
+|       table: rows=6 size=10.28KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=11 row-size=28B cardinality=6
+|     in pipelines: 16(GETNEXT)
+|
+18:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8 row-size=86B cardinality=342.81K
+|  in pipelines: 14(GETNEXT), 13(OPEN)
+|
+|--13:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=8 row-size=54B cardinality=18.00K
+|     in pipelines: 13(GETNEXT)
+|
+17:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=32B cardinality=342.81K
+|  in pipelines: 14(GETNEXT), 15(OPEN)
+|
+|--15:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: (d_year = CAST(1999 AS INT) OR (d_year = CAST(1998 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2000 AS INT) AND d_moy = CAST(1 AS INT)))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=10 row-size=12B cardinality=434
+|     in pipelines: 15(GETNEXT)
+|
+14:SCAN HDFS [tpcds_parquet.catalog_sales]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_call_center_sk, RF002[bloom] -> cs_item_sk, RF004[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=192.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=9 row-size=20B cardinality=1.44M
+   in pipelines: 14(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=213.67MB Threads=29
+Per-Host Resource Estimates: Memory=1.16GB
+F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=47.37KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_category, i_brand, cc_name, d_year, d_moy, avg_monthly_sales, sum_sales, psum, nsum
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+54:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum_sales - avg_monthly_sales ASC
+|  limit: 100
+|  mem-estimate=47.37KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=142B cardinality=100
+|  in pipelines: 35(GETNEXT)
+|
+F15:PLAN FRAGMENT [HASH(rank(),i_category,cc_name,i_brand)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=38.01MB mem-reservation=17.00MB thread-reservation=1
+35:TOP-N [LIMIT=100]
+|  order by: sum_sales - avg_monthly_sales ASC
+|  mem-estimate=13.86KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=142B cardinality=100
+|  in pipelines: 35(GETNEXT), 21(OPEN)
+|
+34:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: rank() = rank() - 1, i_category = i_category, cc_name = cc_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=44,43,36,31,52,51 row-size=322B cardinality=136.11M
+|  in pipelines: 21(GETNEXT), 31(OPEN)
+|
+|--53:EXCHANGE [HASH(rank() - 1,i_category,cc_name,i_brand)]
+|  |  mem-estimate=10.32MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=52,51 row-size=102B cardinality=342.81K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(i_category,i_brand,cc_name)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=33.00MB thread-reservation=1
+|  32:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, cc_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=52,51 row-size=102B cardinality=342.81K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  31:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=52 row-size=94B cardinality=342.81K
+|  |  in pipelines: 31(GETNEXT), 51(OPEN)
+|  |
+|  51:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_sales_price)
+|  |  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=94B cardinality=342.81K
+|  |  in pipelines: 51(GETNEXT), 24(OPEN)
+|  |
+|  50:EXCHANGE [HASH(i_category,i_brand,cc_name)]
+|  |  mem-estimate=10.29MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=94B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=218.83MB mem-reservation=29.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  30:AGGREGATE [STREAMING]
+|  |  output: sum(cs_sales_price)
+|  |  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=94B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  |  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  |  runtime filters: RF012[bloom] <- cc_call_center_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16,19 row-size=114B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--49:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=28B cardinality=6
+|  |  |  in pipelines: 26(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  26:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.28KB
+|  |     stored statistics:
+|  |       table: rows=6 size=10.28KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=6
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=28B cardinality=6
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16 row-size=86B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT), 23(OPEN)
+|  |
+|  |--48:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=16 row-size=54B cardinality=18.00K
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  23:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=16 row-size=54B cardinality=18.00K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18 row-size=32B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=12B cardinality=434
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(1999 AS INT) OR (d_year = CAST(1998 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2000 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=12B cardinality=434
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF012[bloom] -> cs_call_center_sk, RF014[bloom] -> cs_item_sk, RF016[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=17 row-size=20B cardinality=1.44M
+|     in pipelines: 24(GETNEXT)
+|
+52:EXCHANGE [HASH(rank(),i_category,cc_name,i_brand)]
+|  mem-estimate=10.69MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=44,43,36,31 row-size=220B cardinality=274.35K
+|  in pipelines: 21(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_category,i_brand,cc_name)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=35.20MB mem-reservation=34.94MB thread-reservation=1
+33:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: rank() + 1 = rank(), i_category = i_category, cc_name = cc_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=44,43,36,31 row-size=220B cardinality=274.35K
+|  in pipelines: 21(GETNEXT), 10(OPEN)
+|
+|--46:EXCHANGE [BROADCAST]
+|  |  mem-estimate=267.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=36,31 row-size=118B cardinality=553
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(i_category,i_brand,cc_name)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=37.00MB mem-reservation=37.00MB thread-reservation=1
+|  12:SELECT
+|  |  predicates: d_year = CAST(1999 AS INT), avg(sum(cs_sales_price)) > CAST(0 AS DECIMAL(3,0)), CASE WHEN avg(sum(cs_sales_price)) > CAST(0 AS DECIMAL(3,0)) THEN abs(sum(cs_sales_price) - avg(sum(cs_sales_price))) / avg(sum(cs_sales_price)) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=36,31 row-size=118B cardinality=553
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  11:ANALYTIC
+|  |  functions: avg(sum(cs_sales_price))
+|  |  partition by: i_category, i_brand, cc_name, d_year
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=36,31 row-size=118B cardinality=342.81K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  10:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC NULLS LAST
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=36 row-size=102B cardinality=342.81K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  09:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, cc_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34,33 row-size=102B cardinality=342.81K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  08:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34 row-size=94B cardinality=342.81K
+|  |  in pipelines: 08(GETNEXT), 45(OPEN)
+|  |
+|  45:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_sales_price)
+|  |  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=4 row-size=94B cardinality=342.81K
+|  |  in pipelines: 45(GETNEXT), 01(OPEN)
+|  |
+|  44:EXCHANGE [HASH(i_category,i_brand,cc_name)]
+|  |  mem-estimate=10.29MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=94B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=218.83MB mem-reservation=29.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  07:AGGREGATE [STREAMING]
+|  |  output: sum(cs_sales_price)
+|  |  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=4 row-size=94B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  |  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  |  runtime filters: RF006[bloom] <- cc_call_center_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0,3 row-size=114B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |
+|  |--43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=28B cardinality=6
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.28KB
+|  |     stored statistics:
+|  |       table: rows=6 size=10.28KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=6
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=28B cardinality=6
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0 row-size=86B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |
+|  |--42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=54B cardinality=18.00K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=0 row-size=54B cardinality=18.00K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=32B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=12B cardinality=434
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(1999 AS INT) OR (d_year = CAST(1998 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2000 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=12B cardinality=434
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF006[bloom] -> cs_call_center_sk, RF008[bloom] -> cs_item_sk, RF010[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=1.44M
+|     in pipelines: 01(GETNEXT)
+|
+22:ANALYTIC
+|  functions: rank()
+|  partition by: i_category, i_brand, cc_name
+|  order by: d_year ASC, d_moy ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=44,43 row-size=102B cardinality=342.81K
+|  in pipelines: 21(GETNEXT)
+|
+21:SORT
+|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=44 row-size=94B cardinality=342.81K
+|  in pipelines: 21(GETNEXT), 40(OPEN)
+|
+40:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_sales_price)
+|  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=12 row-size=94B cardinality=342.81K
+|  in pipelines: 40(GETNEXT), 14(OPEN)
+|
+39:EXCHANGE [HASH(i_category,i_brand,cc_name)]
+|  mem-estimate=10.29MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=94B cardinality=342.81K
+|  in pipelines: 14(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=218.83MB mem-reservation=29.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+20:AGGREGATE [STREAMING]
+|  output: sum(cs_sales_price)
+|  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=12 row-size=94B cardinality=342.81K
+|  in pipelines: 14(GETNEXT)
+|
+19:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  runtime filters: RF000[bloom] <- cc_call_center_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8,11 row-size=114B cardinality=342.81K
+|  in pipelines: 14(GETNEXT), 16(OPEN)
+|
+|--38:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=28B cardinality=6
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  16:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.28KB
+|     stored statistics:
+|       table: rows=6 size=10.28KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=11 row-size=28B cardinality=6
+|     in pipelines: 16(GETNEXT)
+|
+18:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8 row-size=86B cardinality=342.81K
+|  in pipelines: 14(GETNEXT), 13(OPEN)
+|
+|--37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=54B cardinality=18.00K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=2
+|  13:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=8 row-size=54B cardinality=18.00K
+|     in pipelines: 13(GETNEXT)
+|
+17:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=32B cardinality=342.81K
+|  in pipelines: 14(GETNEXT), 15(OPEN)
+|
+|--36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=434
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  15:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: (d_year = CAST(1999 AS INT) OR (d_year = CAST(1998 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2000 AS INT) AND d_moy = CAST(1 AS INT)))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=10 row-size=12B cardinality=434
+|     in pipelines: 15(GETNEXT)
+|
+14:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_call_center_sk, RF002[bloom] -> cs_item_sk, RF004[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=192.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=9 row-size=20B cardinality=1.44M
+   in pipelines: 14(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=242.05MB Threads=28
+Per-Host Resource Estimates: Memory=540MB
+F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=47.37KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_category, i_brand, cc_name, d_year, d_moy, avg_monthly_sales, sum_sales, psum, nsum
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+54:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum_sales - avg_monthly_sales ASC
+|  limit: 100
+|  mem-estimate=47.37KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=142B cardinality=100
+|  in pipelines: 35(GETNEXT)
+|
+F15:PLAN FRAGMENT [HASH(rank(),i_category,cc_name,i_brand)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=10.70MB mem-reservation=0B thread-reservation=1
+35:TOP-N [LIMIT=100]
+|  order by: sum_sales - avg_monthly_sales ASC
+|  mem-estimate=13.86KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=142B cardinality=100
+|  in pipelines: 35(GETNEXT), 21(OPEN)
+|
+34:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: rank() = rank() - 1, i_category = i_category, cc_name = cc_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=44,43,36,31,52,51 row-size=322B cardinality=136.11M
+|  in pipelines: 21(GETNEXT), 31(OPEN)
+|
+|--F17:PLAN FRAGMENT [HASH(rank(),i_category,cc_name,i_brand)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=27.32MB mem-reservation=17.00MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: rank() - 1, i_category, cc_name, i_brand
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |
+|  53:EXCHANGE [HASH(rank() - 1,i_category,cc_name,i_brand)]
+|  |  mem-estimate=10.32MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=52,51 row-size=102B cardinality=342.81K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(i_category,i_brand,cc_name)] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=33.00MB mem-reservation=33.00MB thread-reservation=1
+|  32:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, cc_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=52,51 row-size=102B cardinality=342.81K
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  31:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=52 row-size=94B cardinality=342.81K
+|  |  in pipelines: 31(GETNEXT), 51(OPEN)
+|  |
+|  51:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_sales_price)
+|  |  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=94B cardinality=342.81K
+|  |  in pipelines: 51(GETNEXT), 24(OPEN)
+|  |
+|  50:EXCHANGE [HASH(i_category,i_brand,cc_name)]
+|  |  mem-estimate=10.29MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=94B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=65.00MB mem-reservation=21.00MB thread-reservation=1
+|  30:AGGREGATE [STREAMING]
+|  |  output: sum(cs_sales_price)
+|  |  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=20 row-size=94B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  |  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16,19 row-size=114B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: cc_call_center_sk
+|  |  |  runtime filters: RF012[bloom] <- cc_call_center_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  49:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=28B cardinality=6
+|  |  |  in pipelines: 26(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  26:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.28KB
+|  |     stored statistics:
+|  |       table: rows=6 size=10.28KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=6
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=19 row-size=28B cardinality=6
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18,16 row-size=86B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT), 23(OPEN)
+|  |
+|  |--F19:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=5.86MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  48:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=16 row-size=54B cardinality=18.00K
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  23:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=16 row-size=54B cardinality=18.00K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=17,18 row-size=32B cardinality=342.81K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=12B cardinality=434
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(1999 AS INT) OR (d_year = CAST(1998 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2000 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=18 row-size=12B cardinality=434
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF012[bloom] -> cs_call_center_sk, RF014[bloom] -> cs_item_sk, RF016[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=17 row-size=20B cardinality=1.44M
+|     in pipelines: 24(GETNEXT)
+|
+52:EXCHANGE [HASH(rank(),i_category,cc_name,i_brand)]
+|  mem-estimate=10.69MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=44,43,36,31 row-size=220B cardinality=274.35K
+|  in pipelines: 21(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_category,i_brand,cc_name)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=33.00MB mem-reservation=33.00MB thread-reservation=1
+33:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: rank() + 1 = rank(), i_category = i_category, cc_name = cc_name, i_brand = i_brand
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=44,43,36,31 row-size=220B cardinality=274.35K
+|  in pipelines: 21(GETNEXT), 10(OPEN)
+|
+|--F21:PLAN FRAGMENT [HASH(i_category,i_brand,cc_name)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.14MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: rank(), i_category, cc_name, i_brand
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  46:EXCHANGE [BROADCAST]
+|  |  mem-estimate=267.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=36,31 row-size=118B cardinality=553
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(i_category,i_brand,cc_name)] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=37.00MB mem-reservation=37.00MB thread-reservation=1
+|  12:SELECT
+|  |  predicates: d_year = CAST(1999 AS INT), avg(sum(cs_sales_price)) > CAST(0 AS DECIMAL(3,0)), CASE WHEN avg(sum(cs_sales_price)) > CAST(0 AS DECIMAL(3,0)) THEN abs(sum(cs_sales_price) - avg(sum(cs_sales_price))) / avg(sum(cs_sales_price)) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=36,31 row-size=118B cardinality=553
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  11:ANALYTIC
+|  |  functions: avg(sum(cs_sales_price))
+|  |  partition by: i_category, i_brand, cc_name, d_year
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=36,31 row-size=118B cardinality=342.81K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  10:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC NULLS LAST
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=36 row-size=102B cardinality=342.81K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  09:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: i_category, i_brand, cc_name
+|  |  order by: d_year ASC, d_moy ASC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34,33 row-size=102B cardinality=342.81K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  08:SORT
+|  |  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34 row-size=94B cardinality=342.81K
+|  |  in pipelines: 08(GETNEXT), 45(OPEN)
+|  |
+|  45:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_sales_price)
+|  |  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=4 row-size=94B cardinality=342.81K
+|  |  in pipelines: 45(GETNEXT), 01(OPEN)
+|  |
+|  44:EXCHANGE [HASH(i_category,i_brand,cc_name)]
+|  |  mem-estimate=10.29MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=94B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=65.00MB mem-reservation=21.00MB thread-reservation=1
+|  07:AGGREGATE [STREAMING]
+|  |  output: sum(cs_sales_price)
+|  |  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=4 row-size=94B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  |  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0,3 row-size=114B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |
+|  |--F22:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  build expressions: cc_call_center_sk
+|  |  |  runtime filters: RF006[bloom] <- cc_call_center_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=28B cardinality=6
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.28KB
+|  |     stored statistics:
+|  |       table: rows=6 size=10.28KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=6
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=28B cardinality=6
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0 row-size=86B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |
+|  |--F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=5.86MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=03
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=54B cardinality=18.00K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=0 row-size=54B cardinality=18.00K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=07
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=32B cardinality=342.81K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--F24:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=03
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=12B cardinality=434
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: (d_year = CAST(1999 AS INT) OR (d_year = CAST(1998 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2000 AS INT) AND d_moy = CAST(1 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=2 row-size=12B cardinality=434
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF006[bloom] -> cs_call_center_sk, RF008[bloom] -> cs_item_sk, RF010[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=1 row-size=20B cardinality=1.44M
+|     in pipelines: 01(GETNEXT)
+|
+22:ANALYTIC
+|  functions: rank()
+|  partition by: i_category, i_brand, cc_name
+|  order by: d_year ASC, d_moy ASC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=44,43 row-size=102B cardinality=342.81K
+|  in pipelines: 21(GETNEXT)
+|
+21:SORT
+|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, cc_name ASC NULLS LAST, d_year ASC, d_moy ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=44 row-size=94B cardinality=342.81K
+|  in pipelines: 21(GETNEXT), 40(OPEN)
+|
+40:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_sales_price)
+|  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=12 row-size=94B cardinality=342.81K
+|  in pipelines: 40(GETNEXT), 14(OPEN)
+|
+39:EXCHANGE [HASH(i_category,i_brand,cc_name)]
+|  mem-estimate=10.29MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=94B cardinality=342.81K
+|  in pipelines: 14(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=65.00MB mem-reservation=21.00MB thread-reservation=1
+20:AGGREGATE [STREAMING]
+|  output: sum(cs_sales_price)
+|  group by: i_category, i_brand, cc_name, d_year, d_moy
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=12 row-size=94B cardinality=342.81K
+|  in pipelines: 14(GETNEXT)
+|
+19:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=08
+|  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8,11 row-size=114B cardinality=342.81K
+|  in pipelines: 14(GETNEXT), 16(OPEN)
+|
+|--F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=08 plan-id=09 cohort-id=01
+|  |  build expressions: cc_call_center_sk
+|  |  runtime filters: RF000[bloom] <- cc_call_center_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  38:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=28B cardinality=6
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  16:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.28KB
+|     stored statistics:
+|       table: rows=6 size=10.28KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=11 row-size=28B cardinality=6
+|     in pipelines: 16(GETNEXT)
+|
+18:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=09
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8 row-size=86B cardinality=342.81K
+|  in pipelines: 14(GETNEXT), 13(OPEN)
+|
+|--F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.86MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1008.92KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=54B cardinality=18.00K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  13:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=8 row-size=54B cardinality=18.00K
+|     in pipelines: 13(GETNEXT)
+|
+17:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=10
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=32B cardinality=342.81K
+|  in pipelines: 14(GETNEXT), 15(OPEN)
+|
+|--F27:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=434
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  15:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: (d_year = CAST(1999 AS INT) OR (d_year = CAST(1998 AS INT) AND d_moy = CAST(12 AS INT)) OR (d_year = CAST(2000 AS INT) AND d_moy = CAST(1 AS INT)))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=10 row-size=12B cardinality=434
+|     in pipelines: 15(GETNEXT)
+|
+14:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_call_center_sk, RF002[bloom] -> cs_item_sk, RF004[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=9 row-size=20B cardinality=1.44M
+   in pipelines: 14(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q58.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q58.test
new file mode 100644
index 0000000..516a58f
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q58.test
@@ -0,0 +1,1498 @@
+# TPCDS-Q58
+WITH ss_items AS
+  (SELECT i_item_id item_id,
+          sum(ss_ext_sales_price) ss_item_rev
+   FROM store_sales,
+        item,
+        date_dim
+   WHERE ss_item_sk = i_item_sk
+     AND d_date IN
+       (SELECT d_date
+        FROM date_dim
+        WHERE d_week_seq =
+            (SELECT d_week_seq
+             FROM date_dim
+             WHERE d_date = '2000-01-03'))
+     AND ss_sold_date_sk = d_date_sk
+   GROUP BY i_item_id),
+     cs_items AS
+  (SELECT i_item_id item_id,
+          sum(cs_ext_sales_price) cs_item_rev
+   FROM catalog_sales,
+        item,
+        date_dim
+   WHERE cs_item_sk = i_item_sk
+     AND d_date IN
+       (SELECT d_date
+        FROM date_dim
+        WHERE d_week_seq =
+            (SELECT d_week_seq
+             FROM date_dim
+             WHERE d_date = '2000-01-03'))
+     AND cs_sold_date_sk = d_date_sk
+   GROUP BY i_item_id),
+     ws_items AS
+  (SELECT i_item_id item_id,
+          sum(ws_ext_sales_price) ws_item_rev
+   FROM web_sales,
+        item,
+        date_dim
+   WHERE ws_item_sk = i_item_sk
+     AND d_date IN
+       (SELECT d_date
+        FROM date_dim
+        WHERE d_week_seq =
+            (SELECT d_week_seq
+             FROM date_dim
+             WHERE d_date = '2000-01-03'))
+     AND ws_sold_date_sk = d_date_sk
+   GROUP BY i_item_id)
+SELECT ss_items.item_id,
+       ss_item_rev,
+       ss_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 ss_dev,
+       cs_item_rev,
+       cs_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 cs_dev,
+       ws_item_rev,
+       ws_item_rev/((ss_item_rev+cs_item_rev+ws_item_rev)/3) * 100 ws_dev,
+       (ss_item_rev+cs_item_rev+ws_item_rev)/3 average
+FROM ss_items,
+     cs_items,
+     ws_items
+WHERE ss_items.item_id=cs_items.item_id
+  AND ss_items.item_id=ws_items.item_id
+  AND ss_item_rev BETWEEN 0.9 * cs_item_rev AND 1.1 * cs_item_rev
+  AND ss_item_rev BETWEEN 0.9 * ws_item_rev AND 1.1 * ws_item_rev
+  AND cs_item_rev BETWEEN 0.9 * ss_item_rev AND 1.1 * ss_item_rev
+  AND cs_item_rev BETWEEN 0.9 * ws_item_rev AND 1.1 * ws_item_rev
+  AND ws_item_rev BETWEEN 0.9 * ss_item_rev AND 1.1 * ss_item_rev
+  AND ws_item_rev BETWEEN 0.9 * cs_item_rev AND 1.1 * cs_item_rev
+ORDER BY ss_items.item_id,
+         ss_item_rev
+LIMIT 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=60.56MB Threads=16
+Per-Host Resource Estimates: Memory=680MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=680.44MB mem-reservation=60.56MB thread-reservation=16 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: item_id, ss_item_rev, ss_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), cs_item_rev, cs_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), ws_item_rev, ws_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), (ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+35:TOP-N [LIMIT=100]
+|  order by: item_id ASC, ss_item_rev ASC
+|  mem-estimate=7.42KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=76B cardinality=100
+|  in pipelines: 35(GETNEXT), 10(OPEN)
+|
+34:HASH JOIN [INNER JOIN]
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  other predicates: sum(cs_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ss_ext_sales_price), sum(cs_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ws_ext_sales_price), sum(cs_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ss_ext_sales_price), sum(cs_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ws_ext_sales_price), sum(ss_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(cs_ext_sales_price), sum(ss_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(cs_ext_sales_price), sum(ws_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(cs_ext_sales_price), sum(ws_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(cs_ext_sales_price)
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25,16 row-size=132B cardinality=281
+|  in pipelines: 10(GETNEXT), 21(OPEN)
+|
+|--21:AGGREGATE [FINALIZE]
+|  |  output: sum(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=44B cardinality=138
+|  |  in pipelines: 21(GETNEXT), 11(OPEN)
+|  |
+|  20:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: d_date = d_date
+|  |  runtime filters: RF020[bloom] <- d_date
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=138
+|  |  in pipelines: 11(GETNEXT), 14(OPEN)
+|  |
+|  |--17:HASH JOIN [LEFT SEMI JOIN]
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  runtime filters: RF026[bloom] <- d_week_seq
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12 row-size=26B cardinality=7
+|  |  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |  |
+|  |  |--16:CARDINALITY CHECK
+|  |  |  |  limit: 1
+|  |  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |  |  |
+|  |  |  15:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date = '2000-01-03'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date = '2000-01-03'
+|  |  |     parquet dictionary predicates: d_date = '2000-01-03'
+|  |  |     limit: 2
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=13 row-size=26B cardinality=1
+|  |  |     in pipelines: 15(GETNEXT)
+|  |  |
+|  |  14:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF026[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=26B cardinality=73.05K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=1.44M
+|  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |
+|  |--13:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF020[bloom] -> d_date
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=26B cardinality=73.05K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10 row-size=52B cardinality=1.44M
+|  |  in pipelines: 11(GETNEXT), 12(OPEN)
+|  |
+|  |--12:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=36B cardinality=18.00K
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=9 row-size=16B cardinality=1.44M
+|     in pipelines: 11(GETNEXT)
+|
+33:HASH JOIN [INNER JOIN]
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  other predicates: sum(ss_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ws_ext_sales_price), sum(ss_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ws_ext_sales_price), sum(ws_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ss_ext_sales_price), sum(ws_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ss_ext_sales_price)
+|  runtime filters: RF002[bloom] <- i_item_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25 row-size=88B cardinality=140
+|  in pipelines: 10(GETNEXT), 32(OPEN)
+|
+|--32:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=44B cardinality=69
+|  |  in pipelines: 32(GETNEXT), 22(OPEN)
+|  |
+|  31:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: d_date = d_date
+|  |  runtime filters: RF012[bloom] <- d_date
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,19,20 row-size=78B cardinality=69
+|  |  in pipelines: 22(GETNEXT), 25(OPEN)
+|  |
+|  |--28:HASH JOIN [LEFT SEMI JOIN]
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  runtime filters: RF018[bloom] <- d_week_seq
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=21 row-size=26B cardinality=7
+|  |  |  in pipelines: 25(GETNEXT), 27(OPEN)
+|  |  |
+|  |  |--27:CARDINALITY CHECK
+|  |  |  |  limit: 1
+|  |  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 27(GETNEXT), 26(OPEN)
+|  |  |  |
+|  |  |  26:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date = '2000-01-03'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date = '2000-01-03'
+|  |  |     parquet dictionary predicates: d_date = '2000-01-03'
+|  |  |     limit: 2
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=22 row-size=26B cardinality=1
+|  |  |     in pipelines: 26(GETNEXT)
+|  |  |
+|  |  25:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF018[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=21 row-size=26B cardinality=73.05K
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  30:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=18,19,20 row-size=78B cardinality=719.38K
+|  |  in pipelines: 22(GETNEXT), 24(OPEN)
+|  |
+|  |--24:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF012[bloom] -> d_date
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=20 row-size=26B cardinality=73.05K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,19 row-size=52B cardinality=719.38K
+|  |  in pipelines: 22(GETNEXT), 23(OPEN)
+|  |
+|  |--23:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=36B cardinality=18.00K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  22:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF014[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=18 row-size=16B cardinality=719.38K
+|     in pipelines: 22(GETNEXT)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=44B cardinality=276
+|  in pipelines: 10(GETNEXT), 00(OPEN)
+|
+09:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: d_date = d_date
+|  runtime filters: RF004[bloom] <- d_date
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=276
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--06:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: d_week_seq = d_week_seq
+|  |  runtime filters: RF010[bloom] <- d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=7
+|  |  in pipelines: 03(GETNEXT), 05(OPEN)
+|  |
+|  |--05:CARDINALITY CHECK
+|  |  |  limit: 1
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=26B cardinality=1
+|  |  |  in pipelines: 05(GETNEXT), 04(OPEN)
+|  |  |
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_date = '2000-01-03'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_date = '2000-01-03'
+|  |     parquet dictionary predicates: d_date = '2000-01-03'
+|  |     limit: 2
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=4 row-size=26B cardinality=1
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF010[bloom] -> d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=26B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF004[bloom] -> d_date
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=73.05K
+|     in pipelines: 02(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF008[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=52B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.item.i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=36B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=83.25MB Threads=35
+Per-Host Resource Estimates: Memory=768MB
+F21:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=25.91KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: item_id, ss_item_rev, ss_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), cs_item_rev, cs_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), ws_item_rev, ws_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), (ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+57:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: item_id ASC, ss_item_rev ASC
+|  limit: 100
+|  mem-estimate=25.91KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=76B cardinality=100
+|  in pipelines: 35(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(i_item_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=34.92MB mem-reservation=10.69MB thread-reservation=1 runtime-filters-memory=1.00MB
+35:TOP-N [LIMIT=100]
+|  order by: item_id ASC, ss_item_rev ASC
+|  mem-estimate=7.42KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=76B cardinality=100
+|  in pipelines: 35(GETNEXT), 42(OPEN)
+|
+34:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  other predicates: sum(cs_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ss_ext_sales_price), sum(cs_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ws_ext_sales_price), sum(cs_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ss_ext_sales_price), sum(cs_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ws_ext_sales_price), sum(ss_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(cs_ext_sales_price), sum(ss_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(cs_ext_sales_price), sum(ws_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(cs_ext_sales_price), sum(ws_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(cs_ext_sales_price)
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25,16 row-size=132B cardinality=281
+|  in pipelines: 42(GETNEXT), 56(OPEN)
+|
+|--56:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=44B cardinality=138
+|  |  in pipelines: 56(GETNEXT), 11(OPEN)
+|  |
+|  55:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=21.38KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=44B cardinality=138
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=164.26MB mem-reservation=17.75MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  21:AGGREGATE [STREAMING]
+|  |  output: sum(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=44B cardinality=138
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  20:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: d_date = d_date
+|  |  runtime filters: RF020[bloom] <- d_date
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=138
+|  |  in pipelines: 11(GETNEXT), 14(OPEN)
+|  |
+|  |--54:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=26B cardinality=7
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=34.95MB mem-reservation=3.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  17:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  runtime filters: RF026[bloom] <- d_week_seq
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12 row-size=26B cardinality=7
+|  |  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |  |
+|  |  |--53:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 16(GETNEXT)
+|  |  |  |
+|  |  |  F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  |  16:CARDINALITY CHECK
+|  |  |  |  limit: 1
+|  |  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |  |  |
+|  |  |  52:EXCHANGE [UNPARTITIONED]
+|  |  |  |  limit: 2
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 15(GETNEXT)
+|  |  |  |
+|  |  |  F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  |  15:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date = '2000-01-03'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date = '2000-01-03'
+|  |  |     parquet dictionary predicates: d_date = '2000-01-03'
+|  |  |     limit: 2
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=13 row-size=26B cardinality=1
+|  |  |     in pipelines: 15(GETNEXT)
+|  |  |
+|  |  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF026[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=26B cardinality=73.05K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=1.44M
+|  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |
+|  |--51:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=26B cardinality=73.05K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF020[bloom] -> d_date
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=26B cardinality=73.05K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10 row-size=52B cardinality=1.44M
+|  |  in pipelines: 11(GETNEXT), 12(OPEN)
+|  |
+|  |--50:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 12(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  12:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=36B cardinality=18.00K
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=9 row-size=16B cardinality=1.44M
+|     in pipelines: 11(GETNEXT)
+|
+33:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  other predicates: sum(ss_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ws_ext_sales_price), sum(ss_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ws_ext_sales_price), sum(ws_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ss_ext_sales_price), sum(ws_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ss_ext_sales_price)
+|  runtime filters: RF002[bloom] <- i_item_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25 row-size=88B cardinality=140
+|  in pipelines: 42(GETNEXT), 49(OPEN)
+|
+|--49:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=44B cardinality=69
+|  |  in pipelines: 49(GETNEXT), 22(OPEN)
+|  |
+|  48:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25 row-size=44B cardinality=69
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=117.26MB mem-reservation=18.75MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  32:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=44B cardinality=69
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  31:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: d_date = d_date
+|  |  runtime filters: RF012[bloom] <- d_date
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,19,20 row-size=78B cardinality=69
+|  |  in pipelines: 22(GETNEXT), 25(OPEN)
+|  |
+|  |--47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21 row-size=26B cardinality=7
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=34.95MB mem-reservation=3.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  28:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  runtime filters: RF018[bloom] <- d_week_seq
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=21 row-size=26B cardinality=7
+|  |  |  in pipelines: 25(GETNEXT), 27(OPEN)
+|  |  |
+|  |  |--46:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 27(GETNEXT)
+|  |  |  |
+|  |  |  F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  |  27:CARDINALITY CHECK
+|  |  |  |  limit: 1
+|  |  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 27(GETNEXT), 26(OPEN)
+|  |  |  |
+|  |  |  45:EXCHANGE [UNPARTITIONED]
+|  |  |  |  limit: 2
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 26(GETNEXT)
+|  |  |  |
+|  |  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  |  26:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date = '2000-01-03'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date = '2000-01-03'
+|  |  |     parquet dictionary predicates: d_date = '2000-01-03'
+|  |  |     limit: 2
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=22 row-size=26B cardinality=1
+|  |  |     in pipelines: 26(GETNEXT)
+|  |  |
+|  |  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF018[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=21 row-size=26B cardinality=73.05K
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  30:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=18,19,20 row-size=78B cardinality=719.38K
+|  |  in pipelines: 22(GETNEXT), 24(OPEN)
+|  |
+|  |--44:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20 row-size=26B cardinality=73.05K
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  24:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF012[bloom] -> d_date
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=20 row-size=26B cardinality=73.05K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,19 row-size=52B cardinality=719.38K
+|  |  in pipelines: 22(GETNEXT), 23(OPEN)
+|  |
+|  |--43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  23:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=36B cardinality=18.00K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  22:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF014[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=18 row-size=16B cardinality=719.38K
+|     in pipelines: 22(GETNEXT)
+|
+42:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=44B cardinality=276
+|  in pipelines: 42(GETNEXT), 00(OPEN)
+|
+41:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=42.77KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=44B cardinality=276
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=54.26MB mem-reservation=12.75MB thread-reservation=2 runtime-filters-memory=3.00MB
+10:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=44B cardinality=276
+|  in pipelines: 00(GETNEXT)
+|
+09:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: d_date = d_date
+|  runtime filters: RF004[bloom] <- d_date
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=276
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--40:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=7
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=34.95MB mem-reservation=3.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  06:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: d_week_seq = d_week_seq
+|  |  runtime filters: RF010[bloom] <- d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=7
+|  |  in pipelines: 03(GETNEXT), 05(OPEN)
+|  |
+|  |--39:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=26B cardinality=1
+|  |  |  in pipelines: 05(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  05:CARDINALITY CHECK
+|  |  |  limit: 1
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=26B cardinality=1
+|  |  |  in pipelines: 05(GETNEXT), 04(OPEN)
+|  |  |
+|  |  38:EXCHANGE [UNPARTITIONED]
+|  |  |  limit: 2
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=26B cardinality=1
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_date = '2000-01-03'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_date = '2000-01-03'
+|  |     parquet dictionary predicates: d_date = '2000-01-03'
+|  |     limit: 2
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=4 row-size=26B cardinality=1
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF010[bloom] -> d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=26B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=73.05K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF004[bloom] -> d_date
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=73.05K
+|     in pipelines: 02(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF008[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=52B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=36B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.item.i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=36B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=129.00MB Threads=38
+Per-Host Resource Estimates: Memory=493MB
+F21:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=49.35KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: item_id, ss_item_rev, ss_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), cs_item_rev, cs_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), ws_item_rev, ws_item_rev / ((ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))) * CAST(100 AS DECIMAL(3,0)), (ss_item_rev + cs_item_rev + ws_item_rev) / CAST(3 AS DECIMAL(3,0))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+57:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: item_id ASC, ss_item_rev ASC
+|  limit: 100
+|  mem-estimate=49.35KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=76B cardinality=100
+|  in pipelines: 35(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(i_item_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.08MB mem-reservation=1.94MB thread-reservation=1
+35:TOP-N [LIMIT=100]
+|  order by: item_id ASC, ss_item_rev ASC
+|  mem-estimate=7.42KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=76B cardinality=100
+|  in pipelines: 35(GETNEXT), 42(OPEN)
+|
+34:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  other predicates: sum(cs_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ss_ext_sales_price), sum(cs_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ws_ext_sales_price), sum(cs_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ss_ext_sales_price), sum(cs_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ws_ext_sales_price), sum(ss_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(cs_ext_sales_price), sum(ss_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(cs_ext_sales_price), sum(ws_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(cs_ext_sales_price), sum(ws_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(cs_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25,16 row-size=132B cardinality=281
+|  in pipelines: 42(GETNEXT), 56(OPEN)
+|
+|--F22:PLAN FRAGMENT [HASH(i_item_id)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=11.94MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  56:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=44B cardinality=138
+|  |  in pipelines: 56(GETNEXT), 11(OPEN)
+|  |
+|  55:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=21.38KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=44B cardinality=138
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=10.00MB thread-reservation=1
+|  21:AGGREGATE [STREAMING]
+|  |  output: sum(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=44B cardinality=138
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  20:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: d_date = d_date
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=138
+|  |  in pipelines: 11(GETNEXT), 14(OPEN)
+|  |
+|  |--F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_date
+|  |  |  runtime filters: RF020[bloom] <- d_date
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  54:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=26B cardinality=7
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  17:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12 row-size=26B cardinality=7
+|  |  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |  |
+|  |  |--F24:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: d_week_seq
+|  |  |  |  runtime filters: RF026[bloom] <- d_week_seq
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  53:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 16(GETNEXT)
+|  |  |  |
+|  |  |  F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  |  16:CARDINALITY CHECK
+|  |  |  |  limit: 1
+|  |  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |  |  |
+|  |  |  52:EXCHANGE [UNPARTITIONED]
+|  |  |  |  limit: 2
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 15(GETNEXT)
+|  |  |  |
+|  |  |  F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |  15:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date = '2000-01-03'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date = '2000-01-03'
+|  |  |     parquet dictionary predicates: d_date = '2000-01-03'
+|  |  |     limit: 2
+|  |  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |  |     tuple-ids=13 row-size=26B cardinality=1
+|  |  |     in pipelines: 15(GETNEXT)
+|  |  |
+|  |  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF026[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=12 row-size=26B cardinality=73.05K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=1.44M
+|  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |
+|  |--F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=7.59MB mem-reservation=5.75MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  51:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=26B cardinality=73.05K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF020[bloom] -> d_date
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=11 row-size=26B cardinality=73.05K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10 row-size=52B cardinality=1.44M
+|  |  in pipelines: 11(GETNEXT), 12(OPEN)
+|  |
+|  |--F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.53MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  50:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 12(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  12:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=10 row-size=36B cardinality=18.00K
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=9 row-size=16B cardinality=1.44M
+|     in pipelines: 11(GETNEXT)
+|
+33:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=05
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  other predicates: sum(ss_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ws_ext_sales_price), sum(ss_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ws_ext_sales_price), sum(ws_ext_sales_price) <= CAST(1.1 AS DECIMAL(2,1)) * sum(ss_ext_sales_price), sum(ws_ext_sales_price) >= CAST(0.9 AS DECIMAL(1,1)) * sum(ss_ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25 row-size=88B cardinality=140
+|  in pipelines: 42(GETNEXT), 49(OPEN)
+|
+|--F27:PLAN FRAGMENT [HASH(i_item_id)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=12.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: i_item_id
+|  |  runtime filters: RF002[bloom] <- i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  49:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=44B cardinality=69
+|  |  in pipelines: 49(GETNEXT), 22(OPEN)
+|  |
+|  48:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25 row-size=44B cardinality=69
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=42.00MB mem-reservation=10.00MB thread-reservation=1
+|  32:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=44B cardinality=69
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  31:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: d_date = d_date
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,19,20 row-size=78B cardinality=69
+|  |  in pipelines: 22(GETNEXT), 25(OPEN)
+|  |
+|  |--F28:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=04
+|  |  |  build expressions: d_date
+|  |  |  runtime filters: RF012[bloom] <- d_date
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21 row-size=26B cardinality=7
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  28:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash-table-id=07
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=21 row-size=26B cardinality=7
+|  |  |  in pipelines: 25(GETNEXT), 27(OPEN)
+|  |  |
+|  |  |--F29:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=07 plan-id=08 cohort-id=05
+|  |  |  |  build expressions: d_week_seq
+|  |  |  |  runtime filters: RF018[bloom] <- d_week_seq
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  46:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 27(GETNEXT)
+|  |  |  |
+|  |  |  F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  |  27:CARDINALITY CHECK
+|  |  |  |  limit: 1
+|  |  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 27(GETNEXT), 26(OPEN)
+|  |  |  |
+|  |  |  45:EXCHANGE [UNPARTITIONED]
+|  |  |  |  limit: 2
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=26B cardinality=1
+|  |  |  |  in pipelines: 26(GETNEXT)
+|  |  |  |
+|  |  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |  26:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date = '2000-01-03'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date = '2000-01-03'
+|  |  |     parquet dictionary predicates: d_date = '2000-01-03'
+|  |  |     limit: 2
+|  |  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |  |     tuple-ids=22 row-size=26B cardinality=1
+|  |  |     in pipelines: 26(GETNEXT)
+|  |  |
+|  |  25:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF018[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=21 row-size=26B cardinality=73.05K
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  30:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=08
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=18,19,20 row-size=78B cardinality=719.38K
+|  |  in pipelines: 22(GETNEXT), 24(OPEN)
+|  |
+|  |--F30:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=8.59MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=08 plan-id=09 cohort-id=04
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  44:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20 row-size=26B cardinality=73.05K
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  24:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF012[bloom] -> d_date
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=20 row-size=26B cardinality=73.05K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=09
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,19 row-size=52B cardinality=719.38K
+|  |  in pipelines: 22(GETNEXT), 23(OPEN)
+|  |
+|  |--F31:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.53MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=09 plan-id=10 cohort-id=04
+|  |  |  build expressions: i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  23:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=19 row-size=36B cardinality=18.00K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  22:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF014[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=18 row-size=16B cardinality=719.38K
+|     in pipelines: 22(GETNEXT)
+|
+42:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=44B cardinality=276
+|  in pipelines: 42(GETNEXT), 00(OPEN)
+|
+41:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=81.58KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=44B cardinality=276
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+10:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=44B cardinality=276
+|  in pipelines: 00(GETNEXT)
+|
+09:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash-table-id=10
+|  hash predicates: d_date = d_date
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=276
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F32:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  build expressions: d_date
+|  |  runtime filters: RF004[bloom] <- d_date
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  40:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=7
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  06:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=11
+|  |  hash predicates: d_week_seq = d_week_seq
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=7
+|  |  in pipelines: 03(GETNEXT), 05(OPEN)
+|  |
+|  |--F33:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=11 plan-id=12 cohort-id=06
+|  |  |  build expressions: d_week_seq
+|  |  |  runtime filters: RF010[bloom] <- d_week_seq
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  39:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=26B cardinality=1
+|  |  |  in pipelines: 05(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+|  |  05:CARDINALITY CHECK
+|  |  |  limit: 1
+|  |  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=26B cardinality=1
+|  |  |  in pipelines: 05(GETNEXT), 04(OPEN)
+|  |  |
+|  |  38:EXCHANGE [UNPARTITIONED]
+|  |  |  limit: 2
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=26B cardinality=1
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_date = '2000-01-03'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_date = '2000-01-03'
+|  |     parquet dictionary predicates: d_date = '2000-01-03'
+|  |     limit: 2
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=4 row-size=26B cardinality=1
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF010[bloom] -> d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=3 row-size=26B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=12
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F34:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=8.59MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=12 plan-id=13 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=73.05K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF004[bloom] -> d_date
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=2 row-size=26B cardinality=73.05K
+|     in pipelines: 02(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=13
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=52B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F35:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.53MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=13 plan-id=14 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=36B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.item.i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=1 row-size=36B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q59.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q59.test
new file mode 100644
index 0000000..4105b3f
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q59.test
@@ -0,0 +1,865 @@
+# TPCDS-Q59
+with
+  wss as
+  (select
+    d_week_seq,
+    ss_store_sk,
+    sum(case when (d_day_name = 'Sunday') then ss_sales_price else null end) sun_sales,
+    sum(case when (d_day_name = 'Monday') then ss_sales_price else null end) mon_sales,
+    sum(case when (d_day_name = 'Tuesday') then ss_sales_price else null end) tue_sales,
+    sum(case when (d_day_name = 'Wednesday') then ss_sales_price else null end) wed_sales,
+    sum(case when (d_day_name = 'Thursday') then ss_sales_price else null end) thu_sales,
+    sum(case when (d_day_name = 'Friday') then ss_sales_price else null end) fri_sales,
+    sum(case when (d_day_name = 'Saturday') then ss_sales_price else null end) sat_sales
+  from
+    store_sales,
+    date_dim
+  where
+    d_date_sk = ss_sold_date_sk
+  group by
+    d_week_seq,
+    ss_store_sk
+  )
+select
+  s_store_name1,
+  s_store_id1,
+  d_week_seq1,
+  sun_sales1 / sun_sales2,
+  mon_sales1 / mon_sales2,
+  tue_sales1 / tue_sales2,
+  wed_sales1 / wed_sales2,
+  thu_sales1 / thu_sales2,
+  fri_sales1 / fri_sales2,
+  sat_sales1 / sat_sales2
+from
+  (select
+    s_store_name s_store_name1,
+    wss.d_week_seq d_week_seq1,
+    s_store_id s_store_id1,
+    sun_sales sun_sales1,
+    mon_sales mon_sales1,
+    tue_sales tue_sales1,
+    wed_sales wed_sales1,
+    thu_sales thu_sales1,
+    fri_sales fri_sales1,
+    sat_sales sat_sales1
+  from
+    wss,
+    store,
+    date_dim d
+  where
+    d.d_week_seq = wss.d_week_seq
+    and ss_store_sk = s_store_sk
+    and d_month_seq between 1185 and 1185 + 11
+  ) y,
+  (select
+    s_store_name s_store_name2,
+    wss.d_week_seq d_week_seq2,
+    s_store_id s_store_id2,
+    sun_sales sun_sales2,
+    mon_sales mon_sales2,
+    tue_sales tue_sales2,
+    wed_sales wed_sales2,
+    thu_sales thu_sales2,
+    fri_sales fri_sales2,
+    sat_sales sat_sales2
+  from
+    wss,
+    store,
+    date_dim d
+  where
+    d.d_week_seq = wss.d_week_seq
+    and ss_store_sk = s_store_sk
+    and d_month_seq between 1185 + 12 and 1185 + 23
+  ) x
+where
+  s_store_id1 = s_store_id2
+  and d_week_seq1 = d_week_seq2 - 52
+order by
+  s_store_name1,
+  s_store_id1,
+  d_week_seq1
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=45.15MB Threads=9
+Per-Host Resource Estimates: Memory=326MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=325.50MB mem-reservation=45.15MB thread-reservation=9 runtime-filters-memory=8.00MB
+PLAN-ROOT SINK
+|  output exprs: s_store_name1, s_store_id1, d_week_seq1, sun_sales1 / sun_sales2, mon_sales1 / mon_sales2, tue_sales1 / tue_sales2, wed_sales1 / wed_sales2, thu_sales1 / thu_sales2, fri_sales1 / fri_sales2, sat_sales1 / sat_sales2
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:TOP-N [LIMIT=100]
+|  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
+|  mem-estimate=26.59KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=272B cardinality=100
+|  in pipelines: 17(GETNEXT), 03(OPEN)
+|
+16:HASH JOIN [INNER JOIN]
+|  hash predicates: d_week_seq = d_week_seq - 52, s_store_id = s_store_id
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- d_week_seq - 52, RF001[bloom] <- s_store_id
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=2,5,4,9,12,11 row-size=336B cardinality=419.05M
+|  in pipelines: 03(GETNEXT), 11(OPEN)
+|
+|--15:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF010[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,12,11 row-size=160B cardinality=50.14K
+|  |  in pipelines: 11(GETNEXT), 12(OPEN)
+|  |
+|  |--12:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=32B cardinality=12
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  14:HASH JOIN [INNER JOIN]
+|  |  hash predicates: d_week_seq = d.d_week_seq
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF012[bloom] <- d.d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,12 row-size=128B cardinality=50.14K
+|  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |
+|  |--13:SCAN HDFS [tpcds_parquet.date_dim d]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1208 AS INT), d_month_seq >= CAST(1197 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1208 AS INT), d_month_seq >= CAST(1197 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1208 AS INT), d_month_seq >= CAST(1197 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=8B cardinality=7.30K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  11:AGGREGATE [FINALIZE]
+|  |  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  |  group by: d_week_seq, ss_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=9 row-size=120B cardinality=63.85K
+|  |  in pipelines: 11(GETNEXT), 08(OPEN)
+|  |
+|  10:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=7,8 row-size=39B cardinality=2.88M
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--09:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF012[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=8 row-size=27B cardinality=73.05K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF010[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF014[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=7 row-size=12B cardinality=2.88M
+|     in pipelines: 08(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF004[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,5,4 row-size=176B cardinality=50.14K
+|  in pipelines: 03(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     runtime filters: RF001[bloom] -> s_store_id
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=4 row-size=48B cardinality=12
+|     in pipelines: 04(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: d_week_seq = d.d_week_seq
+|  fk/pk conjuncts: none
+|  runtime filters: RF006[bloom] <- d.d_week_seq
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,5 row-size=128B cardinality=50.14K
+|  in pipelines: 03(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.date_dim d]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1196 AS INT), d_month_seq >= CAST(1185 AS INT)
+|     runtime filters: RF000[bloom] -> d.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1196 AS INT), d_month_seq >= CAST(1185 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1196 AS INT), d_month_seq >= CAST(1185 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=7.30K
+|     in pipelines: 05(GETNEXT)
+|
+03:AGGREGATE [FINALIZE]
+|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  group by: d_week_seq, ss_store_sk
+|  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=2 row-size=120B cardinality=63.85K
+|  in pipelines: 03(GETNEXT), 00(OPEN)
+|
+02:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF008[bloom] <- d_date_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=39B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_week_seq, RF006[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=27B cardinality=73.05K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF008[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=58.16MB Threads=20
+Per-Host Resource Estimates: Memory=393MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=89.79KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: s_store_name1, s_store_id1, d_week_seq1, sun_sales1 / sun_sales2, mon_sales1 / mon_sales2, tue_sales1 / tue_sales2, wed_sales1 / wed_sales2, thu_sales1 / thu_sales2, fri_sales1 / fri_sales2, sat_sales1 / sat_sales2
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+30:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
+|  limit: 100
+|  mem-estimate=89.79KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=272B cardinality=100
+|  in pipelines: 17(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(d_week_seq,s_store_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=13.17MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=2.00MB
+17:TOP-N [LIMIT=100]
+|  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
+|  mem-estimate=26.59KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=272B cardinality=100
+|  in pipelines: 17(GETNEXT), 20(OPEN)
+|
+16:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: d_week_seq = d_week_seq - 52, s_store_id = s_store_id
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- d_week_seq - 52, RF001[bloom] <- s_store_id
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=2,5,4,9,12,11 row-size=336B cardinality=419.05M
+|  in pipelines: 20(GETNEXT), 25(OPEN)
+|
+|--29:EXCHANGE [HASH(d_week_seq - 52,s_store_id)]
+|  |  mem-estimate=3.05MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9,12,11 row-size=160B cardinality=50.14K
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(d_week_seq,ss_store_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=18.76MB mem-reservation=7.81MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF010[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,12,11 row-size=160B cardinality=50.14K
+|  |  in pipelines: 25(GETNEXT), 12(OPEN)
+|  |
+|  |--27:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=32B cardinality=12
+|  |  |  in pipelines: 12(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  12:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=32B cardinality=12
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: d_week_seq = d.d_week_seq
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF012[bloom] <- d.d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,12 row-size=128B cardinality=50.14K
+|  |  in pipelines: 25(GETNEXT), 13(OPEN)
+|  |
+|  |--26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim d, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1208 AS INT), d_month_seq >= CAST(1197 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1208 AS INT), d_month_seq >= CAST(1197 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1208 AS INT), d_month_seq >= CAST(1197 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=8B cardinality=7.30K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  25:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  |  group by: d_week_seq, ss_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9 row-size=120B cardinality=63.85K
+|  |  in pipelines: 25(GETNEXT), 08(OPEN)
+|  |
+|  24:EXCHANGE [HASH(d_week_seq,ss_store_sk)]
+|  |  mem-estimate=2.80MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=120B cardinality=63.85K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=48.80MB mem-reservation=14.38MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  11:AGGREGATE [STREAMING]
+|  |  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  |  group by: d_week_seq, ss_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=9 row-size=120B cardinality=63.85K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=7,8 row-size=39B cardinality=2.88M
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.92MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=8 row-size=27B cardinality=73.05K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=49.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  09:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF012[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=8 row-size=27B cardinality=73.05K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF010[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF014[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=7 row-size=12B cardinality=2.88M
+|     in pipelines: 08(GETNEXT)
+|
+28:EXCHANGE [HASH(d_week_seq,s_store_id)]
+|  mem-estimate=3.36MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,5,4 row-size=176B cardinality=50.14K
+|  in pipelines: 20(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(d_week_seq,ss_store_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=18.76MB mem-reservation=7.81MB thread-reservation=1 runtime-filters-memory=2.00MB
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF004[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,5,4 row-size=176B cardinality=50.14K
+|  in pipelines: 20(GETNEXT), 04(OPEN)
+|
+|--22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=48B cardinality=12
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=49.00MB mem-reservation=1.02MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  04:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     runtime filters: RF001[bloom] -> s_store_id
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=4 row-size=48B cardinality=12
+|     in pipelines: 04(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: d_week_seq = d.d_week_seq
+|  fk/pk conjuncts: none
+|  runtime filters: RF006[bloom] <- d.d_week_seq
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,5 row-size=128B cardinality=50.14K
+|  in pipelines: 20(GETNEXT), 05(OPEN)
+|
+|--21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=7.30K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  05:SCAN HDFS [tpcds_parquet.date_dim d, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1196 AS INT), d_month_seq >= CAST(1185 AS INT)
+|     runtime filters: RF000[bloom] -> d.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1196 AS INT), d_month_seq >= CAST(1185 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1196 AS INT), d_month_seq >= CAST(1185 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=7.30K
+|     in pipelines: 05(GETNEXT)
+|
+20:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  group by: d_week_seq, ss_store_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2 row-size=120B cardinality=63.85K
+|  in pipelines: 20(GETNEXT), 00(OPEN)
+|
+19:EXCHANGE [HASH(d_week_seq,ss_store_sk)]
+|  mem-estimate=2.80MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2 row-size=120B cardinality=63.85K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=48.80MB mem-reservation=14.38MB thread-reservation=2 runtime-filters-memory=2.00MB
+03:AGGREGATE [STREAMING]
+|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  group by: d_week_seq, ss_store_sk
+|  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=2 row-size=120B cardinality=63.85K
+|  in pipelines: 00(GETNEXT)
+|
+02:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF008[bloom] <- d_date_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=39B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.92MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=27B cardinality=73.05K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=50.00MB mem-reservation=2.50MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_week_seq, RF006[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=27B cardinality=73.05K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF008[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=99.54MB Threads=25
+Per-Host Resource Estimates: Memory=324MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=170.73KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: s_store_name1, s_store_id1, d_week_seq1, sun_sales1 / sun_sales2, mon_sales1 / mon_sales2, tue_sales1 / tue_sales2, wed_sales1 / wed_sales2, thu_sales1 / thu_sales2, fri_sales1 / fri_sales2, sat_sales1 / sat_sales2
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+30:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
+|  limit: 100
+|  mem-estimate=170.73KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=272B cardinality=100
+|  in pipelines: 17(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(d_week_seq,s_store_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=3.94MB mem-reservation=0B thread-reservation=1
+17:TOP-N [LIMIT=100]
+|  order by: s_store_name1 ASC, s_store_id1 ASC, d_week_seq1 ASC
+|  mem-estimate=26.59KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=272B cardinality=100
+|  in pipelines: 17(GETNEXT), 20(OPEN)
+|
+16:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: d_week_seq = d_week_seq - 52, s_store_id = s_store_id
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=2,5,4,9,12,11 row-size=336B cardinality=419.05M
+|  in pipelines: 20(GETNEXT), 25(OPEN)
+|
+|--F12:PLAN FRAGMENT [HASH(d_week_seq,s_store_id)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=8.43MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_week_seq - 52, s_store_id
+|  |  runtime filters: RF000[bloom] <- d_week_seq - 52, RF001[bloom] <- s_store_id
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  29:EXCHANGE [HASH(d_week_seq - 52,s_store_id)]
+|  |  mem-estimate=3.56MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9,12,11 row-size=160B cardinality=50.14K
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(d_week_seq,ss_store_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=13.16MB mem-reservation=1.94MB thread-reservation=1
+|  15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,12,11 row-size=160B cardinality=50.14K
+|  |  in pipelines: 25(GETNEXT), 12(OPEN)
+|  |
+|  |--F13:PLAN FRAGMENT [HASH(d_week_seq,ss_store_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: s_store_sk
+|  |  |  runtime filters: RF010[bloom] <- s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  27:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=32B cardinality=12
+|  |  |  in pipelines: 12(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  12:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=11 row-size=32B cardinality=12
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: d_week_seq = d.d_week_seq
+|  |  fk/pk conjuncts: none
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,12 row-size=128B cardinality=50.14K
+|  |  in pipelines: 25(GETNEXT), 13(OPEN)
+|  |
+|  |--F14:PLAN FRAGMENT [HASH(d_week_seq,ss_store_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: d.d_week_seq
+|  |  |  runtime filters: RF012[bloom] <- d.d_week_seq
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim d, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1208 AS INT), d_month_seq >= CAST(1197 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1208 AS INT), d_month_seq >= CAST(1197 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1208 AS INT), d_month_seq >= CAST(1197 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=12 row-size=8B cardinality=7.30K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  25:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  |  group by: d_week_seq, ss_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9 row-size=120B cardinality=63.85K
+|  |  in pipelines: 25(GETNEXT), 08(OPEN)
+|  |
+|  24:EXCHANGE [HASH(d_week_seq,ss_store_sk)]
+|  |  mem-estimate=3.16MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=120B cardinality=63.85K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=9.50MB thread-reservation=1
+|  11:AGGREGATE [STREAMING]
+|  |  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  |  group by: d_week_seq, ss_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=9 row-size=120B cardinality=63.85K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=7,8 row-size=39B cardinality=2.88M
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=8.67MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.92MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=8 row-size=27B cardinality=73.05K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  09:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF012[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=8 row-size=27B cardinality=73.05K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF010[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF014[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=7 row-size=12B cardinality=2.88M
+|     in pipelines: 08(GETNEXT)
+|
+28:EXCHANGE [HASH(d_week_seq,s_store_id)]
+|  mem-estimate=3.91MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2,5,4 row-size=176B cardinality=50.14K
+|  in pipelines: 20(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(d_week_seq,ss_store_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=13.16MB mem-reservation=1.94MB thread-reservation=1
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,5,4 row-size=176B cardinality=50.14K
+|  in pipelines: 20(GETNEXT), 04(OPEN)
+|
+|--F16:PLAN FRAGMENT [HASH(d_week_seq,ss_store_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF004[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=48B cardinality=12
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     runtime filters: RF001[bloom] -> s_store_id
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|     tuple-ids=4 row-size=48B cardinality=12
+|     in pipelines: 04(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=05
+|  hash predicates: d_week_seq = d.d_week_seq
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,5 row-size=128B cardinality=50.14K
+|  in pipelines: 20(GETNEXT), 05(OPEN)
+|
+|--F17:PLAN FRAGMENT [HASH(d_week_seq,ss_store_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: d.d_week_seq
+|  |  runtime filters: RF006[bloom] <- d.d_week_seq
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=7.30K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.date_dim d, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1196 AS INT), d_month_seq >= CAST(1185 AS INT)
+|     runtime filters: RF000[bloom] -> d.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1196 AS INT), d_month_seq >= CAST(1185 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1196 AS INT), d_month_seq >= CAST(1185 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=5 row-size=8B cardinality=7.30K
+|     in pipelines: 05(GETNEXT)
+|
+20:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum:merge(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  group by: d_week_seq, ss_store_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2 row-size=120B cardinality=63.85K
+|  in pipelines: 20(GETNEXT), 00(OPEN)
+|
+19:EXCHANGE [HASH(d_week_seq,ss_store_sk)]
+|  mem-estimate=3.16MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2 row-size=120B cardinality=63.85K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=9.50MB thread-reservation=1
+03:AGGREGATE [STREAMING]
+|  output: sum(CASE WHEN (d_day_name = 'Sunday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Monday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Tuesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Wednesday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Thursday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Friday') THEN ss_sales_price ELSE NULL END), sum(CASE WHEN (d_day_name = 'Saturday') THEN ss_sales_price ELSE NULL END)
+|  group by: d_week_seq, ss_store_sk
+|  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=2 row-size=120B cardinality=63.85K
+|  in pipelines: 00(GETNEXT)
+|
+02:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=06
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=39B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=8.67MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.92MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=27B cardinality=73.05K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_week_seq, RF006[bloom] -> tpcds_parquet.date_dim.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=1 row-size=27B cardinality=73.05K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF008[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q60.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q60.test
new file mode 100644
index 0000000..771ff8a
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q60.test
@@ -0,0 +1,891 @@
+# TPCDS-Q60
+with ss as (
+ select
+          i_item_id,sum(ss_ext_sales_price) total_sales
+ from
+  store_sales,
+  date_dim,
+         customer_address,
+         item
+ where
+         i_item_id in (select
+  i_item_id
+from
+ item
+where i_category in ('Music'))
+ and     ss_item_sk              = i_item_sk
+ and     ss_sold_date_sk         = d_date_sk
+ and     d_year                  = 1998
+ and     d_moy                   = 9
+ and     ss_addr_sk              = ca_address_sk
+ and     ca_gmt_offset           = -5
+ group by i_item_id),
+ cs as (
+ select
+          i_item_id,sum(cs_ext_sales_price) total_sales
+ from
+  catalog_sales,
+  date_dim,
+         customer_address,
+         item
+ where
+         i_item_id               in (select
+  i_item_id
+from
+ item
+where i_category in ('Music'))
+ and     cs_item_sk              = i_item_sk
+ and     cs_sold_date_sk         = d_date_sk
+ and     d_year                  = 1998
+ and     d_moy                   = 9
+ and     cs_bill_addr_sk         = ca_address_sk
+ and     ca_gmt_offset           = -5
+ group by i_item_id),
+ ws as (
+ select
+          i_item_id,sum(ws_ext_sales_price) total_sales
+ from
+  web_sales,
+  date_dim,
+         customer_address,
+         item
+ where
+         i_item_id               in (select
+  i_item_id
+from
+ item
+where i_category in ('Music'))
+ and     ws_item_sk              = i_item_sk
+ and     ws_sold_date_sk         = d_date_sk
+ and     d_year                  = 1998
+ and     d_moy                   = 9
+ and     ws_bill_addr_sk         = ca_address_sk
+ and     ca_gmt_offset           = -5
+ group by i_item_id)
+  select
+  i_item_id
+,sum(total_sales) total_sales
+ from  (select * from ss
+        union all
+        select * from cs
+        union all
+        select * from ws) tmp1
+ group by i_item_id
+ order by i_item_id
+      ,total_sales
+ limit 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=28.44MB Threads=6
+Per-Host Resource Estimates: Memory=362MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=361.81MB mem-reservation=28.44MB thread-reservation=6 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_id, sum(total_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+32:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC, sum(total_sales) ASC
+|  mem-estimate=4.30KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=44B cardinality=100
+|  in pipelines: 32(GETNEXT), 31(OPEN)
+|
+31:AGGREGATE [FINALIZE]
+|  output: sum(total_sales)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=44B cardinality=10.80K
+|  in pipelines: 31(GETNEXT), 10(OPEN), 20(OPEN), 30(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=44B cardinality=10.80K
+|  in pipelines: 10(GETNEXT), 20(GETNEXT), 30(GETNEXT)
+|
+|--30:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=44B cardinality=2.00K
+|  |  in pipelines: 30(GETNEXT), 24(OPEN)
+|  |
+|  29:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: i_item_id = i_item_id
+|  |  runtime filters: RF016[bloom] <- i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19,16,17,18 row-size=76B cardinality=2.00K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--25:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category IN ('Music')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category IN ('Music')
+|  |     parquet dictionary predicates: i_category IN ('Music')
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=46B cardinality=1.80K
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN]
+|  |  hash predicates: i_item_sk = ws_item_sk
+|  |  fk/pk conjuncts: i_item_sk = ws_item_sk
+|  |  runtime filters: RF018[bloom] <- ws_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=19,16,17,18 row-size=76B cardinality=9.81K
+|  |  in pipelines: 24(GETNEXT), 21(OPEN)
+|  |
+|  |--27:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  |  runtime filters: RF020[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=16,17,18 row-size=40B cardinality=9.81K
+|  |  |  in pipelines: 21(GETNEXT), 23(OPEN)
+|  |  |
+|  |  |--23:SCAN HDFS [tpcds_parquet.customer_address]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=18 row-size=8B cardinality=8.33K
+|  |  |     in pipelines: 23(GETNEXT)
+|  |  |
+|  |  26:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF022[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=16,17 row-size=32B cardinality=42.85K
+|  |  |  in pipelines: 21(GETNEXT), 22(OPEN)
+|  |  |
+|  |  |--22:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=17 row-size=12B cardinality=108
+|  |  |     in pipelines: 22(GETNEXT)
+|  |  |
+|  |  21:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF022[bloom] -> ws_sold_date_sk, RF020[bloom] -> ws_bill_addr_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=16 row-size=20B cardinality=719.38K
+|  |     in pipelines: 21(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF016[bloom] -> i_item_id, RF018[bloom] -> i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=19 row-size=36B cardinality=18.00K
+|     in pipelines: 24(GETNEXT)
+|
+|--20:AGGREGATE [FINALIZE]
+|  |  output: sum(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=44B cardinality=3.01K
+|  |  in pipelines: 20(GETNEXT), 14(OPEN)
+|  |
+|  19:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: i_item_id = i_item_id
+|  |  runtime filters: RF008[bloom] <- i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11,8,9,10 row-size=76B cardinality=3.01K
+|  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |
+|  |--15:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category IN ('Music')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category IN ('Music')
+|  |     parquet dictionary predicates: i_category IN ('Music')
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=46B cardinality=1.80K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN]
+|  |  hash predicates: i_item_sk = cs_item_sk
+|  |  fk/pk conjuncts: i_item_sk = cs_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=11,8,9,10 row-size=76B cardinality=14.81K
+|  |  in pipelines: 14(GETNEXT), 11(OPEN)
+|  |
+|  |--17:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_bill_addr_sk = ca_address_sk
+|  |  |  fk/pk conjuncts: cs_bill_addr_sk = ca_address_sk
+|  |  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9,10 row-size=40B cardinality=14.81K
+|  |  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |  |
+|  |  |--13:SCAN HDFS [tpcds_parquet.customer_address]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=10 row-size=8B cardinality=8.33K
+|  |  |     in pipelines: 13(GETNEXT)
+|  |  |
+|  |  16:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9 row-size=32B cardinality=85.31K
+|  |  |  in pipelines: 11(GETNEXT), 12(OPEN)
+|  |  |
+|  |  |--12:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=9 row-size=12B cardinality=108
+|  |  |     in pipelines: 12(GETNEXT)
+|  |  |
+|  |  11:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF014[bloom] -> cs_sold_date_sk, RF012[bloom] -> cs_bill_addr_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=8 row-size=20B cardinality=1.44M
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF008[bloom] -> i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=11 row-size=36B cardinality=18.00K
+|     in pipelines: 14(GETNEXT)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=44B cardinality=5.79K
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+09:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: i_item_id = i_item_id
+|  runtime filters: RF000[bloom] <- i_item_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=76B cardinality=5.79K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Music')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Music')
+|     parquet dictionary predicates: i_category IN ('Music')
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=4 row-size=46B cardinality=1.80K
+|     in pipelines: 05(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=76B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=36B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  runtime filters: RF004[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=40B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=8.33K
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=32B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=108
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_addr_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=71.62MB Threads=36
+Per-Host Resource Estimates: Memory=902MB
+F23:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, sum(total_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+56:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC, sum(total_sales) ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=44B cardinality=100
+|  in pipelines: 32(GETNEXT)
+|
+F22:PLAN FRAGMENT [HASH(i_item_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.29MB mem-reservation=1.94MB thread-reservation=1
+32:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC, sum(total_sales) ASC
+|  mem-estimate=4.30KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=44B cardinality=100
+|  in pipelines: 32(GETNEXT), 55(OPEN)
+|
+55:AGGREGATE [FINALIZE]
+|  output: sum:merge(total_sales)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=44B cardinality=10.80K
+|  in pipelines: 55(GETNEXT), 39(OPEN), 46(OPEN), 53(OPEN)
+|
+54:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=298.70KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=26 row-size=44B cardinality=10.80K
+|  in pipelines: 39(GETNEXT), 46(GETNEXT), 53(GETNEXT)
+|
+F21:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=20.22MB mem-reservation=3.94MB thread-reservation=1
+31:AGGREGATE [STREAMING]
+|  output: sum(total_sales)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=44B cardinality=10.80K
+|  in pipelines: 39(GETNEXT), 46(GETNEXT), 53(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=44B cardinality=10.80K
+|  in pipelines: 39(GETNEXT), 46(GETNEXT), 53(GETNEXT)
+|
+|--53:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=44B cardinality=2.00K
+|  |  in pipelines: 53(GETNEXT), 21(OPEN)
+|  |
+|  52:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=138.86KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=22 row-size=44B cardinality=2.00K
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [HASH(ws_item_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=15.95MB mem-reservation=6.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  30:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=44B cardinality=2.00K
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  29:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: i_item_id = i_item_id
+|  |  runtime filters: RF016[bloom] <- i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19 row-size=76B cardinality=2.00K
+|  |  in pipelines: 21(GETNEXT), 25(OPEN)
+|  |
+|  |--51:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=130.57KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20 row-size=46B cardinality=1.80K
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  25:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category IN ('Music')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category IN ('Music')
+|  |     parquet dictionary predicates: i_category IN ('Music')
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=46B cardinality=1.80K
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19 row-size=76B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 24(OPEN)
+|  |
+|  |--50:EXCHANGE [HASH(i_item_sk)]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  24:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF016[bloom] -> i_item_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=36B cardinality=18.00K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  49:EXCHANGE [HASH(ws_item_sk)]
+|  |  mem-estimate=295.62KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=40B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=133.97MB mem-reservation=13.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF020[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=40B cardinality=9.81K
+|  |  in pipelines: 21(GETNEXT), 23(OPEN)
+|  |
+|  |--48:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  23:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=8B cardinality=8.33K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF022[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17 row-size=32B cardinality=42.85K
+|  |  in pipelines: 21(GETNEXT), 22(OPEN)
+|  |
+|  |--47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=17 row-size=12B cardinality=108
+|  |  |  in pipelines: 22(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  22:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=17 row-size=12B cardinality=108
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  21:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF022[bloom] -> ws_sold_date_sk, RF020[bloom] -> ws_bill_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=16 row-size=20B cardinality=719.38K
+|     in pipelines: 21(GETNEXT)
+|
+|--46:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=44B cardinality=3.01K
+|  |  in pipelines: 46(GETNEXT), 11(OPEN)
+|  |
+|  45:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=187.13KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=44B cardinality=3.01K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=6.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  20:AGGREGATE [STREAMING]
+|  |  output: sum(cs_ext_sales_price)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=44B cardinality=3.01K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  19:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: i_item_id = i_item_id
+|  |  runtime filters: RF008[bloom] <- i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11 row-size=76B cardinality=3.01K
+|  |  in pipelines: 11(GETNEXT), 15(OPEN)
+|  |
+|  |--44:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=130.57KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=46B cardinality=1.80K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  15:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category IN ('Music')
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category IN ('Music')
+|  |     parquet dictionary predicates: i_category IN ('Music')
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=46B cardinality=1.80K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  18:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11 row-size=76B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 14(OPEN)
+|  |
+|  |--43:EXCHANGE [HASH(i_item_sk)]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  14:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     runtime filters: RF008[bloom] -> i_item_id
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=36B cardinality=18.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  42:EXCHANGE [HASH(cs_item_sk)]
+|  |  mem-estimate=348.84KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=40B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=197.97MB mem-reservation=13.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  17:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_bill_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: cs_bill_addr_sk = ca_address_sk
+|  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=40B cardinality=14.81K
+|  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |
+|  |--41:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  13:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=8B cardinality=8.33K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=32B cardinality=85.31K
+|  |  in pipelines: 11(GETNEXT), 12(OPEN)
+|  |
+|  |--40:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=12B cardinality=108
+|  |  |  in pipelines: 12(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  12:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=12B cardinality=108
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF014[bloom] -> cs_sold_date_sk, RF012[bloom] -> cs_bill_addr_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=8 row-size=20B cardinality=1.44M
+|     in pipelines: 11(GETNEXT)
+|
+39:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=44B cardinality=5.79K
+|  in pipelines: 39(GETNEXT), 01(OPEN)
+|
+38:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=227.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=44B cardinality=5.79K
+|  in pipelines: 01(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=17.17MB mem-reservation=7.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+10:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=44B cardinality=5.79K
+|  in pipelines: 01(GETNEXT)
+|
+09:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: i_item_id = i_item_id
+|  runtime filters: RF000[bloom] <- i_item_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=76B cardinality=5.79K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--37:EXCHANGE [BROADCAST]
+|  |  mem-estimate=130.57KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=46B cardinality=1.80K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Music')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Music')
+|     parquet dictionary predicates: i_category IN ('Music')
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=4 row-size=46B cardinality=1.80K
+|     in pipelines: 05(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=76B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--36:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=36B cardinality=18.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  04:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF000[bloom] -> i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=36B cardinality=18.00K
+|     in pipelines: 04(GETNEXT)
+|
+35:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=527.13KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,1,2 row-size=40B cardinality=28.50K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=54.97MB mem-reservation=8.88MB thread-reservation=2 runtime-filters-memory=3.00MB
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_addr_sk = ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ca_address_sk
+|  runtime filters: RF004[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=40B cardinality=28.50K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--34:EXCHANGE [BROADCAST]
+|  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=8.33K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=8.33K
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=32B cardinality=170.55K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--33:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=108
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(9 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=108
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_addr_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q61.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q61.test
new file mode 100644
index 0000000..a011030
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q61.test
@@ -0,0 +1,1233 @@
+# TPCDS-Q61
+SELECT promotions,
+       total,
+       cast(promotions AS decimal(15,4))/cast(total AS decimal(15,4))*100
+FROM
+  (SELECT sum(ss_ext_sales_price) promotions
+   FROM store_sales,
+        store,
+        promotion,
+        date_dim,
+        customer,
+        customer_address,
+        item
+   WHERE ss_sold_date_sk = d_date_sk
+     AND ss_store_sk = s_store_sk
+     AND ss_promo_sk = p_promo_sk
+     AND ss_customer_sk= c_customer_sk
+     AND ca_address_sk = c_current_addr_sk
+     AND ss_item_sk = i_item_sk
+     AND ca_gmt_offset = -5
+     AND i_category = 'Jewelry'
+     AND (p_channel_dmail = 'Y'
+          OR p_channel_email = 'Y'
+          OR p_channel_tv = 'Y')
+     AND s_gmt_offset = -5
+     AND d_year = 1998
+     AND d_moy = 11) promotional_sales,
+  (SELECT sum(ss_ext_sales_price) total
+   FROM store_sales,
+        store,
+        date_dim,
+        customer,
+        customer_address,
+        item
+   WHERE ss_sold_date_sk = d_date_sk
+     AND ss_store_sk = s_store_sk
+     AND ss_customer_sk= c_customer_sk
+     AND ca_address_sk = c_current_addr_sk
+     AND ss_item_sk = i_item_sk
+     AND ca_gmt_offset = -5
+     AND i_category = 'Jewelry'
+     AND s_gmt_offset = -5
+     AND d_year = 1998
+     AND d_moy = 11) all_sales
+ORDER BY promotions,
+         total
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=39.38MB Threads=14
+Per-Host Resource Estimates: Memory=591MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=591.31MB mem-reservation=39.38MB thread-reservation=14 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: promotions, total, CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4)) * CAST(100 AS DECIMAL(3,0))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:TOP-N [LIMIT=100]
+|  order by: promotions ASC, total ASC
+|  mem-estimate=32B mem-reservation=0B thread-reservation=0
+|  tuple-ids=17 row-size=32B cardinality=1
+|  in pipelines: 27(GETNEXT), 13(OPEN)
+|
+26:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=7,15 row-size=32B cardinality=1
+|  in pipelines: 13(GETNEXT), 25(OPEN)
+|
+|--25:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_ext_sales_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 14(OPEN)
+|  |
+|  24:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12,13 row-size=86B cardinality=3.30K
+|  |  in pipelines: 14(GETNEXT), 18(OPEN)
+|  |
+|  |--18:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=8B cardinality=8.33K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  23:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  runtime filters: RF014[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12 row-size=78B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 17(OPEN)
+|  |
+|  |--17:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF012[bloom] -> c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=8B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10 row-size=70B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |
+|  |--15:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=8B cardinality=12
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF018[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14 row-size=62B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 19(OPEN)
+|  |
+|  |--19:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Jewelry'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Jewelry'
+|  |     parquet dictionary predicates: i_category = 'Jewelry'
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=14 row-size=26B cardinality=1.80K
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11 row-size=36B cardinality=170.55K
+|  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |
+|  |--16:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF020[bloom] -> ss_sold_date_sk, RF018[bloom] -> ss_item_sk, RF014[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=9 row-size=24B cardinality=2.88M
+|     in pipelines: 14(GETNEXT)
+|
+13:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF000[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4,5 row-size=133B cardinality=3.28K
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=8.33K
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4 row-size=125B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=8B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF004[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1 row-size=117B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=12
+|     in pipelines: 01(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  runtime filters: RF006[bloom] <- p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2 row-size=109B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.promotion]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_dmail = 'Y' OR p_channel_email = 'Y' OR p_channel_tv = 'Y')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=2 row-size=43B cardinality=300
+|     in pipelines: 02(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF008[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6 row-size=66B cardinality=17.06K
+|  in pipelines: 00(GETNEXT), 06(OPEN)
+|
+|--06:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category = 'Jewelry'
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category = 'Jewelry'
+|     parquet dictionary predicates: i_category = 'Jewelry'
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=6 row-size=26B cardinality=1.80K
+|     in pipelines: 06(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF010[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=40B cardinality=170.55K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF010[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk, RF006[bloom] -> ss_promo_sk, RF002[bloom] -> ss_customer_sk, RF004[bloom] -> ss_store_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=43.38MB Threads=30
+Per-Host Resource Estimates: Memory=637MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.03MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: promotions, total, CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4)) * CAST(100 AS DECIMAL(3,0))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:TOP-N [LIMIT=100]
+|  order by: promotions ASC, total ASC
+|  mem-estimate=32B mem-reservation=0B thread-reservation=0
+|  tuple-ids=17 row-size=32B cardinality=1
+|  in pipelines: 27(GETNEXT), 36(OPEN)
+|
+26:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=7,15 row-size=32B cardinality=1
+|  in pipelines: 36(GETNEXT), 44(OPEN)
+|
+|--45:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 44(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  44:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_ext_sales_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 44(GETNEXT), 25(OPEN)
+|  |
+|  43:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=16.51MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  25:AGGREGATE
+|  |  output: sum(ss_ext_sales_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 14(OPEN)
+|  |
+|  24:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12,13 row-size=86B cardinality=3.30K
+|  |  in pipelines: 14(GETNEXT), 18(OPEN)
+|  |
+|  |--42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  18:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=8B cardinality=8.33K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  23:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  runtime filters: RF014[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12 row-size=78B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 17(OPEN)
+|  |
+|  |--41:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=8B cardinality=100.00K
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  17:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF012[bloom] -> c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=8B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  40:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=645.75KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9,11,14,10 row-size=70B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=72.92MB mem-reservation=10.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10 row-size=70B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |
+|  |--39:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=8B cardinality=12
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  15:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=8B cardinality=12
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF018[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14 row-size=62B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 19(OPEN)
+|  |
+|  |--38:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=75.41KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=26B cardinality=1.80K
+|  |  |  in pipelines: 19(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  19:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Jewelry'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Jewelry'
+|  |     parquet dictionary predicates: i_category = 'Jewelry'
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=14 row-size=26B cardinality=1.80K
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11 row-size=36B cardinality=170.55K
+|  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |
+|  |--37:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=12B cardinality=108
+|  |  |  in pipelines: 16(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  16:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF020[bloom] -> ss_sold_date_sk, RF018[bloom] -> ss_item_sk, RF014[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=9 row-size=24B cardinality=2.88M
+|     in pipelines: 14(GETNEXT)
+|
+36:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 36(GETNEXT), 13(OPEN)
+|
+35:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 13(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=16.91MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+13:AGGREGATE
+|  output: sum(ss_ext_sales_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF000[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4,5 row-size=133B cardinality=3.28K
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--34:EXCHANGE [BROADCAST]
+|  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=8.33K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=8.33K
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4 row-size=125B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--33:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=8B cardinality=100.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  04:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=8B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+32:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=1.03MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,6,2,1 row-size=117B cardinality=16.94K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=92.88MB mem-reservation=14.75MB thread-reservation=2 runtime-filters-memory=5.00MB
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF004[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1 row-size=117B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--31:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=12
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=12
+|     in pipelines: 01(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  runtime filters: RF006[bloom] <- p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2 row-size=109B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--30:EXCHANGE [BROADCAST]
+|  |  mem-estimate=26.37KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=43B cardinality=300
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_dmail = 'Y' OR p_channel_email = 'Y' OR p_channel_tv = 'Y')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=2 row-size=43B cardinality=300
+|     in pipelines: 02(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF008[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6 row-size=66B cardinality=17.06K
+|  in pipelines: 00(GETNEXT), 06(OPEN)
+|
+|--29:EXCHANGE [BROADCAST]
+|  |  mem-estimate=75.41KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=26B cardinality=1.80K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  06:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category = 'Jewelry'
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category = 'Jewelry'
+|     parquet dictionary predicates: i_category = 'Jewelry'
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=6 row-size=26B cardinality=1.80K
+|     in pipelines: 06(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF010[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=40B cardinality=170.55K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--28:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF010[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk, RF006[bloom] -> ss_promo_sk, RF002[bloom] -> ss_customer_sk, RF004[bloom] -> ss_store_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=76.69MB Threads=35
+Per-Host Resource Estimates: Memory=373MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: promotions, total, CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4)) * CAST(100 AS DECIMAL(3,0))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:TOP-N [LIMIT=100]
+|  order by: promotions ASC, total ASC
+|  mem-estimate=32B mem-reservation=0B thread-reservation=0
+|  tuple-ids=17 row-size=32B cardinality=1
+|  in pipelines: 27(GETNEXT), 36(OPEN)
+|
+26:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 00
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=7,15 row-size=32B cardinality=1
+|  in pipelines: 36(GETNEXT), 44(OPEN)
+|
+|--F17:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |
+|  45:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 44(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  44:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_ext_sales_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 44(GETNEXT), 25(OPEN)
+|  |
+|  43:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=10.88MB mem-reservation=0B thread-reservation=1
+|  25:AGGREGATE
+|  |  output: sum(ss_ext_sales_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 14(OPEN)
+|  |
+|  24:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12,13 row-size=86B cardinality=3.30K
+|  |  in pipelines: 14(GETNEXT), 18(OPEN)
+|  |
+|  |--F18:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: ca_address_sk
+|  |  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  18:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=13 row-size=8B cardinality=8.33K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  23:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=02
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12 row-size=78B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 17(OPEN)
+|  |
+|  |--F19:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=3.71MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF014[bloom] <- c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  41:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=8B cardinality=100.00K
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  17:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF012[bloom] -> c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=12 row-size=8B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  40:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=903.43KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9,11,14,10 row-size=70B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10 row-size=70B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |
+|  |--F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  39:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=8B cardinality=12
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  15:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=10 row-size=8B cardinality=12
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14 row-size=62B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 19(OPEN)
+|  |
+|  |--F21:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF018[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  38:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=75.41KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=26B cardinality=1.80K
+|  |  |  in pipelines: 19(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  19:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Jewelry'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Jewelry'
+|  |     parquet dictionary predicates: i_category = 'Jewelry'
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=14 row-size=26B cardinality=1.80K
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11 row-size=36B cardinality=170.55K
+|  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |
+|  |--F22:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  37:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=12B cardinality=108
+|  |  |  in pipelines: 16(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  16:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF020[bloom] -> ss_sold_date_sk, RF018[bloom] -> ss_item_sk, RF014[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=9 row-size=24B cardinality=2.88M
+|     in pipelines: 14(GETNEXT)
+|
+36:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 36(GETNEXT), 13(OPEN)
+|
+35:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 13(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.43MB mem-reservation=0B thread-reservation=1
+13:AGGREGATE
+|  output: sum(ss_ext_sales_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=06
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4,5 row-size=133B cardinality=3.28K
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--F23:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: ca_address_sk
+|  |  runtime filters: RF000[bloom] <- ca_address_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  34:EXCHANGE [BROADCAST]
+|  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=8.33K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=5 row-size=8B cardinality=8.33K
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=07
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4 row-size=125B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F24:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=3.71MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=07 plan-id=08 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF002[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  33:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=8B cardinality=100.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=4 row-size=8B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+32:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=1.43MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,6,2,1 row-size=117B cardinality=16.94K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=08
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1 row-size=117B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=08 plan-id=09 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF004[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  31:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=12
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=1 row-size=8B cardinality=12
+|     in pipelines: 01(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=09
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2 row-size=109B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  build expressions: p_promo_sk
+|  |  runtime filters: RF006[bloom] <- p_promo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  30:EXCHANGE [BROADCAST]
+|  |  mem-estimate=26.37KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=43B cardinality=300
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_dmail = 'Y' OR p_channel_email = 'Y' OR p_channel_tv = 'Y')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=0
+|     tuple-ids=2 row-size=43B cardinality=300
+|     in pipelines: 02(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=10
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6 row-size=66B cardinality=17.06K
+|  in pipelines: 00(GETNEXT), 06(OPEN)
+|
+|--F27:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  29:EXCHANGE [BROADCAST]
+|  |  mem-estimate=75.41KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=26B cardinality=1.80K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  06:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category = 'Jewelry'
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category = 'Jewelry'
+|     parquet dictionary predicates: i_category = 'Jewelry'
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=6 row-size=26B cardinality=1.80K
+|     in pipelines: 06(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=11
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=40B cardinality=170.55K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F28:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=11 plan-id=12 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  28:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF010[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk, RF006[bloom] -> ss_promo_sk, RF002[bloom] -> ss_customer_sk, RF004[bloom] -> ss_store_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q62.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q62.test
new file mode 100644
index 0000000..5dee361
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q62.test
@@ -0,0 +1,504 @@
+# TPCDS-Q62
+SELECT w_substr,
+       sm_type,
+       web_name,
+       sum(CASE
+               WHEN (ws_ship_date_sk - ws_sold_date_sk <= 30) THEN 1
+               ELSE 0
+           END) AS "30 days",
+       sum(CASE
+               WHEN (ws_ship_date_sk - ws_sold_date_sk > 30)
+                    AND (ws_ship_date_sk - ws_sold_date_sk <= 60) THEN 1
+               ELSE 0
+           END) AS "31-60 days",
+       sum(CASE
+               WHEN (ws_ship_date_sk - ws_sold_date_sk > 60)
+                    AND (ws_ship_date_sk - ws_sold_date_sk <= 90) THEN 1
+               ELSE 0
+           END) AS "61-90 days",
+       sum(CASE
+               WHEN (ws_ship_date_sk - ws_sold_date_sk > 90)
+                    AND (ws_ship_date_sk - ws_sold_date_sk <= 120) THEN 1
+               ELSE 0
+           END) AS "91-120 days",
+       sum(CASE
+               WHEN (ws_ship_date_sk - ws_sold_date_sk > 120) THEN 1
+               ELSE 0
+           END) AS ">120 days"
+FROM web_sales,
+  (SELECT SUBSTRING(w_warehouse_name,1,20) w_substr,
+          *
+   FROM warehouse) sq1,
+     ship_mode,
+     web_site,
+     date_dim
+WHERE d_month_seq BETWEEN 1200 AND 1200 + 11
+  AND ws_ship_date_sk = d_date_sk
+  AND ws_warehouse_sk = w_warehouse_sk
+  AND ws_ship_mode_sk = sm_ship_mode_sk
+  AND ws_web_site_sk = web_site_sk
+GROUP BY w_substr,
+         sm_type,
+         web_name
+ORDER BY 1,
+         2,
+         3
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=17.69MB Threads=6
+Per-Host Resource Estimates: Memory=300MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=299.75MB mem-reservation=17.69MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: w_substr, sm_type, web_name, sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 30) AND (ws_ship_date_sk - ws_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 60) AND (ws_ship_date_sk - ws_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 90) AND (ws_ship_date_sk - ws_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+10:TOP-N [LIMIT=100]
+|  order by: w_substr ASC, sm_type ASC, web_name ASC
+|  mem-estimate=8.74KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=90B cardinality=100
+|  in pipelines: 10(GETNEXT), 09(OPEN)
+|
+09:AGGREGATE [FINALIZE]
+|  output: sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(30 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(30 AS BIGINT)) AND (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(60 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(60 AS BIGINT)) AND (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(90 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(90 AS BIGINT)) AND (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  group by: substring(w_warehouse_name, CAST(1 AS BIGINT), CAST(20 AS BIGINT)), sm_type, web_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=90B cardinality=120
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_ship_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_ship_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4,5 row-size=107B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_web_site_sk = web_site_sk
+|  fk/pk conjuncts: ws_web_site_sk = web_site_sk
+|  runtime filters: RF002[bloom] <- web_site_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4 row-size=99B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.web_site]
+|     HDFS partitions=1/1 files=1 size=11.91KB
+|     stored statistics:
+|       table: rows=30 size=11.91KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=30
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=4 row-size=22B cardinality=30
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_ship_mode_sk = sm_ship_mode_sk
+|  fk/pk conjuncts: ws_ship_mode_sk = sm_ship_mode_sk
+|  runtime filters: RF004[bloom] <- sm_ship_mode_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3 row-size=77B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.ship_mode]
+|     HDFS partitions=1/1 files=1 size=2.68KB
+|     stored statistics:
+|       table: rows=20 size=2.68KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=24B cardinality=20
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  fk/pk conjuncts: ws_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  runtime filters: RF006[bloom] <- tpcds_parquet.warehouse.w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=54B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.warehouse]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=34B cardinality=5
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_ship_date_sk, RF002[bloom] -> ws_web_site_sk, RF004[bloom] -> ws_ship_mode_sk, RF006[bloom] -> ws_warehouse_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=160.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=20.23MB Threads=12
+Per-Host Resource Estimates: Memory=320MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=22.63KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_substr, sm_type, web_name, sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 30) AND (ws_ship_date_sk - ws_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 60) AND (ws_ship_date_sk - ws_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 90) AND (ws_ship_date_sk - ws_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_substr ASC, sm_type ASC, web_name ASC
+|  limit: 100
+|  mem-estimate=22.63KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=90B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(w_substr,sm_type,web_name)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=10.03MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: w_substr ASC, sm_type ASC, web_name ASC
+|  mem-estimate=8.74KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=90B cardinality=100
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 30) AND (ws_ship_date_sk - ws_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 60) AND (ws_ship_date_sk - ws_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 90) AND (ws_ship_date_sk - ws_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  group by: w_substr, sm_type, web_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=90B cardinality=120
+|  in pipelines: 16(GETNEXT), 00(OPEN)
+|
+15:EXCHANGE [HASH(w_substr,sm_type,web_name)]
+|  mem-estimate=27.16KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=90B cardinality=120
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=181.86MB mem-reservation=17.75MB thread-reservation=2 runtime-filters-memory=4.00MB
+09:AGGREGATE [STREAMING]
+|  output: sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(30 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(30 AS BIGINT)) AND (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(60 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(60 AS BIGINT)) AND (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(90 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(90 AS BIGINT)) AND (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  group by: substring(w_warehouse_name, CAST(1 AS BIGINT), CAST(20 AS BIGINT)), sm_type, web_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=90B cardinality=120
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_ship_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_ship_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4,5 row-size=107B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=7.30K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_web_site_sk = web_site_sk
+|  fk/pk conjuncts: ws_web_site_sk = web_site_sk
+|  runtime filters: RF002[bloom] <- web_site_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4 row-size=99B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=22B cardinality=30
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.web_site, RANDOM]
+|     HDFS partitions=1/1 files=1 size=11.91KB
+|     stored statistics:
+|       table: rows=30 size=11.91KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=30
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=4 row-size=22B cardinality=30
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_ship_mode_sk = sm_ship_mode_sk
+|  fk/pk conjuncts: ws_ship_mode_sk = sm_ship_mode_sk
+|  runtime filters: RF004[bloom] <- sm_ship_mode_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3 row-size=77B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=24B cardinality=20
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.ship_mode, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.68KB
+|     stored statistics:
+|       table: rows=20 size=2.68KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=24B cardinality=20
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  fk/pk conjuncts: ws_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  runtime filters: RF006[bloom] <- tpcds_parquet.warehouse.w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=54B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=34B cardinality=5
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=34B cardinality=5
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_ship_date_sk, RF002[bloom] -> ws_web_site_sk, RF004[bloom] -> ws_ship_mode_sk, RF006[bloom] -> ws_warehouse_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=160.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=31.98MB Threads=11
+Per-Host Resource Estimates: Memory=140MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=22.63KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_substr, sm_type, web_name, sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 30) AND (ws_ship_date_sk - ws_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 60) AND (ws_ship_date_sk - ws_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 90) AND (ws_ship_date_sk - ws_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_substr ASC, sm_type ASC, web_name ASC
+|  limit: 100
+|  mem-estimate=22.63KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=90B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(w_substr,sm_type,web_name)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=10.03MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: w_substr ASC, sm_type ASC, web_name ASC
+|  mem-estimate=8.74KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=90B cardinality=100
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 30) AND (ws_ship_date_sk - ws_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 60) AND (ws_ship_date_sk - ws_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 90) AND (ws_ship_date_sk - ws_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (ws_ship_date_sk - ws_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  group by: w_substr, sm_type, web_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=90B cardinality=120
+|  in pipelines: 16(GETNEXT), 00(OPEN)
+|
+15:EXCHANGE [HASH(w_substr,sm_type,web_name)]
+|  mem-estimate=27.16KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=90B cardinality=120
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=42.00MB mem-reservation=6.00MB thread-reservation=1
+09:AGGREGATE [STREAMING]
+|  output: sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(30 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(30 AS BIGINT)) AND (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(60 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(60 AS BIGINT)) AND (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(90 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(90 AS BIGINT)) AND (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) <= CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(ws_ship_date_sk AS BIGINT) - CAST(ws_sold_date_sk AS BIGINT) > CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  group by: substring(w_warehouse_name, CAST(1 AS BIGINT), CAST(20 AS BIGINT)), sm_type, web_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=90B cardinality=120
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ws_ship_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_ship_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4,5 row-size=107B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=7.30K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=5 row-size=8B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ws_web_site_sk = web_site_sk
+|  fk/pk conjuncts: ws_web_site_sk = web_site_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4 row-size=99B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F08:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: web_site_sk
+|  |  runtime filters: RF002[bloom] <- web_site_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=22B cardinality=30
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.web_site, RANDOM]
+|     HDFS partitions=1/1 files=1 size=11.91KB
+|     stored statistics:
+|       table: rows=30 size=11.91KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=30
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=4 row-size=22B cardinality=30
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: ws_ship_mode_sk = sm_ship_mode_sk
+|  fk/pk conjuncts: ws_ship_mode_sk = sm_ship_mode_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3 row-size=77B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: sm_ship_mode_sk
+|  |  runtime filters: RF004[bloom] <- sm_ship_mode_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=24B cardinality=20
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.ship_mode, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.68KB
+|     stored statistics:
+|       table: rows=20 size=2.68KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=3 row-size=24B cardinality=20
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: ws_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  fk/pk conjuncts: ws_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=54B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: tpcds_parquet.warehouse.w_warehouse_sk
+|  |  runtime filters: RF006[bloom] <- tpcds_parquet.warehouse.w_warehouse_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=34B cardinality=5
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=1 row-size=34B cardinality=5
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_ship_date_sk, RF002[bloom] -> ws_web_site_sk, RF004[bloom] -> ws_ship_mode_sk, RF006[bloom] -> ws_warehouse_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=20B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q63.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q63.test
new file mode 100644
index 0000000..e08a9e3
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q63.test
@@ -0,0 +1,479 @@
+# TPCDS-Q63
+select
+  *
+from
+  (select
+    i_manager_id,
+    sum(ss_sales_price) sum_sales,
+    avg(sum(ss_sales_price)) over (partition by i_manager_id) avg_monthly_sales
+  from
+    item,
+    store_sales,
+    date_dim,
+    store
+  where
+    ss_item_sk = i_item_sk
+    and ss_sold_date_sk = d_date_sk
+    and ss_store_sk = s_store_sk
+    and d_month_seq in (1212, 1212 + 1, 1212 + 2, 1212 + 3, 1212 + 4, 1212 + 5, 1212 + 6, 1212 + 7, 1212 + 8, 1212 + 9, 1212 + 10, 1212 + 11)
+    and ((i_category in ('Books', 'Children', 'Electronics')
+      and i_class in ('personal', 'portable', 'refernece', 'self-help')
+      and i_brand in ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9'))
+    or (i_category in ('Women', 'Music', 'Men')
+      and i_class in ('accessories', 'classical', 'fragrances', 'pants')
+      and i_brand in ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
+  group by
+    i_manager_id,
+    d_moy
+  ) tmp1
+where
+case when avg_monthly_sales > 0 then abs (sum_sales - avg_monthly_sales) / avg_monthly_sales else null end > 0.1
+order by
+  i_manager_id,
+  avg_monthly_sales,
+  sum_sales
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=15.75MB Threads=5
+Per-Host Resource Estimates: Memory=205MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=204.81MB mem-reservation=15.75MB thread-reservation=5 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: i_manager_id, sum_sales, avg_monthly_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:TOP-N [LIMIT=100]
+|  order by: i_manager_id ASC, avg_monthly_sales ASC, sum_sales ASC
+|  mem-estimate=360B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=36B cardinality=10
+|  in pipelines: 11(GETNEXT), 08(OPEN)
+|
+10:SELECT
+|  predicates: CASE WHEN avg(sum(ss_sales_price)) > CAST(0 AS DECIMAL(3,0)) THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=15,14 row-size=40B cardinality=10
+|  in pipelines: 08(GETNEXT)
+|
+09:ANALYTIC
+|  functions: avg(sum(ss_sales_price))
+|  partition by: i_manager_id
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=15,14 row-size=40B cardinality=96
+|  in pipelines: 08(GETNEXT)
+|
+08:SORT
+|  order by: i_manager_id ASC NULLS LAST
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=15 row-size=24B cardinality=96
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+07:AGGREGATE [FINALIZE]
+|  output: sum(ss_sales_price)
+|  group by: i_manager_id, d_moy
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 07(GETNEXT), 01(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2,3 row-size=114B cardinality=96
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=4B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=110B cardinality=96
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     parquet dictionary predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=362
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF004[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=98B cardinality=481
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'refernece', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=0 row-size=78B cardinality=3
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=24.52MB Threads=10
+Per-Host Resource Estimates: Memory=231MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_manager_id, sum_sales, avg_monthly_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_manager_id ASC, avg_monthly_sales ASC, sum_sales ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=36B cardinality=10
+|  in pipelines: 11(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_manager_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=20.00MB mem-reservation=11.94MB thread-reservation=1
+11:TOP-N [LIMIT=100]
+|  order by: i_manager_id ASC, avg_monthly_sales ASC, sum_sales ASC
+|  mem-estimate=360B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=36B cardinality=10
+|  in pipelines: 11(GETNEXT), 08(OPEN)
+|
+10:SELECT
+|  predicates: CASE WHEN avg(sum(ss_sales_price)) > CAST(0 AS DECIMAL(3,0)) THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=15,14 row-size=40B cardinality=10
+|  in pipelines: 08(GETNEXT)
+|
+09:ANALYTIC
+|  functions: avg(sum(ss_sales_price))
+|  partition by: i_manager_id
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=15,14 row-size=40B cardinality=96
+|  in pipelines: 08(GETNEXT)
+|
+08:SORT
+|  order by: i_manager_id ASC NULLS LAST
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=15 row-size=24B cardinality=96
+|  in pipelines: 08(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: i_manager_id, d_moy
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 16(GETNEXT), 01(OPEN)
+|
+15:EXCHANGE [HASH(i_manager_id)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=66.86MB mem-reservation=11.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+07:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: i_manager_id, d_moy
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 01(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2,3 row-size=114B cardinality=96
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=4B cardinality=12
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=4B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=110B cardinality=96
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=362
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     parquet dictionary predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=362
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF004[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=98B cardinality=481
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=78B cardinality=3
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=80.00MB mem-reservation=256.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'refernece', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=0 row-size=78B cardinality=3
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=48.27MB Threads=11
+Per-Host Resource Estimates: Memory=158MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_manager_id, sum_sales, avg_monthly_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_manager_id ASC, avg_monthly_sales ASC, sum_sales ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=36B cardinality=10
+|  in pipelines: 11(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_manager_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=20.00MB mem-reservation=11.94MB thread-reservation=1
+11:TOP-N [LIMIT=100]
+|  order by: i_manager_id ASC, avg_monthly_sales ASC, sum_sales ASC
+|  mem-estimate=360B mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=36B cardinality=10
+|  in pipelines: 11(GETNEXT), 08(OPEN)
+|
+10:SELECT
+|  predicates: CASE WHEN avg(sum(ss_sales_price)) > CAST(0 AS DECIMAL(3,0)) THEN abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price)) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=15,14 row-size=40B cardinality=10
+|  in pipelines: 08(GETNEXT)
+|
+09:ANALYTIC
+|  functions: avg(sum(ss_sales_price))
+|  partition by: i_manager_id
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=15,14 row-size=40B cardinality=96
+|  in pipelines: 08(GETNEXT)
+|
+08:SORT
+|  order by: i_manager_id ASC NULLS LAST
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=15 row-size=24B cardinality=96
+|  in pipelines: 08(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: i_manager_id, d_moy
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 16(GETNEXT), 01(OPEN)
+|
+15:EXCHANGE [HASH(i_manager_id)]
+|  mem-estimate=16.50KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: i_manager_id, d_moy
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=24B cardinality=96
+|  in pipelines: 01(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2,3 row-size=114B cardinality=96
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF000[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=4B cardinality=12
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=3 row-size=4B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=110B cardinality=96
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=362
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     parquet dictionary predicates: d_month_seq IN (CAST(1212 AS INT), CAST(1213 AS INT), CAST(1214 AS INT), CAST(1215 AS INT), CAST(1216 AS INT), CAST(1217 AS INT), CAST(1218 AS INT), CAST(1219 AS INT), CAST(1220 AS INT), CAST(1221 AS INT), CAST(1222 AS INT), CAST(1223 AS INT))
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=12B cardinality=362
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=98B cardinality=481
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF004[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=78B cardinality=3
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category IN ('Books', 'Children', 'Electronics') AND i_class IN ('personal', 'portable', 'refernece', 'self-help') AND i_brand IN ('scholaramalgamalg #14', 'scholaramalgamalg #7', 'exportiunivamalg #9', 'scholaramalgamalg #9')) OR (i_category IN ('Women', 'Music', 'Men') AND i_class IN ('accessories', 'classical', 'fragrances', 'pants') AND i_brand IN ('amalgimporto #1', 'edu packscholar #1', 'exportiimporto #1', 'importoamalg #1')))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=0 row-size=78B cardinality=3
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=1 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q64.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q64.test
new file mode 100644
index 0000000..7b14fbe
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q64.test
@@ -0,0 +1,3452 @@
+# TPCDS-Q64
+WITH cs_ui AS
+  (SELECT cs_item_sk,
+          sum(cs_ext_list_price) AS sale,
+          sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit) AS refund
+   FROM catalog_sales,
+        catalog_returns
+   WHERE cs_item_sk = cr_item_sk
+     AND cs_order_number = cr_order_number
+   GROUP BY cs_item_sk
+   HAVING sum(cs_ext_list_price)>2*sum(cr_refunded_cash+cr_reversed_charge+cr_store_credit)),
+     cross_sales AS
+  (SELECT i_product_name product_name,
+          i_item_sk item_sk,
+          s_store_name store_name,
+          s_zip store_zip,
+          ad1.ca_street_number b_street_number,
+          ad1.ca_street_name b_street_name,
+          ad1.ca_city b_city,
+          ad1.ca_zip b_zip,
+          ad2.ca_street_number c_street_number,
+          ad2.ca_street_name c_street_name,
+          ad2.ca_city c_city,
+          ad2.ca_zip c_zip,
+          d1.d_year AS syear,
+          d2.d_year AS fsyear,
+          d3.d_year s2year,
+          count(*) cnt,
+          sum(ss_wholesale_cost) s1,
+          sum(ss_list_price) s2,
+          sum(ss_coupon_amt) s3
+   FROM store_sales,
+        store_returns,
+        cs_ui,
+        date_dim d1,
+        date_dim d2,
+        date_dim d3,
+        store,
+        customer,
+        customer_demographics cd1,
+        customer_demographics cd2,
+        promotion,
+        household_demographics hd1,
+        household_demographics hd2,
+        customer_address ad1,
+        customer_address ad2,
+        income_band ib1,
+        income_band ib2,
+        item
+   WHERE ss_store_sk = s_store_sk
+     AND ss_sold_date_sk = d1.d_date_sk
+     AND ss_customer_sk = c_customer_sk
+     AND ss_cdemo_sk= cd1.cd_demo_sk
+     AND ss_hdemo_sk = hd1.hd_demo_sk
+     AND ss_addr_sk = ad1.ca_address_sk
+     AND ss_item_sk = i_item_sk
+     AND ss_item_sk = sr_item_sk
+     AND ss_ticket_number = sr_ticket_number
+     AND ss_item_sk = cs_ui.cs_item_sk
+     AND c_current_cdemo_sk = cd2.cd_demo_sk
+     AND c_current_hdemo_sk = hd2.hd_demo_sk
+     AND c_current_addr_sk = ad2.ca_address_sk
+     AND c_first_sales_date_sk = d2.d_date_sk
+     AND c_first_shipto_date_sk = d3.d_date_sk
+     AND ss_promo_sk = p_promo_sk
+     AND hd1.hd_income_band_sk = ib1.ib_income_band_sk
+     AND hd2.hd_income_band_sk = ib2.ib_income_band_sk
+     AND cd1.cd_marital_status <> cd2.cd_marital_status
+     AND i_color IN ('purple',
+                     'burlywood',
+                     'indian',
+                     'spring',
+                     'floral',
+                     'medium')
+     AND i_current_price BETWEEN 64 AND 64 + 10
+     AND i_current_price BETWEEN 64 + 1 AND 64 + 15
+   GROUP BY i_product_name,
+            i_item_sk,
+            s_store_name,
+            s_zip,
+            ad1.ca_street_number,
+            ad1.ca_street_name,
+            ad1.ca_city,
+            ad1.ca_zip,
+            ad2.ca_street_number,
+            ad2.ca_street_name,
+            ad2.ca_city,
+            ad2.ca_zip,
+            d1.d_year,
+            d2.d_year,
+            d3.d_year)
+SELECT cs1.product_name,
+       cs1.store_name,
+       cs1.store_zip,
+       cs1.b_street_number,
+       cs1.b_street_name,
+       cs1.b_city,
+       cs1.b_zip,
+       cs1.c_street_number,
+       cs1.c_street_name,
+       cs1.c_city,
+       cs1.c_zip,
+       cs1.syear,
+       cs1.cnt,
+       cs1.s1 AS s11,
+       cs1.s2 AS s21,
+       cs1.s3 AS s31,
+       cs2.s1 AS s12,
+       cs2.s2 AS s22,
+       cs2.s3 AS s32,
+       cs2.syear,
+       cs2.cnt
+FROM cross_sales cs1,
+     cross_sales cs2
+WHERE cs1.item_sk=cs2.item_sk
+  AND cs1.syear = 1999
+  AND cs2.syear = 1999 + 1
+  AND cs2.cnt <= cs1.cnt
+  AND cs1.store_name = cs2.store_name
+  AND cs1.store_zip = cs2.store_zip
+ORDER BY cs1.product_name,
+         cs1.store_name,
+         cs2.cnt,
+         cs1.s1,
+         cs2.s1;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=154.39MB Threads=39
+Per-Host Resource Estimates: Memory=2.17GB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=2.17GB mem-reservation=154.39MB thread-reservation=39 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: product_name, store_name, store_zip, b_street_number, b_street_name, b_city, b_zip, c_street_number, c_street_name, c_city, c_zip, syear, cnt, s1, s2, s3, s1, s2, s3, syear, cnt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+79:SORT
+|  order by: product_name ASC, store_name ASC, cnt ASC, s1 ASC, s1 ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=46 row-size=330B cardinality=288.12K
+|  in pipelines: 79(GETNEXT), 38(OPEN)
+|
+78:HASH JOIN [INNER JOIN]
+|  hash predicates: i_item_sk = i_item_sk, s_store_name = s_store_name, s_zip = s_zip
+|  fk/pk conjuncts: i_item_sk = i_item_sk, s_store_name = s_store_name, s_zip = s_zip
+|  other predicates: count(*) <= count(*)
+|  mem-estimate=86.56MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21,44 row-size=573B cardinality=288.12K
+|  in pipelines: 38(GETNEXT), 77(OPEN)
+|
+|--77:AGGREGATE [FINALIZE]
+|  |  output: count(*), sum(ss_wholesale_cost), sum(ss_list_price), sum(ss_coupon_amt)
+|  |  group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
+|  |  mem-estimate=86.56MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=44 row-size=286B cardinality=288.12K
+|  |  in pipelines: 77(GETNEXT), 56(OPEN)
+|  |
+|  76:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = cs_item_sk
+|  |  fk/pk conjuncts: none
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=40,39,35,34,33,24,23,43,29,37,36,32,38,30,31,41,42,27 row-size=474B cardinality=288.12K
+|  |  in pipelines: 56(GETNEXT), 44(OPEN)
+|  |
+|  |--44:AGGREGATE [FINALIZE]
+|  |  |  output: sum(cs_ext_list_price), sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  |  group by: cs_item_sk
+|  |  |  having: sum(cs_ext_list_price) > CAST(2 AS DECIMAL(3,0)) * sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=27 row-size=40B cardinality=1.80K
+|  |  |  in pipelines: 44(GETNEXT), 41(OPEN)
+|  |  |
+|  |  43:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  |  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=25,26 row-size=48B cardinality=849.41K
+|  |  |  in pipelines: 41(GETNEXT), 42(OPEN)
+|  |  |
+|  |  |--42:SCAN HDFS [tpcds_parquet.catalog_returns]
+|  |  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=144.07K size=10.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |  |     mem-estimate=120.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=26 row-size=28B cardinality=144.07K
+|  |  |     in pipelines: 42(GETNEXT)
+|  |  |
+|  |  41:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=25 row-size=20B cardinality=1.44M
+|  |     in pipelines: 41(GETNEXT)
+|  |
+|  75:HASH JOIN [INNER JOIN]
+|  |  hash predicates: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  |  fk/pk conjuncts: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=40,39,35,34,33,24,23,43,29,37,36,32,38,30,31,41,42 row-size=434B cardinality=8.45K
+|  |  in pipelines: 56(GETNEXT), 58(OPEN)
+|  |
+|  |--58:SCAN HDFS [tpcds_parquet.income_band ib2]
+|  |     HDFS partitions=1/1 files=1 size=1.21KB
+|  |     stored statistics:
+|  |       table: rows=20 size=1.21KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=20
+|  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |     tuple-ids=42 row-size=4B cardinality=20
+|  |     in pipelines: 58(GETNEXT)
+|  |
+|  74:HASH JOIN [INNER JOIN]
+|  |  hash predicates: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  |  fk/pk conjuncts: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=40,39,35,34,33,24,23,43,29,37,36,32,38,30,31,41 row-size=430B cardinality=8.45K
+|  |  in pipelines: 56(GETNEXT), 57(OPEN)
+|  |
+|  |--57:SCAN HDFS [tpcds_parquet.income_band ib1]
+|  |     HDFS partitions=1/1 files=1 size=1.21KB
+|  |     stored statistics:
+|  |       table: rows=20 size=1.21KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=20
+|  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |     tuple-ids=41 row-size=4B cardinality=20
+|  |     in pipelines: 57(GETNEXT)
+|  |
+|  73:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ad2.ca_address_sk = c_current_addr_sk
+|  |  fk/pk conjuncts: ad2.ca_address_sk = c_current_addr_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=40,39,35,34,33,24,23,43,29,37,36,32,38,30,31 row-size=426B cardinality=8.45K
+|  |  in pipelines: 56(GETNEXT), 55(OPEN)
+|  |
+|  |--72:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ad1.ca_address_sk = ss_addr_sk
+|  |  |  fk/pk conjuncts: ad1.ca_address_sk = ss_addr_sk
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=39,35,34,33,24,23,43,29,37,36,32,38,30,31 row-size=348B cardinality=8.45K
+|  |  |  in pipelines: 55(GETNEXT), 51(OPEN)
+|  |  |
+|  |  |--71:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cd2.cd_demo_sk = c_current_cdemo_sk
+|  |  |  |  fk/pk conjuncts: cd2.cd_demo_sk = c_current_cdemo_sk
+|  |  |  |  other predicates: cd1.cd_marital_status != cd2.cd_marital_status
+|  |  |  |  runtime filters: RF056[bloom] <- c_current_cdemo_sk
+|  |  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  |  tuple-ids=35,34,33,24,23,43,29,37,36,32,38,30,31 row-size=271B cardinality=8.45K
+|  |  |  |  in pipelines: 51(GETNEXT), 50(OPEN)
+|  |  |  |
+|  |  |  |--70:HASH JOIN [INNER JOIN]
+|  |  |  |  |  hash predicates: cd1.cd_demo_sk = ss_cdemo_sk
+|  |  |  |  |  fk/pk conjuncts: cd1.cd_demo_sk = ss_cdemo_sk
+|  |  |  |  |  runtime filters: RF058[bloom] <- ss_cdemo_sk
+|  |  |  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=34,33,24,23,43,29,37,36,32,38,30,31 row-size=254B cardinality=8.45K
+|  |  |  |  |  in pipelines: 50(GETNEXT), 49(OPEN)
+|  |  |  |  |
+|  |  |  |  |--69:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  hash predicates: c_first_shipto_date_sk = d3.d_date_sk
+|  |  |  |  |  |  fk/pk conjuncts: c_first_shipto_date_sk = d3.d_date_sk
+|  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=33,24,23,43,29,37,36,32,38,30,31 row-size=237B cardinality=8.45K
+|  |  |  |  |  |  in pipelines: 49(GETNEXT), 47(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  |--47:SCAN HDFS [tpcds_parquet.date_dim d3]
+|  |  |  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |  |  |       columns: all
+|  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |  |     tuple-ids=31 row-size=8B cardinality=73.05K
+|  |  |  |  |  |     in pipelines: 47(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  68:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  hash predicates: c_first_sales_date_sk = d2.d_date_sk
+|  |  |  |  |  |  fk/pk conjuncts: c_first_sales_date_sk = d2.d_date_sk
+|  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=33,24,23,43,29,37,36,32,38,30 row-size=229B cardinality=8.45K
+|  |  |  |  |  |  in pipelines: 49(GETNEXT), 46(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  |--46:SCAN HDFS [tpcds_parquet.date_dim d2]
+|  |  |  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |  |  |       columns: all
+|  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |  |     tuple-ids=30 row-size=8B cardinality=73.05K
+|  |  |  |  |  |     in pipelines: 46(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  67:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  hash predicates: c_current_hdemo_sk = hd2.hd_demo_sk
+|  |  |  |  |  |  fk/pk conjuncts: c_current_hdemo_sk = hd2.hd_demo_sk
+|  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=33,24,23,43,29,37,36,32,38 row-size=221B cardinality=8.45K
+|  |  |  |  |  |  in pipelines: 49(GETNEXT), 54(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  |--54:SCAN HDFS [tpcds_parquet.household_demographics hd2]
+|  |  |  |  |  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |       table: rows=7.20K size=41.69KB
+|  |  |  |  |  |       columns: all
+|  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |  |  |  |  |     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  |  |  |  |     tuple-ids=38 row-size=8B cardinality=7.20K
+|  |  |  |  |  |     in pipelines: 54(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  66:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  hash predicates: c_customer_sk = ss_customer_sk
+|  |  |  |  |  |  fk/pk conjuncts: c_customer_sk = ss_customer_sk
+|  |  |  |  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=33,24,23,43,29,37,36,32 row-size=213B cardinality=8.66K
+|  |  |  |  |  |  in pipelines: 49(GETNEXT), 40(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  |--65:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  |  hash predicates: ss_store_sk = s_store_sk
+|  |  |  |  |  |  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  |  tuple-ids=24,23,43,29,37,36,32 row-size=189B cardinality=8.66K
+|  |  |  |  |  |  |  in pipelines: 40(GETNEXT), 48(OPEN)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  |--48:SCAN HDFS [tpcds_parquet.store]
+|  |  |  |  |  |  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |  |       table: rows=12 size=9.93KB
+|  |  |  |  |  |  |       columns: all
+|  |  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |  |  |  |  |  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |  |  |  |  |  |     tuple-ids=32 row-size=37B cardinality=12
+|  |  |  |  |  |  |     in pipelines: 48(GETNEXT)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  64:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  |  hash predicates: ss_promo_sk = p_promo_sk
+|  |  |  |  |  |  |  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  |  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  |  tuple-ids=24,23,43,29,37,36 row-size=151B cardinality=8.66K
+|  |  |  |  |  |  |  in pipelines: 40(GETNEXT), 52(OPEN)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  |--52:SCAN HDFS [tpcds_parquet.promotion]
+|  |  |  |  |  |  |     HDFS partitions=1/1 files=1 size=23.30KB
+|  |  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |  |       table: rows=300 size=23.30KB
+|  |  |  |  |  |  |       columns: all
+|  |  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=300
+|  |  |  |  |  |  |     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  |  |  |  |  |  |     tuple-ids=36 row-size=4B cardinality=300
+|  |  |  |  |  |  |     in pipelines: 52(GETNEXT)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  63:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  |  hash predicates: ss_hdemo_sk = hd1.hd_demo_sk
+|  |  |  |  |  |  |  fk/pk conjuncts: ss_hdemo_sk = hd1.hd_demo_sk
+|  |  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  |  tuple-ids=24,23,43,29,37 row-size=147B cardinality=8.72K
+|  |  |  |  |  |  |  in pipelines: 40(GETNEXT), 53(OPEN)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  |--53:SCAN HDFS [tpcds_parquet.household_demographics hd1]
+|  |  |  |  |  |  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |  |       table: rows=7.20K size=41.69KB
+|  |  |  |  |  |  |       columns: all
+|  |  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |  |  |  |  |  |     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  |  |  |  |  |     tuple-ids=37 row-size=8B cardinality=7.20K
+|  |  |  |  |  |  |     in pipelines: 53(GETNEXT)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  62:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  |  hash predicates: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  |  |  |  |  fk/pk conjuncts: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  |  |  |  |  runtime filters: RF074[bloom] <- ss_item_sk, RF075[bloom] <- ss_ticket_number
+|  |  |  |  |  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  |  |  |  tuple-ids=24,23,43,29 row-size=139B cardinality=8.93K
+|  |  |  |  |  |  |  in pipelines: 40(GETNEXT), 39(OPEN)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  |--61:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  |  |  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  |  |  tuple-ids=23,43,29 row-size=123B cardinality=12.14K
+|  |  |  |  |  |  |  |  in pipelines: 39(GETNEXT), 45(OPEN)
+|  |  |  |  |  |  |  |
+|  |  |  |  |  |  |  |--45:SCAN HDFS [tpcds_parquet.date_dim d1]
+|  |  |  |  |  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |  |  |  |  |     predicates: d1.d_year = CAST(2000 AS INT)
+|  |  |  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |  |  |  |  |       columns: all
+|  |  |  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |  |  |  |  |     parquet statistics predicates: d1.d_year = CAST(2000 AS INT)
+|  |  |  |  |  |  |  |     parquet dictionary predicates: d1.d_year = CAST(2000 AS INT)
+|  |  |  |  |  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |  |  |  |     tuple-ids=29 row-size=8B cardinality=373
+|  |  |  |  |  |  |  |     in pipelines: 45(GETNEXT)
+|  |  |  |  |  |  |  |
+|  |  |  |  |  |  |  60:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  |  |  |  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  |  |  |  |  |  runtime filters: RF080[bloom] <- i_item_sk
+|  |  |  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  |  |  tuple-ids=23,43 row-size=115B cardinality=59.37K
+|  |  |  |  |  |  |  |  in pipelines: 39(GETNEXT), 59(OPEN)
+|  |  |  |  |  |  |  |
+|  |  |  |  |  |  |  |--59:SCAN HDFS [tpcds_parquet.item]
+|  |  |  |  |  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |  |  |  |  |     predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |  |  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |  |  |  |  |       columns: all
+|  |  |  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |  |  |  |  |     parquet statistics predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |  |  |  |  |  |  |     parquet dictionary predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |  |  |  |  |  |  |     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |  |  |  |     tuple-ids=43 row-size=59B cardinality=371
+|  |  |  |  |  |  |  |     in pipelines: 59(GETNEXT)
+|  |  |  |  |  |  |  |
+|  |  |  |  |  |  |  39:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |  |  |  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |  |  |  |  |     runtime filters: RF080[bloom] -> ss_item_sk
+|  |  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |  |       table: rows=2.88M size=201.02MB
+|  |  |  |  |  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |  |  |  |  |       columns: all
+|  |  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |  |  |  |  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |  |  |  |  |     tuple-ids=23 row-size=56B cardinality=2.88M
+|  |  |  |  |  |  |     in pipelines: 39(GETNEXT)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  40:SCAN HDFS [tpcds_parquet.store_returns]
+|  |  |  |  |  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |  |  |  |  |     runtime filters: RF074[bloom] -> sr_item_sk, RF075[bloom] -> sr_ticket_number
+|  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |       table: rows=287.51K size=15.43MB
+|  |  |  |  |  |       columns: all
+|  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |  |  |  |  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |  |  |  |     tuple-ids=24 row-size=16B cardinality=287.51K
+|  |  |  |  |  |     in pipelines: 40(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  49:SCAN HDFS [tpcds_parquet.customer]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |  |     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  |  |     tuple-ids=33 row-size=24B cardinality=100.00K
+|  |  |  |  |     in pipelines: 49(GETNEXT)
+|  |  |  |  |
+|  |  |  |  50:SCAN HDFS [tpcds_parquet.customer_demographics cd1]
+|  |  |  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |  |  |     runtime filters: RF058[bloom] -> cd1.cd_demo_sk
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=1.92M size=7.49MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |  |  |     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |  |     tuple-ids=34 row-size=17B cardinality=1.92M
+|  |  |  |     in pipelines: 50(GETNEXT)
+|  |  |  |
+|  |  |  51:SCAN HDFS [tpcds_parquet.customer_demographics cd2]
+|  |  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |  |     runtime filters: RF056[bloom] -> cd2.cd_demo_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=1.92M size=7.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |  |     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |     tuple-ids=35 row-size=17B cardinality=1.92M
+|  |  |     in pipelines: 51(GETNEXT)
+|  |  |
+|  |  55:SCAN HDFS [tpcds_parquet.customer_address ad1]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=39 row-size=78B cardinality=50.00K
+|  |     in pipelines: 55(GETNEXT)
+|  |
+|  56:SCAN HDFS [tpcds_parquet.customer_address ad2]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=40 row-size=78B cardinality=50.00K
+|     in pipelines: 56(GETNEXT)
+|
+38:AGGREGATE [FINALIZE]
+|  output: count(*), sum(ss_wholesale_cost), sum(ss_list_price), sum(ss_coupon_amt)
+|  group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
+|  mem-estimate=86.56MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21 row-size=286B cardinality=288.12K
+|  in pipelines: 38(GETNEXT), 17(OPEN)
+|
+37:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = cs_item_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=17,16,12,11,10,1,0,20,6,14,13,9,15,7,8,18,19,4 row-size=474B cardinality=288.12K
+|  in pipelines: 17(GETNEXT), 05(OPEN)
+|
+|--05:AGGREGATE [FINALIZE]
+|  |  output: sum(cs_ext_list_price), sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  group by: cs_item_sk
+|  |  having: sum(cs_ext_list_price) > CAST(2 AS DECIMAL(3,0)) * sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=40B cardinality=1.80K
+|  |  in pipelines: 05(GETNEXT), 02(OPEN)
+|  |
+|  04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=2,3 row-size=48B cardinality=849.41K
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.catalog_returns]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=120.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=3 row-size=28B cardinality=144.07K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=2 row-size=20B cardinality=1.44M
+|     in pipelines: 02(GETNEXT)
+|
+36:HASH JOIN [INNER JOIN]
+|  hash predicates: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  fk/pk conjuncts: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=17,16,12,11,10,1,0,20,6,14,13,9,15,7,8,18,19 row-size=434B cardinality=8.45K
+|  in pipelines: 17(GETNEXT), 19(OPEN)
+|
+|--19:SCAN HDFS [tpcds_parquet.income_band ib2]
+|     HDFS partitions=1/1 files=1 size=1.21KB
+|     stored statistics:
+|       table: rows=20 size=1.21KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|     tuple-ids=19 row-size=4B cardinality=20
+|     in pipelines: 19(GETNEXT)
+|
+35:HASH JOIN [INNER JOIN]
+|  hash predicates: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  fk/pk conjuncts: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=17,16,12,11,10,1,0,20,6,14,13,9,15,7,8,18 row-size=430B cardinality=8.45K
+|  in pipelines: 17(GETNEXT), 18(OPEN)
+|
+|--18:SCAN HDFS [tpcds_parquet.income_band ib1]
+|     HDFS partitions=1/1 files=1 size=1.21KB
+|     stored statistics:
+|       table: rows=20 size=1.21KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|     tuple-ids=18 row-size=4B cardinality=20
+|     in pipelines: 18(GETNEXT)
+|
+34:HASH JOIN [INNER JOIN]
+|  hash predicates: ad2.ca_address_sk = c_current_addr_sk
+|  fk/pk conjuncts: ad2.ca_address_sk = c_current_addr_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=17,16,12,11,10,1,0,20,6,14,13,9,15,7,8 row-size=426B cardinality=8.45K
+|  in pipelines: 17(GETNEXT), 16(OPEN)
+|
+|--33:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ad1.ca_address_sk = ss_addr_sk
+|  |  fk/pk conjuncts: ad1.ca_address_sk = ss_addr_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=16,12,11,10,1,0,20,6,14,13,9,15,7,8 row-size=348B cardinality=8.45K
+|  |  in pipelines: 16(GETNEXT), 12(OPEN)
+|  |
+|  |--32:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cd2.cd_demo_sk = c_current_cdemo_sk
+|  |  |  fk/pk conjuncts: cd2.cd_demo_sk = c_current_cdemo_sk
+|  |  |  other predicates: cd1.cd_marital_status != cd2.cd_marital_status
+|  |  |  runtime filters: RF016[bloom] <- c_current_cdemo_sk
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=12,11,10,1,0,20,6,14,13,9,15,7,8 row-size=271B cardinality=8.45K
+|  |  |  in pipelines: 12(GETNEXT), 11(OPEN)
+|  |  |
+|  |  |--31:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cd1.cd_demo_sk = ss_cdemo_sk
+|  |  |  |  fk/pk conjuncts: cd1.cd_demo_sk = ss_cdemo_sk
+|  |  |  |  runtime filters: RF018[bloom] <- ss_cdemo_sk
+|  |  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=11,10,1,0,20,6,14,13,9,15,7,8 row-size=254B cardinality=8.45K
+|  |  |  |  in pipelines: 11(GETNEXT), 10(OPEN)
+|  |  |  |
+|  |  |  |--30:HASH JOIN [INNER JOIN]
+|  |  |  |  |  hash predicates: c_first_shipto_date_sk = d3.d_date_sk
+|  |  |  |  |  fk/pk conjuncts: c_first_shipto_date_sk = d3.d_date_sk
+|  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=10,1,0,20,6,14,13,9,15,7,8 row-size=237B cardinality=8.45K
+|  |  |  |  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |  |  |  |
+|  |  |  |  |--08:SCAN HDFS [tpcds_parquet.date_dim d3]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |     tuple-ids=8 row-size=8B cardinality=73.05K
+|  |  |  |  |     in pipelines: 08(GETNEXT)
+|  |  |  |  |
+|  |  |  |  29:HASH JOIN [INNER JOIN]
+|  |  |  |  |  hash predicates: c_first_sales_date_sk = d2.d_date_sk
+|  |  |  |  |  fk/pk conjuncts: c_first_sales_date_sk = d2.d_date_sk
+|  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=10,1,0,20,6,14,13,9,15,7 row-size=229B cardinality=8.45K
+|  |  |  |  |  in pipelines: 10(GETNEXT), 07(OPEN)
+|  |  |  |  |
+|  |  |  |  |--07:SCAN HDFS [tpcds_parquet.date_dim d2]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |     tuple-ids=7 row-size=8B cardinality=73.05K
+|  |  |  |  |     in pipelines: 07(GETNEXT)
+|  |  |  |  |
+|  |  |  |  28:HASH JOIN [INNER JOIN]
+|  |  |  |  |  hash predicates: c_current_hdemo_sk = hd2.hd_demo_sk
+|  |  |  |  |  fk/pk conjuncts: c_current_hdemo_sk = hd2.hd_demo_sk
+|  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=10,1,0,20,6,14,13,9,15 row-size=221B cardinality=8.45K
+|  |  |  |  |  in pipelines: 10(GETNEXT), 15(OPEN)
+|  |  |  |  |
+|  |  |  |  |--15:SCAN HDFS [tpcds_parquet.household_demographics hd2]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=7.20K size=41.69KB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |  |  |  |     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  |  |  |     tuple-ids=15 row-size=8B cardinality=7.20K
+|  |  |  |  |     in pipelines: 15(GETNEXT)
+|  |  |  |  |
+|  |  |  |  27:HASH JOIN [INNER JOIN]
+|  |  |  |  |  hash predicates: c_customer_sk = ss_customer_sk
+|  |  |  |  |  fk/pk conjuncts: c_customer_sk = ss_customer_sk
+|  |  |  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  |  tuple-ids=10,1,0,20,6,14,13,9 row-size=213B cardinality=8.66K
+|  |  |  |  |  in pipelines: 10(GETNEXT), 01(OPEN)
+|  |  |  |  |
+|  |  |  |  |--26:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  hash predicates: ss_store_sk = s_store_sk
+|  |  |  |  |  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=1,0,20,6,14,13,9 row-size=189B cardinality=8.66K
+|  |  |  |  |  |  in pipelines: 01(GETNEXT), 09(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  |--09:SCAN HDFS [tpcds_parquet.store]
+|  |  |  |  |  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |       table: rows=12 size=9.93KB
+|  |  |  |  |  |       columns: all
+|  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |  |  |  |  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |  |  |  |  |     tuple-ids=9 row-size=37B cardinality=12
+|  |  |  |  |  |     in pipelines: 09(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  25:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  hash predicates: ss_promo_sk = p_promo_sk
+|  |  |  |  |  |  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=1,0,20,6,14,13 row-size=151B cardinality=8.66K
+|  |  |  |  |  |  in pipelines: 01(GETNEXT), 13(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  |--13:SCAN HDFS [tpcds_parquet.promotion]
+|  |  |  |  |  |     HDFS partitions=1/1 files=1 size=23.30KB
+|  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |       table: rows=300 size=23.30KB
+|  |  |  |  |  |       columns: all
+|  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=300
+|  |  |  |  |  |     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  |  |  |  |  |     tuple-ids=13 row-size=4B cardinality=300
+|  |  |  |  |  |     in pipelines: 13(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  24:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  hash predicates: ss_hdemo_sk = hd1.hd_demo_sk
+|  |  |  |  |  |  fk/pk conjuncts: ss_hdemo_sk = hd1.hd_demo_sk
+|  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=1,0,20,6,14 row-size=147B cardinality=8.72K
+|  |  |  |  |  |  in pipelines: 01(GETNEXT), 14(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  |--14:SCAN HDFS [tpcds_parquet.household_demographics hd1]
+|  |  |  |  |  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |       table: rows=7.20K size=41.69KB
+|  |  |  |  |  |       columns: all
+|  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |  |  |  |  |     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  |  |  |  |     tuple-ids=14 row-size=8B cardinality=7.20K
+|  |  |  |  |  |     in pipelines: 14(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  23:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  hash predicates: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  |  |  |  fk/pk conjuncts: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  |  |  |  runtime filters: RF034[bloom] <- ss_item_sk, RF035[bloom] <- ss_ticket_number
+|  |  |  |  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  |  |  tuple-ids=1,0,20,6 row-size=139B cardinality=8.93K
+|  |  |  |  |  |  in pipelines: 01(GETNEXT), 00(OPEN)
+|  |  |  |  |  |
+|  |  |  |  |  |--22:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  |  |  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  |  tuple-ids=0,20,6 row-size=123B cardinality=12.14K
+|  |  |  |  |  |  |  in pipelines: 00(GETNEXT), 06(OPEN)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  |--06:SCAN HDFS [tpcds_parquet.date_dim d1]
+|  |  |  |  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |  |  |  |     predicates: d1.d_year = CAST(1999 AS INT)
+|  |  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |  |  |  |       columns: all
+|  |  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |  |  |  |     parquet statistics predicates: d1.d_year = CAST(1999 AS INT)
+|  |  |  |  |  |  |     parquet dictionary predicates: d1.d_year = CAST(1999 AS INT)
+|  |  |  |  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |  |  |     tuple-ids=6 row-size=8B cardinality=373
+|  |  |  |  |  |  |     in pipelines: 06(GETNEXT)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  21:HASH JOIN [INNER JOIN]
+|  |  |  |  |  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  |  |  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  |  |  |  |  runtime filters: RF040[bloom] <- i_item_sk
+|  |  |  |  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |  |  |  tuple-ids=0,20 row-size=115B cardinality=59.37K
+|  |  |  |  |  |  |  in pipelines: 00(GETNEXT), 20(OPEN)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  |--20:SCAN HDFS [tpcds_parquet.item]
+|  |  |  |  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |  |  |  |     predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |  |  |  |       columns: all
+|  |  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |  |  |  |     parquet statistics predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |  |  |  |  |  |     parquet dictionary predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |  |  |  |  |  |     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |  |  |  |     tuple-ids=20 row-size=59B cardinality=371
+|  |  |  |  |  |  |     in pipelines: 20(GETNEXT)
+|  |  |  |  |  |  |
+|  |  |  |  |  |  00:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |  |  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |  |  |  |     runtime filters: RF040[bloom] -> ss_item_sk
+|  |  |  |  |  |     stored statistics:
+|  |  |  |  |  |       table: rows=2.88M size=201.02MB
+|  |  |  |  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |  |  |  |       columns: all
+|  |  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |  |  |  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |  |  |  |     tuple-ids=0 row-size=56B cardinality=2.88M
+|  |  |  |  |  |     in pipelines: 00(GETNEXT)
+|  |  |  |  |  |
+|  |  |  |  |  01:SCAN HDFS [tpcds_parquet.store_returns]
+|  |  |  |  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |  |  |  |     runtime filters: RF034[bloom] -> sr_item_sk, RF035[bloom] -> sr_ticket_number
+|  |  |  |  |     stored statistics:
+|  |  |  |  |       table: rows=287.51K size=15.43MB
+|  |  |  |  |       columns: all
+|  |  |  |  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |  |  |  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |  |  |     tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  |  |  |     in pipelines: 01(GETNEXT)
+|  |  |  |  |
+|  |  |  |  10:SCAN HDFS [tpcds_parquet.customer]
+|  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  |     tuple-ids=10 row-size=24B cardinality=100.00K
+|  |  |  |     in pipelines: 10(GETNEXT)
+|  |  |  |
+|  |  |  11:SCAN HDFS [tpcds_parquet.customer_demographics cd1]
+|  |  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |  |     runtime filters: RF018[bloom] -> cd1.cd_demo_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=1.92M size=7.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |  |     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |     tuple-ids=11 row-size=17B cardinality=1.92M
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  12:SCAN HDFS [tpcds_parquet.customer_demographics cd2]
+|  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |     runtime filters: RF016[bloom] -> cd2.cd_demo_sk
+|  |     stored statistics:
+|  |       table: rows=1.92M size=7.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=17B cardinality=1.92M
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  16:SCAN HDFS [tpcds_parquet.customer_address ad1]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=16 row-size=78B cardinality=50.00K
+|     in pipelines: 16(GETNEXT)
+|
+17:SCAN HDFS [tpcds_parquet.customer_address ad2]
+   HDFS partitions=1/1 files=1 size=1.16MB
+   stored statistics:
+     table: rows=50.00K size=1.16MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=50.00K
+   mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=17 row-size=78B cardinality=50.00K
+   in pipelines: 17(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=436.52MB Threads=98
+Per-Host Resource Estimates: Memory=2.68GB
+F59:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=30.98MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: product_name, store_name, store_zip, b_street_number, b_street_name, b_city, b_zip, c_street_number, c_street_name, c_city, c_zip, syear, cnt, s1, s2, s3, s1, s2, s3, syear, cnt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+142:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: product_name ASC, store_name ASC, cnt ASC, s1 ASC, s1 ASC
+|  mem-estimate=30.98MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=46 row-size=330B cardinality=288.12K
+|  in pipelines: 79(GETNEXT)
+|
+F58:PLAN FRAGMENT [HASH(i_item_sk,s_store_name,s_zip)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=56.85MB mem-reservation=46.00MB thread-reservation=1
+79:SORT
+|  order by: product_name ASC, store_name ASC, cnt ASC, s1 ASC, s1 ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=46 row-size=330B cardinality=288.12K
+|  in pipelines: 79(GETNEXT), 109(OPEN)
+|
+78:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: i_item_sk = i_item_sk, s_store_name = s_store_name, s_zip = s_zip
+|  fk/pk conjuncts: i_item_sk = i_item_sk, s_store_name = s_store_name, s_zip = s_zip
+|  other predicates: count(*) <= count(*)
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21,44 row-size=573B cardinality=288.12K
+|  in pipelines: 109(GETNEXT), 139(OPEN)
+|
+|--141:EXCHANGE [HASH(i_item_sk,s_store_name,s_zip)]
+|  |  mem-estimate=10.85MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=44 row-size=286B cardinality=288.12K
+|  |  in pipelines: 139(GETNEXT)
+|  |
+|  F57:PLAN FRAGMENT [HASH(i_product_name,i_item_sk,s_store_name,s_zip,ad1.ca_street_number,ad1.ca_street_name,ad1.ca_city,ad1.ca_zip,ad2.ca_street_number,ad2.ca_street_name,ad2.ca_city,ad2.ca_zip,d1.d_year,d2.d_year,d3.d_year)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=54.13MB mem-reservation=34.00MB thread-reservation=1
+|  139:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*), sum:merge(ss_wholesale_cost), sum:merge(ss_list_price), sum:merge(ss_coupon_amt)
+|  |  group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
+|  |  mem-estimate=43.28MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=44 row-size=286B cardinality=288.12K
+|  |  in pipelines: 139(GETNEXT), 39(OPEN)
+|  |
+|  138:EXCHANGE [HASH(i_product_name,i_item_sk,s_store_name,s_zip,ad1.ca_street_number,ad1.ca_street_name,ad1.ca_city,ad1.ca_zip,ad2.ca_street_number,ad2.ca_street_name,ad2.ca_city,ad2.ca_zip,d1.d_year,d2.d_year,d3.d_year)]
+|  |  mem-estimate=10.85MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=44 row-size=286B cardinality=288.12K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F51:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=58.09MB mem-reservation=42.69MB thread-reservation=1
+|  77:AGGREGATE [STREAMING]
+|  |  output: count(*), sum(ss_wholesale_cost), sum(ss_list_price), sum(ss_coupon_amt)
+|  |  group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
+|  |  mem-estimate=43.28MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=44 row-size=286B cardinality=288.12K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  76:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = cs_item_sk
+|  |  fk/pk conjuncts: none
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39,40,41,42,27 row-size=474B cardinality=288.12K
+|  |  in pipelines: 39(GETNEXT), 136(OPEN)
+|  |
+|  |--137:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=202.23KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=27 row-size=40B cardinality=1.80K
+|  |  |  in pipelines: 136(GETNEXT)
+|  |  |
+|  |  F56:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=10.36MB mem-reservation=1.94MB thread-reservation=1
+|  |  136:AGGREGATE [FINALIZE]
+|  |  |  output: sum:merge(cs_ext_list_price), sum:merge(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  |  group by: cs_item_sk
+|  |  |  having: sum(cs_ext_list_price) > CAST(2 AS DECIMAL(3,0)) * sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=27 row-size=40B cardinality=1.80K
+|  |  |  in pipelines: 136(GETNEXT), 41(OPEN)
+|  |  |
+|  |  135:EXCHANGE [HASH(cs_item_sk)]
+|  |  |  mem-estimate=366.05KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=27 row-size=40B cardinality=17.98K
+|  |  |  in pipelines: 41(GETNEXT)
+|  |  |
+|  |  F54:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=164.63MB mem-reservation=16.75MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  44:AGGREGATE [STREAMING]
+|  |  |  output: sum(cs_ext_list_price), sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  |  group by: cs_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=27 row-size=40B cardinality=17.98K
+|  |  |  in pipelines: 41(GETNEXT)
+|  |  |
+|  |  43:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  |  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  |  runtime filters: RF082[bloom] <- cr_item_sk, RF083[bloom] <- cr_order_number
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=25,26 row-size=48B cardinality=849.41K
+|  |  |  in pipelines: 41(GETNEXT), 42(OPEN)
+|  |  |
+|  |  |--134:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=3.88MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=26 row-size=28B cardinality=144.07K
+|  |  |  |  in pipelines: 42(GETNEXT)
+|  |  |  |
+|  |  |  F55:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=120.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  |  42:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=144.07K size=10.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |  |     mem-estimate=120.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=26 row-size=28B cardinality=144.07K
+|  |  |     in pipelines: 42(GETNEXT)
+|  |  |
+|  |  41:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF082[bloom] -> cs_item_sk, RF083[bloom] -> cs_order_number
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=25 row-size=20B cardinality=1.44M
+|  |     in pipelines: 41(GETNEXT)
+|  |
+|  75:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  |  fk/pk conjuncts: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39,40,41,42 row-size=434B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 58(OPEN)
+|  |
+|  |--133:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=42 row-size=4B cardinality=20
+|  |  |  in pipelines: 58(GETNEXT)
+|  |  |
+|  |  F53:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=2
+|  |  58:SCAN HDFS [tpcds_parquet.income_band ib2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.21KB
+|  |     stored statistics:
+|  |       table: rows=20 size=1.21KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=20
+|  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |     tuple-ids=42 row-size=4B cardinality=20
+|  |     in pipelines: 58(GETNEXT)
+|  |
+|  74:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  |  fk/pk conjuncts: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39,40,41 row-size=430B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 57(OPEN)
+|  |
+|  |--132:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=41 row-size=4B cardinality=20
+|  |  |  in pipelines: 57(GETNEXT)
+|  |  |
+|  |  F52:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=2
+|  |  57:SCAN HDFS [tpcds_parquet.income_band ib1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.21KB
+|  |     stored statistics:
+|  |       table: rows=20 size=1.21KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=20
+|  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |     tuple-ids=41 row-size=4B cardinality=20
+|  |     in pipelines: 57(GETNEXT)
+|  |
+|  73:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: c_current_addr_sk = ad2.ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ad2.ca_address_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39,40 row-size=426B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 56(OPEN)
+|  |
+|  |--131:EXCHANGE [HASH(ad2.ca_address_sk)]
+|  |  |  mem-estimate=3.78MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=40 row-size=78B cardinality=50.00K
+|  |  |  in pipelines: 56(GETNEXT)
+|  |  |
+|  |  F50:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  56:SCAN HDFS [tpcds_parquet.customer_address ad2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=40 row-size=78B cardinality=50.00K
+|  |     in pipelines: 56(GETNEXT)
+|  |
+|  130:EXCHANGE [HASH(c_current_addr_sk)]
+|  |  mem-estimate=2.12MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39 row-size=348B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F49:PLAN FRAGMENT [HASH(ss_addr_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=8.33MB mem-reservation=2.88MB thread-reservation=1
+|  72:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_addr_sk = ad1.ca_address_sk
+|  |  fk/pk conjuncts: ss_addr_sk = ad1.ca_address_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39 row-size=348B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 55(OPEN)
+|  |
+|  |--129:EXCHANGE [HASH(ad1.ca_address_sk)]
+|  |  |  mem-estimate=3.78MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=39 row-size=78B cardinality=50.00K
+|  |  |  in pipelines: 55(GETNEXT)
+|  |  |
+|  |  F48:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  55:SCAN HDFS [tpcds_parquet.customer_address ad1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=39 row-size=78B cardinality=50.00K
+|  |     in pipelines: 55(GETNEXT)
+|  |
+|  128:EXCHANGE [HASH(ss_addr_sk)]
+|  |  mem-estimate=1.67MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35 row-size=271B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F47:PLAN FRAGMENT [HASH(c_current_cdemo_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=28.59MB mem-reservation=17.00MB thread-reservation=1
+|  71:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: c_current_cdemo_sk = cd2.cd_demo_sk
+|  |  fk/pk conjuncts: c_current_cdemo_sk = cd2.cd_demo_sk
+|  |  other predicates: cd1.cd_marital_status != cd2.cd_marital_status
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35 row-size=271B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 51(OPEN)
+|  |
+|  |--127:EXCHANGE [HASH(cd2.cd_demo_sk)]
+|  |  |  mem-estimate=10.02MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=35 row-size=17B cardinality=1.92M
+|  |  |  in pipelines: 51(GETNEXT)
+|  |  |
+|  |  F46:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=2
+|  |  51:SCAN HDFS [tpcds_parquet.customer_demographics cd2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |     stored statistics:
+|  |       table: rows=1.92M size=7.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=35 row-size=17B cardinality=1.92M
+|  |     in pipelines: 51(GETNEXT)
+|  |
+|  126:EXCHANGE [HASH(c_current_cdemo_sk)]
+|  |  mem-estimate=1.57MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34 row-size=254B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F45:PLAN FRAGMENT [HASH(ss_cdemo_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=28.48MB mem-reservation=17.00MB thread-reservation=1
+|  70:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_cdemo_sk = cd1.cd_demo_sk
+|  |  fk/pk conjuncts: ss_cdemo_sk = cd1.cd_demo_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34 row-size=254B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 50(OPEN)
+|  |
+|  |--125:EXCHANGE [HASH(cd1.cd_demo_sk)]
+|  |  |  mem-estimate=10.02MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=34 row-size=17B cardinality=1.92M
+|  |  |  in pipelines: 50(GETNEXT)
+|  |  |
+|  |  F44:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=2
+|  |  50:SCAN HDFS [tpcds_parquet.customer_demographics cd1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |     stored statistics:
+|  |       table: rows=1.92M size=7.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=34 row-size=17B cardinality=1.92M
+|  |     in pipelines: 50(GETNEXT)
+|  |
+|  124:EXCHANGE [HASH(ss_cdemo_sk)]
+|  |  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31 row-size=237B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F43:PLAN FRAGMENT [HASH(c_first_shipto_date_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=3.91MB mem-reservation=1.94MB thread-reservation=1
+|  69:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: c_first_shipto_date_sk = d3.d_date_sk
+|  |  fk/pk conjuncts: c_first_shipto_date_sk = d3.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31 row-size=237B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 47(OPEN)
+|  |
+|  |--123:EXCHANGE [HASH(d3.d_date_sk)]
+|  |  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=31 row-size=8B cardinality=73.05K
+|  |  |  in pipelines: 47(GETNEXT)
+|  |  |
+|  |  F42:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  47:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=31 row-size=8B cardinality=73.05K
+|  |     in pipelines: 47(GETNEXT)
+|  |
+|  122:EXCHANGE [HASH(c_first_shipto_date_sk)]
+|  |  mem-estimate=1.40MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30 row-size=229B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F41:PLAN FRAGMENT [HASH(c_first_sales_date_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=3.85MB mem-reservation=1.94MB thread-reservation=1
+|  68:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: c_first_sales_date_sk = d2.d_date_sk
+|  |  fk/pk conjuncts: c_first_sales_date_sk = d2.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30 row-size=229B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 46(OPEN)
+|  |
+|  |--121:EXCHANGE [HASH(d2.d_date_sk)]
+|  |  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=30 row-size=8B cardinality=73.05K
+|  |  |  in pipelines: 46(GETNEXT)
+|  |  |
+|  |  F40:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  46:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=30 row-size=8B cardinality=73.05K
+|  |     in pipelines: 46(GETNEXT)
+|  |
+|  120:EXCHANGE [HASH(c_first_sales_date_sk)]
+|  |  mem-estimate=1.35MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38 row-size=221B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F38:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=7.41MB mem-reservation=3.88MB thread-reservation=1
+|  67:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: c_current_hdemo_sk = hd2.hd_demo_sk
+|  |  fk/pk conjuncts: c_current_hdemo_sk = hd2.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38 row-size=221B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 54(OPEN)
+|  |
+|  |--119:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=68.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=38 row-size=8B cardinality=7.20K
+|  |  |  in pipelines: 54(GETNEXT)
+|  |  |
+|  |  F39:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=2
+|  |  54:SCAN HDFS [tpcds_parquet.household_demographics hd2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=38 row-size=8B cardinality=7.20K
+|  |     in pipelines: 54(GETNEXT)
+|  |
+|  66:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33 row-size=213B cardinality=8.66K
+|  |  in pipelines: 39(GETNEXT), 49(OPEN)
+|  |
+|  |--118:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=2.32MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=33 row-size=24B cardinality=100.00K
+|  |  |  in pipelines: 49(GETNEXT)
+|  |  |
+|  |  F37:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  49:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=33 row-size=24B cardinality=100.00K
+|  |     in pipelines: 49(GETNEXT)
+|  |
+|  117:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=1.15MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32 row-size=189B cardinality=8.66K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F33:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=14.07MB mem-reservation=8.69MB thread-reservation=1
+|  65:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32 row-size=189B cardinality=8.66K
+|  |  in pipelines: 39(GETNEXT), 48(OPEN)
+|  |
+|  |--116:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=32 row-size=37B cardinality=12
+|  |  |  in pipelines: 48(GETNEXT)
+|  |  |
+|  |  F36:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=2
+|  |  48:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |     tuple-ids=32 row-size=37B cardinality=12
+|  |     in pipelines: 48(GETNEXT)
+|  |
+|  64:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_promo_sk = p_promo_sk
+|  |  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36 row-size=151B cardinality=8.66K
+|  |  in pipelines: 39(GETNEXT), 52(OPEN)
+|  |
+|  |--115:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=36 row-size=4B cardinality=300
+|  |  |  in pipelines: 52(GETNEXT)
+|  |  |
+|  |  F35:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=2
+|  |  52:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=23.30KB
+|  |     stored statistics:
+|  |       table: rows=300 size=23.30KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=300
+|  |     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  |     tuple-ids=36 row-size=4B cardinality=300
+|  |     in pipelines: 52(GETNEXT)
+|  |
+|  63:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_hdemo_sk = hd1.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = hd1.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37 row-size=147B cardinality=8.72K
+|  |  in pipelines: 39(GETNEXT), 53(OPEN)
+|  |
+|  |--114:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=68.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=37 row-size=8B cardinality=7.20K
+|  |  |  in pipelines: 53(GETNEXT)
+|  |  |
+|  |  F34:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=2
+|  |  53:SCAN HDFS [tpcds_parquet.household_demographics hd1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=37 row-size=8B cardinality=7.20K
+|  |     in pipelines: 53(GETNEXT)
+|  |
+|  62:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24 row-size=139B cardinality=8.93K
+|  |  in pipelines: 39(GETNEXT), 40(OPEN)
+|  |
+|  |--113:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=24 row-size=16B cardinality=287.51K
+|  |  |  in pipelines: 40(GETNEXT)
+|  |  |
+|  |  F32:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  40:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=24 row-size=16B cardinality=287.51K
+|  |     in pipelines: 40(GETNEXT)
+|  |
+|  112:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  |  mem-estimate=894.08KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29 row-size=123B cardinality=12.14K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F29:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=133.93MB mem-reservation=13.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  61:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  runtime filters: RF078[bloom] <- d1.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29 row-size=123B cardinality=12.14K
+|  |  in pipelines: 39(GETNEXT), 45(OPEN)
+|  |
+|  |--111:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=29 row-size=8B cardinality=373
+|  |  |  in pipelines: 45(GETNEXT)
+|  |  |
+|  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  45:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d1.d_year = CAST(2000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=29 row-size=8B cardinality=373
+|  |     in pipelines: 45(GETNEXT)
+|  |
+|  60:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF080[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43 row-size=115B cardinality=59.37K
+|  |  in pipelines: 39(GETNEXT), 59(OPEN)
+|  |
+|  |--110:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=44.51KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=43 row-size=59B cardinality=371
+|  |  |  in pipelines: 59(GETNEXT)
+|  |  |
+|  |  F30:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  59:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=43 row-size=59B cardinality=371
+|  |     in pipelines: 59(GETNEXT)
+|  |
+|  39:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF080[bloom] -> ss_item_sk, RF078[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=23 row-size=56B cardinality=2.88M
+|     in pipelines: 39(GETNEXT)
+|
+140:EXCHANGE [HASH(i_item_sk,s_store_name,s_zip)]
+|  mem-estimate=10.85MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=21 row-size=286B cardinality=288.12K
+|  in pipelines: 109(GETNEXT)
+|
+F28:PLAN FRAGMENT [HASH(i_product_name,i_item_sk,s_store_name,s_zip,ad1.ca_street_number,ad1.ca_street_name,ad1.ca_city,ad1.ca_zip,ad2.ca_street_number,ad2.ca_street_name,ad2.ca_city,ad2.ca_zip,d1.d_year,d2.d_year,d3.d_year)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=54.13MB mem-reservation=34.00MB thread-reservation=1
+109:AGGREGATE [FINALIZE]
+|  output: count:merge(*), sum:merge(ss_wholesale_cost), sum:merge(ss_list_price), sum:merge(ss_coupon_amt)
+|  group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
+|  mem-estimate=43.28MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21 row-size=286B cardinality=288.12K
+|  in pipelines: 109(GETNEXT), 00(OPEN)
+|
+108:EXCHANGE [HASH(i_product_name,i_item_sk,s_store_name,s_zip,ad1.ca_street_number,ad1.ca_street_name,ad1.ca_city,ad1.ca_zip,ad2.ca_street_number,ad2.ca_street_name,ad2.ca_city,ad2.ca_zip,d1.d_year,d2.d_year,d3.d_year)]
+|  mem-estimate=10.85MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=21 row-size=286B cardinality=288.12K
+|  in pipelines: 00(GETNEXT)
+|
+F22:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=58.09MB mem-reservation=42.69MB thread-reservation=1
+38:AGGREGATE [STREAMING]
+|  output: count(*), sum(ss_wholesale_cost), sum(ss_list_price), sum(ss_coupon_amt)
+|  group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
+|  mem-estimate=43.28MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21 row-size=286B cardinality=288.12K
+|  in pipelines: 00(GETNEXT)
+|
+37:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = cs_item_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16,17,18,19,4 row-size=474B cardinality=288.12K
+|  in pipelines: 00(GETNEXT), 106(OPEN)
+|
+|--107:EXCHANGE [BROADCAST]
+|  |  mem-estimate=202.23KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=40B cardinality=1.80K
+|  |  in pipelines: 106(GETNEXT)
+|  |
+|  F27:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=10.36MB mem-reservation=1.94MB thread-reservation=1
+|  106:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_ext_list_price), sum:merge(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  group by: cs_item_sk
+|  |  having: sum(cs_ext_list_price) > CAST(2 AS DECIMAL(3,0)) * sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=40B cardinality=1.80K
+|  |  in pipelines: 106(GETNEXT), 02(OPEN)
+|  |
+|  105:EXCHANGE [HASH(cs_item_sk)]
+|  |  mem-estimate=366.05KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=40B cardinality=17.98K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=164.63MB mem-reservation=16.75MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  05:AGGREGATE [STREAMING]
+|  |  output: sum(cs_ext_list_price), sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  group by: cs_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=40B cardinality=17.98K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  runtime filters: RF042[bloom] <- cr_item_sk, RF043[bloom] <- cr_order_number
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=2,3 row-size=48B cardinality=849.41K
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--104:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=3.88MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=28B cardinality=144.07K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=120.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=120.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=3 row-size=28B cardinality=144.07K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF042[bloom] -> cs_item_sk, RF043[bloom] -> cs_order_number
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=144.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=2 row-size=20B cardinality=1.44M
+|     in pipelines: 02(GETNEXT)
+|
+36:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  fk/pk conjuncts: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16,17,18,19 row-size=434B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 19(OPEN)
+|
+|--103:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=4B cardinality=20
+|  |  in pipelines: 19(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=2
+|  19:SCAN HDFS [tpcds_parquet.income_band ib2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.21KB
+|     stored statistics:
+|       table: rows=20 size=1.21KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|     tuple-ids=19 row-size=4B cardinality=20
+|     in pipelines: 19(GETNEXT)
+|
+35:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  fk/pk conjuncts: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16,17,18 row-size=430B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 18(OPEN)
+|
+|--102:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=4B cardinality=20
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=2
+|  18:SCAN HDFS [tpcds_parquet.income_band ib1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.21KB
+|     stored statistics:
+|       table: rows=20 size=1.21KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|     tuple-ids=18 row-size=4B cardinality=20
+|     in pipelines: 18(GETNEXT)
+|
+34:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_current_addr_sk = ad2.ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ad2.ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16,17 row-size=426B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 17(OPEN)
+|
+|--101:EXCHANGE [HASH(ad2.ca_address_sk)]
+|  |  mem-estimate=3.78MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=78B cardinality=50.00K
+|  |  in pipelines: 17(GETNEXT)
+|  |
+|  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=2
+|  17:SCAN HDFS [tpcds_parquet.customer_address ad2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=17 row-size=78B cardinality=50.00K
+|     in pipelines: 17(GETNEXT)
+|
+100:EXCHANGE [HASH(c_current_addr_sk)]
+|  mem-estimate=2.12MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16 row-size=348B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F20:PLAN FRAGMENT [HASH(ss_addr_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=8.33MB mem-reservation=2.88MB thread-reservation=1
+33:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_addr_sk = ad1.ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ad1.ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16 row-size=348B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 16(OPEN)
+|
+|--99:EXCHANGE [HASH(ad1.ca_address_sk)]
+|  |  mem-estimate=3.78MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=78B cardinality=50.00K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=2
+|  16:SCAN HDFS [tpcds_parquet.customer_address ad1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=16 row-size=78B cardinality=50.00K
+|     in pipelines: 16(GETNEXT)
+|
+98:EXCHANGE [HASH(ss_addr_sk)]
+|  mem-estimate=1.67MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12 row-size=271B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F18:PLAN FRAGMENT [HASH(c_current_cdemo_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=28.59MB mem-reservation=17.00MB thread-reservation=1
+32:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_current_cdemo_sk = cd2.cd_demo_sk
+|  fk/pk conjuncts: c_current_cdemo_sk = cd2.cd_demo_sk
+|  other predicates: cd1.cd_marital_status != cd2.cd_marital_status
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12 row-size=271B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 12(OPEN)
+|
+|--97:EXCHANGE [HASH(cd2.cd_demo_sk)]
+|  |  mem-estimate=10.02MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=17B cardinality=1.92M
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=2
+|  12:SCAN HDFS [tpcds_parquet.customer_demographics cd2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=12 row-size=17B cardinality=1.92M
+|     in pipelines: 12(GETNEXT)
+|
+96:EXCHANGE [HASH(c_current_cdemo_sk)]
+|  mem-estimate=1.57MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11 row-size=254B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F16:PLAN FRAGMENT [HASH(ss_cdemo_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=28.48MB mem-reservation=17.00MB thread-reservation=1
+31:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_cdemo_sk = cd1.cd_demo_sk
+|  fk/pk conjuncts: ss_cdemo_sk = cd1.cd_demo_sk
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11 row-size=254B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 11(OPEN)
+|
+|--95:EXCHANGE [HASH(cd1.cd_demo_sk)]
+|  |  mem-estimate=10.02MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=17B cardinality=1.92M
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=2
+|  11:SCAN HDFS [tpcds_parquet.customer_demographics cd1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=11 row-size=17B cardinality=1.92M
+|     in pipelines: 11(GETNEXT)
+|
+94:EXCHANGE [HASH(ss_cdemo_sk)]
+|  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8 row-size=237B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F14:PLAN FRAGMENT [HASH(c_first_shipto_date_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=3.91MB mem-reservation=1.94MB thread-reservation=1
+30:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_first_shipto_date_sk = d3.d_date_sk
+|  fk/pk conjuncts: c_first_shipto_date_sk = d3.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8 row-size=237B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 08(OPEN)
+|
+|--93:EXCHANGE [HASH(d3.d_date_sk)]
+|  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=8B cardinality=73.05K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  08:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=8 row-size=8B cardinality=73.05K
+|     in pipelines: 08(GETNEXT)
+|
+92:EXCHANGE [HASH(c_first_shipto_date_sk)]
+|  mem-estimate=1.40MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7 row-size=229B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F12:PLAN FRAGMENT [HASH(c_first_sales_date_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=3.85MB mem-reservation=1.94MB thread-reservation=1
+29:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: c_first_sales_date_sk = d2.d_date_sk
+|  fk/pk conjuncts: c_first_sales_date_sk = d2.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7 row-size=229B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 07(OPEN)
+|
+|--91:EXCHANGE [HASH(d2.d_date_sk)]
+|  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=8B cardinality=73.05K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  07:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=7 row-size=8B cardinality=73.05K
+|     in pipelines: 07(GETNEXT)
+|
+90:EXCHANGE [HASH(c_first_sales_date_sk)]
+|  mem-estimate=1.35MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15 row-size=221B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=7.41MB mem-reservation=3.88MB thread-reservation=1
+28:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: c_current_hdemo_sk = hd2.hd_demo_sk
+|  fk/pk conjuncts: c_current_hdemo_sk = hd2.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15 row-size=221B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 15(OPEN)
+|
+|--89:EXCHANGE [BROADCAST]
+|  |  mem-estimate=68.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=8B cardinality=7.20K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=2
+|  15:SCAN HDFS [tpcds_parquet.household_demographics hd2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=15 row-size=8B cardinality=7.20K
+|     in pipelines: 15(GETNEXT)
+|
+27:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10 row-size=213B cardinality=8.66K
+|  in pipelines: 00(GETNEXT), 10(OPEN)
+|
+|--88:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=2.32MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=24B cardinality=100.00K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=2
+|  10:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=10 row-size=24B cardinality=100.00K
+|     in pipelines: 10(GETNEXT)
+|
+87:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=1.15MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9 row-size=189B cardinality=8.66K
+|  in pipelines: 00(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=16.07MB mem-reservation=10.69MB thread-reservation=1 runtime-filters-memory=2.00MB
+26:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9 row-size=189B cardinality=8.66K
+|  in pipelines: 00(GETNEXT), 09(OPEN)
+|
+|--86:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=37B cardinality=12
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=2
+|  09:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=9 row-size=37B cardinality=12
+|     in pipelines: 09(GETNEXT)
+|
+25:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13 row-size=151B cardinality=8.66K
+|  in pipelines: 00(GETNEXT), 13(OPEN)
+|
+|--85:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=4B cardinality=300
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=2
+|  13:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=13 row-size=4B cardinality=300
+|     in pipelines: 13(GETNEXT)
+|
+24:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_hdemo_sk = hd1.hd_demo_sk
+|  fk/pk conjuncts: ss_hdemo_sk = hd1.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14 row-size=147B cardinality=8.72K
+|  in pipelines: 00(GETNEXT), 14(OPEN)
+|
+|--84:EXCHANGE [BROADCAST]
+|  |  mem-estimate=68.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=7.20K
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=2
+|  14:SCAN HDFS [tpcds_parquet.household_demographics hd1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=14 row-size=8B cardinality=7.20K
+|     in pipelines: 14(GETNEXT)
+|
+23:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  runtime filters: RF034[bloom] <- sr_item_sk, RF035[bloom] <- sr_ticket_number
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1 row-size=139B cardinality=8.93K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--83:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=16B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+82:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  mem-estimate=894.08KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6 row-size=123B cardinality=12.14K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=135.93MB mem-reservation=15.88MB thread-reservation=2 runtime-filters-memory=4.00MB
+22:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  runtime filters: RF038[bloom] <- d1.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6 row-size=123B cardinality=12.14K
+|  in pipelines: 00(GETNEXT), 06(OPEN)
+|
+|--81:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=8B cardinality=373
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  06:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d1.d_year = CAST(1999 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d1.d_year = CAST(1999 AS INT)
+|     parquet dictionary predicates: d1.d_year = CAST(1999 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=6 row-size=8B cardinality=373
+|     in pipelines: 06(GETNEXT)
+|
+21:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF040[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20 row-size=115B cardinality=59.37K
+|  in pipelines: 00(GETNEXT), 20(OPEN)
+|
+|--80:EXCHANGE [BROADCAST]
+|  |  mem-estimate=44.51KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=59B cardinality=371
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=65.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  20:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|     runtime filters: RF034[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|     parquet dictionary predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=20 row-size=59B cardinality=371
+|     in pipelines: 20(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF040[bloom] -> ss_item_sk, RF038[bloom] -> ss_sold_date_sk, RF034[bloom] -> ss_item_sk, RF035[bloom] -> ss_ticket_number
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=56B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=672.52MB Threads=135
+Per-Host Resource Estimates: Memory=1.64GB
+F59:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=32.22MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: product_name, store_name, store_zip, b_street_number, b_street_name, b_city, b_zip, c_street_number, c_street_name, c_city, c_zip, syear, cnt, s1, s2, s3, s1, s2, s3, syear, cnt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+142:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: product_name ASC, store_name ASC, cnt ASC, s1 ASC, s1 ASC
+|  mem-estimate=32.22MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=46 row-size=330B cardinality=288.12K
+|  in pipelines: 79(GETNEXT)
+|
+F58:PLAN FRAGMENT [HASH(i_item_sk,s_store_name,s_zip)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=23.70MB mem-reservation=12.00MB thread-reservation=1
+79:SORT
+|  order by: product_name ASC, store_name ASC, cnt ASC, s1 ASC, s1 ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=46 row-size=330B cardinality=288.12K
+|  in pipelines: 79(GETNEXT), 109(OPEN)
+|
+78:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: i_item_sk = i_item_sk, s_store_name = s_store_name, s_zip = s_zip
+|  fk/pk conjuncts: i_item_sk = i_item_sk, s_store_name = s_store_name, s_zip = s_zip
+|  other predicates: count(*) <= count(*)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=21,44 row-size=573B cardinality=288.12K
+|  in pipelines: 109(GETNEXT), 139(OPEN)
+|
+|--F60:PLAN FRAGMENT [HASH(i_item_sk,s_store_name,s_zip)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=28.70MB mem-reservation=17.00MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_sk, s_store_name, s_zip
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |
+|  141:EXCHANGE [HASH(i_item_sk,s_store_name,s_zip)]
+|  |  mem-estimate=11.70MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=44 row-size=286B cardinality=288.12K
+|  |  in pipelines: 139(GETNEXT)
+|  |
+|  F57:PLAN FRAGMENT [HASH(i_product_name,i_item_sk,s_store_name,s_zip,ad1.ca_street_number,ad1.ca_street_name,ad1.ca_city,ad1.ca_zip,ad2.ca_street_number,ad2.ca_street_name,ad2.ca_city,ad2.ca_zip,d1.d_year,d2.d_year,d3.d_year)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=45.70MB mem-reservation=34.00MB thread-reservation=1
+|  139:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*), sum:merge(ss_wholesale_cost), sum:merge(ss_list_price), sum:merge(ss_coupon_amt)
+|  |  group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=44 row-size=286B cardinality=288.12K
+|  |  in pipelines: 139(GETNEXT), 39(OPEN)
+|  |
+|  138:EXCHANGE [HASH(i_product_name,i_item_sk,s_store_name,s_zip,ad1.ca_street_number,ad1.ca_street_name,ad1.ca_city,ad1.ca_zip,ad2.ca_street_number,ad2.ca_street_name,ad2.ca_city,ad2.ca_zip,d1.d_year,d2.d_year,d3.d_year)]
+|  |  mem-estimate=11.70MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=44 row-size=286B cardinality=288.12K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F51:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=37.30MB mem-reservation=34.00MB thread-reservation=1
+|  77:AGGREGATE [STREAMING]
+|  |  output: count(*), sum(ss_wholesale_cost), sum(ss_list_price), sum(ss_coupon_amt)
+|  |  group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=44 row-size=286B cardinality=288.12K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  76:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ss_item_sk = cs_item_sk
+|  |  fk/pk conjuncts: none
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39,40,41,42,27 row-size=474B cardinality=288.12K
+|  |  in pipelines: 39(GETNEXT), 136(OPEN)
+|  |
+|  |--F61:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.07MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: cs_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  137:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=202.23KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=27 row-size=40B cardinality=1.80K
+|  |  |  in pipelines: 136(GETNEXT)
+|  |  |
+|  |  F56:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=10.36MB mem-reservation=1.94MB thread-reservation=1
+|  |  136:AGGREGATE [FINALIZE]
+|  |  |  output: sum:merge(cs_ext_list_price), sum:merge(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  |  group by: cs_item_sk
+|  |  |  having: sum(cs_ext_list_price) > CAST(2 AS DECIMAL(3,0)) * sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=27 row-size=40B cardinality=1.80K
+|  |  |  in pipelines: 136(GETNEXT), 41(OPEN)
+|  |  |
+|  |  135:EXCHANGE [HASH(cs_item_sk)]
+|  |  |  mem-estimate=366.05KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=27 row-size=40B cardinality=17.98K
+|  |  |  in pipelines: 41(GETNEXT)
+|  |  |
+|  |  F54:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  |  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=10.00MB thread-reservation=1
+|  |  44:AGGREGATE [STREAMING]
+|  |  |  output: sum(cs_ext_list_price), sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  |  group by: cs_item_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=27 row-size=40B cardinality=17.98K
+|  |  |  in pipelines: 41(GETNEXT)
+|  |  |
+|  |  43:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  |  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=25,26 row-size=48B cardinality=849.41K
+|  |  |  in pipelines: 41(GETNEXT), 42(OPEN)
+|  |  |
+|  |  |--F62:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=15.38MB mem-reservation=11.50MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: cr_item_sk, cr_order_number
+|  |  |  |  runtime filters: RF082[bloom] <- cr_item_sk, RF083[bloom] <- cr_order_number
+|  |  |  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  |
+|  |  |  134:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=3.88MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=26 row-size=28B cardinality=144.07K
+|  |  |  |  in pipelines: 42(GETNEXT)
+|  |  |  |
+|  |  |  F55:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |  42:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |  |     stored statistics:
+|  |  |       table: rows=144.07K size=10.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |  |     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=26 row-size=28B cardinality=144.07K
+|  |  |     in pipelines: 42(GETNEXT)
+|  |  |
+|  |  41:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF082[bloom] -> cs_item_sk, RF083[bloom] -> cs_order_number
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=25 row-size=20B cardinality=1.44M
+|  |     in pipelines: 41(GETNEXT)
+|  |
+|  75:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  |  fk/pk conjuncts: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39,40,41,42 row-size=434B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 58(OPEN)
+|  |
+|  |--F63:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: ib2.ib_income_band_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  133:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=42 row-size=4B cardinality=20
+|  |  |  in pipelines: 58(GETNEXT)
+|  |  |
+|  |  F53:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |  58:SCAN HDFS [tpcds_parquet.income_band ib2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.21KB
+|  |     stored statistics:
+|  |       table: rows=20 size=1.21KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=20
+|  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=0
+|  |     tuple-ids=42 row-size=4B cardinality=20
+|  |     in pipelines: 58(GETNEXT)
+|  |
+|  74:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  |  fk/pk conjuncts: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39,40,41 row-size=430B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 57(OPEN)
+|  |
+|  |--F64:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: ib1.ib_income_band_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  132:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=41 row-size=4B cardinality=20
+|  |  |  in pipelines: 57(GETNEXT)
+|  |  |
+|  |  F52:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |  57:SCAN HDFS [tpcds_parquet.income_band ib1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.21KB
+|  |     stored statistics:
+|  |       table: rows=20 size=1.21KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=20
+|  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=0
+|  |     tuple-ids=41 row-size=4B cardinality=20
+|  |     in pipelines: 57(GETNEXT)
+|  |
+|  73:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=05
+|  |  hash predicates: c_current_addr_sk = ad2.ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ad2.ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39,40 row-size=426B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 56(OPEN)
+|  |
+|  |--F65:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=5.71MB mem-reservation=1.94MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: ad2.ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  131:EXCHANGE [HASH(ad2.ca_address_sk)]
+|  |  |  mem-estimate=3.78MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=40 row-size=78B cardinality=50.00K
+|  |  |  in pipelines: 56(GETNEXT)
+|  |  |
+|  |  F50:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  56:SCAN HDFS [tpcds_parquet.customer_address ad2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=40 row-size=78B cardinality=50.00K
+|  |     in pipelines: 56(GETNEXT)
+|  |
+|  130:EXCHANGE [HASH(c_current_addr_sk)]
+|  |  mem-estimate=3.30MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39 row-size=348B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F49:PLAN FRAGMENT [HASH(ss_addr_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=2.62MB mem-reservation=0B thread-reservation=1
+|  72:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=06
+|  |  hash predicates: ss_addr_sk = ad1.ca_address_sk
+|  |  fk/pk conjuncts: ss_addr_sk = ad1.ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35,39 row-size=348B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 55(OPEN)
+|  |
+|  |--F66:PLAN FRAGMENT [HASH(ss_addr_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=5.71MB mem-reservation=1.94MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=02
+|  |  |  build expressions: ad1.ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  129:EXCHANGE [HASH(ad1.ca_address_sk)]
+|  |  |  mem-estimate=3.78MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=39 row-size=78B cardinality=50.00K
+|  |  |  in pipelines: 55(GETNEXT)
+|  |  |
+|  |  F48:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  55:SCAN HDFS [tpcds_parquet.customer_address ad1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=39 row-size=78B cardinality=50.00K
+|  |     in pipelines: 55(GETNEXT)
+|  |
+|  128:EXCHANGE [HASH(ss_addr_sk)]
+|  |  mem-estimate=2.62MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35 row-size=271B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F47:PLAN FRAGMENT [HASH(c_current_cdemo_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=2.45MB mem-reservation=0B thread-reservation=1
+|  71:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=07
+|  |  hash predicates: c_current_cdemo_sk = cd2.cd_demo_sk
+|  |  fk/pk conjuncts: c_current_cdemo_sk = cd2.cd_demo_sk
+|  |  other predicates: cd1.cd_marital_status != cd2.cd_marital_status
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34,35 row-size=271B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 51(OPEN)
+|  |
+|  |--F67:PLAN FRAGMENT [HASH(c_current_cdemo_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=18.52MB mem-reservation=8.50MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=02
+|  |  |  build expressions: cd2.cd_demo_sk
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |
+|  |  127:EXCHANGE [HASH(cd2.cd_demo_sk)]
+|  |  |  mem-estimate=10.02MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=35 row-size=17B cardinality=1.92M
+|  |  |  in pipelines: 51(GETNEXT)
+|  |  |
+|  |  F46:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  51:SCAN HDFS [tpcds_parquet.customer_demographics cd2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |     stored statistics:
+|  |       table: rows=1.92M size=7.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=35 row-size=17B cardinality=1.92M
+|  |     in pipelines: 51(GETNEXT)
+|  |
+|  126:EXCHANGE [HASH(c_current_cdemo_sk)]
+|  |  mem-estimate=2.45MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34 row-size=254B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F45:PLAN FRAGMENT [HASH(ss_cdemo_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=2.28MB mem-reservation=0B thread-reservation=1
+|  70:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=08
+|  |  hash predicates: ss_cdemo_sk = cd1.cd_demo_sk
+|  |  fk/pk conjuncts: ss_cdemo_sk = cd1.cd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31,34 row-size=254B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 50(OPEN)
+|  |
+|  |--F68:PLAN FRAGMENT [HASH(ss_cdemo_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=18.52MB mem-reservation=8.50MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=08 plan-id=09 cohort-id=02
+|  |  |  build expressions: cd1.cd_demo_sk
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |
+|  |  125:EXCHANGE [HASH(cd1.cd_demo_sk)]
+|  |  |  mem-estimate=10.02MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=34 row-size=17B cardinality=1.92M
+|  |  |  in pipelines: 50(GETNEXT)
+|  |  |
+|  |  F44:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  50:SCAN HDFS [tpcds_parquet.customer_demographics cd1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |     stored statistics:
+|  |       table: rows=1.92M size=7.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=34 row-size=17B cardinality=1.92M
+|  |     in pipelines: 50(GETNEXT)
+|  |
+|  124:EXCHANGE [HASH(ss_cdemo_sk)]
+|  |  mem-estimate=2.28MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31 row-size=237B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F43:PLAN FRAGMENT [HASH(c_first_shipto_date_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=2.19MB mem-reservation=0B thread-reservation=1
+|  69:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=09
+|  |  hash predicates: c_first_shipto_date_sk = d3.d_date_sk
+|  |  fk/pk conjuncts: c_first_shipto_date_sk = d3.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30,31 row-size=237B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 47(OPEN)
+|  |
+|  |--F69:PLAN FRAGMENT [HASH(c_first_shipto_date_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=2.51MB mem-reservation=1.94MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=09 plan-id=10 cohort-id=02
+|  |  |  build expressions: d3.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  123:EXCHANGE [HASH(d3.d_date_sk)]
+|  |  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=31 row-size=8B cardinality=73.05K
+|  |  |  in pipelines: 47(GETNEXT)
+|  |  |
+|  |  F42:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  47:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=31 row-size=8B cardinality=73.05K
+|  |     in pipelines: 47(GETNEXT)
+|  |
+|  122:EXCHANGE [HASH(c_first_shipto_date_sk)]
+|  |  mem-estimate=2.19MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30 row-size=229B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F41:PLAN FRAGMENT [HASH(c_first_sales_date_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=2.10MB mem-reservation=0B thread-reservation=1
+|  68:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=10
+|  |  hash predicates: c_first_sales_date_sk = d2.d_date_sk
+|  |  fk/pk conjuncts: c_first_sales_date_sk = d2.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38,30 row-size=229B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 46(OPEN)
+|  |
+|  |--F70:PLAN FRAGMENT [HASH(c_first_sales_date_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=2.51MB mem-reservation=1.94MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=10 plan-id=11 cohort-id=02
+|  |  |  build expressions: d2.d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  121:EXCHANGE [HASH(d2.d_date_sk)]
+|  |  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=30 row-size=8B cardinality=73.05K
+|  |  |  in pipelines: 46(GETNEXT)
+|  |  |
+|  |  F40:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  46:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=30 row-size=8B cardinality=73.05K
+|  |     in pipelines: 46(GETNEXT)
+|  |
+|  120:EXCHANGE [HASH(c_first_sales_date_sk)]
+|  |  mem-estimate=2.10MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38 row-size=221B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F38:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=1.79MB mem-reservation=0B thread-reservation=1
+|  67:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=11
+|  |  hash predicates: c_current_hdemo_sk = hd2.hd_demo_sk
+|  |  fk/pk conjuncts: c_current_hdemo_sk = hd2.hd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33,38 row-size=221B cardinality=8.45K
+|  |  in pipelines: 39(GETNEXT), 54(OPEN)
+|  |
+|  |--F71:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=11 plan-id=12 cohort-id=02
+|  |  |  build expressions: hd2.hd_demo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  119:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=68.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=38 row-size=8B cardinality=7.20K
+|  |  |  in pipelines: 54(GETNEXT)
+|  |  |
+|  |  F39:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  54:SCAN HDFS [tpcds_parquet.household_demographics hd2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|  |     tuple-ids=38 row-size=8B cardinality=7.20K
+|  |     in pipelines: 54(GETNEXT)
+|  |
+|  66:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=12
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32,33 row-size=213B cardinality=8.66K
+|  |  in pipelines: 39(GETNEXT), 49(OPEN)
+|  |
+|  |--F72:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=4.25MB mem-reservation=1.94MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=12 plan-id=13 cohort-id=02
+|  |  |  build expressions: c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  118:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=2.32MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=33 row-size=24B cardinality=100.00K
+|  |  |  in pipelines: 49(GETNEXT)
+|  |  |
+|  |  F37:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  49:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=33 row-size=24B cardinality=100.00K
+|  |     in pipelines: 49(GETNEXT)
+|  |
+|  117:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=1.79MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32 row-size=189B cardinality=8.66K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F33:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=1.27MB mem-reservation=0B thread-reservation=1
+|  65:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=13
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36,32 row-size=189B cardinality=8.66K
+|  |  in pipelines: 39(GETNEXT), 48(OPEN)
+|  |
+|  |--F73:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=13 plan-id=14 cohort-id=02
+|  |  |  build expressions: s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  116:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=32 row-size=37B cardinality=12
+|  |  |  in pipelines: 48(GETNEXT)
+|  |  |
+|  |  F36:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  |  48:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|  |     tuple-ids=32 row-size=37B cardinality=12
+|  |     in pipelines: 48(GETNEXT)
+|  |
+|  64:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=14
+|  |  hash predicates: ss_promo_sk = p_promo_sk
+|  |  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37,36 row-size=151B cardinality=8.66K
+|  |  in pipelines: 39(GETNEXT), 52(OPEN)
+|  |
+|  |--F74:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=14 plan-id=15 cohort-id=02
+|  |  |  build expressions: p_promo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  115:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=36 row-size=4B cardinality=300
+|  |  |  in pipelines: 52(GETNEXT)
+|  |  |
+|  |  F35:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  |  52:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=23.30KB
+|  |     stored statistics:
+|  |       table: rows=300 size=23.30KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=300
+|  |     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=0
+|  |     tuple-ids=36 row-size=4B cardinality=300
+|  |     in pipelines: 52(GETNEXT)
+|  |
+|  63:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=15
+|  |  hash predicates: ss_hdemo_sk = hd1.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = hd1.hd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24,37 row-size=147B cardinality=8.72K
+|  |  in pipelines: 39(GETNEXT), 53(OPEN)
+|  |
+|  |--F75:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=15 plan-id=16 cohort-id=02
+|  |  |  build expressions: hd1.hd_demo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  114:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=68.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=37 row-size=8B cardinality=7.20K
+|  |  |  in pipelines: 53(GETNEXT)
+|  |  |
+|  |  F34:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  53:SCAN HDFS [tpcds_parquet.household_demographics hd1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|  |     tuple-ids=37 row-size=8B cardinality=7.20K
+|  |     in pipelines: 53(GETNEXT)
+|  |
+|  62:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=16
+|  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29,24 row-size=139B cardinality=8.93K
+|  |  in pipelines: 39(GETNEXT), 40(OPEN)
+|  |
+|  |--F76:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=6.34MB mem-reservation=1.94MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=16 plan-id=17 cohort-id=02
+|  |  |  build expressions: sr_item_sk, sr_ticket_number
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  113:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=24 row-size=16B cardinality=287.51K
+|  |  |  in pipelines: 40(GETNEXT)
+|  |  |
+|  |  F32:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  40:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=24 row-size=16B cardinality=287.51K
+|  |     in pipelines: 40(GETNEXT)
+|  |
+|  112:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  |  mem-estimate=1.27MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=23,43,29 row-size=123B cardinality=12.14K
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F29:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  61:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=17
+|  |  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43,29 row-size=123B cardinality=12.14K
+|  |  in pipelines: 39(GETNEXT), 45(OPEN)
+|  |
+|  |--F77:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=17 plan-id=18 cohort-id=02
+|  |  |  build expressions: d1.d_date_sk
+|  |  |  runtime filters: RF078[bloom] <- d1.d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  111:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=29 row-size=8B cardinality=373
+|  |  |  in pipelines: 45(GETNEXT)
+|  |  |
+|  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  45:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d1.d_year = CAST(2000 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=29 row-size=8B cardinality=373
+|  |     in pipelines: 45(GETNEXT)
+|  |
+|  60:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=18
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=23,43 row-size=115B cardinality=59.37K
+|  |  in pipelines: 39(GETNEXT), 59(OPEN)
+|  |
+|  |--F78:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.92MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=18 plan-id=19 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF080[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  110:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=44.51KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=43 row-size=59B cardinality=371
+|  |  |  in pipelines: 59(GETNEXT)
+|  |  |
+|  |  F30:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  59:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=43 row-size=59B cardinality=371
+|  |     in pipelines: 59(GETNEXT)
+|  |
+|  39:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF080[bloom] -> ss_item_sk, RF078[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=23 row-size=56B cardinality=2.88M
+|     in pipelines: 39(GETNEXT)
+|
+140:EXCHANGE [HASH(i_item_sk,s_store_name,s_zip)]
+|  mem-estimate=11.70MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=21 row-size=286B cardinality=288.12K
+|  in pipelines: 109(GETNEXT)
+|
+F28:PLAN FRAGMENT [HASH(i_product_name,i_item_sk,s_store_name,s_zip,ad1.ca_street_number,ad1.ca_street_name,ad1.ca_city,ad1.ca_zip,ad2.ca_street_number,ad2.ca_street_name,ad2.ca_city,ad2.ca_zip,d1.d_year,d2.d_year,d3.d_year)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=45.70MB mem-reservation=34.00MB thread-reservation=1
+109:AGGREGATE [FINALIZE]
+|  output: count:merge(*), sum:merge(ss_wholesale_cost), sum:merge(ss_list_price), sum:merge(ss_coupon_amt)
+|  group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21 row-size=286B cardinality=288.12K
+|  in pipelines: 109(GETNEXT), 00(OPEN)
+|
+108:EXCHANGE [HASH(i_product_name,i_item_sk,s_store_name,s_zip,ad1.ca_street_number,ad1.ca_street_name,ad1.ca_city,ad1.ca_zip,ad2.ca_street_number,ad2.ca_street_name,ad2.ca_city,ad2.ca_zip,d1.d_year,d2.d_year,d3.d_year)]
+|  mem-estimate=11.70MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=21 row-size=286B cardinality=288.12K
+|  in pipelines: 00(GETNEXT)
+|
+F22:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=37.30MB mem-reservation=34.00MB thread-reservation=1
+38:AGGREGATE [STREAMING]
+|  output: count(*), sum(ss_wholesale_cost), sum(ss_list_price), sum(ss_coupon_amt)
+|  group by: i_product_name, i_item_sk, s_store_name, s_zip, ad1.ca_street_number, ad1.ca_street_name, ad1.ca_city, ad1.ca_zip, ad2.ca_street_number, ad2.ca_street_name, ad2.ca_city, ad2.ca_zip, d1.d_year, d2.d_year, d3.d_year
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=21 row-size=286B cardinality=288.12K
+|  in pipelines: 00(GETNEXT)
+|
+37:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=19
+|  hash predicates: ss_item_sk = cs_item_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16,17,18,19,4 row-size=474B cardinality=288.12K
+|  in pipelines: 00(GETNEXT), 106(OPEN)
+|
+|--F79:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.07MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=19 plan-id=20 cohort-id=01
+|  |  build expressions: cs_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  107:EXCHANGE [BROADCAST]
+|  |  mem-estimate=202.23KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=40B cardinality=1.80K
+|  |  in pipelines: 106(GETNEXT)
+|  |
+|  F27:PLAN FRAGMENT [HASH(cs_item_sk)] hosts=3 instances=3
+|  Per-Instance Resources: mem-estimate=10.36MB mem-reservation=1.94MB thread-reservation=1
+|  106:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_ext_list_price), sum:merge(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  group by: cs_item_sk
+|  |  having: sum(cs_ext_list_price) > CAST(2 AS DECIMAL(3,0)) * sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=40B cardinality=1.80K
+|  |  in pipelines: 106(GETNEXT), 02(OPEN)
+|  |
+|  105:EXCHANGE [HASH(cs_item_sk)]
+|  |  mem-estimate=366.05KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=40B cardinality=17.98K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=58.00MB mem-reservation=10.00MB thread-reservation=1
+|  05:AGGREGATE [STREAMING]
+|  |  output: sum(cs_ext_list_price), sum(cr_refunded_cash + cr_reversed_charge + cr_store_credit)
+|  |  group by: cs_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=40B cardinality=17.98K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=20
+|  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=2,3 row-size=48B cardinality=849.41K
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--F80:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=15.38MB mem-reservation=11.50MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=20 plan-id=21 cohort-id=04
+|  |  |  build expressions: cr_item_sk, cr_order_number
+|  |  |  runtime filters: RF042[bloom] <- cr_item_sk, RF043[bloom] <- cr_order_number
+|  |  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |  |
+|  |  104:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=3.88MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=28B cardinality=144.07K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=3 row-size=28B cardinality=144.07K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF042[bloom] -> cs_item_sk, RF043[bloom] -> cs_order_number
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=2 row-size=20B cardinality=1.44M
+|     in pipelines: 02(GETNEXT)
+|
+36:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=21
+|  hash predicates: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  fk/pk conjuncts: hd2.hd_income_band_sk = ib2.ib_income_band_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16,17,18,19 row-size=434B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 19(OPEN)
+|
+|--F81:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=21 plan-id=22 cohort-id=01
+|  |  build expressions: ib2.ib_income_band_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  103:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=19 row-size=4B cardinality=20
+|  |  in pipelines: 19(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  19:SCAN HDFS [tpcds_parquet.income_band ib2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.21KB
+|     stored statistics:
+|       table: rows=20 size=1.21KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=0
+|     tuple-ids=19 row-size=4B cardinality=20
+|     in pipelines: 19(GETNEXT)
+|
+35:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=22
+|  hash predicates: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  fk/pk conjuncts: hd1.hd_income_band_sk = ib1.ib_income_band_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16,17,18 row-size=430B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 18(OPEN)
+|
+|--F82:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=22 plan-id=23 cohort-id=01
+|  |  build expressions: ib1.ib_income_band_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  102:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=18 row-size=4B cardinality=20
+|  |  in pipelines: 18(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  18:SCAN HDFS [tpcds_parquet.income_band ib1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.21KB
+|     stored statistics:
+|       table: rows=20 size=1.21KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=0
+|     tuple-ids=18 row-size=4B cardinality=20
+|     in pipelines: 18(GETNEXT)
+|
+34:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=23
+|  hash predicates: c_current_addr_sk = ad2.ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ad2.ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16,17 row-size=426B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 17(OPEN)
+|
+|--F83:PLAN FRAGMENT [HASH(c_current_addr_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=5.71MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=23 plan-id=24 cohort-id=01
+|  |  build expressions: ad2.ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  101:EXCHANGE [HASH(ad2.ca_address_sk)]
+|  |  mem-estimate=3.78MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=17 row-size=78B cardinality=50.00K
+|  |  in pipelines: 17(GETNEXT)
+|  |
+|  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  17:SCAN HDFS [tpcds_parquet.customer_address ad2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=17 row-size=78B cardinality=50.00K
+|     in pipelines: 17(GETNEXT)
+|
+100:EXCHANGE [HASH(c_current_addr_sk)]
+|  mem-estimate=3.30MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16 row-size=348B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F20:PLAN FRAGMENT [HASH(ss_addr_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=2.62MB mem-reservation=0B thread-reservation=1
+33:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=24
+|  hash predicates: ss_addr_sk = ad1.ca_address_sk
+|  fk/pk conjuncts: ss_addr_sk = ad1.ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12,16 row-size=348B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 16(OPEN)
+|
+|--F84:PLAN FRAGMENT [HASH(ss_addr_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=5.71MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=24 plan-id=25 cohort-id=01
+|  |  build expressions: ad1.ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  99:EXCHANGE [HASH(ad1.ca_address_sk)]
+|  |  mem-estimate=3.78MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=78B cardinality=50.00K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  16:SCAN HDFS [tpcds_parquet.customer_address ad1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=16 row-size=78B cardinality=50.00K
+|     in pipelines: 16(GETNEXT)
+|
+98:EXCHANGE [HASH(ss_addr_sk)]
+|  mem-estimate=2.62MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12 row-size=271B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F18:PLAN FRAGMENT [HASH(c_current_cdemo_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=2.45MB mem-reservation=0B thread-reservation=1
+32:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=25
+|  hash predicates: c_current_cdemo_sk = cd2.cd_demo_sk
+|  fk/pk conjuncts: c_current_cdemo_sk = cd2.cd_demo_sk
+|  other predicates: cd1.cd_marital_status != cd2.cd_marital_status
+|  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11,12 row-size=271B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 12(OPEN)
+|
+|--F85:PLAN FRAGMENT [HASH(c_current_cdemo_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=18.52MB mem-reservation=8.50MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=25 plan-id=26 cohort-id=01
+|  |  build expressions: cd2.cd_demo_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |
+|  97:EXCHANGE [HASH(cd2.cd_demo_sk)]
+|  |  mem-estimate=10.02MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=17B cardinality=1.92M
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  12:SCAN HDFS [tpcds_parquet.customer_demographics cd2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=12 row-size=17B cardinality=1.92M
+|     in pipelines: 12(GETNEXT)
+|
+96:EXCHANGE [HASH(c_current_cdemo_sk)]
+|  mem-estimate=2.45MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11 row-size=254B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F16:PLAN FRAGMENT [HASH(ss_cdemo_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=2.28MB mem-reservation=0B thread-reservation=1
+31:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=26
+|  hash predicates: ss_cdemo_sk = cd1.cd_demo_sk
+|  fk/pk conjuncts: ss_cdemo_sk = cd1.cd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8,11 row-size=254B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 11(OPEN)
+|
+|--F86:PLAN FRAGMENT [HASH(ss_cdemo_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=18.52MB mem-reservation=8.50MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=26 plan-id=27 cohort-id=01
+|  |  build expressions: cd1.cd_demo_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |
+|  95:EXCHANGE [HASH(cd1.cd_demo_sk)]
+|  |  mem-estimate=10.02MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=17B cardinality=1.92M
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  11:SCAN HDFS [tpcds_parquet.customer_demographics cd1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=11 row-size=17B cardinality=1.92M
+|     in pipelines: 11(GETNEXT)
+|
+94:EXCHANGE [HASH(ss_cdemo_sk)]
+|  mem-estimate=2.28MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8 row-size=237B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F14:PLAN FRAGMENT [HASH(c_first_shipto_date_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=2.19MB mem-reservation=0B thread-reservation=1
+30:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=27
+|  hash predicates: c_first_shipto_date_sk = d3.d_date_sk
+|  fk/pk conjuncts: c_first_shipto_date_sk = d3.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7,8 row-size=237B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 08(OPEN)
+|
+|--F87:PLAN FRAGMENT [HASH(c_first_shipto_date_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=2.51MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=27 plan-id=28 cohort-id=01
+|  |  build expressions: d3.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  93:EXCHANGE [HASH(d3.d_date_sk)]
+|  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=8B cardinality=73.05K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  08:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=8 row-size=8B cardinality=73.05K
+|     in pipelines: 08(GETNEXT)
+|
+92:EXCHANGE [HASH(c_first_shipto_date_sk)]
+|  mem-estimate=2.19MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7 row-size=229B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F12:PLAN FRAGMENT [HASH(c_first_sales_date_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=2.10MB mem-reservation=0B thread-reservation=1
+29:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=28
+|  hash predicates: c_first_sales_date_sk = d2.d_date_sk
+|  fk/pk conjuncts: c_first_sales_date_sk = d2.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15,7 row-size=229B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 07(OPEN)
+|
+|--F88:PLAN FRAGMENT [HASH(c_first_sales_date_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=2.51MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=28 plan-id=29 cohort-id=01
+|  |  build expressions: d2.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  91:EXCHANGE [HASH(d2.d_date_sk)]
+|  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=8B cardinality=73.05K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  07:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=7 row-size=8B cardinality=73.05K
+|     in pipelines: 07(GETNEXT)
+|
+90:EXCHANGE [HASH(c_first_sales_date_sk)]
+|  mem-estimate=2.10MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15 row-size=221B cardinality=8.45K
+|  in pipelines: 00(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=1.79MB mem-reservation=0B thread-reservation=1
+28:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=29
+|  hash predicates: c_current_hdemo_sk = hd2.hd_demo_sk
+|  fk/pk conjuncts: c_current_hdemo_sk = hd2.hd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10,15 row-size=221B cardinality=8.45K
+|  in pipelines: 00(GETNEXT), 15(OPEN)
+|
+|--F89:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=29 plan-id=30 cohort-id=01
+|  |  build expressions: hd2.hd_demo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  89:EXCHANGE [BROADCAST]
+|  |  mem-estimate=68.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=8B cardinality=7.20K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  15:SCAN HDFS [tpcds_parquet.household_demographics hd2, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=15 row-size=8B cardinality=7.20K
+|     in pipelines: 15(GETNEXT)
+|
+27:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=30
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9,10 row-size=213B cardinality=8.66K
+|  in pipelines: 00(GETNEXT), 10(OPEN)
+|
+|--F90:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=4.25MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=30 plan-id=31 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  88:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=2.32MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=24B cardinality=100.00K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  10:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=10 row-size=24B cardinality=100.00K
+|     in pipelines: 10(GETNEXT)
+|
+87:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=1.79MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9 row-size=189B cardinality=8.66K
+|  in pipelines: 00(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=1.27MB mem-reservation=0B thread-reservation=1
+26:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=31
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13,9 row-size=189B cardinality=8.66K
+|  in pipelines: 00(GETNEXT), 09(OPEN)
+|
+|--F91:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=31 plan-id=32 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  86:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=37B cardinality=12
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  09:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|     tuple-ids=9 row-size=37B cardinality=12
+|     in pipelines: 09(GETNEXT)
+|
+25:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=32
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14,13 row-size=151B cardinality=8.66K
+|  in pipelines: 00(GETNEXT), 13(OPEN)
+|
+|--F92:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=32 plan-id=33 cohort-id=01
+|  |  build expressions: p_promo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  85:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=4B cardinality=300
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  13:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=0
+|     tuple-ids=13 row-size=4B cardinality=300
+|     in pipelines: 13(GETNEXT)
+|
+24:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=33
+|  hash predicates: ss_hdemo_sk = hd1.hd_demo_sk
+|  fk/pk conjuncts: ss_hdemo_sk = hd1.hd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1,14 row-size=147B cardinality=8.72K
+|  in pipelines: 00(GETNEXT), 14(OPEN)
+|
+|--F93:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.94MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=33 plan-id=34 cohort-id=01
+|  |  build expressions: hd1.hd_demo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  84:EXCHANGE [BROADCAST]
+|  |  mem-estimate=68.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=8B cardinality=7.20K
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  14:SCAN HDFS [tpcds_parquet.household_demographics hd1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=14 row-size=8B cardinality=7.20K
+|     in pipelines: 14(GETNEXT)
+|
+23:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=34
+|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6,1 row-size=139B cardinality=8.93K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F94:PLAN FRAGMENT [HASH(ss_item_sk,ss_ticket_number)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=8.34MB mem-reservation=3.94MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=34 plan-id=35 cohort-id=01
+|  |  build expressions: sr_item_sk, sr_ticket_number
+|  |  runtime filters: RF034[bloom] <- sr_item_sk, RF035[bloom] <- sr_ticket_number
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  83:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=1 row-size=16B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+82:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  mem-estimate=1.27MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,20,6 row-size=123B cardinality=12.14K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+22:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=35
+|  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20,6 row-size=123B cardinality=12.14K
+|  in pipelines: 00(GETNEXT), 06(OPEN)
+|
+|--F95:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=35 plan-id=36 cohort-id=01
+|  |  build expressions: d1.d_date_sk
+|  |  runtime filters: RF038[bloom] <- d1.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  81:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=8B cardinality=373
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  06:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d1.d_year = CAST(1999 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d1.d_year = CAST(1999 AS INT)
+|     parquet dictionary predicates: d1.d_year = CAST(1999 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=6 row-size=8B cardinality=373
+|     in pipelines: 06(GETNEXT)
+|
+21:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=36
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,20 row-size=115B cardinality=59.37K
+|  in pipelines: 00(GETNEXT), 20(OPEN)
+|
+|--F96:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.92MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=36 plan-id=37 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF040[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  80:EXCHANGE [BROADCAST]
+|  |  mem-estimate=44.51KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=20 row-size=59B cardinality=371
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  20:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|     runtime filters: RF034[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|     parquet dictionary predicates: i_color IN ('purple', 'burlywood', 'indian', 'spring', 'floral', 'medium'), i_current_price <= CAST(74 AS DECIMAL(3,0)), i_current_price <= CAST(79 AS DECIMAL(3,0)), i_current_price >= CAST(64 AS DECIMAL(3,0)), i_current_price >= CAST(65 AS DECIMAL(3,0))
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=20 row-size=59B cardinality=371
+|     in pipelines: 20(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF040[bloom] -> ss_item_sk, RF038[bloom] -> ss_sold_date_sk, RF034[bloom] -> ss_item_sk, RF035[bloom] -> ss_ticket_number
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=0 row-size=56B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q65.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q65.test
new file mode 100644
index 0000000..4f40746
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q65.test
@@ -0,0 +1,726 @@
+# TPCDS-Q65
+select
+  s_store_name,
+  i_item_desc,
+  sc.revenue,
+  i_current_price,
+  i_wholesale_cost,
+  i_brand
+from
+  store,
+  item,
+  (select
+    ss_store_sk,
+    avg(revenue) as ave
+  from
+    (select
+      ss_store_sk,
+      ss_item_sk,
+      sum(ss_sales_price) as revenue
+    from
+      store_sales,
+      date_dim
+    where
+      ss_sold_date_sk = d_date_sk
+      and d_month_seq between 1212 and 1212 + 11
+    group by
+      ss_store_sk,
+      ss_item_sk
+    ) sa
+  group by
+    ss_store_sk
+  ) sb,
+  (select
+    ss_store_sk,
+    ss_item_sk,
+    sum(ss_sales_price) as revenue
+  from
+    store_sales,
+    date_dim
+  where
+    ss_sold_date_sk = d_date_sk
+    and d_month_seq between 1212 and 1212 + 11
+  group by
+    ss_store_sk,
+    ss_item_sk
+  ) sc
+where
+  sb.ss_store_sk = sc.ss_store_sk
+  and sc.revenue <= 0.1 * sb.ave
+  and s_store_sk = sc.ss_store_sk
+  and i_item_sk = sc.ss_item_sk
+order by
+  s_store_name,
+  i_item_desc
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=29.08MB Threads=7
+Per-Host Resource Estimates: Memory=288MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=287.56MB mem-reservation=29.08MB thread-reservation=7 runtime-filters-memory=5.00MB
+PLAN-ROOT SINK
+|  output exprs: s_store_name, i_item_desc, revenue, i_current_price, i_wholesale_cost, i_brand
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC, i_item_desc ASC
+|  mem-estimate=17.67KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=181B cardinality=100
+|  in pipelines: 14(GETNEXT), 10(OPEN)
+|
+13:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = ss_store_sk
+|  fk/pk conjuncts: none
+|  other predicates: sum(ss_sales_price) <= CAST(0.1 AS DECIMAL(1,1)) * avg(revenue)
+|  runtime filters: RF000[bloom] <- ss_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11,0,1,7 row-size=225B cardinality=647.10K
+|  in pipelines: 10(GETNEXT), 06(OPEN)
+|
+|--06:AGGREGATE [FINALIZE]
+|  |  output: avg(sum(ss_sales_price))
+|  |  group by: ss_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=6
+|  |  in pipelines: 06(GETNEXT), 05(OPEN)
+|  |
+|  05:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_sales_price)
+|  |  group by: ss_store_sk, ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=28B cardinality=107.85K
+|  |  in pipelines: 05(GETNEXT), 02(OPEN)
+|  |
+|  04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,3 row-size=28B cardinality=2.88M
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=8B cardinality=7.30K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=20B cardinality=2.88M
+|     in pipelines: 02(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=11,0,1 row-size=205B cardinality=107.85K
+|  in pipelines: 10(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=157B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF004[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11,0 row-size=48B cardinality=107.85K
+|  in pipelines: 10(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store.s_store_sk
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=0 row-size=20B cardinality=12
+|     in pipelines: 00(GETNEXT)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum(ss_sales_price)
+|  group by: ss_store_sk, ss_item_sk
+|  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=11 row-size=28B cardinality=107.85K
+|  in pipelines: 10(GETNEXT), 07(OPEN)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=28B cardinality=2.88M
+|  in pipelines: 07(GETNEXT), 08(OPEN)
+|
+|--08:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=10 row-size=8B cardinality=7.30K
+|     in pipelines: 08(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF002[bloom] -> tpcds_parquet.store_sales.ss_item_sk, RF004[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF006[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=9 row-size=20B cardinality=2.88M
+   in pipelines: 07(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=41.52MB Threads=17
+Per-Host Resource Estimates: Memory=358MB
+F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=60.05KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: s_store_name, i_item_desc, revenue, i_current_price, i_wholesale_cost, i_brand
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: s_store_name ASC, i_item_desc ASC
+|  limit: 100
+|  mem-estimate=60.05KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=181B cardinality=100
+|  in pipelines: 14(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.56MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+14:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC, i_item_desc ASC
+|  mem-estimate=17.67KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=181B cardinality=100
+|  in pipelines: 14(GETNEXT), 17(OPEN)
+|
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = ss_store_sk
+|  fk/pk conjuncts: none
+|  other predicates: sum(ss_sales_price) <= CAST(0.1 AS DECIMAL(1,1)) * avg(revenue)
+|  runtime filters: RF000[bloom] <- ss_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11,0,1,7 row-size=225B cardinality=647.10K
+|  in pipelines: 17(GETNEXT), 25(OPEN)
+|
+|--26:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=6
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(ss_store_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  25:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(revenue)
+|  |  group by: ss_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=6
+|  |  in pipelines: 25(GETNEXT), 23(OPEN)
+|  |
+|  24:EXCHANGE [HASH(ss_store_sk)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=20B cardinality=6
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [HASH(ss_store_sk,ss_item_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=21.05MB mem-reservation=3.94MB thread-reservation=1
+|  06:AGGREGATE [STREAMING]
+|  |  output: avg(sum(ss_sales_price))
+|  |  group by: ss_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=20B cardinality=6
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  23:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_sales_price)
+|  |  group by: ss_store_sk, ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=28B cardinality=107.85K
+|  |  in pipelines: 23(GETNEXT), 02(OPEN)
+|  |
+|  22:EXCHANGE [HASH(ss_store_sk,ss_item_sk)]
+|  |  mem-estimate=1.05MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=28B cardinality=107.85K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=61.00MB mem-reservation=8.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  05:AGGREGATE [STREAMING]
+|  |  output: sum(ss_sales_price)
+|  |  group by: ss_store_sk, ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=28B cardinality=107.85K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,3 row-size=28B cardinality=2.88M
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=8B cardinality=7.30K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=20B cardinality=2.88M
+|     in pipelines: 02(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11,0,1 row-size=205B cardinality=107.85K
+|  in pipelines: 17(GETNEXT), 01(OPEN)
+|
+|--20:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=2.85MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=157B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=157B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+19:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=1.82MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11,0 row-size=48B cardinality=107.85K
+|  in pipelines: 17(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(ss_store_sk,ss_item_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=14.01MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF004[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11,0 row-size=48B cardinality=107.85K
+|  in pipelines: 17(GETNEXT), 00(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=20B cardinality=12
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.02MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  00:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store.s_store_sk
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=0 row-size=20B cardinality=12
+|     in pipelines: 00(GETNEXT)
+|
+17:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: ss_store_sk, ss_item_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11 row-size=28B cardinality=107.85K
+|  in pipelines: 17(GETNEXT), 07(OPEN)
+|
+16:EXCHANGE [HASH(ss_store_sk,ss_item_sk)]
+|  mem-estimate=1.05MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11 row-size=28B cardinality=107.85K
+|  in pipelines: 07(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=64.00MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=4.00MB
+10:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: ss_store_sk, ss_item_sk
+|  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=11 row-size=28B cardinality=107.85K
+|  in pipelines: 07(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=28B cardinality=2.88M
+|  in pipelines: 07(GETNEXT), 08(OPEN)
+|
+|--15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  08:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=10 row-size=8B cardinality=7.30K
+|     in pipelines: 08(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF002[bloom] -> tpcds_parquet.store_sales.ss_item_sk, RF004[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF006[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=9 row-size=20B cardinality=2.88M
+   in pipelines: 07(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=74.02MB Threads=23
+Per-Host Resource Estimates: Memory=294MB
+F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=114.22KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: s_store_name, i_item_desc, revenue, i_current_price, i_wholesale_cost, i_brand
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: s_store_name ASC, i_item_desc ASC
+|  limit: 100
+|  mem-estimate=114.22KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=181B cardinality=100
+|  in pipelines: 14(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=2.00MB mem-reservation=0B thread-reservation=1
+14:TOP-N [LIMIT=100]
+|  order by: s_store_name ASC, i_item_desc ASC
+|  mem-estimate=17.67KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=181B cardinality=100
+|  in pipelines: 14(GETNEXT), 17(OPEN)
+|
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_store_sk = ss_store_sk
+|  fk/pk conjuncts: none
+|  other predicates: sum(ss_sales_price) <= CAST(0.1 AS DECIMAL(1,1)) * avg(revenue)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11,0,1,7 row-size=225B cardinality=647.10K
+|  in pipelines: 17(GETNEXT), 25(OPEN)
+|
+|--F11:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: ss_store_sk
+|  |  runtime filters: RF000[bloom] <- ss_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  26:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=6
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(ss_store_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  25:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(revenue)
+|  |  group by: ss_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=7 row-size=20B cardinality=6
+|  |  in pipelines: 25(GETNEXT), 23(OPEN)
+|  |
+|  24:EXCHANGE [HASH(ss_store_sk)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=20B cardinality=6
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [HASH(ss_store_sk,ss_item_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=21.15MB mem-reservation=3.94MB thread-reservation=1
+|  06:AGGREGATE [STREAMING]
+|  |  output: avg(sum(ss_sales_price))
+|  |  group by: ss_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=20B cardinality=6
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  23:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_sales_price)
+|  |  group by: ss_store_sk, ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=28B cardinality=107.85K
+|  |  in pipelines: 23(GETNEXT), 02(OPEN)
+|  |
+|  22:EXCHANGE [HASH(ss_store_sk,ss_item_sk)]
+|  |  mem-estimate=1.15MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=28B cardinality=107.85K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+|  05:AGGREGATE [STREAMING]
+|  |  output: sum(ss_sales_price)
+|  |  group by: ss_store_sk, ss_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=28B cardinality=107.85K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,3 row-size=28B cardinality=2.88M
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--F12:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=8B cardinality=7.30K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=2 row-size=20B cardinality=2.88M
+|     in pipelines: 02(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=02
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11,0,1 row-size=205B cardinality=107.85K
+|  in pipelines: 17(GETNEXT), 01(OPEN)
+|
+|--F13:PLAN FRAGMENT [HASH(ss_item_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=5.78MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  20:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=2.85MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=157B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=1 row-size=157B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+19:EXCHANGE [HASH(ss_item_sk)]
+|  mem-estimate=1.98MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11,0 row-size=48B cardinality=107.85K
+|  in pipelines: 17(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(ss_store_sk,ss_item_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.15MB mem-reservation=1.94MB thread-reservation=1
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11,0 row-size=48B cardinality=107.85K
+|  in pipelines: 17(GETNEXT), 00(OPEN)
+|
+|--F14:PLAN FRAGMENT [HASH(ss_store_sk,ss_item_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF004[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=20B cardinality=12
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store.s_store_sk
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=0 row-size=20B cardinality=12
+|     in pipelines: 00(GETNEXT)
+|
+17:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: ss_store_sk, ss_item_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11 row-size=28B cardinality=107.85K
+|  in pipelines: 17(GETNEXT), 07(OPEN)
+|
+16:EXCHANGE [HASH(ss_store_sk,ss_item_sk)]
+|  mem-estimate=1.15MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11 row-size=28B cardinality=107.85K
+|  in pipelines: 07(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+10:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: ss_store_sk, ss_item_sk
+|  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=11 row-size=28B cardinality=107.85K
+|  in pipelines: 07(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=28B cardinality=2.88M
+|  in pipelines: 07(GETNEXT), 08(OPEN)
+|
+|--F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=7.30K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  08:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=10 row-size=8B cardinality=7.30K
+|     in pipelines: 08(GETNEXT)
+|
+07:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF002[bloom] -> tpcds_parquet.store_sales.ss_item_sk, RF004[bloom] -> tpcds_parquet.store_sales.ss_store_sk, RF006[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=9 row-size=20B cardinality=2.88M
+   in pipelines: 07(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q66.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q66.test
new file mode 100644
index 0000000..341f5cc
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q66.test
@@ -0,0 +1,1226 @@
+# TPCDS-Q66
+select promotions,total,cast(promotions as decimal(15,4))/cast(total as decimal(15,4))*100
+from
+  (select sum(ss_ext_sales_price) promotions
+   from  store_sales
+        ,store
+        ,promotion
+        ,date_dim
+        ,customer
+        ,customer_address
+        ,item
+   where ss_sold_date_sk = d_date_sk
+   and   ss_store_sk = s_store_sk
+   and   ss_promo_sk = p_promo_sk
+   and   ss_customer_sk= c_customer_sk
+   and   ca_address_sk = c_current_addr_sk
+   and   ss_item_sk = i_item_sk
+   and   ca_gmt_offset = -5
+   and   i_category = 'Books'
+   and   (p_channel_dmail = 'Y' or p_channel_email = 'Y' or p_channel_tv = 'Y')
+   and   s_gmt_offset = -5
+   and   d_year = 2000
+   and   d_moy  = 11) promotional_sales,
+  (select sum(ss_ext_sales_price) total
+   from  store_sales
+        ,store
+        ,date_dim
+        ,customer
+        ,customer_address
+        ,item
+   where ss_sold_date_sk = d_date_sk
+   and   ss_store_sk = s_store_sk
+   and   ss_customer_sk= c_customer_sk
+   and   ca_address_sk = c_current_addr_sk
+   and   ss_item_sk = i_item_sk
+   and   ca_gmt_offset = -5
+   and   i_category = 'Books'
+   and   s_gmt_offset = -5
+   and   d_year = 2000
+   and   d_moy  = 11) all_sales
+order by promotions, total
+---- PLAN
+Max Per-Host Resource Reservation: Memory=39.38MB Threads=14
+Per-Host Resource Estimates: Memory=591MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=591.31MB mem-reservation=39.38MB thread-reservation=14 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: promotions, total, CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4)) * CAST(100 AS DECIMAL(3,0))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:SORT
+|  order by: promotions ASC, total ASC
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=17 row-size=32B cardinality=1
+|  in pipelines: 27(GETNEXT), 13(OPEN)
+|
+26:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=7,15 row-size=32B cardinality=1
+|  in pipelines: 13(GETNEXT), 25(OPEN)
+|
+|--25:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_ext_sales_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 14(OPEN)
+|  |
+|  24:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12,13 row-size=86B cardinality=3.30K
+|  |  in pipelines: 14(GETNEXT), 18(OPEN)
+|  |
+|  |--18:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=8B cardinality=8.33K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  23:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  runtime filters: RF014[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12 row-size=78B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 17(OPEN)
+|  |
+|  |--17:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF012[bloom] -> c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=8B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10 row-size=70B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |
+|  |--15:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=8B cardinality=12
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF018[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14 row-size=62B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 19(OPEN)
+|  |
+|  |--19:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Books'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Books'
+|  |     parquet dictionary predicates: i_category = 'Books'
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=14 row-size=26B cardinality=1.80K
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11 row-size=36B cardinality=170.55K
+|  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |
+|  |--16:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF020[bloom] -> ss_sold_date_sk, RF018[bloom] -> ss_item_sk, RF014[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=9 row-size=24B cardinality=2.88M
+|     in pipelines: 14(GETNEXT)
+|
+13:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF000[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4,5 row-size=133B cardinality=3.28K
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=8.33K
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4 row-size=125B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=8B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF004[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1 row-size=117B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=12
+|     in pipelines: 01(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  runtime filters: RF006[bloom] <- p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2 row-size=109B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.promotion]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_dmail = 'Y' OR p_channel_email = 'Y' OR p_channel_tv = 'Y')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=2 row-size=43B cardinality=300
+|     in pipelines: 02(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF008[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6 row-size=66B cardinality=17.06K
+|  in pipelines: 00(GETNEXT), 06(OPEN)
+|
+|--06:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category = 'Books'
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category = 'Books'
+|     parquet dictionary predicates: i_category = 'Books'
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=6 row-size=26B cardinality=1.80K
+|     in pipelines: 06(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF010[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=40B cardinality=170.55K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF010[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk, RF006[bloom] -> ss_promo_sk, RF002[bloom] -> ss_customer_sk, RF004[bloom] -> ss_store_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=49.38MB Threads=30
+Per-Host Resource Estimates: Memory=643MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.02MB mem-reservation=6.00MB thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: promotions, total, CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4)) * CAST(100 AS DECIMAL(3,0))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:SORT
+|  order by: promotions ASC, total ASC
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=17 row-size=32B cardinality=1
+|  in pipelines: 27(GETNEXT), 36(OPEN)
+|
+26:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=7,15 row-size=32B cardinality=1
+|  in pipelines: 36(GETNEXT), 44(OPEN)
+|
+|--45:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 44(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  44:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_ext_sales_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 44(GETNEXT), 25(OPEN)
+|  |
+|  43:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=16.51MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  25:AGGREGATE
+|  |  output: sum(ss_ext_sales_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 14(OPEN)
+|  |
+|  24:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12,13 row-size=86B cardinality=3.30K
+|  |  in pipelines: 14(GETNEXT), 18(OPEN)
+|  |
+|  |--42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  18:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=8B cardinality=8.33K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  23:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  runtime filters: RF014[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12 row-size=78B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 17(OPEN)
+|  |
+|  |--41:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=8B cardinality=100.00K
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  17:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF012[bloom] -> c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=8B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  40:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=645.75KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9,11,14,10 row-size=70B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=72.92MB mem-reservation=10.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10 row-size=70B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |
+|  |--39:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=8B cardinality=12
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  15:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=8B cardinality=12
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF018[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14 row-size=62B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 19(OPEN)
+|  |
+|  |--38:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=75.41KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=26B cardinality=1.80K
+|  |  |  in pipelines: 19(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  19:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Books'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Books'
+|  |     parquet dictionary predicates: i_category = 'Books'
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=14 row-size=26B cardinality=1.80K
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11 row-size=36B cardinality=170.55K
+|  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |
+|  |--37:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=12B cardinality=108
+|  |  |  in pipelines: 16(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  16:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF020[bloom] -> ss_sold_date_sk, RF018[bloom] -> ss_item_sk, RF014[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=9 row-size=24B cardinality=2.88M
+|     in pipelines: 14(GETNEXT)
+|
+36:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 36(GETNEXT), 13(OPEN)
+|
+35:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 13(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=16.91MB mem-reservation=5.88MB thread-reservation=1 runtime-filters-memory=2.00MB
+13:AGGREGATE
+|  output: sum(ss_ext_sales_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  runtime filters: RF000[bloom] <- ca_address_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4,5 row-size=133B cardinality=3.28K
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--34:EXCHANGE [BROADCAST]
+|  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=8.33K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=8.33K
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4 row-size=125B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--33:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=8B cardinality=100.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  04:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=8B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+32:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=1.03MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,6,2,1 row-size=117B cardinality=16.94K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=92.88MB mem-reservation=14.75MB thread-reservation=2 runtime-filters-memory=5.00MB
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF004[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1 row-size=117B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--31:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=12
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=12
+|     in pipelines: 01(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  runtime filters: RF006[bloom] <- p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2 row-size=109B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--30:EXCHANGE [BROADCAST]
+|  |  mem-estimate=26.37KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=43B cardinality=300
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_dmail = 'Y' OR p_channel_email = 'Y' OR p_channel_tv = 'Y')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=2 row-size=43B cardinality=300
+|     in pipelines: 02(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF008[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6 row-size=66B cardinality=17.06K
+|  in pipelines: 00(GETNEXT), 06(OPEN)
+|
+|--29:EXCHANGE [BROADCAST]
+|  |  mem-estimate=75.41KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=26B cardinality=1.80K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  06:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category = 'Books'
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category = 'Books'
+|     parquet dictionary predicates: i_category = 'Books'
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=6 row-size=26B cardinality=1.80K
+|     in pipelines: 06(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF010[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=40B cardinality=170.55K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--28:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF010[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk, RF006[bloom] -> ss_promo_sk, RF002[bloom] -> ss_customer_sk, RF004[bloom] -> ss_store_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=82.69MB Threads=35
+Per-Host Resource Estimates: Memory=379MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=6.00MB thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: promotions, total, CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4)) * CAST(100 AS DECIMAL(3,0))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:SORT
+|  order by: promotions ASC, total ASC
+|  mem-estimate=6.00MB mem-reservation=6.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=17 row-size=32B cardinality=1
+|  in pipelines: 27(GETNEXT), 36(OPEN)
+|
+26:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 00
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=7,15 row-size=32B cardinality=1
+|  in pipelines: 36(GETNEXT), 44(OPEN)
+|
+|--F17:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.02KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  |
+|  45:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 44(GETNEXT)
+|  |
+|  F16:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  44:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_ext_sales_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 44(GETNEXT), 25(OPEN)
+|  |
+|  43:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=10.88MB mem-reservation=0B thread-reservation=1
+|  25:AGGREGATE
+|  |  output: sum(ss_ext_sales_price)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=15 row-size=16B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 14(OPEN)
+|  |
+|  24:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12,13 row-size=86B cardinality=3.30K
+|  |  in pipelines: 14(GETNEXT), 18(OPEN)
+|  |
+|  |--F18:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: ca_address_sk
+|  |  |  runtime filters: RF012[bloom] <- ca_address_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  18:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=13 row-size=8B cardinality=8.33K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  23:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=02
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10,12 row-size=78B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 17(OPEN)
+|  |
+|  |--F19:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=3.71MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF014[bloom] <- c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  41:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=8B cardinality=100.00K
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  17:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF012[bloom] -> c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=12 row-size=8B cardinality=100.00K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  40:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=903.43KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9,11,14,10 row-size=70B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14,10 row-size=70B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |
+|  |--F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  39:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=8B cardinality=12
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  15:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=10 row-size=8B cardinality=12
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11,14 row-size=62B cardinality=17.06K
+|  |  in pipelines: 14(GETNEXT), 19(OPEN)
+|  |
+|  |--F21:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF018[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  38:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=75.41KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=26B cardinality=1.80K
+|  |  |  in pipelines: 19(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  19:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Books'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Books'
+|  |     parquet dictionary predicates: i_category = 'Books'
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=14 row-size=26B cardinality=1.80K
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,11 row-size=36B cardinality=170.55K
+|  |  in pipelines: 14(GETNEXT), 16(OPEN)
+|  |
+|  |--F22:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  37:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=12B cardinality=108
+|  |  |  in pipelines: 16(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  16:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=11 row-size=12B cardinality=108
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF020[bloom] -> ss_sold_date_sk, RF018[bloom] -> ss_item_sk, RF014[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=9 row-size=24B cardinality=2.88M
+|     in pipelines: 14(GETNEXT)
+|
+36:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 36(GETNEXT), 13(OPEN)
+|
+35:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 13(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.43MB mem-reservation=0B thread-reservation=1
+13:AGGREGATE
+|  output: sum(ss_ext_sales_price)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=1
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=06
+|  hash predicates: c_current_addr_sk = ca_address_sk
+|  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4,5 row-size=133B cardinality=3.28K
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--F23:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: ca_address_sk
+|  |  runtime filters: RF000[bloom] <- ca_address_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  34:EXCHANGE [BROADCAST]
+|  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=8.33K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: ca_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=5 row-size=8B cardinality=8.33K
+|     in pipelines: 05(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=07
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1,4 row-size=125B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F24:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=3.71MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=07 plan-id=08 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF002[bloom] <- c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  33:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=793.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=8B cardinality=100.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=4 row-size=8B cardinality=100.00K
+|     in pipelines: 04(GETNEXT)
+|
+32:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=1.43MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,3,6,2,1 row-size=117B cardinality=16.94K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=08
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2,1 row-size=117B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=08 plan-id=09 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF004[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  31:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=12
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     parquet dictionary predicates: s_gmt_offset = CAST(-5 AS DECIMAL(3,0))
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=1 row-size=8B cardinality=12
+|     in pipelines: 01(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=09
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6,2 row-size=109B cardinality=16.94K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F26:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  build expressions: p_promo_sk
+|  |  runtime filters: RF006[bloom] <- p_promo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  30:EXCHANGE [BROADCAST]
+|  |  mem-estimate=26.37KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=43B cardinality=300
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: (p_channel_dmail = 'Y' OR p_channel_email = 'Y' OR p_channel_tv = 'Y')
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=0
+|     tuple-ids=2 row-size=43B cardinality=300
+|     in pipelines: 02(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=10
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,6 row-size=66B cardinality=17.06K
+|  in pipelines: 00(GETNEXT), 06(OPEN)
+|
+|--F27:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  29:EXCHANGE [BROADCAST]
+|  |  mem-estimate=75.41KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=26B cardinality=1.80K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  06:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category = 'Books'
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category = 'Books'
+|     parquet dictionary predicates: i_category = 'Books'
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=6 row-size=26B cardinality=1.80K
+|     in pipelines: 06(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=11
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=40B cardinality=170.55K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F28:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=11 plan-id=12 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  28:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2000 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF010[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_item_sk, RF006[bloom] -> ss_promo_sk, RF002[bloom] -> ss_customer_sk, RF004[bloom] -> ss_store_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q67.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q67.test
new file mode 100644
index 0000000..3eed906
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q67.test
@@ -0,0 +1,411 @@
+# TPCDS-Q67
+select  *
+from (select i_category
+            ,i_class
+            ,i_brand
+            ,i_product_name
+            ,d_year
+            ,d_qoy
+            ,d_moy
+            ,s_store_id
+            ,sumsales
+            ,rank() over (partition by i_category order by sumsales desc) rk
+      from (select i_category
+                  ,i_class
+                  ,i_brand
+                  ,i_product_name
+                  ,d_year
+                  ,d_qoy
+                  ,d_moy
+                  ,s_store_id
+                  ,sum(coalesce(ss_sales_price*ss_quantity,0)) sumsales
+            from store_sales
+                ,date_dim
+                ,store
+                ,item
+       where  ss_sold_date_sk=d_date_sk
+          and ss_item_sk=i_item_sk
+          and ss_store_sk = s_store_sk
+          and d_month_seq between 1212 and 1212+11
+       group by  rollup(i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy,s_store_id))dw1) dw2
+where rk <= 100
+order by i_category
+        ,i_class
+        ,i_brand
+        ,i_product_name
+        ,d_year
+        ,d_qoy
+        ,d_moy
+        ,s_store_id
+        ,sumsales
+        ,rk
+limit 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=251.75MB Threads=5
+Per-Host Resource Estimates: Memory=18.41GB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=18.41GB mem-reservation=251.75MB thread-reservation=5 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, s_store_id, sumsales, rk
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+12:TOP-N [LIMIT=100]
+|  order by: i_category ASC, i_class ASC, i_brand ASC, i_product_name ASC, d_year ASC, d_qoy ASC, d_moy ASC, s_store_id ASC, sumsales ASC, rk ASC
+|  mem-estimate=9.38KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=18 row-size=96B cardinality=100
+|  in pipelines: 12(GETNEXT), 09(OPEN)
+|
+11:SELECT
+|  predicates: rank() <= CAST(100 AS BIGINT)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=25,24 row-size=100B cardinality=100
+|  in pipelines: 09(GETNEXT)
+|
+10:ANALYTIC
+|  functions: rank()
+|  partition by: i_category
+|  order by: aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END) DESC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=25,24 row-size=100B cardinality=100
+|  in pipelines: 09(GETNEXT)
+|
+09:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END ASC NULLS LAST, aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END) DESC
+|  mem-estimate=8.98KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=92B cardinality=100
+|  in pipelines: 09(GETNEXT), 08(OPEN)
+|
+08:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT), CAST(7 AS INT), CAST(8 AS INT), CAST(9 AS INT), CAST(10 AS INT), CAST(11 AS INT), CAST(12 AS INT)), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(5 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(6 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(7 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(8 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(9 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(10 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(11 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(12 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END)
+|  group by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_category WHEN CAST(5 AS INT) THEN i_category WHEN CAST(6 AS INT) THEN i_category WHEN CAST(7 AS INT) THEN i_category WHEN CAST(8 AS INT) THEN i_category WHEN CAST(9 AS INT) THEN i_category WHEN CAST(10 AS INT) THEN i_category WHEN CAST(11 AS INT) THEN i_category WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_class WHEN CAST(5 AS INT) THEN i_class WHEN CAST(6 AS INT) THEN i_class WHEN CAST(7 AS INT) THEN i_class WHEN CAST(8 AS INT) THEN i_class WHEN CAST(9 AS INT) THEN i_class WHEN CAST(10 AS INT) THEN i_class WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_brand WHEN CAST(5 AS INT) THEN i_brand WHEN CAST(6 AS INT) THEN i_brand WHEN CAST(7 AS INT) THEN i_brand WHEN CAST(8 AS INT) THEN i_brand WHEN CAST(9 AS INT) THEN i_brand WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_product_name WHEN CAST(5 AS INT) THEN i_product_name WHEN CAST(6 AS INT) THEN i_product_name WHEN CAST(7 AS INT) THEN i_product_name WHEN CAST(8 AS INT) THEN i_product_name WHEN CAST(9 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN d_year WHEN CAST(5 AS INT) THEN d_year WHEN CAST(6 AS INT) THEN d_year WHEN CAST(7 AS INT) THEN d_year WHEN CAST(8 AS INT) THEN NULL WHEN CAST(9 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN d_qoy WHEN CAST(5 AS INT) THEN d_qoy WHEN CAST(6 AS INT) THEN d_qoy WHEN CAST(7 AS INT) THEN NULL WHEN CAST(8 AS INT) THEN NULL WHEN CAST(9 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN d_moy WHEN CAST(5 AS INT) THEN d_moy WHEN CAST(6 AS INT) THEN NULL WHEN CAST(7 AS INT) THEN NULL WHEN CAST(8 AS INT) THEN NULL WHEN CAST(9 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN s_store_id WHEN CAST(5 AS INT) THEN NULL WHEN CAST(6 AS INT) THEN NULL WHEN CAST(7 AS INT) THEN NULL WHEN CAST(8 AS INT) THEN NULL WHEN CAST(9 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN CAST(4 AS INT) WHEN CAST(5 AS INT) THEN CAST(5 AS INT) WHEN CAST(6 AS INT) THEN CAST(6 AS INT) WHEN CAST(7 AS INT) THEN CAST(7 AS INT) WHEN CAST(8 AS INT) THEN CAST(8 AS INT) WHEN CAST(9 AS INT) THEN CAST(9 AS INT) WHEN CAST(10 AS INT) THEN CAST(10 AS INT) WHEN CAST(11 AS INT) THEN CAST(11 AS INT) WHEN CAST(12 AS INT) THEN CAST(12 AS INT) END
+|  mem-estimate=1.42GB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=13 row-size=92B cardinality=15.09M
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+07:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, s_store_id
+|  Class 1
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, NULL
+|  Class 2
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, NULL, NULL
+|  Class 3
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, NULL, NULL, NULL
+|  Class 4
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, i_product_name, NULL, NULL, NULL, NULL
+|  Class 5
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, NULL, NULL, NULL, NULL, NULL
+|  Class 6
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, NULL, NULL, NULL, NULL, NULL, NULL
+|  Class 7
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+|  Class 8
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+|  mem-estimate=16.98GB mem-reservation=210.75MB thread-reservation=0
+|  tuple-ids=4N,5N,6N,7N,8N,9N,10N,11N,12N row-size=1.07KB cardinality=15.09M
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=180B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=104B cardinality=18.00K
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=76B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=32B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=44B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_store_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=64.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=24B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=472.52MB Threads=11
+Per-Host Resource Estimates: Memory=53.05GB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.42KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, s_store_id, sumsales, rk
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+20:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_category ASC, i_class ASC, i_brand ASC, i_product_name ASC, d_year ASC, d_qoy ASC, d_moy ASC, s_store_id ASC, sumsales ASC, rk ASC
+|  limit: 100
+|  mem-estimate=32.42KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=18 row-size=96B cardinality=100
+|  in pipelines: 12(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=4.04MB mem-reservation=4.00MB thread-reservation=1
+12:TOP-N [LIMIT=100]
+|  order by: i_category ASC, i_class ASC, i_brand ASC, i_product_name ASC, d_year ASC, d_qoy ASC, d_moy ASC, s_store_id ASC, sumsales ASC, rk ASC
+|  mem-estimate=9.38KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=18 row-size=96B cardinality=100
+|  in pipelines: 12(GETNEXT), 19(OPEN)
+|
+11:SELECT
+|  predicates: rank() <= CAST(100 AS BIGINT)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=25,24 row-size=100B cardinality=100
+|  in pipelines: 19(GETNEXT)
+|
+10:ANALYTIC
+|  functions: rank()
+|  partition by: i_category
+|  order by: aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END) DESC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=25,24 row-size=100B cardinality=100
+|  in pipelines: 19(GETNEXT)
+|
+19:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END ASC NULLS LAST, aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END) DESC
+|  mem-estimate=8.98KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=92B cardinality=100
+|  in pipelines: 19(GETNEXT), 09(OPEN)
+|
+18:EXCHANGE [HASH(CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END)]
+|  mem-estimate=31.12KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=92B cardinality=100
+|  in pipelines: 09(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_category) WHEN 5 THEN murmur_hash(i_category) WHEN 6 THEN murmur_hash(i_category) WHEN 7 THEN murmur_hash(i_category) WHEN 8 THEN murmur_hash(i_category) WHEN 9 THEN murmur_hash(i_category) WHEN 10 THEN murmur_hash(i_category) WHEN 11 THEN murmur_hash(i_category) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_class) WHEN 5 THEN murmur_hash(i_class) WHEN 6 THEN murmur_hash(i_class) WHEN 7 THEN murmur_hash(i_class) WHEN 8 THEN murmur_hash(i_class) WHEN 9 THEN murmur_hash(i_class) WHEN 10 THEN murmur_hash(i_class) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_brand) WHEN 5 THEN murmur_hash(i_brand) WHEN 6 THEN murmur_hash(i_brand) WHEN 7 THEN murmur_hash(i_brand) WHEN 8 THEN murmur_hash(i_brand) WHEN 9 THEN murmur_hash(i_brand) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_product_name) WHEN 5 THEN murmur_hash(i_product_name) WHEN 6 THEN murmur_hash(i_product_name) WHEN 7 THEN murmur_hash(i_product_name) WHEN 8 THEN murmur_hash(i_product_name) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(d_year) WHEN 5 THEN murmur_hash(d_year) WHEN 6 THEN murmur_hash(d_year) WHEN 7 THEN murmur_hash(d_year) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(d_qoy) WHEN 5 THEN murmur_hash(d_qoy) WHEN 6 THEN murmur_hash(d_qoy) WHEN 7 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(d_moy) WHEN 5 THEN murmur_hash(d_moy) WHEN 6 THEN murmur_hash(NULL) WHEN 7 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(s_store_id) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) WHEN 7 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=43.90GB mem-reservation=244.75MB thread-reservation=1
+09:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN i_category WHEN 5 THEN i_category WHEN 6 THEN i_category WHEN 7 THEN i_category WHEN 8 THEN i_category WHEN 9 THEN i_category WHEN 10 THEN i_category WHEN 11 THEN i_category WHEN 12 THEN NULL END ASC NULLS LAST, aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (4, 5, 6, 7, 8, 9, 10, 11, 12), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 5 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 6 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 7 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 8 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 9 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 10 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 11 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN 12 THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END) DESC
+|  mem-estimate=8.98KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=25 row-size=92B cardinality=100
+|  in pipelines: 09(GETNEXT), 08(OPEN)
+|
+08:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(4,5,6,7,8,9,10,11,12) IN (CAST(4 AS INT), CAST(5 AS INT), CAST(6 AS INT), CAST(7 AS INT), CAST(8 AS INT), CAST(9 AS INT), CAST(10 AS INT), CAST(11 AS INT), CAST(12 AS INT)), CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(5 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(6 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(7 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(8 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(9 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(10 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(11 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) WHEN CAST(12 AS INT) THEN sum(coalesce(ss_sales_price * ss_quantity, 0)) END)
+|  group by: CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_category WHEN CAST(5 AS INT) THEN i_category WHEN CAST(6 AS INT) THEN i_category WHEN CAST(7 AS INT) THEN i_category WHEN CAST(8 AS INT) THEN i_category WHEN CAST(9 AS INT) THEN i_category WHEN CAST(10 AS INT) THEN i_category WHEN CAST(11 AS INT) THEN i_category WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_class WHEN CAST(5 AS INT) THEN i_class WHEN CAST(6 AS INT) THEN i_class WHEN CAST(7 AS INT) THEN i_class WHEN CAST(8 AS INT) THEN i_class WHEN CAST(9 AS INT) THEN i_class WHEN CAST(10 AS INT) THEN i_class WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_brand WHEN CAST(5 AS INT) THEN i_brand WHEN CAST(6 AS INT) THEN i_brand WHEN CAST(7 AS INT) THEN i_brand WHEN CAST(8 AS INT) THEN i_brand WHEN CAST(9 AS INT) THEN i_brand WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN i_product_name WHEN CAST(5 AS INT) THEN i_product_name WHEN CAST(6 AS INT) THEN i_product_name WHEN CAST(7 AS INT) THEN i_product_name WHEN CAST(8 AS INT) THEN i_product_name WHEN CAST(9 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN d_year WHEN CAST(5 AS INT) THEN d_year WHEN CAST(6 AS INT) THEN d_year WHEN CAST(7 AS INT) THEN d_year WHEN CAST(8 AS INT) THEN NULL WHEN CAST(9 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN d_qoy WHEN CAST(5 AS INT) THEN d_qoy WHEN CAST(6 AS INT) THEN d_qoy WHEN CAST(7 AS INT) THEN NULL WHEN CAST(8 AS INT) THEN NULL WHEN CAST(9 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN d_moy WHEN CAST(5 AS INT) THEN d_moy WHEN CAST(6 AS INT) THEN NULL WHEN CAST(7 AS INT) THEN NULL WHEN CAST(8 AS INT) THEN NULL WHEN CAST(9 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN s_store_id WHEN CAST(5 AS INT) THEN NULL WHEN CAST(6 AS INT) THEN NULL WHEN CAST(7 AS INT) THEN NULL WHEN CAST(8 AS INT) THEN NULL WHEN CAST(9 AS INT) THEN NULL WHEN CAST(10 AS INT) THEN NULL WHEN CAST(11 AS INT) THEN NULL WHEN CAST(12 AS INT) THEN NULL END, CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN CAST(4 AS INT) THEN CAST(4 AS INT) WHEN CAST(5 AS INT) THEN CAST(5 AS INT) WHEN CAST(6 AS INT) THEN CAST(6 AS INT) WHEN CAST(7 AS INT) THEN CAST(7 AS INT) WHEN CAST(8 AS INT) THEN CAST(8 AS INT) WHEN CAST(9 AS INT) THEN CAST(9 AS INT) WHEN CAST(10 AS INT) THEN CAST(10 AS INT) WHEN CAST(11 AS INT) THEN CAST(11 AS INT) WHEN CAST(12 AS INT) THEN CAST(12 AS INT) END
+|  mem-estimate=728.04MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=13 row-size=92B cardinality=15.09M
+|  in pipelines: 08(GETNEXT), 17(OPEN)
+|
+17:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, s_store_id
+|  Class 1
+|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, NULL
+|  Class 2
+|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, NULL, NULL
+|  Class 3
+|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, NULL, NULL, NULL
+|  Class 4
+|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
+|    group by: i_category, i_class, i_brand, i_product_name, NULL, NULL, NULL, NULL
+|  Class 5
+|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
+|    group by: i_category, i_class, i_brand, NULL, NULL, NULL, NULL, NULL
+|  Class 6
+|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
+|    group by: i_category, i_class, NULL, NULL, NULL, NULL, NULL, NULL
+|  Class 7
+|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
+|    group by: i_category, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+|  Class 8
+|    output: sum:merge(coalesce(ss_sales_price * ss_quantity, 0))
+|    group by: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+|  mem-estimate=43.19GB mem-reservation=210.75MB thread-reservation=0
+|  tuple-ids=4N,5N,6N,7N,8N,9N,10N,11N,12N row-size=1.07KB cardinality=15.09M
+|  in pipelines: 17(GETNEXT), 00(OPEN)
+|
+16:EXCHANGE [HASH(CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_category) WHEN 5 THEN murmur_hash(i_category) WHEN 6 THEN murmur_hash(i_category) WHEN 7 THEN murmur_hash(i_category) WHEN 8 THEN murmur_hash(i_category) WHEN 9 THEN murmur_hash(i_category) WHEN 10 THEN murmur_hash(i_category) WHEN 11 THEN murmur_hash(i_category) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_class) WHEN 5 THEN murmur_hash(i_class) WHEN 6 THEN murmur_hash(i_class) WHEN 7 THEN murmur_hash(i_class) WHEN 8 THEN murmur_hash(i_class) WHEN 9 THEN murmur_hash(i_class) WHEN 10 THEN murmur_hash(i_class) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_brand) WHEN 5 THEN murmur_hash(i_brand) WHEN 6 THEN murmur_hash(i_brand) WHEN 7 THEN murmur_hash(i_brand) WHEN 8 THEN murmur_hash(i_brand) WHEN 9 THEN murmur_hash(i_brand) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(i_product_name) WHEN 5 THEN murmur_hash(i_product_name) WHEN 6 THEN murmur_hash(i_product_name) WHEN 7 THEN murmur_hash(i_product_name) WHEN 8 THEN murmur_hash(i_product_name) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(d_year) WHEN 5 THEN murmur_hash(d_year) WHEN 6 THEN murmur_hash(d_year) WHEN 7 THEN murmur_hash(d_year) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(d_qoy) WHEN 5 THEN murmur_hash(d_qoy) WHEN 6 THEN murmur_hash(d_qoy) WHEN 7 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(d_moy) WHEN 5 THEN murmur_hash(d_moy) WHEN 6 THEN murmur_hash(NULL) WHEN 7 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END,CASE valid_tid(4,5,6,7,8,9,10,11,12) WHEN 4 THEN murmur_hash(s_store_id) WHEN 5 THEN murmur_hash(NULL) WHEN 6 THEN murmur_hash(NULL) WHEN 7 THEN murmur_hash(NULL) WHEN 8 THEN murmur_hash(NULL) WHEN 9 THEN murmur_hash(NULL) WHEN 10 THEN murmur_hash(NULL) WHEN 11 THEN murmur_hash(NULL) WHEN 12 THEN murmur_hash(NULL) END)]
+|  mem-estimate=13.32MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4N,5N,6N,7N,8N,9N,10N,11N,12N row-size=1.07KB cardinality=15.09M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=8.96GB mem-reservation=221.75MB thread-reservation=2 runtime-filters-memory=3.00MB
+07:AGGREGATE [STREAMING]
+|  Class 0
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, s_store_id
+|  Class 1
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, NULL
+|  Class 2
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, d_qoy, NULL, NULL
+|  Class 3
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, i_product_name, d_year, NULL, NULL, NULL
+|  Class 4
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, i_product_name, NULL, NULL, NULL, NULL
+|  Class 5
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, i_brand, NULL, NULL, NULL, NULL, NULL
+|  Class 6
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, i_class, NULL, NULL, NULL, NULL, NULL, NULL
+|  Class 7
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: i_category, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+|  Class 8
+|    output: sum(coalesce(ss_sales_price * CAST(ss_quantity AS DECIMAL(10,0)), CAST(0 AS DECIMAL(18,2))))
+|    group by: NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+|  mem-estimate=8.89GB mem-reservation=211.00MB thread-reservation=0
+|  tuple-ids=4N,5N,6N,7N,8N,9N,10N,11N,12N row-size=1.07KB cardinality=15.09M
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=180B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.89MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=104B cardinality=18.00K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=104B cardinality=18.00K
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=76B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=32B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=32B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=44B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=166.68KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=20B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_item_sk, RF002[bloom] -> ss_store_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=64.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=24B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q68.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q68.test
new file mode 100644
index 0000000..5b18f62
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q68.test
@@ -0,0 +1,680 @@
+# TPCDS-Q68
+select
+  c_last_name,
+  c_first_name,
+  ca_city,
+  bought_city,
+  ss_ticket_number,
+  extended_price,
+  extended_tax,
+  list_price
+from
+  (select
+    ss_ticket_number,
+    ss_customer_sk,
+    ca_city bought_city,
+    sum(ss_ext_sales_price) extended_price,
+    sum(ss_ext_list_price) list_price,
+    sum(ss_ext_tax) extended_tax
+  from
+    store_sales,
+    date_dim,
+    store,
+    household_demographics,
+    customer_address
+  where
+    store_sales.ss_sold_date_sk = date_dim.d_date_sk
+    and store_sales.ss_store_sk = store.s_store_sk
+    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+    and store_sales.ss_addr_sk = customer_address.ca_address_sk
+    and (household_demographics.hd_dep_count = 5
+      or household_demographics.hd_vehicle_count = 3)
+    and store.s_city in ('Midway', 'Fairview')
+    and d_date between '1999-01-01' and '1999-03-31'
+  group by
+    ss_ticket_number,
+    ss_customer_sk,
+    ss_addr_sk,
+    ca_city
+  ) dn,
+  customer,
+  customer_address current_addr
+where
+  ss_customer_sk = c_customer_sk
+  and customer.c_current_addr_sk = current_addr.ca_address_sk
+  and current_addr.ca_city <> bought_city
+order by
+  c_last_name,
+  ss_ticket_number
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=66.56MB Threads=8
+Per-Host Resource Estimates: Memory=394MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=394.06MB mem-reservation=66.56MB thread-reservation=8 runtime-filters-memory=6.00MB
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, extended_price, extended_tax, list_price
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, ss_ticket_number ASC
+|  mem-estimate=13.07KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=134B cardinality=100
+|  in pipelines: 14(GETNEXT), 09(OPEN)
+|
+13:HASH JOIN [INNER JOIN]
+|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  fk/pk conjuncts: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  other predicates: current_addr.ca_city != ca_city
+|  runtime filters: RF000[bloom] <- current_addr.ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,7,8 row-size=154B cardinality=702.92K
+|  in pipelines: 09(GETNEXT), 11(OPEN)
+|
+|--11:SCAN HDFS [tpcds_parquet.customer_address current_addr]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=8 row-size=25B cardinality=50.00K
+|     in pipelines: 11(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=5,7 row-size=129B cardinality=702.92K
+|  in pipelines: 09(GETNEXT), 10(OPEN)
+|
+|--10:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> customer.c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=7 row-size=44B cardinality=100.00K
+|     in pipelines: 10(GETNEXT)
+|
+09:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price), sum(ss_ext_list_price), sum(ss_ext_tax)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
+|  mem-estimate=62.64MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5 row-size=85B cardinality=702.92K
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  fk/pk conjuncts: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  runtime filters: RF004[bloom] <- customer_address.ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2,4 row-size=125B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=25B cardinality=50.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  runtime filters: RF006[bloom] <- store.s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=101B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_city IN ('Midway', 'Fairview')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_city IN ('Midway', 'Fairview')
+|     parquet dictionary predicates: store.s_city IN ('Midway', 'Fairview')
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=23B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  runtime filters: RF008[bloom] <- date_dim.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=78B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     parquet dictionary predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=26B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  runtime filters: RF010[bloom] <- household_demographics.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=52B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.household_demographics]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: (household_demographics.hd_dep_count = CAST(5 AS INT) OR household_demographics.hd_vehicle_count = CAST(3 AS INT))
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=1.80K
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF002[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF004[bloom] -> store_sales.ss_addr_sk, RF006[bloom] -> store_sales.ss_store_sk, RF008[bloom] -> store_sales.ss_sold_date_sk, RF010[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=128.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=40B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=104.14MB Threads=16
+Per-Host Resource Estimates: Memory=481MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=44.75KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, extended_price, extended_tax, list_price
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+23:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_last_name ASC, ss_ticket_number ASC
+|  limit: 100
+|  mem-estimate=44.75KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=134B cardinality=100
+|  in pipelines: 14(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=63.09MB mem-reservation=47.38MB thread-reservation=1 runtime-filters-memory=2.00MB
+14:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, ss_ticket_number ASC
+|  mem-estimate=13.07KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=134B cardinality=100
+|  in pipelines: 14(GETNEXT), 20(OPEN)
+|
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  fk/pk conjuncts: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  other predicates: current_addr.ca_city != ca_city
+|  runtime filters: RF000[bloom] <- current_addr.ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,7,8 row-size=154B cardinality=702.92K
+|  in pipelines: 20(GETNEXT), 11(OPEN)
+|
+|--22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=25B cardinality=50.00K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  11:SCAN HDFS [tpcds_parquet.customer_address current_addr, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=8 row-size=25B cardinality=50.00K
+|     in pipelines: 11(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=5,7 row-size=129B cardinality=702.92K
+|  in pipelines: 20(GETNEXT), 10(OPEN)
+|
+|--21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=4.24MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=44B cardinality=100.00K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=65.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  10:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> customer.c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=7 row-size=44B cardinality=100.00K
+|     in pipelines: 10(GETNEXT)
+|
+20:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price), sum:merge(ss_ext_list_price), sum:merge(ss_ext_tax)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5 row-size=85B cardinality=702.92K
+|  in pipelines: 20(GETNEXT), 00(OPEN)
+|
+19:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)]
+|  mem-estimate=10.26MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=85B cardinality=702.92K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=177.17MB mem-reservation=51.69MB thread-reservation=2 runtime-filters-memory=5.00MB
+09:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price), sum(ss_ext_list_price), sum(ss_ext_tax)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=5 row-size=85B cardinality=702.92K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  fk/pk conjuncts: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  runtime filters: RF004[bloom] <- customer_address.ca_address_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2,4 row-size=125B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=25B cardinality=50.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=4 row-size=25B cardinality=50.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  runtime filters: RF006[bloom] <- store.s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=101B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--17:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=23B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_city IN ('Midway', 'Fairview')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_city IN ('Midway', 'Fairview')
+|     parquet dictionary predicates: store.s_city IN ('Midway', 'Fairview')
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=23B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  runtime filters: RF008[bloom] <- date_dim.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=78B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--16:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     parquet dictionary predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=26B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  runtime filters: RF010[bloom] <- household_demographics.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=52B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=37.09KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=1.80K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: (household_demographics.hd_dep_count = CAST(5 AS INT) OR household_demographics.hd_vehicle_count = CAST(3 AS INT))
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=1.80K
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF002[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF004[bloom] -> store_sales.ss_addr_sk, RF006[bloom] -> store_sales.ss_store_sk, RF008[bloom] -> store_sales.ss_sold_date_sk, RF010[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=128.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=40B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=132.20MB Threads=17
+Per-Host Resource Estimates: Memory=276MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=85.13KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, ca_city, bought_city, ss_ticket_number, extended_price, extended_tax, list_price
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+23:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_last_name ASC, ss_ticket_number ASC
+|  limit: 100
+|  mem-estimate=85.13KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=134B cardinality=100
+|  in pipelines: 14(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=27.52MB mem-reservation=17.00MB thread-reservation=1
+14:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, ss_ticket_number ASC
+|  mem-estimate=13.07KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=134B cardinality=100
+|  in pipelines: 14(GETNEXT), 20(OPEN)
+|
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  fk/pk conjuncts: customer.c_current_addr_sk = current_addr.ca_address_sk
+|  other predicates: current_addr.ca_city != ca_city
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=5,7,8 row-size=154B cardinality=702.92K
+|  in pipelines: 20(GETNEXT), 11(OPEN)
+|
+|--F09:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=7.97MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: current_addr.ca_address_sk
+|  |  runtime filters: RF000[bloom] <- current_addr.ca_address_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=25B cardinality=50.00K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  11:SCAN HDFS [tpcds_parquet.customer_address current_addr, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=8 row-size=25B cardinality=50.00K
+|     in pipelines: 11(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=5,7 row-size=129B cardinality=702.92K
+|  in pipelines: 20(GETNEXT), 10(OPEN)
+|
+|--F10:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=22.24MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF002[bloom] <- c_customer_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+|  |
+|  21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=4.24MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=44B cardinality=100.00K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  10:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> customer.c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=7 row-size=44B cardinality=100.00K
+|     in pipelines: 10(GETNEXT)
+|
+20:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price), sum:merge(ss_ext_list_price), sum:merge(ss_ext_tax)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5 row-size=85B cardinality=702.92K
+|  in pipelines: 20(GETNEXT), 00(OPEN)
+|
+19:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city)]
+|  mem-estimate=10.52MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=85B cardinality=702.92K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+Per-Instance Resources: mem-estimate=33.00MB mem-reservation=21.00MB thread-reservation=1
+09:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price), sum(ss_ext_list_price), sum(ss_ext_tax)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, ca_city
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=5 row-size=85B cardinality=702.92K
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  fk/pk conjuncts: store_sales.ss_addr_sk = customer_address.ca_address_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2,4 row-size=125B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=7.97MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: customer_address.ca_address_sk
+|  |  runtime filters: RF004[bloom] <- customer_address.ca_address_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=25B cardinality=50.00K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=4 row-size=25B cardinality=50.00K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=101B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F12:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: store.s_store_sk
+|  |  runtime filters: RF006[bloom] <- store.s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  17:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=23B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_city IN ('Midway', 'Fairview')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_city IN ('Midway', 'Fairview')
+|     parquet dictionary predicates: store.s_city IN ('Midway', 'Fairview')
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=2 row-size=23B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=78B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.09MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: date_dim.d_date_sk
+|  |  runtime filters: RF008[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  16:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     parquet dictionary predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=1 row-size=26B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=05
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=52B cardinality=702.92K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.91MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: household_demographics.hd_demo_sk
+|  |  runtime filters: RF010[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  15:EXCHANGE [BROADCAST]
+|  |  mem-estimate=37.09KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=1.80K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: (household_demographics.hd_dep_count = CAST(5 AS INT) OR household_demographics.hd_vehicle_count = CAST(3 AS INT))
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=3 row-size=12B cardinality=1.80K
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF002[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF004[bloom] -> store_sales.ss_addr_sk, RF006[bloom] -> store_sales.ss_store_sk, RF008[bloom] -> store_sales.ss_sold_date_sk, RF010[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=40B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q69.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q69.test
new file mode 100644
index 0000000..cc86cf1
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q69.test
@@ -0,0 +1,859 @@
+# TPCDS-Q69
+SELECT cd_gender,
+       cd_marital_status,
+       cd_education_status,
+       count(*) cnt1,
+       cd_purchase_estimate,
+       count(*) cnt2,
+       cd_credit_rating,
+       count(*) cnt3
+FROM customer c,
+     customer_address ca,
+     customer_demographics
+WHERE c.c_current_addr_sk = ca.ca_address_sk
+  AND ca_state IN ('KY',
+                   'GA',
+                   'NM')
+  AND cd_demo_sk = c.c_current_cdemo_sk
+  AND EXISTS
+    (SELECT *
+     FROM store_sales,
+          date_dim
+     WHERE c.c_customer_sk = ss_customer_sk
+       AND ss_sold_date_sk = d_date_sk
+       AND d_year = 2001
+       AND d_moy BETWEEN 4 AND 4+2)
+  AND (NOT EXISTS
+         (SELECT *
+          FROM web_sales,
+               date_dim
+          WHERE c.c_customer_sk = ws_bill_customer_sk
+            AND ws_sold_date_sk = d_date_sk
+            AND d_year = 2001
+            AND d_moy BETWEEN 4 AND 4+2)
+       AND NOT EXISTS
+         (SELECT *
+          FROM catalog_sales,
+               date_dim
+          WHERE c.c_customer_sk = cs_ship_customer_sk
+            AND cs_sold_date_sk = d_date_sk
+            AND d_year = 2001
+            AND d_moy BETWEEN 4 AND 4+2))
+GROUP BY cd_gender,
+         cd_marital_status,
+         cd_education_status,
+         cd_purchase_estimate,
+         cd_credit_rating
+ORDER BY cd_gender,
+         cd_marital_status,
+         cd_education_status,
+         cd_purchase_estimate,
+         cd_credit_rating
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=36.88MB Threads=10
+Per-Host Resource Estimates: Memory=513MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=512.62MB mem-reservation=36.88MB thread-reservation=10 runtime-filters-memory=6.00MB
+PLAN-ROOT SINK
+|  output exprs: cd_gender, cd_marital_status, cd_education_status, count(*), cd_purchase_estimate, count(*), cd_credit_rating, count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:TOP-N [LIMIT=100]
+|  order by: cd_gender ASC, cd_marital_status ASC, cd_education_status ASC, cd_purchase_estimate ASC, cd_credit_rating ASC
+|  mem-estimate=7.67KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=79B cardinality=100
+|  in pipelines: 18(GETNEXT), 17(OPEN)
+|
+17:AGGREGATE [FINALIZE]
+|  output: count(*)
+|  group by: cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=79B cardinality=5.60K
+|  in pipelines: 17(GETNEXT), 09(OPEN)
+|
+16:HASH JOIN [RIGHT ANTI JOIN]
+|  hash predicates: cs_ship_customer_sk = c.c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  in pipelines: 09(GETNEXT), 06(OPEN)
+|
+|--15:HASH JOIN [RIGHT ANTI JOIN]
+|  |  hash predicates: ws_bill_customer_sk = c.c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  |  in pipelines: 06(GETNEXT), 03(OPEN)
+|  |
+|  |--14:HASH JOIN [RIGHT SEMI JOIN]
+|  |  |  hash predicates: ss_customer_sk = c.c_customer_sk
+|  |  |  runtime filters: RF004[bloom] <- c.c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  |  |  in pipelines: 03(GETNEXT), 02(OPEN)
+|  |  |
+|  |  |--13:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  |  fk/pk conjuncts: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  |  runtime filters: RF008[bloom] <- ca.ca_address_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  |  |  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |  |  |
+|  |  |  |--01:SCAN HDFS [tpcds_parquet.customer_address ca]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |  |     predicates: ca_state IN ('KY', 'GA', 'NM')
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=50.00K size=1.16MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |  |     parquet statistics predicates: ca_state IN ('KY', 'GA', 'NM')
+|  |  |  |     parquet dictionary predicates: ca_state IN ('KY', 'GA', 'NM')
+|  |  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=1 row-size=18B cardinality=2.94K
+|  |  |  |     in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  12:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: cd_demo_sk = c.c_current_cdemo_sk
+|  |  |  |  fk/pk conjuncts: none
+|  |  |  |  runtime filters: RF010[bloom] <- c.c_current_cdemo_sk
+|  |  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=2,0 row-size=87B cardinality=100.00K
+|  |  |  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |  |  |
+|  |  |  |--00:SCAN HDFS [tpcds_parquet.customer c]
+|  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |     runtime filters: RF008[bloom] -> c.c_current_addr_sk
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  |     tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |  |     in pipelines: 00(GETNEXT)
+|  |  |  |
+|  |  |  02:SCAN HDFS [tpcds_parquet.customer_demographics]
+|  |  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |  |     runtime filters: RF010[bloom] -> cd_demo_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=1.92M size=7.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |  |     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |     tuple-ids=2 row-size=75B cardinality=1.92M
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  05:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--04:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=4 row-size=12B cardinality=118
+|  |  |     in pipelines: 04(GETNEXT)
+|  |  |
+|  |  03:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF004[bloom] -> ss_customer_sk, RF006[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=8B cardinality=2.88M
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7 row-size=20B cardinality=46.82K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--07:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=12B cardinality=118
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF002[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=6 row-size=8B cardinality=719.38K
+|     in pipelines: 06(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=20B cardinality=93.21K
+|  in pipelines: 09(GETNEXT), 10(OPEN)
+|
+|--10:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=10 row-size=12B cardinality=118
+|     in pipelines: 10(GETNEXT)
+|
+09:SCAN HDFS [tpcds_parquet.catalog_sales]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=9 row-size=8B cardinality=1.44M
+   in pipelines: 09(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=46.69MB Threads=21
+Per-Host Resource Estimates: Memory=543MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: cd_gender, cd_marital_status, cd_education_status, count(*), cd_purchase_estimate, count(*), cd_credit_rating, count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+30:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: cd_gender ASC, cd_marital_status ASC, cd_education_status ASC, cd_purchase_estimate ASC, cd_credit_rating ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=79B cardinality=100
+|  in pipelines: 18(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=10.50MB mem-reservation=1.94MB thread-reservation=1
+18:TOP-N [LIMIT=100]
+|  order by: cd_gender ASC, cd_marital_status ASC, cd_education_status ASC, cd_purchase_estimate ASC, cd_credit_rating ASC
+|  mem-estimate=7.67KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=79B cardinality=100
+|  in pipelines: 18(GETNEXT), 29(OPEN)
+|
+29:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=79B cardinality=5.60K
+|  in pipelines: 29(GETNEXT), 09(OPEN)
+|
+28:EXCHANGE [HASH(cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating)]
+|  mem-estimate=512.26KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=79B cardinality=5.60K
+|  in pipelines: 09(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=17.32MB mem-reservation=6.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+17:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=79B cardinality=5.60K
+|  in pipelines: 09(GETNEXT)
+|
+16:HASH JOIN [RIGHT ANTI JOIN, PARTITIONED]
+|  hash predicates: cs_ship_customer_sk = c.c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  in pipelines: 09(GETNEXT), 06(OPEN)
+|
+|--15:HASH JOIN [RIGHT ANTI JOIN, PARTITIONED]
+|  |  hash predicates: ws_bill_customer_sk = c.c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  |  in pipelines: 06(GETNEXT), 03(OPEN)
+|  |
+|  |--14:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  |  |  hash predicates: ss_customer_sk = c.c_customer_sk
+|  |  |  runtime filters: RF004[bloom] <- c.c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  |  |  in pipelines: 03(GETNEXT), 02(OPEN)
+|  |  |
+|  |  |--25:EXCHANGE [HASH(c.c_customer_sk)]
+|  |  |  |  mem-estimate=813.54KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  |  |  |  in pipelines: 02(GETNEXT)
+|  |  |  |
+|  |  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=104.04MB mem-reservation=14.81MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  |  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  |  fk/pk conjuncts: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  |  runtime filters: RF008[bloom] <- ca.ca_address_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  |  |  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |  |  |
+|  |  |  |--23:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=73.70KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=1 row-size=18B cardinality=2.94K
+|  |  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  |  01:SCAN HDFS [tpcds_parquet.customer_address ca, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |  |     predicates: ca_state IN ('KY', 'GA', 'NM')
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=50.00K size=1.16MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |  |     parquet statistics predicates: ca_state IN ('KY', 'GA', 'NM')
+|  |  |  |     parquet dictionary predicates: ca_state IN ('KY', 'GA', 'NM')
+|  |  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=1 row-size=18B cardinality=2.94K
+|  |  |  |     in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: cd_demo_sk = c.c_current_cdemo_sk
+|  |  |  |  fk/pk conjuncts: none
+|  |  |  |  runtime filters: RF010[bloom] <- c.c_current_cdemo_sk
+|  |  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=2,0 row-size=87B cardinality=100.00K
+|  |  |  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |  |  |
+|  |  |  |--22:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=1.16MB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |  |  |  in pipelines: 00(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=49.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  |  |  00:SCAN HDFS [tpcds_parquet.customer c, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |     runtime filters: RF008[bloom] -> c.c_current_addr_sk
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  |     tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |  |     in pipelines: 00(GETNEXT)
+|  |  |  |
+|  |  |  02:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |  |     runtime filters: RF010[bloom] -> cd_demo_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=1.92M size=7.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |  |     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |     tuple-ids=2 row-size=75B cardinality=1.92M
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  24:EXCHANGE [HASH(ss_customer_sk)]
+|  |  |  mem-estimate=1.27MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=19.95MB mem-reservation=4.44MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--21:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=4 row-size=12B cardinality=118
+|  |  |  |  in pipelines: 04(GETNEXT)
+|  |  |  |
+|  |  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=4 row-size=12B cardinality=118
+|  |  |     in pipelines: 04(GETNEXT)
+|  |  |
+|  |  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF004[bloom] -> ss_customer_sk, RF006[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=8B cardinality=2.88M
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  26:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=513.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6,7 row-size=20B cardinality=46.82K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=66.95MB mem-reservation=6.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7 row-size=20B cardinality=46.82K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=12B cardinality=118
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=12B cardinality=118
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF002[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=6 row-size=8B cardinality=719.38K
+|     in pipelines: 06(GETNEXT)
+|
+27:EXCHANGE [HASH(cs_ship_customer_sk)]
+|  mem-estimate=690.82KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9,10 row-size=20B cardinality=93.21K
+|  in pipelines: 09(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=98.95MB mem-reservation=6.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=20B cardinality=93.21K
+|  in pipelines: 09(GETNEXT), 10(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=118
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  10:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=10 row-size=12B cardinality=118
+|     in pipelines: 10(GETNEXT)
+|
+09:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=9 row-size=8B cardinality=1.44M
+   in pipelines: 09(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=63.75MB Threads=21
+Per-Host Resource Estimates: Memory=272MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: cd_gender, cd_marital_status, cd_education_status, count(*), cd_purchase_estimate, count(*), cd_credit_rating, count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+30:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: cd_gender ASC, cd_marital_status ASC, cd_education_status ASC, cd_purchase_estimate ASC, cd_credit_rating ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=79B cardinality=100
+|  in pipelines: 18(GETNEXT)
+|
+F10:PLAN FRAGMENT [HASH(cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=10.50MB mem-reservation=1.94MB thread-reservation=1
+18:TOP-N [LIMIT=100]
+|  order by: cd_gender ASC, cd_marital_status ASC, cd_education_status ASC, cd_purchase_estimate ASC, cd_credit_rating ASC
+|  mem-estimate=7.67KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=79B cardinality=100
+|  in pipelines: 18(GETNEXT), 29(OPEN)
+|
+29:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=79B cardinality=5.60K
+|  in pipelines: 29(GETNEXT), 09(OPEN)
+|
+28:EXCHANGE [HASH(cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating)]
+|  mem-estimate=512.26KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=79B cardinality=5.60K
+|  in pipelines: 09(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=10.67MB mem-reservation=2.00MB thread-reservation=1
+17:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: cd_gender, cd_marital_status, cd_education_status, cd_purchase_estimate, cd_credit_rating
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=79B cardinality=5.60K
+|  in pipelines: 09(GETNEXT)
+|
+16:HASH JOIN [RIGHT ANTI JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: cs_ship_customer_sk = c.c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  in pipelines: 09(GETNEXT), 06(OPEN)
+|
+|--F12:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=2.44MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: c.c_customer_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  15:HASH JOIN [RIGHT ANTI JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: ws_bill_customer_sk = c.c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  |  in pipelines: 06(GETNEXT), 03(OPEN)
+|  |
+|  |--F13:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=3.29MB mem-reservation=1.94MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: c.c_customer_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  14:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: ss_customer_sk = c.c_customer_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  |  |  in pipelines: 03(GETNEXT), 02(OPEN)
+|  |  |
+|  |  |--F14:PLAN FRAGMENT [HASH(c.c_customer_sk)] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=3.73MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: c.c_customer_sk
+|  |  |  |  runtime filters: RF004[bloom] <- c.c_customer_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  25:EXCHANGE [HASH(c.c_customer_sk)]
+|  |  |  |  mem-estimate=813.54KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  |  |  |  in pipelines: 02(GETNEXT)
+|  |  |  |
+|  |  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=03
+|  |  |  |  hash predicates: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  |  fk/pk conjuncts: c.c_current_addr_sk = ca.ca_address_sk
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=2,0,1 row-size=105B cardinality=6.83K
+|  |  |  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |  |  |
+|  |  |  |--F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=03 plan-id=04 cohort-id=04
+|  |  |  |  |  build expressions: ca.ca_address_sk
+|  |  |  |  |  runtime filters: RF008[bloom] <- ca.ca_address_sk
+|  |  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  23:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=73.70KB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=1 row-size=18B cardinality=2.94K
+|  |  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |  01:SCAN HDFS [tpcds_parquet.customer_address ca, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |  |     predicates: ca_state IN ('KY', 'GA', 'NM')
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=50.00K size=1.16MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |  |     parquet statistics predicates: ca_state IN ('KY', 'GA', 'NM')
+|  |  |  |     parquet dictionary predicates: ca_state IN ('KY', 'GA', 'NM')
+|  |  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |  |     tuple-ids=1 row-size=18B cardinality=2.94K
+|  |  |  |     in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=04
+|  |  |  |  hash predicates: cd_demo_sk = c.c_current_cdemo_sk
+|  |  |  |  fk/pk conjuncts: none
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  tuple-ids=2,0 row-size=87B cardinality=100.00K
+|  |  |  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |  |  |
+|  |  |  |--F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  |  Per-Instance Resources: mem-estimate=7.91MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=04 plan-id=05 cohort-id=04
+|  |  |  |  |  build expressions: c.c_current_cdemo_sk
+|  |  |  |  |  runtime filters: RF010[bloom] <- c.c_current_cdemo_sk
+|  |  |  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  22:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=1.16MB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |  |  |  in pipelines: 00(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  |  00:SCAN HDFS [tpcds_parquet.customer c, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |  |  |     runtime filters: RF008[bloom] -> c.c_current_addr_sk
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=100.00K size=5.49MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |  |  |     tuple-ids=0 row-size=12B cardinality=100.00K
+|  |  |  |     in pipelines: 00(GETNEXT)
+|  |  |  |
+|  |  |  02:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |  |     runtime filters: RF010[bloom] -> cd_demo_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=1.92M size=7.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |  |     tuple-ids=2 row-size=75B cardinality=1.92M
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  24:EXCHANGE [HASH(ss_customer_sk)]
+|  |  |  mem-estimate=1.35MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=05
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=3,4 row-size=20B cardinality=186.34K
+|  |  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |  |
+|  |  |--F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  21:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=4 row-size=12B cardinality=118
+|  |  |  |  in pipelines: 04(GETNEXT)
+|  |  |  |
+|  |  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=4 row-size=12B cardinality=118
+|  |  |     in pipelines: 04(GETNEXT)
+|  |  |
+|  |  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF004[bloom] -> ss_customer_sk, RF006[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=8B cardinality=2.88M
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  26:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=513.25KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6,7 row-size=20B cardinality=46.82K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=1
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7 row-size=20B cardinality=46.82K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--F18:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  20:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=12B cardinality=118
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=7 row-size=12B cardinality=118
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF002[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=6 row-size=8B cardinality=719.38K
+|     in pipelines: 06(GETNEXT)
+|
+27:EXCHANGE [HASH(cs_ship_customer_sk)]
+|  mem-estimate=690.82KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9,10 row-size=20B cardinality=93.21K
+|  in pipelines: 09(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+Per-Instance Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=07
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=20B cardinality=93.21K
+|  in pipelines: 09(GETNEXT), 10(OPEN)
+|
+|--F19:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=07 plan-id=08 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=118
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  10:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|     parquet dictionary predicates: d_year = CAST(2001 AS INT), d_moy <= CAST(6 AS INT), d_moy >= CAST(4 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=10 row-size=12B cardinality=118
+|     in pipelines: 10(GETNEXT)
+|
+09:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=9 row-size=8B cardinality=1.44M
+   in pipelines: 09(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q70.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q70.test
new file mode 100644
index 0000000..55e2e37
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q70.test
@@ -0,0 +1,501 @@
+# TPCDS-Q70
+select
+    sum(ss_net_profit) as total_sum
+   ,s_state
+   ,s_county
+   ,grouping(s_state)+grouping(s_county) as lochierarchy
+   ,rank() over (
+        partition by grouping(s_state)+grouping(s_county),
+        case when grouping(s_county) = 0 then s_state end
+        order by sum(ss_net_profit) desc) as rank_within_parent
+ from
+    store_sales
+   ,date_dim       d1
+   ,store
+ where
+    d1.d_month_seq between 1212 and 1212+11
+ and d1.d_date_sk = ss_sold_date_sk
+ and s_store_sk  = ss_store_sk
+ and s_state in
+             ( select s_state
+               from  (select s_state as s_state,
+                            rank() over ( partition by s_state order by sum(ss_net_profit) desc) as ranking
+                      from   store_sales, store, date_dim
+                      where  d_month_seq between 1212 and 1212+11
+                            and d_date_sk = ss_sold_date_sk
+                            and s_store_sk  = ss_store_sk
+                      group by s_state
+                     ) tmp1
+               where ranking <= 5
+             )
+ group by rollup(s_state,s_county)
+ order by
+   lochierarchy desc
+  -- Modified from original because Impala does not allow aliases within order by
+  -- expressions, except at the top level.
+  ,case when grouping(s_state)+grouping(s_county) = 0 then s_state end
+  ,rank_within_parent
+ limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=32.34MB Threads=7
+Per-Host Resource Estimates: Memory=229MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=228.75MB mem-reservation=32.34MB thread-reservation=7 runtime-filters-memory=5.00MB
+PLAN-ROOT SINK
+|  output exprs: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END), CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END, CASE valid_tid(11,12,13) WHEN 11 THEN s_county WHEN 12 THEN NULL WHEN 13 THEN NULL END, CAST(aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) AS SMALLINT) + CAST(aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) AS SMALLINT), rank()
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+19:TOP-N [LIMIT=100]
+|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END ASC, rank() ASC
+|  mem-estimate=150B mem-reservation=0B thread-reservation=0
+|  tuple-ids=17 row-size=50B cardinality=3
+|  in pipelines: 19(GETNEXT), 17(OPEN)
+|
+18:ANALYTIC
+|  functions: rank()
+|  partition by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END), CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END
+|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END) DESC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=30,29 row-size=54B cardinality=3
+|  in pipelines: 17(GETNEXT)
+|
+17:SORT
+|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END) DESC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=30 row-size=46B cardinality=3
+|  in pipelines: 17(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(11,12,13) IN (CAST(11 AS INT), CAST(12 AS INT), CAST(13 AS INT)), CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN sum(ss_net_profit) WHEN CAST(12 AS INT) THEN sum(ss_net_profit) WHEN CAST(13 AS INT) THEN sum(ss_net_profit) END), aggif(valid_tid(11,12,13) IN (CAST(11 AS INT), CAST(12 AS INT), CAST(13 AS INT)), CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(12 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(13 AS INT) THEN CAST(1 AS TINYINT) END), aggif(valid_tid(11,12,13) IN (CAST(11 AS INT), CAST(12 AS INT), CAST(13 AS INT)), CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(12 AS INT) THEN CAST(1 AS TINYINT) WHEN CAST(13 AS INT) THEN CAST(1 AS TINYINT) END)
+|  group by: CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN s_state WHEN CAST(12 AS INT) THEN s_state WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN s_county WHEN CAST(12 AS INT) THEN NULL WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN CAST(11 AS INT) WHEN CAST(12 AS INT) THEN CAST(12 AS INT) WHEN CAST(13 AS INT) THEN CAST(13 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=14 row-size=46B cardinality=3
+|  in pipelines: 16(GETNEXT), 15(OPEN)
+|
+15:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum(ss_net_profit)
+|    group by: s_state, s_county
+|  Class 1
+|    output: sum(ss_net_profit)
+|    group by: s_state, NULL
+|  Class 2
+|    output: sum(ss_net_profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=5.81MB thread-reservation=0
+|  tuple-ids=11N,12N,13N row-size=141B cardinality=3
+|  in pipelines: 15(GETNEXT), 00(OPEN)
+|
+14:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: s_state = s_state
+|  runtime filters: RF000[bloom] <- s_state
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=67B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 09(OPEN)
+|
+|--11:SELECT
+|  |  predicates: rank() <= CAST(5 AS BIGINT)
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=26,25 row-size=38B cardinality=1
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  10:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: s_state
+|  |  order by: sum(ss_net_profit) DESC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=26,25 row-size=38B cardinality=1
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  09:SORT
+|  |  order by: s_state ASC NULLS LAST, sum(ss_net_profit) DESC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=26 row-size=30B cardinality=1
+|  |  in pipelines: 09(GETNEXT), 08(OPEN)
+|  |
+|  08:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_net_profit)
+|  |  group by: s_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=30B cardinality=1
+|  |  in pipelines: 08(GETNEXT), 03(OPEN)
+|  |
+|  07:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4,5 row-size=38B cardinality=2.88M
+|  |  in pipelines: 03(GETNEXT), 05(OPEN)
+|  |
+|  |--05:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=8B cardinality=7.30K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF008[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4 row-size=30B cardinality=2.88M
+|  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |
+|  |--04:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=18B cardinality=12
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_store_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=2.88M
+|     in pipelines: 03(GETNEXT)
+|
+13:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=67B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     runtime filters: RF000[bloom] -> s_state
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=2 row-size=47B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  runtime filters: RF004[bloom] <- d1.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=20B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim d1]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     parquet dictionary predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF002[bloom] -> ss_store_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=68.41MB Threads=16
+Per-Host Resource Estimates: Memory=346MB
+F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END), CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END, CASE valid_tid(11,12,13) WHEN 11 THEN s_county WHEN 12 THEN NULL WHEN 13 THEN NULL END, CAST(aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) AS SMALLINT) + CAST(aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) AS SMALLINT), rank()
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+30:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END ASC, rank() ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=17 row-size=50B cardinality=3
+|  in pipelines: 19(GETNEXT)
+|
+F08:PLAN FRAGMENT [HASH(aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END),CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=16.02MB mem-reservation=16.00MB thread-reservation=1
+19:TOP-N [LIMIT=100]
+|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END ASC, rank() ASC
+|  mem-estimate=150B mem-reservation=0B thread-reservation=0
+|  tuple-ids=17 row-size=50B cardinality=3
+|  in pipelines: 19(GETNEXT), 17(OPEN)
+|
+18:ANALYTIC
+|  functions: rank()
+|  partition by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END), CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END
+|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END) DESC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=30,29 row-size=54B cardinality=3
+|  in pipelines: 17(GETNEXT)
+|
+17:SORT
+|  order by: aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN sum(ss_net_profit) WHEN 12 THEN sum(ss_net_profit) WHEN 13 THEN sum(ss_net_profit) END) DESC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=30 row-size=46B cardinality=3
+|  in pipelines: 17(GETNEXT), 16(OPEN)
+|
+29:EXCHANGE [HASH(aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 0 WHEN 13 THEN 1 END) + aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END),CASE WHEN aggif(valid_tid(11,12,13) IN (11, 12, 13), CASE valid_tid(11,12,13) WHEN 11 THEN 0 WHEN 12 THEN 1 WHEN 13 THEN 1 END) = 0 THEN CASE valid_tid(11,12,13) WHEN 11 THEN s_state WHEN 12 THEN s_state WHEN 13 THEN NULL END END)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=46B cardinality=3
+|  in pipelines: 16(GETNEXT)
+|
+F07:PLAN FRAGMENT [HASH(CASE valid_tid(11,12,13) WHEN 11 THEN murmur_hash(s_state) WHEN 12 THEN murmur_hash(s_state) WHEN 13 THEN murmur_hash(NULL) END,CASE valid_tid(11,12,13) WHEN 11 THEN murmur_hash(s_county) WHEN 12 THEN murmur_hash(NULL) WHEN 13 THEN murmur_hash(NULL) END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=40.00MB mem-reservation=7.75MB thread-reservation=1
+16:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(11,12,13) IN (CAST(11 AS INT), CAST(12 AS INT), CAST(13 AS INT)), CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN sum(ss_net_profit) WHEN CAST(12 AS INT) THEN sum(ss_net_profit) WHEN CAST(13 AS INT) THEN sum(ss_net_profit) END), aggif(valid_tid(11,12,13) IN (CAST(11 AS INT), CAST(12 AS INT), CAST(13 AS INT)), CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(12 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(13 AS INT) THEN CAST(1 AS TINYINT) END), aggif(valid_tid(11,12,13) IN (CAST(11 AS INT), CAST(12 AS INT), CAST(13 AS INT)), CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(12 AS INT) THEN CAST(1 AS TINYINT) WHEN CAST(13 AS INT) THEN CAST(1 AS TINYINT) END)
+|  group by: CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN s_state WHEN CAST(12 AS INT) THEN s_state WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN s_county WHEN CAST(12 AS INT) THEN NULL WHEN CAST(13 AS INT) THEN NULL END, CASE valid_tid(11,12,13) WHEN CAST(11 AS INT) THEN CAST(11 AS INT) WHEN CAST(12 AS INT) THEN CAST(12 AS INT) WHEN CAST(13 AS INT) THEN CAST(13 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=14 row-size=46B cardinality=3
+|  in pipelines: 16(GETNEXT), 28(OPEN)
+|
+28:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum:merge(ss_net_profit)
+|    group by: s_state, s_county
+|  Class 1
+|    output: sum:merge(ss_net_profit)
+|    group by: s_state, NULL
+|  Class 2
+|    output: sum:merge(ss_net_profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=5.81MB thread-reservation=0
+|  tuple-ids=11N,12N,13N row-size=141B cardinality=3
+|  in pipelines: 28(GETNEXT), 00(OPEN)
+|
+27:EXCHANGE [HASH(CASE valid_tid(11,12,13) WHEN 11 THEN murmur_hash(s_state) WHEN 12 THEN murmur_hash(s_state) WHEN 13 THEN murmur_hash(NULL) END,CASE valid_tid(11,12,13) WHEN 11 THEN murmur_hash(s_county) WHEN 12 THEN murmur_hash(NULL) WHEN 13 THEN murmur_hash(NULL) END)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11N,12N,13N row-size=141B cardinality=3
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=70.91MB mem-reservation=15.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+15:AGGREGATE [STREAMING]
+|  Class 0
+|    output: sum(ss_net_profit)
+|    group by: s_state, s_county
+|  Class 1
+|    output: sum(ss_net_profit)
+|    group by: s_state, NULL
+|  Class 2
+|    output: sum(ss_net_profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=6.00MB thread-reservation=0
+|  tuple-ids=11N,12N,13N row-size=141B cardinality=3
+|  in pipelines: 00(GETNEXT)
+|
+14:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: s_state = s_state
+|  runtime filters: RF000[bloom] <- s_state
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=67B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 09(OPEN)
+|
+|--26:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=26,25 row-size=38B cardinality=1
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [HASH(s_state)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=26.00MB mem-reservation=17.94MB thread-reservation=1
+|  11:SELECT
+|  |  predicates: rank() <= CAST(5 AS BIGINT)
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=26,25 row-size=38B cardinality=1
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  10:ANALYTIC
+|  |  functions: rank()
+|  |  partition by: s_state
+|  |  order by: sum(ss_net_profit) DESC
+|  |  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  |  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=26,25 row-size=38B cardinality=1
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  09:SORT
+|  |  order by: s_state ASC NULLS LAST, sum(ss_net_profit) DESC
+|  |  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=26 row-size=30B cardinality=1
+|  |  in pipelines: 09(GETNEXT), 25(OPEN)
+|  |
+|  25:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_net_profit)
+|  |  group by: s_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=30B cardinality=1
+|  |  in pipelines: 25(GETNEXT), 03(OPEN)
+|  |
+|  24:EXCHANGE [HASH(s_state)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=30B cardinality=1
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=47.96MB mem-reservation=8.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  08:AGGREGATE [STREAMING]
+|  |  output: sum(ss_net_profit)
+|  |  group by: s_state
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=30B cardinality=1
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4,5 row-size=38B cardinality=2.88M
+|  |  in pipelines: 03(GETNEXT), 05(OPEN)
+|  |
+|  |--23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 05(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  05:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1223 AS INT), d_month_seq >= CAST(1212 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=8B cardinality=7.30K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  runtime filters: RF008[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4 row-size=30B cardinality=2.88M
+|  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |
+|  |--22:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=18B cardinality=12
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  04:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=18B cardinality=12
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF006[bloom] -> ss_sold_date_sk, RF008[bloom] -> ss_store_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=2.88M
+|     in pipelines: 03(GETNEXT)
+|
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF002[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=67B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=47B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=49.00MB mem-reservation=1.02MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     runtime filters: RF000[bloom] -> s_state
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=2 row-size=47B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d1.d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d1.d_date_sk
+|  runtime filters: RF004[bloom] <- d1.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=20B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     parquet dictionary predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF002[bloom] -> ss_store_sk, RF004[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q71.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q71.test
new file mode 100644
index 0000000..b20f33e
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q71.test
@@ -0,0 +1,698 @@
+# TPCDS-Q71
+SELECT i_brand_id brand_id,
+       i_brand brand,
+       t_hour,
+       t_minute,
+       sum(ext_price) ext_price
+FROM item,
+  (SELECT ws_ext_sales_price AS ext_price,
+          ws_sold_date_sk AS sold_date_sk,
+          ws_item_sk AS sold_item_sk,
+          ws_sold_time_sk AS time_sk
+   FROM web_sales,
+        date_dim
+   WHERE d_date_sk = ws_sold_date_sk
+     AND d_moy=11
+     AND d_year=1999
+   UNION ALL SELECT cs_ext_sales_price AS ext_price,
+                    cs_sold_date_sk AS sold_date_sk,
+                    cs_item_sk AS sold_item_sk,
+                    cs_sold_time_sk AS time_sk
+   FROM catalog_sales,
+        date_dim
+   WHERE d_date_sk = cs_sold_date_sk
+     AND d_moy=11
+     AND d_year=1999
+   UNION ALL SELECT ss_ext_sales_price AS ext_price,
+                    ss_sold_date_sk AS sold_date_sk,
+                    ss_item_sk AS sold_item_sk,
+                    ss_sold_time_sk AS time_sk
+   FROM store_sales,
+        date_dim
+   WHERE d_date_sk = ss_sold_date_sk
+     AND d_moy=11
+     AND d_year=1999 ) tmp,
+     time_dim
+WHERE sold_item_sk = i_item_sk
+  AND i_manager_id=1
+  AND time_sk = t_time_sk
+  AND (t_meal_time = 'breakfast'
+       OR t_meal_time = 'dinner')
+GROUP BY i_brand,
+         i_brand_id,
+         t_hour,
+         t_minute
+ORDER BY ext_price DESC,
+         i_brand_id ;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=54.25MB Threads=5
+Per-Host Resource Estimates: Memory=380MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=379.75MB mem-reservation=54.25MB thread-reservation=5 runtime-filters-memory=5.00MB
+PLAN-ROOT SINK
+|  output exprs: i_brand_id, i_brand, t_hour, t_minute, sum(ext_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+15:SORT
+|  order by: sum(ext_price) DESC, i_brand_id ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=11 row-size=56B cardinality=298.71K
+|  in pipelines: 15(GETNEXT), 14(OPEN)
+|
+14:AGGREGATE [FINALIZE]
+|  output: sum(ext_price)
+|  group by: i_brand, i_brand_id, t_hour, t_minute
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10 row-size=56B cardinality=298.71K
+|  in pipelines: 14(GETNEXT), 02(OPEN), 05(OPEN), 08(OPEN)
+|
+13:HASH JOIN [INNER JOIN]
+|  hash predicates: time_sk = t_time_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF000[bloom] <- t_time_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=7,0,9 row-size=91B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT), 11(OPEN)
+|
+|--11:SCAN HDFS [tpcds_parquet.time_dim]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: t_meal_time IN ('breakfast', 'dinner')
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: t_meal_time IN ('breakfast', 'dinner')
+|     parquet dictionary predicates: t_meal_time IN ('breakfast', 'dinner')
+|     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=9 row-size=31B cardinality=57.60K
+|     in pipelines: 11(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: sold_item_sk = i_item_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,0 row-size=60B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_manager_id = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_manager_id = CAST(1 AS INT)
+|     parquet dictionary predicates: i_manager_id = CAST(1 AS INT)
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=0 row-size=44B cardinality=182
+|     in pipelines: 00(GETNEXT)
+|
+01:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT)
+|
+|--10:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=32B cardinality=170.55K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--09:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=12B cardinality=108
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_sold_time_sk, RF002[bloom] -> tpcds_parquet.store_sales.ss_item_sk, RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=5 row-size=20B cardinality=2.88M
+|     in pipelines: 08(GETNEXT)
+|
+|--07:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4 row-size=32B cardinality=85.31K
+|  |  in pipelines: 05(GETNEXT), 06(OPEN)
+|  |
+|  |--06:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=12B cardinality=108
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_sold_time_sk, RF002[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF006[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=3 row-size=20B cardinality=1.44M
+|     in pipelines: 05(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=32B cardinality=42.85K
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.web_sales]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.web_sales.ws_sold_time_sk, RF002[bloom] -> tpcds_parquet.web_sales.ws_item_sk, RF004[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=1 row-size=20B cardinality=719.38K
+   in pipelines: 02(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=68.00MB Threads=14
+Per-Host Resource Estimates: Memory=529MB
+F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=5.51MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_brand_id, i_brand, t_hour, t_minute, sum(ext_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+23:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(ext_price) DESC, i_brand_id ASC
+|  mem-estimate=5.51MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11 row-size=56B cardinality=298.71K
+|  in pipelines: 15(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(i_brand,i_brand_id,t_hour,t_minute)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=29.00MB mem-reservation=29.00MB thread-reservation=1
+15:SORT
+|  order by: sum(ext_price) DESC, i_brand_id ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=11 row-size=56B cardinality=298.71K
+|  in pipelines: 15(GETNEXT), 22(OPEN)
+|
+22:AGGREGATE [FINALIZE]
+|  output: sum:merge(ext_price)
+|  group by: i_brand, i_brand_id, t_hour, t_minute
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=10 row-size=56B cardinality=298.71K
+|  in pipelines: 22(GETNEXT), 02(OPEN), 05(OPEN), 08(OPEN)
+|
+21:EXCHANGE [HASH(i_brand,i_brand_id,t_hour,t_minute)]
+|  mem-estimate=5.51MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=56B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT)
+|
+F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=222.51MB mem-reservation=36.75MB thread-reservation=2 runtime-filters-memory=5.00MB
+14:AGGREGATE [STREAMING]
+|  output: sum(ext_price)
+|  group by: i_brand, i_brand_id, t_hour, t_minute
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=10 row-size=56B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT)
+|
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: time_sk = t_time_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF000[bloom] <- t_time_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=7,0,9 row-size=91B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT), 11(OPEN)
+|
+|--20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=31B cardinality=57.60K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=2
+|  11:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: t_meal_time IN ('breakfast', 'dinner')
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: t_meal_time IN ('breakfast', 'dinner')
+|     parquet dictionary predicates: t_meal_time IN ('breakfast', 'dinner')
+|     mem-estimate=64.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=9 row-size=31B cardinality=57.60K
+|     in pipelines: 11(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: sold_item_sk = i_item_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,0 row-size=60B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT), 00(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.42KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=44B cardinality=182
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_manager_id = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_manager_id = CAST(1 AS INT)
+|     parquet dictionary predicates: i_manager_id = CAST(1 AS INT)
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=0 row-size=44B cardinality=182
+|     in pipelines: 00(GETNEXT)
+|
+01:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT)
+|
+|--10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=32B cardinality=170.55K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--18:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=12B cardinality=108
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  09:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=12B cardinality=108
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_sold_time_sk, RF002[bloom] -> tpcds_parquet.store_sales.ss_item_sk, RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=5 row-size=20B cardinality=2.88M
+|     in pipelines: 08(GETNEXT)
+|
+|--07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4 row-size=32B cardinality=85.31K
+|  |  in pipelines: 05(GETNEXT), 06(OPEN)
+|  |
+|  |--17:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=12B cardinality=108
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  06:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=12B cardinality=108
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_sold_time_sk, RF002[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF006[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=3 row-size=20B cardinality=1.44M
+|     in pipelines: 05(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF004[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=32B cardinality=42.85K
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--16:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.web_sales.ws_sold_time_sk, RF002[bloom] -> tpcds_parquet.web_sales.ws_item_sk, RF004[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=1 row-size=20B cardinality=719.38K
+   in pipelines: 02(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=108.50MB Threads=15
+Per-Host Resource Estimates: Memory=279MB
+F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=5.69MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_brand_id, i_brand, t_hour, t_minute, sum(ext_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+23:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(ext_price) DESC, i_brand_id ASC
+|  mem-estimate=5.69MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11 row-size=56B cardinality=298.71K
+|  in pipelines: 15(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(i_brand,i_brand_id,t_hour,t_minute)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=22.00MB mem-reservation=20.50MB thread-reservation=1
+15:SORT
+|  order by: sum(ext_price) DESC, i_brand_id ASC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=11 row-size=56B cardinality=298.71K
+|  in pipelines: 15(GETNEXT), 22(OPEN)
+|
+22:AGGREGATE [FINALIZE]
+|  output: sum:merge(ext_price)
+|  group by: i_brand, i_brand_id, t_hour, t_minute
+|  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=10 row-size=56B cardinality=298.71K
+|  in pipelines: 22(GETNEXT), 02(OPEN), 05(OPEN), 08(OPEN)
+|
+21:EXCHANGE [HASH(i_brand,i_brand_id,t_hour,t_minute)]
+|  mem-estimate=5.69MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=56B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT)
+|
+F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+Per-Instance Resources: mem-estimate=58.00MB mem-reservation=17.00MB thread-reservation=1
+14:AGGREGATE [STREAMING]
+|  output: sum(ext_price)
+|  group by: i_brand, i_brand_id, t_hour, t_minute
+|  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=10 row-size=56B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT)
+|
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: time_sk = t_time_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=7,0,9 row-size=91B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT), 11(OPEN)
+|
+|--F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=8.48MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: t_time_sk
+|  |  runtime filters: RF000[bloom] <- t_time_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.73MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=31B cardinality=57.60K
+|  |  in pipelines: 11(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  11:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: t_meal_time IN ('breakfast', 'dinner')
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: t_meal_time IN ('breakfast', 'dinner')
+|     parquet dictionary predicates: t_meal_time IN ('breakfast', 'dinner')
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=9 row-size=31B cardinality=57.60K
+|     in pipelines: 11(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: sold_item_sk = i_item_sk
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,0 row-size=60B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT), 00(OPEN)
+|
+|--F12:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.42KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=44B cardinality=182
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_manager_id = CAST(1 AS INT)
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_manager_id = CAST(1 AS INT)
+|     parquet dictionary predicates: i_manager_id = CAST(1 AS INT)
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=0 row-size=44B cardinality=182
+|     in pipelines: 00(GETNEXT)
+|
+01:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=16B cardinality=298.71K
+|  in pipelines: 02(GETNEXT), 05(GETNEXT), 08(GETNEXT)
+|
+|--10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=32B cardinality=170.55K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  18:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=12B cardinality=108
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  09:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=6 row-size=12B cardinality=108
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_sold_time_sk, RF002[bloom] -> tpcds_parquet.store_sales.ss_item_sk, RF008[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=5 row-size=20B cardinality=2.88M
+|     in pipelines: 08(GETNEXT)
+|
+|--07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,4 row-size=32B cardinality=85.31K
+|  |  in pipelines: 05(GETNEXT), 06(OPEN)
+|  |
+|  |--F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  17:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=12B cardinality=108
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  06:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=4 row-size=12B cardinality=108
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.catalog_sales.cs_sold_time_sk, RF002[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF006[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=3 row-size=20B cardinality=1.44M
+|     in pipelines: 05(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=32B cardinality=42.85K
+|  in pipelines: 02(GETNEXT), 03(OPEN)
+|
+|--F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  16:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=108
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1999 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 03(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.web_sales.ws_sold_time_sk, RF002[bloom] -> tpcds_parquet.web_sales.ws_item_sk, RF004[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=1 row-size=20B cardinality=719.38K
+   in pipelines: 02(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q72.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q72.test
new file mode 100644
index 0000000..274b672
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q72.test
@@ -0,0 +1,994 @@
+# TPCDS-Q72
+SELECT i_item_desc,
+       w_warehouse_name,
+       d1.d_week_seq,
+       sum(CASE
+               WHEN p_promo_sk IS NULL THEN 1
+               ELSE 0
+           END) no_promo,
+       sum(CASE
+               WHEN p_promo_sk IS NOT NULL THEN 1
+               ELSE 0
+           END) promo,
+       count(*) total_cnt
+FROM catalog_sales
+JOIN inventory ON (cs_item_sk = inv_item_sk)
+JOIN warehouse ON (w_warehouse_sk=inv_warehouse_sk)
+JOIN item ON (i_item_sk = cs_item_sk)
+JOIN customer_demographics ON (cs_bill_cdemo_sk = cd_demo_sk)
+JOIN household_demographics ON (cs_bill_hdemo_sk = hd_demo_sk)
+JOIN date_dim d1 ON (cs_sold_date_sk = d1.d_date_sk)
+JOIN date_dim d2 ON (inv_date_sk = d2.d_date_sk)
+JOIN date_dim d3 ON (cs_ship_date_sk = d3.d_date_sk)
+LEFT OUTER JOIN promotion ON (cs_promo_sk=p_promo_sk)
+LEFT OUTER JOIN catalog_returns ON (cr_item_sk = cs_item_sk
+                                    AND cr_order_number = cs_order_number)
+WHERE d1.d_week_seq = d2.d_week_seq
+  AND inv_quantity_on_hand < cs_quantity
+  AND cast(d3.d_date as timestamp) > (cast(d1.d_date as timestamp) + interval 5 days)
+  AND hd_buy_potential = '>10000'
+  AND d1.d_year = 1999
+  AND cd_marital_status = 'D'
+GROUP BY i_item_desc,
+         w_warehouse_name,
+         d1.d_week_seq
+ORDER BY total_cnt DESC,
+         i_item_desc,
+         w_warehouse_name,
+         d1.d_week_seq
+LIMIT 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=123.56MB Threads=12
+Per-Host Resource Estimates: Memory=932MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=932.05MB mem-reservation=123.56MB thread-reservation=12 runtime-filters-memory=9.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_desc, w_warehouse_name, d1.d_week_seq, sum(CASE WHEN p_promo_sk IS NULL THEN 1 ELSE 0 END), sum(CASE WHEN p_promo_sk IS NOT NULL THEN 1 ELSE 0 END), count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+22:TOP-N [LIMIT=100]
+|  order by: count(*) DESC, i_item_desc ASC, w_warehouse_name ASC, d1.d_week_seq ASC
+|  mem-estimate=16.60KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=170B cardinality=100
+|  in pipelines: 22(GETNEXT), 21(OPEN)
+|
+21:AGGREGATE [FINALIZE]
+|  output: sum(CAST(CASE WHEN p_promo_sk IS NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN p_promo_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), count(*)
+|  group by: i_item_desc, w_warehouse_name, d1.d_week_seq
+|  mem-estimate=235.61MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=11 row-size=170B cardinality=1.32M
+|  in pipelines: 21(GETNEXT), 01(OPEN)
+|
+20:HASH JOIN [LEFT OUTER JOIN]
+|  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=1,2,3,7,6,0,5,4,8,9N,10N row-size=342B cardinality=1.32M
+|  in pipelines: 01(GETNEXT), 10(OPEN)
+|
+|--10:SCAN HDFS [tpcds_parquet.catalog_returns]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=10 row-size=16B cardinality=144.07K
+|     in pipelines: 10(GETNEXT)
+|
+19:HASH JOIN [LEFT OUTER JOIN]
+|  hash predicates: cs_promo_sk = p_promo_sk
+|  fk/pk conjuncts: cs_promo_sk = p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,3,7,6,0,5,4,8,9N row-size=326B cardinality=1.32M
+|  in pipelines: 01(GETNEXT), 09(OPEN)
+|
+|--09:SCAN HDFS [tpcds_parquet.promotion]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=9 row-size=4B cardinality=300
+|     in pipelines: 09(GETNEXT)
+|
+18:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_ship_date_sk = d3.d_date_sk
+|  fk/pk conjuncts: cs_ship_date_sk = d3.d_date_sk
+|  other predicates: CAST(d3.d_date AS TIMESTAMP) > (CAST(d1.d_date AS TIMESTAMP) + INTERVAL CAST(5 AS INT) days)
+|  runtime filters: RF000[bloom] <- d3.d_date_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=1,2,3,7,6,0,5,4,8 row-size=322B cardinality=1.32M
+|  in pipelines: 01(GETNEXT), 08(OPEN)
+|
+|--08:SCAN HDFS [tpcds_parquet.date_dim d3]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=8 row-size=26B cardinality=73.05K
+|     in pipelines: 08(GETNEXT)
+|
+17:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_bill_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: cs_bill_cdemo_sk = cd_demo_sk
+|  runtime filters: RF002[bloom] <- cd_demo_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=1,2,3,7,6,0,5,4 row-size=296B cardinality=1.32M
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.customer_demographics]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'D'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd_marital_status = 'D'
+|     parquet dictionary predicates: cd_marital_status = 'D'
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=4 row-size=17B cardinality=384.16K
+|     in pipelines: 04(GETNEXT)
+|
+16:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_bill_hdemo_sk = hd_demo_sk
+|  fk/pk conjuncts: cs_bill_hdemo_sk = hd_demo_sk
+|  runtime filters: RF004[bloom] <- hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,3,7,6,0,5 row-size=279B cardinality=1.32M
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.household_demographics]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: hd_buy_potential = '>10000'
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: hd_buy_potential = '>10000'
+|     parquet dictionary predicates: hd_buy_potential = '>10000'
+|     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=5 row-size=24B cardinality=1.20K
+|     in pipelines: 05(GETNEXT)
+|
+15:HASH JOIN [INNER JOIN]
+|  hash predicates: d1.d_date_sk = cs_sold_date_sk, inv_item_sk = cs_item_sk
+|  fk/pk conjuncts: none
+|  other predicates: inv_quantity_on_hand < cs_quantity
+|  runtime filters: RF006[bloom] <- cs_sold_date_sk, RF007[bloom] <- cs_item_sk
+|  mem-estimate=60.49MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=1,2,3,7,6,0 row-size=256B cardinality=8.12M
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF000[bloom] -> cs_ship_date_sk, RF002[bloom] -> cs_bill_cdemo_sk, RF004[bloom] -> cs_bill_hdemo_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=384.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=0 row-size=40B cardinality=1.44M
+|     in pipelines: 00(GETNEXT)
+|
+14:HASH JOIN [INNER JOIN]
+|  hash predicates: d2.d_week_seq = d1.d_week_seq
+|  fk/pk conjuncts: none
+|  runtime filters: RF010[bloom] <- d1.d_week_seq
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,3,7,6 row-size=216B cardinality=411.66K
+|  in pipelines: 01(GETNEXT), 06(OPEN)
+|
+|--06:SCAN HDFS [tpcds_parquet.date_dim d1]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d1.d_year = CAST(1999 AS INT)
+|     runtime filters: RF006[bloom] -> d1.d_date_sk
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d1.d_year = CAST(1999 AS INT)
+|     parquet dictionary predicates: d1.d_year = CAST(1999 AS INT)
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=6 row-size=34B cardinality=373
+|     in pipelines: 06(GETNEXT)
+|
+13:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_date_sk = d2.d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d2.d_date_sk
+|  runtime filters: RF012[bloom] <- d2.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2,3,7 row-size=182B cardinality=11.74M
+|  in pipelines: 01(GETNEXT), 07(OPEN)
+|
+|--07:SCAN HDFS [tpcds_parquet.date_dim d2]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF010[bloom] -> d2.d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=7 row-size=8B cardinality=73.05K
+|     in pipelines: 07(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: tpcds_parquet.inventory.inv_item_sk = tpcds_parquet.item.i_item_sk
+|  fk/pk conjuncts: tpcds_parquet.inventory.inv_item_sk = tpcds_parquet.item.i_item_sk
+|  runtime filters: RF014[bloom] <- tpcds_parquet.item.i_item_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=1,2,3 row-size=174B cardinality=11.74M
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF007[bloom] -> tpcds_parquet.item.i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=3 row-size=120B cardinality=18.00K
+|     in pipelines: 03(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  runtime filters: RF016[bloom] <- w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,2 row-size=54B cardinality=11.74M
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.warehouse]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=34B cardinality=5
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.inventory]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   runtime filters: RF007[bloom] -> inv_item_sk, RF012[bloom] -> inv_date_sk, RF014[bloom] -> tpcds_parquet.inventory.inv_item_sk, RF016[bloom] -> inv_warehouse_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=1 row-size=20B cardinality=11.74M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=195.17MB Threads=25
+Per-Host Resource Estimates: Memory=1.29GB
+F13:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=42.27KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_desc, w_warehouse_name, d1.d_week_seq, sum(CASE WHEN p_promo_sk IS NULL THEN 1 ELSE 0 END), sum(CASE WHEN p_promo_sk IS NOT NULL THEN 1 ELSE 0 END), count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+36:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: count(*) DESC, i_item_desc ASC, w_warehouse_name ASC, d1.d_week_seq ASC
+|  limit: 100
+|  mem-estimate=42.27KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=170B cardinality=100
+|  in pipelines: 22(GETNEXT)
+|
+F12:PLAN FRAGMENT [HASH(i_item_desc,w_warehouse_name,d1.d_week_seq)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=187.05MB mem-reservation=34.00MB thread-reservation=1
+22:TOP-N [LIMIT=100]
+|  order by: count(*) DESC, i_item_desc ASC, w_warehouse_name ASC, d1.d_week_seq ASC
+|  mem-estimate=16.60KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=170B cardinality=100
+|  in pipelines: 22(GETNEXT), 35(OPEN)
+|
+35:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN p_promo_sk IS NULL THEN 1 ELSE 0 END), sum:merge(CASE WHEN p_promo_sk IS NOT NULL THEN 1 ELSE 0 END), count:merge(*)
+|  group by: i_item_desc, w_warehouse_name, d1.d_week_seq
+|  mem-estimate=176.71MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=11 row-size=170B cardinality=1.32M
+|  in pipelines: 35(GETNEXT), 00(OPEN)
+|
+34:EXCHANGE [HASH(i_item_desc,w_warehouse_name,d1.d_week_seq)]
+|  mem-estimate=10.34MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11 row-size=170B cardinality=1.32M
+|  in pipelines: 00(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(cs_sold_date_sk,cs_item_sk)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=279.30MB mem-reservation=93.00MB thread-reservation=1 runtime-filters-memory=5.00MB
+21:AGGREGATE [STREAMING]
+|  output: sum(CAST(CASE WHEN p_promo_sk IS NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN p_promo_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), count(*)
+|  group by: i_item_desc, w_warehouse_name, d1.d_week_seq
+|  mem-estimate=176.71MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=11 row-size=170B cardinality=1.32M
+|  in pipelines: 00(GETNEXT)
+|
+20:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6,5,4,8,9N,10N row-size=342B cardinality=1.32M
+|  in pipelines: 00(GETNEXT), 10(OPEN)
+|
+|--33:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=16B cardinality=144.07K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  10:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=10 row-size=16B cardinality=144.07K
+|     in pipelines: 10(GETNEXT)
+|
+19:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash predicates: cs_promo_sk = p_promo_sk
+|  fk/pk conjuncts: cs_promo_sk = p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6,5,4,8,9N row-size=326B cardinality=1.32M
+|  in pipelines: 00(GETNEXT), 09(OPEN)
+|
+|--32:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=4B cardinality=300
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=2
+|  09:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=9 row-size=4B cardinality=300
+|     in pipelines: 09(GETNEXT)
+|
+18:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_ship_date_sk = d3.d_date_sk
+|  fk/pk conjuncts: cs_ship_date_sk = d3.d_date_sk
+|  other predicates: CAST(d3.d_date AS TIMESTAMP) > (CAST(d1.d_date AS TIMESTAMP) + INTERVAL CAST(5 AS INT) days)
+|  runtime filters: RF000[bloom] <- d3.d_date_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6,5,4,8 row-size=322B cardinality=1.32M
+|  in pipelines: 00(GETNEXT), 08(OPEN)
+|
+|--31:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=26B cardinality=73.05K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  08:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=8 row-size=26B cardinality=73.05K
+|     in pipelines: 08(GETNEXT)
+|
+17:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_bill_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: cs_bill_cdemo_sk = cd_demo_sk
+|  runtime filters: RF002[bloom] <- cd_demo_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6,5,4 row-size=296B cardinality=1.32M
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--30:EXCHANGE [BROADCAST]
+|  |  mem-estimate=6.25MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=17B cardinality=384.16K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'D'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd_marital_status = 'D'
+|     parquet dictionary predicates: cd_marital_status = 'D'
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=4 row-size=17B cardinality=384.16K
+|     in pipelines: 04(GETNEXT)
+|
+16:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_bill_hdemo_sk = hd_demo_sk
+|  fk/pk conjuncts: cs_bill_hdemo_sk = hd_demo_sk
+|  runtime filters: RF004[bloom] <- hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6,5 row-size=279B cardinality=1.32M
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--29:EXCHANGE [BROADCAST]
+|  |  mem-estimate=55.04KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=24B cardinality=1.20K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: hd_buy_potential = '>10000'
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: hd_buy_potential = '>10000'
+|     parquet dictionary predicates: hd_buy_potential = '>10000'
+|     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=5 row-size=24B cardinality=1.20K
+|     in pipelines: 05(GETNEXT)
+|
+15:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: cs_sold_date_sk = d1.d_date_sk, cs_item_sk = inv_item_sk
+|  fk/pk conjuncts: none
+|  other predicates: inv_quantity_on_hand < cs_quantity
+|  runtime filters: RF006[bloom] <- d1.d_date_sk, RF007[bloom] <- inv_item_sk
+|  mem-estimate=46.63MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6 row-size=256B cardinality=8.12M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--28:EXCHANGE [HASH(d1.d_date_sk,inv_item_sk)]
+|  |  mem-estimate=10.46MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1,2,3,7,6 row-size=216B cardinality=411.66K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=145.36MB mem-reservation=30.56MB thread-reservation=2 runtime-filters-memory=4.00MB
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: d2.d_week_seq = d1.d_week_seq
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF010[bloom] <- d1.d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,3,7,6 row-size=216B cardinality=411.66K
+|  |  in pipelines: 01(GETNEXT), 06(OPEN)
+|  |
+|  |--26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=26.23KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=34B cardinality=373
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  06:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year = CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year = CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d1.d_year = CAST(1999 AS INT)
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=34B cardinality=373
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: inv_date_sk = d2.d_date_sk
+|  |  fk/pk conjuncts: inv_date_sk = d2.d_date_sk
+|  |  runtime filters: RF012[bloom] <- d2.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,3,7 row-size=182B cardinality=11.74M
+|  |  in pipelines: 01(GETNEXT), 07(OPEN)
+|  |
+|  |--25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=8B cardinality=73.05K
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF010[bloom] -> d2.d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=8B cardinality=73.05K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: tpcds_parquet.inventory.inv_item_sk = tpcds_parquet.item.i_item_sk
+|  |  fk/pk conjuncts: tpcds_parquet.inventory.inv_item_sk = tpcds_parquet.item.i_item_sk
+|  |  runtime filters: RF014[bloom] <- tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=1,2,3 row-size=174B cardinality=11.74M
+|  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |
+|  |--24:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=2.19MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=120B cardinality=18.00K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=3 row-size=120B cardinality=18.00K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  |  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  |  runtime filters: RF016[bloom] <- w_warehouse_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=54B cardinality=11.74M
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=34B cardinality=5
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  02:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=4.38KB
+|  |     stored statistics:
+|  |       table: rows=5 size=4.38KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=5
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=34B cardinality=5
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+|     HDFS partitions=1/1 files=2 size=34.09MB
+|     runtime filters: RF012[bloom] -> inv_date_sk, RF014[bloom] -> tpcds_parquet.inventory.inv_item_sk, RF016[bloom] -> inv_warehouse_sk
+|     stored statistics:
+|       table: rows=11.74M size=34.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6.66M
+|     mem-estimate=128.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=1 row-size=20B cardinality=11.74M
+|     in pipelines: 01(GETNEXT)
+|
+27:EXCHANGE [HASH(cs_sold_date_sk,cs_item_sk)]
+|  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0 row-size=40B cardinality=1.44M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=389.00MB mem-reservation=21.00MB thread-reservation=2 runtime-filters-memory=5.00MB
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_ship_date_sk, RF002[bloom] -> cs_bill_cdemo_sk, RF004[bloom] -> cs_bill_hdemo_sk, RF006[bloom] -> cs_sold_date_sk, RF007[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=384.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=0 row-size=40B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=228.73MB Threads=24
+Per-Host Resource Estimates: Memory=755MB
+F13:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=42.27KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_desc, w_warehouse_name, d1.d_week_seq, sum(CASE WHEN p_promo_sk IS NULL THEN 1 ELSE 0 END), sum(CASE WHEN p_promo_sk IS NOT NULL THEN 1 ELSE 0 END), count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+36:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: count(*) DESC, i_item_desc ASC, w_warehouse_name ASC, d1.d_week_seq ASC
+|  limit: 100
+|  mem-estimate=42.27KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=170B cardinality=100
+|  in pipelines: 22(GETNEXT)
+|
+F12:PLAN FRAGMENT [HASH(i_item_desc,w_warehouse_name,d1.d_week_seq)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=187.05MB mem-reservation=34.00MB thread-reservation=1
+22:TOP-N [LIMIT=100]
+|  order by: count(*) DESC, i_item_desc ASC, w_warehouse_name ASC, d1.d_week_seq ASC
+|  mem-estimate=16.60KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=170B cardinality=100
+|  in pipelines: 22(GETNEXT), 35(OPEN)
+|
+35:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN p_promo_sk IS NULL THEN 1 ELSE 0 END), sum:merge(CASE WHEN p_promo_sk IS NOT NULL THEN 1 ELSE 0 END), count:merge(*)
+|  group by: i_item_desc, w_warehouse_name, d1.d_week_seq
+|  mem-estimate=176.71MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=11 row-size=170B cardinality=1.32M
+|  in pipelines: 35(GETNEXT), 00(OPEN)
+|
+34:EXCHANGE [HASH(i_item_desc,w_warehouse_name,d1.d_week_seq)]
+|  mem-estimate=10.34MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11 row-size=170B cardinality=1.32M
+|  in pipelines: 00(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(cs_sold_date_sk,cs_item_sk)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=186.83MB mem-reservation=34.00MB thread-reservation=1
+21:AGGREGATE [STREAMING]
+|  output: sum(CAST(CASE WHEN p_promo_sk IS NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN p_promo_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), count(*)
+|  group by: i_item_desc, w_warehouse_name, d1.d_week_seq
+|  mem-estimate=176.71MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=11 row-size=170B cardinality=1.32M
+|  in pipelines: 00(GETNEXT)
+|
+20:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6,5,4,8,9N,10N row-size=342B cardinality=1.32M
+|  in pipelines: 00(GETNEXT), 10(OPEN)
+|
+|--F14:PLAN FRAGMENT [HASH(cs_sold_date_sk,cs_item_sk)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=11.72MB mem-reservation=9.50MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: cr_item_sk, cr_order_number
+|  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  33:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=16B cardinality=144.07K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=1
+|  10:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=10 row-size=16B cardinality=144.07K
+|     in pipelines: 10(GETNEXT)
+|
+19:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: cs_promo_sk = p_promo_sk
+|  fk/pk conjuncts: cs_promo_sk = p_promo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6,5,4,8,9N row-size=326B cardinality=1.32M
+|  in pipelines: 00(GETNEXT), 09(OPEN)
+|
+|--F15:PLAN FRAGMENT [HASH(cs_sold_date_sk,cs_item_sk)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: p_promo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  32:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=9 row-size=4B cardinality=300
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  09:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=0
+|     tuple-ids=9 row-size=4B cardinality=300
+|     in pipelines: 09(GETNEXT)
+|
+18:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: cs_ship_date_sk = d3.d_date_sk
+|  fk/pk conjuncts: cs_ship_date_sk = d3.d_date_sk
+|  other predicates: CAST(d3.d_date AS TIMESTAMP) > (CAST(d1.d_date AS TIMESTAMP) + INTERVAL CAST(5 AS INT) days)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6,5,4,8 row-size=322B cardinality=1.32M
+|  in pipelines: 00(GETNEXT), 08(OPEN)
+|
+|--F16:PLAN FRAGMENT [HASH(cs_sold_date_sk,cs_item_sk)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=8.59MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: d3.d_date_sk
+|  |  runtime filters: RF000[bloom] <- d3.d_date_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  31:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=26B cardinality=73.05K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  08:SCAN HDFS [tpcds_parquet.date_dim d3, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=8 row-size=26B cardinality=73.05K
+|     in pipelines: 08(GETNEXT)
+|
+17:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: cs_bill_cdemo_sk = cd_demo_sk
+|  fk/pk conjuncts: cs_bill_cdemo_sk = cd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6,5,4 row-size=296B cardinality=1.32M
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F17:PLAN FRAGMENT [HASH(cs_sold_date_sk,cs_item_sk)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=24.25MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: cd_demo_sk
+|  |  runtime filters: RF002[bloom] <- cd_demo_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+|  |
+|  30:EXCHANGE [BROADCAST]
+|  |  mem-estimate=6.25MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=17B cardinality=384.16K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: cd_marital_status = 'D'
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     parquet statistics predicates: cd_marital_status = 'D'
+|     parquet dictionary predicates: cd_marital_status = 'D'
+|     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=4 row-size=17B cardinality=384.16K
+|     in pipelines: 04(GETNEXT)
+|
+16:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: cs_bill_hdemo_sk = hd_demo_sk
+|  fk/pk conjuncts: cs_bill_hdemo_sk = hd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6,5 row-size=279B cardinality=1.32M
+|  in pipelines: 00(GETNEXT), 05(OPEN)
+|
+|--F18:PLAN FRAGMENT [HASH(cs_sold_date_sk,cs_item_sk)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.93MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: hd_demo_sk
+|  |  runtime filters: RF004[bloom] <- hd_demo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  29:EXCHANGE [BROADCAST]
+|  |  mem-estimate=55.04KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=24B cardinality=1.20K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: hd_buy_potential = '>10000'
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: hd_buy_potential = '>10000'
+|     parquet dictionary predicates: hd_buy_potential = '>10000'
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=5 row-size=24B cardinality=1.20K
+|     in pipelines: 05(GETNEXT)
+|
+15:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=05
+|  hash predicates: cs_sold_date_sk = d1.d_date_sk, cs_item_sk = inv_item_sk
+|  fk/pk conjuncts: none
+|  other predicates: inv_quantity_on_hand < cs_quantity
+|  mem-estimate=0B mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=0,1,2,3,7,6 row-size=256B cardinality=8.12M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F19:PLAN FRAGMENT [HASH(cs_sold_date_sk,cs_item_sk)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=59.09MB mem-reservation=36.00MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: d1.d_date_sk, inv_item_sk
+|  |  runtime filters: RF006[bloom] <- d1.d_date_sk, RF007[bloom] <- inv_item_sk
+|  |  mem-estimate=46.63MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |
+|  28:EXCHANGE [HASH(d1.d_date_sk,inv_item_sk)]
+|  |  mem-estimate=10.46MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1,2,3,7,6 row-size=216B cardinality=411.66K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=1
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: d2.d_week_seq = d1.d_week_seq
+|  |  fk/pk conjuncts: none
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,3,7,6 row-size=216B cardinality=411.66K
+|  |  in pipelines: 01(GETNEXT), 06(OPEN)
+|  |
+|  |--F20:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=02
+|  |  |  build expressions: d1.d_week_seq
+|  |  |  runtime filters: RF010[bloom] <- d1.d_week_seq
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=26.23KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=34B cardinality=373
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  06:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d1.d_year = CAST(1999 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d1.d_year = CAST(1999 AS INT)
+|  |     parquet dictionary predicates: d1.d_year = CAST(1999 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=6 row-size=34B cardinality=373
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=07
+|  |  hash predicates: inv_date_sk = d2.d_date_sk
+|  |  fk/pk conjuncts: inv_date_sk = d2.d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2,3,7 row-size=182B cardinality=11.74M
+|  |  in pipelines: 01(GETNEXT), 07(OPEN)
+|  |
+|  |--F21:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=5.44MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=02
+|  |  |  build expressions: d2.d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d2.d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=582.70KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=8B cardinality=73.05K
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim d2, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF010[bloom] -> d2.d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=7 row-size=8B cardinality=73.05K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=08
+|  |  hash predicates: tpcds_parquet.inventory.inv_item_sk = tpcds_parquet.item.i_item_sk
+|  |  fk/pk conjuncts: tpcds_parquet.inventory.inv_item_sk = tpcds_parquet.item.i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=1,2,3 row-size=174B cardinality=11.74M
+|  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |
+|  |--F22:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=12.69MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=08 plan-id=09 cohort-id=02
+|  |  |  build expressions: tpcds_parquet.item.i_item_sk
+|  |  |  runtime filters: RF014[bloom] <- tpcds_parquet.item.i_item_sk
+|  |  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |  |
+|  |  24:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=2.19MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=120B cardinality=18.00K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=3 row-size=120B cardinality=18.00K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=09
+|  |  hash predicates: inv_warehouse_sk = w_warehouse_sk
+|  |  fk/pk conjuncts: inv_warehouse_sk = w_warehouse_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=54B cardinality=11.74M
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--F23:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=09 plan-id=10 cohort-id=02
+|  |  |  build expressions: w_warehouse_sk
+|  |  |  runtime filters: RF016[bloom] <- w_warehouse_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=34B cardinality=5
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  02:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=4.38KB
+|  |     stored statistics:
+|  |       table: rows=5 size=4.38KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=5
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=2 row-size=34B cardinality=5
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+|     HDFS partitions=1/1 files=2 size=34.09MB
+|     runtime filters: RF012[bloom] -> inv_date_sk, RF014[bloom] -> tpcds_parquet.inventory.inv_item_sk, RF016[bloom] -> inv_warehouse_sk
+|     stored statistics:
+|       table: rows=11.74M size=34.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6.66M
+|     mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=1 row-size=20B cardinality=11.74M
+|     in pipelines: 01(GETNEXT)
+|
+27:EXCHANGE [HASH(cs_sold_date_sk,cs_item_sk)]
+|  mem-estimate=10.13MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0 row-size=40B cardinality=1.44M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=5.00MB mem-reservation=5.00MB thread-reservation=0 runtime-filters-memory=5.00MB
+Per-Instance Resources: mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=1
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_ship_date_sk, RF002[bloom] -> cs_bill_cdemo_sk, RF004[bloom] -> cs_bill_hdemo_sk, RF006[bloom] -> cs_sold_date_sk, RF007[bloom] -> cs_item_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=0
+   tuple-ids=0 row-size=40B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q73.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q73.test
new file mode 100644
index 0000000..3da74ac
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q73.test
@@ -0,0 +1,525 @@
+# TPCDS-Q73
+select
+  c_last_name,
+  c_first_name,
+  c_salutation,
+  c_preferred_cust_flag,
+  ss_ticket_number,
+  cnt
+from
+  (select
+    ss_ticket_number,
+    ss_customer_sk,
+    count(*) cnt
+  from
+    store_sales,
+    date_dim,
+    store,
+    household_demographics
+  where
+    store_sales.ss_sold_date_sk = date_dim.d_date_sk
+    and store_sales.ss_store_sk = store.s_store_sk
+    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+    and (household_demographics.hd_buy_potential = '>10000'
+      or household_demographics.hd_buy_potential = 'unknown')
+    and household_demographics.hd_vehicle_count > 0
+    and case when household_demographics.hd_vehicle_count > 0 then household_demographics.hd_dep_count / household_demographics.hd_vehicle_count else null end > 1
+    and store.s_county in ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
+  group by
+    ss_ticket_number,
+    ss_customer_sk
+  ) dj,
+  customer
+where
+  ss_customer_sk = c_customer_sk
+  and cnt between 1 and 5
+order by
+  cnt desc
+limit 1000
+---- PLAN
+Max Per-Host Resource Reservation: Memory=17.56MB Threads=6
+Per-Host Resource Estimates: Memory=266MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=265.81MB mem-reservation=17.56MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+10:TOP-N [LIMIT=1000]
+|  order by: cnt DESC
+|  mem-estimate=78.33KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=80B cardinality=1.00K
+|  in pipelines: 10(GETNEXT), 08(OPEN)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: c_customer_sk = ss_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- ss_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6,4 row-size=88B cardinality=16.25K
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+|--07:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  group by: ss_ticket_number, ss_customer_sk
+|  |  having: count(*) <= CAST(5 AS BIGINT), count(*) >= CAST(1 AS BIGINT)
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=20B cardinality=16.25K
+|  |  in pipelines: 07(GETNEXT), 00(OPEN)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  |  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  |  runtime filters: RF002[bloom] <- store.s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1,2 row-size=93B cardinality=162.45K
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
+|  |     parquet dictionary predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=33B cardinality=12
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN]
+|  |  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  |  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  |  runtime filters: RF004[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,1 row-size=60B cardinality=162.45K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--01:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=1 row-size=4B cardinality=73.05K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  runtime filters: RF006[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3 row-size=56B cardinality=162.45K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown'), CASE WHEN household_demographics.hd_vehicle_count > CAST(0 AS INT) THEN CAST(household_demographics.hd_dep_count AS DOUBLE) / CAST(household_demographics.hd_vehicle_count AS DOUBLE) ELSE NULL END > CAST(1 AS DOUBLE)
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     parquet statistics predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|  |     parquet dictionary predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|  |     mem-estimate=64.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=32B cardinality=416
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF002[bloom] -> store_sales.ss_store_sk, RF004[bloom] -> store_sales.ss_sold_date_sk, RF006[bloom] -> store_sales.ss_hdemo_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=0 row-size=24B cardinality=2.88M
+|     in pipelines: 00(GETNEXT)
+|
+08:SCAN HDFS [tpcds_parquet.customer]
+   HDFS partitions=1/1 files=1 size=5.49MB
+   runtime filters: RF000[bloom] -> c_customer_sk
+   stored statistics:
+     table: rows=100.00K size=5.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=100.00K
+   mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=6 row-size=68B cardinality=100.00K
+   in pipelines: 08(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=28.77MB Threads=13
+Per-Host Resource Estimates: Memory=304MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=160.56KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: cnt DESC
+|  limit: 1000
+|  mem-estimate=160.56KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=80B cardinality=1.00K
+|  in pipelines: 10(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=16.25MB mem-reservation=9.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+10:TOP-N [LIMIT=1000]
+|  order by: cnt DESC
+|  mem-estimate=78.33KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=80B cardinality=1.00K
+|  in pipelines: 10(GETNEXT), 15(OPEN)
+|
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- c_customer_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=4,6 row-size=88B cardinality=16.25K
+|  in pipelines: 15(GETNEXT), 08(OPEN)
+|
+|--17:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=6.58MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=68B cardinality=100.00K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=2
+|  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=80.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=6 row-size=68B cardinality=100.00K
+|     in pipelines: 08(GETNEXT)
+|
+16:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=177.76KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=16.25K
+|  in pipelines: 15(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=11.10MB mem-reservation=2.88MB thread-reservation=1
+15:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: ss_ticket_number, ss_customer_sk
+|  having: count(*) <= CAST(5 AS BIGINT), count(*) >= CAST(1 AS BIGINT)
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=16.25K
+|  in pipelines: 15(GETNEXT), 00(OPEN)
+|
+14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk)]
+|  mem-estimate=1.10MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=162.45K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=84.14MB mem-reservation=14.81MB thread-reservation=2 runtime-filters-memory=4.00MB
+07:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: ss_ticket_number, ss_customer_sk
+|  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=162.45K
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  runtime filters: RF002[bloom] <- store.s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=93B cardinality=162.45K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=33B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
+|     parquet dictionary predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=33B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  runtime filters: RF004[bloom] <- date_dim.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=60B cardinality=162.45K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=293.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=4B cardinality=73.05K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=4B cardinality=73.05K
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  runtime filters: RF006[bloom] <- household_demographics.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=56B cardinality=162.45K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=27.22KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=32B cardinality=416
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=64.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown'), CASE WHEN household_demographics.hd_vehicle_count > CAST(0 AS INT) THEN CAST(household_demographics.hd_dep_count AS DOUBLE) / CAST(household_demographics.hd_vehicle_count AS DOUBLE) ELSE NULL END > CAST(1 AS DOUBLE)
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|     parquet dictionary predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|     mem-estimate=64.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=3 row-size=32B cardinality=416
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF002[bloom] -> store_sales.ss_store_sk, RF004[bloom] -> store_sales.ss_sold_date_sk, RF006[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=24B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=41.58MB Threads=14
+Per-Host Resource Estimates: Memory=174MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=160.56KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, c_salutation, c_preferred_cust_flag, ss_ticket_number, cnt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: cnt DESC
+|  limit: 1000
+|  mem-estimate=160.56KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=80B cardinality=1.00K
+|  in pipelines: 10(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=328.09KB mem-reservation=0B thread-reservation=1
+10:TOP-N [LIMIT=1000]
+|  order by: cnt DESC
+|  mem-estimate=78.33KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=80B cardinality=1.00K
+|  in pipelines: 10(GETNEXT), 15(OPEN)
+|
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=4,6 row-size=88B cardinality=16.25K
+|  in pipelines: 15(GETNEXT), 08(OPEN)
+|
+|--F08:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.08MB mem-reservation=9.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF000[bloom] <- c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |
+|  17:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=6.58MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=68B cardinality=100.00K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=6 row-size=68B cardinality=100.00K
+|     in pipelines: 08(GETNEXT)
+|
+16:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=249.76KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=16.25K
+|  in pipelines: 15(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.17MB mem-reservation=1.94MB thread-reservation=1
+15:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  group by: ss_ticket_number, ss_customer_sk
+|  having: count(*) <= CAST(5 AS BIGINT), count(*) >= CAST(1 AS BIGINT)
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=16.25K
+|  in pipelines: 15(GETNEXT), 00(OPEN)
+|
+14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk)]
+|  mem-estimate=1.17MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=162.45K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=4.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  output: count(*)
+|  group by: ss_ticket_number, ss_customer_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=162.45K
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1,2 row-size=93B cardinality=162.45K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: store.s_store_sk
+|  |  runtime filters: RF002[bloom] <- store.s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=33B cardinality=12
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
+|     parquet dictionary predicates: store.s_county IN ('Saginaw County', 'Sumner County', 'Appanoose County', 'Daviess County')
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=2 row-size=33B cardinality=12
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,1 row-size=60B cardinality=162.45K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.16MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: date_dim.d_date_sk
+|  |  runtime filters: RF004[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=293.35KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=4B cardinality=73.05K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=1 row-size=4B cardinality=73.05K
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=56B cardinality=162.45K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: household_demographics.hd_demo_sk
+|  |  runtime filters: RF006[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=27.22KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=32B cardinality=416
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown'), CASE WHEN household_demographics.hd_vehicle_count > CAST(0 AS INT) THEN CAST(household_demographics.hd_dep_count AS DOUBLE) / CAST(household_demographics.hd_vehicle_count AS DOUBLE) ELSE NULL END > CAST(1 AS DOUBLE)
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|     parquet dictionary predicates: household_demographics.hd_vehicle_count > CAST(0 AS INT), household_demographics.hd_buy_potential IN ('>10000', 'unknown')
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=3 row-size=32B cardinality=416
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF002[bloom] -> store_sales.ss_store_sk, RF004[bloom] -> store_sales.ss_sold_date_sk, RF006[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=0 row-size=24B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q74.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q74.test
new file mode 100644
index 0000000..fa5f31e
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q74.test
@@ -0,0 +1,1381 @@
+# TPCDS-Q74
+WITH year_total AS
+  (SELECT c_customer_id customer_id,
+          c_first_name customer_first_name,
+          c_last_name customer_last_name,
+          d_year AS year_,
+          sum(ss_net_paid) year_total,
+          's' sale_type
+   FROM customer,
+        store_sales,
+        date_dim
+   WHERE c_customer_sk = ss_customer_sk
+     AND ss_sold_date_sk = d_date_sk
+     AND d_year IN (2001,
+                    2001+1)
+   GROUP BY c_customer_id,
+            c_first_name,
+            c_last_name,
+            d_year
+   UNION ALL SELECT c_customer_id customer_id,
+                    c_first_name customer_first_name,
+                    c_last_name customer_last_name,
+                    d_year AS year_,
+                    sum(ws_net_paid) year_total,
+                    'w' sale_type
+   FROM customer,
+        web_sales,
+        date_dim
+   WHERE c_customer_sk = ws_bill_customer_sk
+     AND ws_sold_date_sk = d_date_sk
+     AND d_year IN (2001,
+                    2001+1)
+   GROUP BY c_customer_id,
+            c_first_name,
+            c_last_name,
+            d_year)
+SELECT t_s_secyear.customer_id,
+       t_s_secyear.customer_first_name,
+       t_s_secyear.customer_last_name
+FROM year_total t_s_firstyear,
+     year_total t_s_secyear,
+     year_total t_w_firstyear,
+     year_total t_w_secyear
+WHERE t_s_secyear.customer_id = t_s_firstyear.customer_id
+  AND t_s_firstyear.customer_id = t_w_secyear.customer_id
+  AND t_s_firstyear.customer_id = t_w_firstyear.customer_id
+  AND t_s_firstyear.sale_type = 's'
+  AND t_w_firstyear.sale_type = 'w'
+  AND t_s_secyear.sale_type = 's'
+  AND t_w_secyear.sale_type = 'w'
+  AND t_s_firstyear.year_ = 2001
+  AND t_s_secyear.year_ = 2001+1
+  AND t_w_firstyear.year_ = 2001
+  AND t_w_secyear.year_ = 2001+1
+  AND t_s_firstyear.year_total > 0
+  AND t_w_firstyear.year_total > 0
+  AND CASE
+          WHEN t_w_firstyear.year_total > 0 THEN t_w_secyear.year_total / t_w_firstyear.year_total
+          ELSE NULL
+      END > CASE
+                WHEN t_s_firstyear.year_total > 0 THEN t_s_secyear.year_total / t_s_firstyear.year_total
+                ELSE NULL
+            END
+ORDER BY 1
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=167.56MB Threads=13
+Per-Host Resource Estimates: Memory=690MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=689.94MB mem-reservation=167.56MB thread-reservation=13 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: customer_id, customer_first_name, customer_last_name
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+31:TOP-N [LIMIT=100]
+|  order by: customer_id ASC
+|  mem-estimate=6.25KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=40 row-size=64B cardinality=100
+|  in pipelines: 31(GETNEXT), 13(OPEN)
+|
+30:HASH JOIN [INNER JOIN]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END
+|  runtime filters: RF000[bloom] <- customer_id
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=18,8,28,38 row-size=212B cardinality=589.03K
+|  in pipelines: 13(GETNEXT), 27(OPEN)
+|
+|--21:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=44B cardinality=148.00K
+|  |  in pipelines: 27(GETNEXT)
+|  |
+|  27:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=37 row-size=84B cardinality=148.00K
+|  |  in pipelines: 27(GETNEXT), 22(OPEN)
+|  |
+|  26:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = ws_bill_customer_sk
+|  |  fk/pk conjuncts: c_customer_sk = ws_bill_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=34,35,36 row-size=88B cardinality=148.00K
+|  |  in pipelines: 22(GETNEXT), 23(OPEN)
+|  |
+|  |--25:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=35,36 row-size=20B cardinality=148.00K
+|  |  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |  |
+|  |  |--24:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=36 row-size=8B cardinality=373
+|  |  |     in pipelines: 24(GETNEXT)
+|  |  |
+|  |  23:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF020[bloom] -> ws_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=35 row-size=12B cardinality=719.38K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  22:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=34 row-size=68B cardinality=100.00K
+|     in pipelines: 22(GETNEXT)
+|
+29:HASH JOIN [INNER JOIN]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF002[bloom] <- customer_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=18,8,28 row-size=168B cardinality=589.03K
+|  in pipelines: 13(GETNEXT), 20(OPEN)
+|
+|--14:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=44B cardinality=14.80K
+|  |  in pipelines: 20(GETNEXT)
+|  |
+|  20:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  having: sum(ws_net_paid) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=27 row-size=84B cardinality=14.80K
+|  |  in pipelines: 20(GETNEXT), 15(OPEN)
+|  |
+|  19:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_customer_sk = ws_bill_customer_sk
+|  |  fk/pk conjuncts: c_customer_sk = ws_bill_customer_sk
+|  |  runtime filters: RF014[bloom] <- ws_bill_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=24,25,26 row-size=88B cardinality=148.00K
+|  |  in pipelines: 15(GETNEXT), 16(OPEN)
+|  |
+|  |--18:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=25,26 row-size=20B cardinality=148.00K
+|  |  |  in pipelines: 16(GETNEXT), 17(OPEN)
+|  |  |
+|  |  |--17:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=26 row-size=8B cardinality=373
+|  |  |     in pipelines: 17(GETNEXT)
+|  |  |
+|  |  16:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF016[bloom] -> ws_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=25 row-size=12B cardinality=719.38K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  15:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF014[bloom] -> c_customer_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=24 row-size=68B cardinality=100.00K
+|     in pipelines: 15(GETNEXT)
+|
+28:HASH JOIN [INNER JOIN]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF004[bloom] <- customer_id
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=18,8 row-size=124B cardinality=589.03K
+|  in pipelines: 13(GETNEXT), 06(OPEN)
+|
+|--00:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=44B cardinality=58.90K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  06:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  having: sum(ss_net_paid) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=51.88MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=3 row-size=84B cardinality=58.90K
+|  |  in pipelines: 06(GETNEXT), 02(OPEN)
+|  |
+|  05:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  runtime filters: RF010[bloom] <- c_customer_sk
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0 row-size=88B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |
+|  |--01:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=68B cardinality=100.00K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=20B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=8B cardinality=373
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF012[bloom] -> ss_sold_date_sk, RF010[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=2.88M
+|     in pipelines: 02(GETNEXT)
+|
+07:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=18 row-size=80B cardinality=589.03K
+|  in pipelines: 13(GETNEXT)
+|
+13:AGGREGATE [FINALIZE]
+|  output: sum(ss_net_paid)
+|  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  mem-estimate=51.88MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=589.03K
+|  in pipelines: 13(GETNEXT), 09(OPEN)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF006[bloom] <- c_customer_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=11,12,10 row-size=88B cardinality=589.03K
+|  in pipelines: 09(GETNEXT), 08(OPEN)
+|
+|--08:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id, RF004[bloom] -> tpcds_parquet.customer.c_customer_id
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=68B cardinality=100.00K
+|     in pipelines: 08(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF008[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11,12 row-size=20B cardinality=589.03K
+|  in pipelines: 09(GETNEXT), 10(OPEN)
+|
+|--10:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=12 row-size=8B cardinality=373
+|     in pipelines: 10(GETNEXT)
+|
+09:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF008[bloom] -> ss_sold_date_sk, RF006[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=11 row-size=12B cardinality=2.88M
+   in pipelines: 09(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=300.94MB Threads=33
+Per-Host Resource Estimates: Memory=984MB
+F24:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=22.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: customer_id, customer_first_name, customer_last_name
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+55:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: customer_id ASC
+|  limit: 100
+|  mem-estimate=22.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=40 row-size=64B cardinality=100
+|  in pipelines: 31(GETNEXT)
+|
+F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=72.08MB mem-reservation=52.19MB thread-reservation=1 runtime-filters-memory=3.00MB
+31:TOP-N [LIMIT=100]
+|  order by: customer_id ASC
+|  mem-estimate=6.25KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=40 row-size=64B cardinality=100
+|  in pipelines: 31(GETNEXT), 36(OPEN)
+|
+30:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END
+|  runtime filters: RF000[bloom] <- customer_id
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=18,8,28,38 row-size=212B cardinality=589.03K
+|  in pipelines: 36(GETNEXT), 53(OPEN)
+|
+|--54:EXCHANGE [BROADCAST]
+|  |  mem-estimate=6.30MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=44B cardinality=148.00K
+|  |  in pipelines: 53(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=23.10MB mem-reservation=17.00MB thread-reservation=1
+|  21:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=44B cardinality=148.00K
+|  |  in pipelines: 53(GETNEXT)
+|  |
+|  53:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=37 row-size=84B cardinality=148.00K
+|  |  in pipelines: 53(GETNEXT), 23(OPEN)
+|  |
+|  52:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,d_year)]
+|  |  mem-estimate=6.10MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=37 row-size=84B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F21:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=29.77MB mem-reservation=21.75MB thread-reservation=1
+|  27:AGGREGATE [STREAMING]
+|  |  output: sum(ws_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=37 row-size=84B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=35,36,34 row-size=88B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT), 22(OPEN)
+|  |
+|  |--51:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=6.55MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=34 row-size=68B cardinality=100.00K
+|  |  |  in pipelines: 22(GETNEXT)
+|  |  |
+|  |  F20:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  22:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=34 row-size=68B cardinality=100.00K
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  50:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=1.47MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=35,36 row-size=20B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=98.95MB mem-reservation=10.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  25:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=35,36 row-size=20B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |
+|  |--49:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=36 row-size=8B cardinality=373
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  24:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=36 row-size=8B cardinality=373
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF020[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=35 row-size=12B cardinality=719.38K
+|     in pipelines: 23(GETNEXT)
+|
+29:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF002[bloom] <- customer_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=18,8,28 row-size=168B cardinality=589.03K
+|  in pipelines: 36(GETNEXT), 47(OPEN)
+|
+|--48:EXCHANGE [BROADCAST]
+|  |  mem-estimate=731.94KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=44B cardinality=14.80K
+|  |  in pipelines: 47(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=23.10MB mem-reservation=17.00MB thread-reservation=1
+|  14:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=44B cardinality=14.80K
+|  |  in pipelines: 47(GETNEXT)
+|  |
+|  47:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  having: sum(ws_net_paid) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=27 row-size=84B cardinality=14.80K
+|  |  in pipelines: 47(GETNEXT), 16(OPEN)
+|  |
+|  46:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,d_year)]
+|  |  mem-estimate=6.10MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=27 row-size=84B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=30.77MB mem-reservation=22.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  20:AGGREGATE [STREAMING]
+|  |  output: sum(ws_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=27 row-size=84B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  |  runtime filters: RF014[bloom] <- c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=25,26,24 row-size=88B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |
+|  |--45:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=6.55MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=24 row-size=68B cardinality=100.00K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=65.00MB mem-reservation=5.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  15:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=24 row-size=68B cardinality=100.00K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  44:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=1.47MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25,26 row-size=20B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=99.95MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  18:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25,26 row-size=20B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT), 17(OPEN)
+|  |
+|  |--43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=26 row-size=8B cardinality=373
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  17:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=26 row-size=8B cardinality=373
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  16:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF016[bloom] -> ws_sold_date_sk, RF014[bloom] -> ws_bill_customer_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=25 row-size=12B cardinality=719.38K
+|     in pipelines: 16(GETNEXT)
+|
+28:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  runtime filters: RF004[bloom] <- customer_id
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=18,8 row-size=124B cardinality=589.03K
+|  in pipelines: 36(GETNEXT), 41(OPEN)
+|
+|--42:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.61MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=44B cardinality=58.90K
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=44.26MB mem-reservation=34.00MB thread-reservation=1
+|  00:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=44B cardinality=58.90K
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  41:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  having: sum(ss_net_paid) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=3 row-size=84B cardinality=58.90K
+|  |  in pipelines: 41(GETNEXT), 02(OPEN)
+|  |
+|  40:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,d_year)]
+|  |  mem-estimate=10.26MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=84B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=50.13MB mem-reservation=39.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  06:AGGREGATE [STREAMING]
+|  |  output: sum(ss_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=3 row-size=84B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  runtime filters: RF010[bloom] <- c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0 row-size=88B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |
+|  |--39:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=6.55MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=68B cardinality=100.00K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=66.00MB mem-reservation=6.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  01:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=68B cardinality=100.00K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  38:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=3.83MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1,2 row-size=20B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=35.95MB mem-reservation=4.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=20B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--37:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=8B cardinality=373
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF012[bloom] -> ss_sold_date_sk, RF010[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=2.88M
+|     in pipelines: 02(GETNEXT)
+|
+07:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=18 row-size=80B cardinality=589.03K
+|  in pipelines: 36(GETNEXT)
+|
+36:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_net_paid)
+|  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=589.03K
+|  in pipelines: 36(GETNEXT), 09(OPEN)
+|
+35:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,d_year)]
+|  mem-estimate=10.26MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=589.03K
+|  in pipelines: 09(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=50.13MB mem-reservation=39.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+13:AGGREGATE [STREAMING]
+|  output: sum(ss_net_paid)
+|  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=589.03K
+|  in pipelines: 09(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  runtime filters: RF006[bloom] <- c_customer_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=11,12,10 row-size=88B cardinality=589.03K
+|  in pipelines: 09(GETNEXT), 08(OPEN)
+|
+|--34:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=6.55MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=68B cardinality=100.00K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=67.00MB mem-reservation=7.00MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id, RF004[bloom] -> tpcds_parquet.customer.c_customer_id
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=68B cardinality=100.00K
+|     in pipelines: 08(GETNEXT)
+|
+33:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=3.83MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11,12 row-size=20B cardinality=589.03K
+|  in pipelines: 09(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=35.95MB mem-reservation=4.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF008[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11,12 row-size=20B cardinality=589.03K
+|  in pipelines: 09(GETNEXT), 10(OPEN)
+|
+|--32:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=8B cardinality=373
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  10:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=12 row-size=8B cardinality=373
+|     in pipelines: 10(GETNEXT)
+|
+09:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF008[bloom] -> ss_sold_date_sk, RF006[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=11 row-size=12B cardinality=2.88M
+   in pipelines: 09(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=333.88MB Threads=40
+Per-Host Resource Estimates: Memory=674MB
+F24:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=41.91KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: customer_id, customer_first_name, customer_last_name
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+55:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: customer_id ASC
+|  limit: 100
+|  mem-estimate=41.91KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=40 row-size=64B cardinality=100
+|  in pipelines: 31(GETNEXT)
+|
+F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=27.52MB mem-reservation=17.00MB thread-reservation=1
+31:TOP-N [LIMIT=100]
+|  order by: customer_id ASC
+|  mem-estimate=6.25KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=40 row-size=64B cardinality=100
+|  in pipelines: 31(GETNEXT), 36(OPEN)
+|
+30:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END > CASE WHEN year_total > CAST(0 AS DECIMAL(3,0)) THEN year_total / year_total ELSE NULL END
+|  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=18,8,28,38 row-size=212B cardinality=589.03K
+|  in pipelines: 36(GETNEXT), 53(OPEN)
+|
+|--F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=24.30MB mem-reservation=18.00MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: customer_id
+|  |  runtime filters: RF000[bloom] <- customer_id
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+|  |
+|  54:EXCHANGE [BROADCAST]
+|  |  mem-estimate=6.30MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=44B cardinality=148.00K
+|  |  in pipelines: 53(GETNEXT)
+|  |
+|  F23:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=23.10MB mem-reservation=17.00MB thread-reservation=1
+|  21:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=38 row-size=44B cardinality=148.00K
+|  |  in pipelines: 53(GETNEXT)
+|  |
+|  53:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=37 row-size=84B cardinality=148.00K
+|  |  in pipelines: 53(GETNEXT), 23(OPEN)
+|  |
+|  52:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,d_year)]
+|  |  mem-estimate=6.10MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=37 row-size=84B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F21:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=18.47MB mem-reservation=17.00MB thread-reservation=1
+|  27:AGGREGATE [STREAMING]
+|  |  output: sum(ws_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=37 row-size=84B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=35,36,34 row-size=88B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT), 22(OPEN)
+|  |
+|  |--F26:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=11.30MB mem-reservation=4.75MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: c_customer_sk
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |
+|  |  51:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=6.55MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=34 row-size=68B cardinality=100.00K
+|  |  |  in pipelines: 22(GETNEXT)
+|  |  |
+|  |  F20:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  22:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=34 row-size=68B cardinality=100.00K
+|  |     in pipelines: 22(GETNEXT)
+|  |
+|  50:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=1.47MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=35,36 row-size=20B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  25:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=35,36 row-size=20B cardinality=148.00K
+|  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |
+|  |--F27:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  49:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=36 row-size=8B cardinality=373
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  24:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=36 row-size=8B cardinality=373
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF020[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=35 row-size=12B cardinality=719.38K
+|     in pipelines: 23(GETNEXT)
+|
+29:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=18,8,28 row-size=168B cardinality=589.03K
+|  in pipelines: 36(GETNEXT), 47(OPEN)
+|
+|--F28:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.59MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: customer_id
+|  |  runtime filters: RF002[bloom] <- customer_id
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  48:EXCHANGE [BROADCAST]
+|  |  mem-estimate=731.94KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=44B cardinality=14.80K
+|  |  in pipelines: 47(GETNEXT)
+|  |
+|  F17:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=23.10MB mem-reservation=17.00MB thread-reservation=1
+|  14:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=44B cardinality=14.80K
+|  |  in pipelines: 47(GETNEXT)
+|  |
+|  47:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  having: sum(ws_net_paid) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=27 row-size=84B cardinality=14.80K
+|  |  in pipelines: 47(GETNEXT), 16(OPEN)
+|  |
+|  46:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,d_year)]
+|  |  mem-estimate=6.10MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=27 row-size=84B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=18.47MB mem-reservation=17.00MB thread-reservation=1
+|  20:AGGREGATE [STREAMING]
+|  |  output: sum(ws_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=27 row-size=84B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=04
+|  |  hash predicates: ws_bill_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ws_bill_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=25,26,24 row-size=88B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT), 15(OPEN)
+|  |
+|  |--F29:PLAN FRAGMENT [HASH(ws_bill_customer_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=12.30MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=03
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF014[bloom] <- c_customer_sk
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |
+|  |  45:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=6.55MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=24 row-size=68B cardinality=100.00K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  15:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=24 row-size=68B cardinality=100.00K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  44:EXCHANGE [HASH(ws_bill_customer_sk)]
+|  |  mem-estimate=1.47MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25,26 row-size=20B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  18:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25,26 row-size=20B cardinality=148.00K
+|  |  in pipelines: 16(GETNEXT), 17(OPEN)
+|  |
+|  |--F30:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=26 row-size=8B cardinality=373
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  17:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=26 row-size=8B cardinality=373
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  16:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF016[bloom] -> ws_sold_date_sk, RF014[bloom] -> ws_bill_customer_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=25 row-size=12B cardinality=719.38K
+|     in pipelines: 16(GETNEXT)
+|
+28:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=06
+|  hash predicates: customer_id = customer_id
+|  fk/pk conjuncts: assumed fk/pk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=18,8 row-size=124B cardinality=589.03K
+|  in pipelines: 36(GETNEXT), 41(OPEN)
+|
+|--F31:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=13.25MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: customer_id
+|  |  runtime filters: RF004[bloom] <- customer_id
+|  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  42:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.75MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=44B cardinality=58.90K
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=27.52MB mem-reservation=17.00MB thread-reservation=1
+|  00:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=44B cardinality=58.90K
+|  |  in pipelines: 41(GETNEXT)
+|  |
+|  41:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ss_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  having: sum(ss_net_paid) > CAST(0 AS DECIMAL(3,0))
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=3 row-size=84B cardinality=58.90K
+|  |  in pipelines: 41(GETNEXT), 02(OPEN)
+|  |
+|  40:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,d_year)]
+|  |  mem-estimate=10.52MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=84B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=20.91MB mem-reservation=17.00MB thread-reservation=1
+|  06:AGGREGATE [STREAMING]
+|  |  output: sum(ss_net_paid)
+|  |  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=3 row-size=84B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=07
+|  |  hash predicates: ss_customer_sk = c_customer_sk
+|  |  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=1,2,0 row-size=88B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT), 01(OPEN)
+|  |
+|  |--F32:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=10.43MB mem-reservation=3.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=04
+|  |  |  build expressions: c_customer_sk
+|  |  |  runtime filters: RF010[bloom] <- c_customer_sk
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  39:EXCHANGE [HASH(c_customer_sk)]
+|  |  |  mem-estimate=6.55MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=68B cardinality=100.00K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  01:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=0 row-size=68B cardinality=100.00K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  38:EXCHANGE [HASH(ss_customer_sk)]
+|  |  mem-estimate=3.91MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1,2 row-size=20B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=08
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=1,2 row-size=20B cardinality=589.03K
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--F33:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=08 plan-id=09 cohort-id=04
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  37:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=2 row-size=8B cardinality=373
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF012[bloom] -> ss_sold_date_sk, RF010[bloom] -> ss_customer_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=1 row-size=12B cardinality=2.88M
+|     in pipelines: 02(GETNEXT)
+|
+07:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=18 row-size=80B cardinality=589.03K
+|  in pipelines: 36(GETNEXT)
+|
+36:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_net_paid)
+|  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=589.03K
+|  in pipelines: 36(GETNEXT), 09(OPEN)
+|
+35:EXCHANGE [HASH(c_customer_id,c_first_name,c_last_name,d_year)]
+|  mem-estimate=10.52MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=589.03K
+|  in pipelines: 09(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=20.91MB mem-reservation=17.00MB thread-reservation=1
+13:AGGREGATE [STREAMING]
+|  output: sum(ss_net_paid)
+|  group by: c_customer_id, c_first_name, c_last_name, d_year
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=13 row-size=84B cardinality=589.03K
+|  in pipelines: 09(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=09
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: ss_customer_sk = c_customer_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=11,12,10 row-size=88B cardinality=589.03K
+|  in pipelines: 09(GETNEXT), 08(OPEN)
+|
+|--F34:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=10.43MB mem-reservation=3.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=09 plan-id=10 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF006[bloom] <- c_customer_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  34:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=6.55MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=68B cardinality=100.00K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.customer.c_customer_id, RF002[bloom] -> tpcds_parquet.customer.c_customer_id, RF004[bloom] -> tpcds_parquet.customer.c_customer_id
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=10 row-size=68B cardinality=100.00K
+|     in pipelines: 08(GETNEXT)
+|
+33:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=3.91MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11,12 row-size=20B cardinality=589.03K
+|  in pipelines: 09(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=10
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11,12 row-size=20B cardinality=589.03K
+|  in pipelines: 09(GETNEXT), 10(OPEN)
+|
+|--F35:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  32:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=8B cardinality=373
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  10:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=12 row-size=8B cardinality=373
+|     in pipelines: 10(GETNEXT)
+|
+09:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF008[bloom] -> ss_sold_date_sk, RF006[bloom] -> ss_customer_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=11 row-size=12B cardinality=2.88M
+   in pipelines: 09(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q75.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q75.test
new file mode 100644
index 0000000..3b52ae7
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q75.test
@@ -0,0 +1,2166 @@
+# TPCDS-Q75
+WITH all_sales AS
+  ( SELECT d_year ,
+           i_brand_id ,
+           i_class_id ,
+           i_category_id ,
+           i_manufact_id ,
+           SUM(sales_cnt) AS sales_cnt ,
+           SUM(sales_amt) AS sales_amt
+   FROM
+     (SELECT d_year ,
+             i_brand_id ,
+             i_class_id ,
+             i_category_id ,
+             i_manufact_id ,
+             cs_quantity - COALESCE(cr_return_quantity,0) AS sales_cnt ,
+             cs_ext_sales_price - COALESCE(cr_return_amount,0.0) AS sales_amt
+      FROM catalog_sales
+      JOIN item ON i_item_sk=cs_item_sk
+      JOIN date_dim ON d_date_sk=cs_sold_date_sk
+      LEFT JOIN catalog_returns ON (cs_order_number=cr_order_number
+                                    AND cs_item_sk=cr_item_sk)
+      WHERE i_category='Books'
+      UNION SELECT d_year ,
+                   i_brand_id ,
+                   i_class_id ,
+                   i_category_id ,
+                   i_manufact_id ,
+                   ss_quantity - COALESCE(sr_return_quantity,0) AS sales_cnt ,
+                   ss_ext_sales_price - COALESCE(sr_return_amt,0.0) AS sales_amt
+      FROM store_sales
+      JOIN item ON i_item_sk=ss_item_sk
+      JOIN date_dim ON d_date_sk=ss_sold_date_sk
+      LEFT JOIN store_returns ON (ss_ticket_number=sr_ticket_number
+                                  AND ss_item_sk=sr_item_sk)
+      WHERE i_category='Books'
+      UNION SELECT d_year ,
+                   i_brand_id ,
+                   i_class_id ,
+                   i_category_id ,
+                   i_manufact_id ,
+                   ws_quantity - COALESCE(wr_return_quantity,0) AS sales_cnt ,
+                   ws_ext_sales_price - COALESCE(wr_return_amt,0.0) AS sales_amt
+      FROM web_sales
+      JOIN item ON i_item_sk=ws_item_sk
+      JOIN date_dim ON d_date_sk=ws_sold_date_sk
+      LEFT JOIN web_returns ON (ws_order_number=wr_order_number
+                                AND ws_item_sk=wr_item_sk)
+      WHERE i_category='Books') sales_detail
+   GROUP BY d_year,
+            i_brand_id,
+            i_class_id,
+            i_category_id,
+            i_manufact_id)
+SELECT prev_yr.d_year AS prev_year ,
+       curr_yr.d_year AS year_ ,
+       curr_yr.i_brand_id ,
+       curr_yr.i_class_id ,
+       curr_yr.i_category_id ,
+       curr_yr.i_manufact_id ,
+       prev_yr.sales_cnt AS prev_yr_cnt ,
+       curr_yr.sales_cnt AS curr_yr_cnt ,
+       curr_yr.sales_cnt-prev_yr.sales_cnt AS sales_cnt_diff ,
+       curr_yr.sales_amt-prev_yr.sales_amt AS sales_amt_diff
+FROM all_sales curr_yr,
+     all_sales prev_yr
+WHERE curr_yr.i_brand_id=prev_yr.i_brand_id
+  AND curr_yr.i_class_id=prev_yr.i_class_id
+  AND curr_yr.i_category_id=prev_yr.i_category_id
+  AND curr_yr.i_manufact_id=prev_yr.i_manufact_id
+  AND curr_yr.d_year=2002
+  AND prev_yr.d_year=2002-1
+  AND CAST(curr_yr.sales_cnt AS DECIMAL(17,2))/CAST(prev_yr.sales_cnt AS DECIMAL(17,2))<0.9
+ORDER BY sales_cnt_diff,
+         sales_amt_diff
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=60.75MB Threads=9
+Per-Host Resource Estimates: Memory=966MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=965.75MB mem-reservation=60.75MB thread-reservation=9 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: d_year, d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_cnt, sales_cnt - sales_cnt, sales_amt - sales_amt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+49:TOP-N [LIMIT=100]
+|  order by: sales_cnt - sales_cnt ASC, sales_amt - sales_amt ASC
+|  mem-estimate=7.03KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=32 row-size=72B cardinality=100
+|  in pipelines: 49(GETNEXT), 23(OPEN)
+|
+48:HASH JOIN [INNER JOIN]
+|  hash predicates: i_brand_id = i_brand_id, i_category_id = i_category_id, i_class_id = i_class_id, i_manufact_id = i_manufact_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CAST(sum(sales_cnt) AS DECIMAL(17,2)) / CAST(sum(sales_cnt) AS DECIMAL(17,2)) < CAST(0.9 AS DECIMAL(1,1))
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=14,30 row-size=88B cardinality=175
+|  in pipelines: 23(GETNEXT), 47(OPEN)
+|
+|--47:AGGREGATE [FINALIZE]
+|  |  output: sum(sales_cnt), sum(sales_amt)
+|  |  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id
+|  |  having: d_year = CAST(2001 AS INT)
+|  |  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=30 row-size=44B cardinality=175
+|  |  in pipelines: 47(GETNEXT), 46(OPEN)
+|  |
+|  46:AGGREGATE [FINALIZE]
+|  |  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_amt
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=28 row-size=32B cardinality=103.17K
+|  |  in pipelines: 46(GETNEXT), 28(OPEN), 35(OPEN), 42(OPEN)
+|  |
+|  24:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=32B cardinality=103.17K
+|  |  in pipelines: 28(GETNEXT), 35(GETNEXT), 42(GETNEXT)
+|  |
+|  |--45:HASH JOIN [RIGHT OUTER JOIN]
+|  |  |  hash predicates: wr_item_sk = ws_item_sk, wr_order_number = ws_order_number
+|  |  |  fk/pk conjuncts: wr_item_sk = ws_item_sk, wr_order_number = ws_order_number
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=27N,24,25,26 row-size=102B cardinality=14.80K
+|  |  |  in pipelines: 42(GETNEXT), 39(OPEN)
+|  |  |
+|  |  |--44:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=24,25,26 row-size=78B cardinality=14.80K
+|  |  |  |  in pipelines: 39(GETNEXT), 41(OPEN)
+|  |  |  |
+|  |  |  |--41:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=26 row-size=8B cardinality=373
+|  |  |  |     in pipelines: 41(GETNEXT)
+|  |  |  |
+|  |  |  43:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ws_item_sk = i_item_sk
+|  |  |  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  |  |  runtime filters: RF054[bloom] <- i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=24,25 row-size=70B cardinality=71.94K
+|  |  |  |  in pipelines: 39(GETNEXT), 40(OPEN)
+|  |  |  |
+|  |  |  |--40:SCAN HDFS [tpcds_parquet.item]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     predicates: i_category = 'Books'
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     parquet statistics predicates: i_category = 'Books'
+|  |  |  |     parquet dictionary predicates: i_category = 'Books'
+|  |  |  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=25 row-size=42B cardinality=1.80K
+|  |  |  |     in pipelines: 40(GETNEXT)
+|  |  |  |
+|  |  |  39:SCAN HDFS [tpcds_parquet.web_sales]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     runtime filters: RF054[bloom] -> ws_item_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=160.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |     tuple-ids=24 row-size=28B cardinality=719.38K
+|  |  |     in pipelines: 39(GETNEXT)
+|  |  |
+|  |  42:SCAN HDFS [tpcds_parquet.web_returns]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=27 row-size=24B cardinality=71.76K
+|  |     in pipelines: 42(GETNEXT)
+|  |
+|  |--38:HASH JOIN [RIGHT OUTER JOIN]
+|  |  |  hash predicates: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  fk/pk conjuncts: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |  tuple-ids=23N,20,21,22 row-size=102B cardinality=58.90K
+|  |  |  in pipelines: 35(GETNEXT), 32(OPEN)
+|  |  |
+|  |  |--37:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  |  runtime filters: RF044[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=20,21,22 row-size=78B cardinality=58.90K
+|  |  |  |  in pipelines: 32(GETNEXT), 34(OPEN)
+|  |  |  |
+|  |  |  |--34:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=73.05K size=2.15MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  |     tuple-ids=22 row-size=8B cardinality=373
+|  |  |  |     in pipelines: 34(GETNEXT)
+|  |  |  |
+|  |  |  36:HASH JOIN [INNER JOIN]
+|  |  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  |  runtime filters: RF046[bloom] <- i_item_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |  tuple-ids=20,21 row-size=70B cardinality=288.04K
+|  |  |  |  in pipelines: 32(GETNEXT), 33(OPEN)
+|  |  |  |
+|  |  |  |--33:SCAN HDFS [tpcds_parquet.item]
+|  |  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |  |     predicates: i_category = 'Books'
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=18.00K size=1.73MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |  |     parquet statistics predicates: i_category = 'Books'
+|  |  |  |     parquet dictionary predicates: i_category = 'Books'
+|  |  |  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  |     tuple-ids=21 row-size=42B cardinality=1.80K
+|  |  |  |     in pipelines: 33(GETNEXT)
+|  |  |  |
+|  |  |  32:SCAN HDFS [tpcds_parquet.store_sales]
+|  |  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |  |     runtime filters: RF046[bloom] -> ss_item_sk, RF044[bloom] -> ss_sold_date_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=2.88M size=201.02MB
+|  |  |       partitions: 1824/1824 rows=2.88M
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=20 row-size=28B cardinality=2.88M
+|  |  |     in pipelines: 32(GETNEXT)
+|  |  |
+|  |  35:SCAN HDFS [tpcds_parquet.store_returns]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=23 row-size=24B cardinality=287.51K
+|  |     in pipelines: 35(GETNEXT)
+|  |
+|  31:HASH JOIN [RIGHT OUTER JOIN]
+|  |  hash predicates: cr_item_sk = cs_item_sk, cr_order_number = cs_order_number
+|  |  fk/pk conjuncts: cr_item_sk = cs_item_sk, cr_order_number = cs_order_number
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=19N,16,17,18 row-size=102B cardinality=29.46K
+|  |  in pipelines: 28(GETNEXT), 25(OPEN)
+|  |
+|  |--30:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF036[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=16,17,18 row-size=78B cardinality=29.46K
+|  |  |  in pipelines: 25(GETNEXT), 27(OPEN)
+|  |  |
+|  |  |--27:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=18 row-size=8B cardinality=373
+|  |  |     in pipelines: 27(GETNEXT)
+|  |  |
+|  |  29:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cs_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  |  runtime filters: RF038[bloom] <- i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=16,17 row-size=70B cardinality=144.16K
+|  |  |  in pipelines: 25(GETNEXT), 26(OPEN)
+|  |  |
+|  |  |--26:SCAN HDFS [tpcds_parquet.item]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     predicates: i_category = 'Books'
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     parquet statistics predicates: i_category = 'Books'
+|  |  |     parquet dictionary predicates: i_category = 'Books'
+|  |  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=17 row-size=42B cardinality=1.80K
+|  |  |     in pipelines: 26(GETNEXT)
+|  |  |
+|  |  25:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     runtime filters: RF038[bloom] -> cs_item_sk, RF036[bloom] -> cs_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=240.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=16 row-size=28B cardinality=1.44M
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  28:SCAN HDFS [tpcds_parquet.catalog_returns]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=19 row-size=24B cardinality=144.07K
+|     in pipelines: 28(GETNEXT)
+|
+23:AGGREGATE [FINALIZE]
+|  output: sum(sales_cnt), sum(sales_amt)
+|  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id
+|  having: d_year = CAST(2002 AS INT)
+|  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=14 row-size=44B cardinality=175
+|  in pipelines: 23(GETNEXT), 22(OPEN)
+|
+22:AGGREGATE [FINALIZE]
+|  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_amt
+|  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=12 row-size=32B cardinality=103.17K
+|  in pipelines: 22(GETNEXT), 04(OPEN), 11(OPEN), 18(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=32B cardinality=103.17K
+|  in pipelines: 04(GETNEXT), 11(GETNEXT), 18(GETNEXT)
+|
+|--21:HASH JOIN [RIGHT OUTER JOIN]
+|  |  hash predicates: wr_item_sk = ws_item_sk, wr_order_number = ws_order_number
+|  |  fk/pk conjuncts: wr_item_sk = ws_item_sk, wr_order_number = ws_order_number
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=11N,8,9,10 row-size=102B cardinality=14.80K
+|  |  in pipelines: 18(GETNEXT), 15(OPEN)
+|  |
+|  |--20:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9,10 row-size=78B cardinality=14.80K
+|  |  |  in pipelines: 15(GETNEXT), 17(OPEN)
+|  |  |
+|  |  |--17:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=10 row-size=8B cardinality=373
+|  |  |     in pipelines: 17(GETNEXT)
+|  |  |
+|  |  19:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  |  runtime filters: RF030[bloom] <- i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,9 row-size=70B cardinality=71.94K
+|  |  |  in pipelines: 15(GETNEXT), 16(OPEN)
+|  |  |
+|  |  |--16:SCAN HDFS [tpcds_parquet.item]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     predicates: i_category = 'Books'
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     parquet statistics predicates: i_category = 'Books'
+|  |  |     parquet dictionary predicates: i_category = 'Books'
+|  |  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=9 row-size=42B cardinality=1.80K
+|  |  |     in pipelines: 16(GETNEXT)
+|  |  |
+|  |  15:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF030[bloom] -> ws_item_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=160.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=8 row-size=28B cardinality=719.38K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  18:SCAN HDFS [tpcds_parquet.web_returns]
+|     HDFS partitions=1/1 files=1 size=5.66MB
+|     stored statistics:
+|       table: rows=71.76K size=5.66MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=11 row-size=24B cardinality=71.76K
+|     in pipelines: 18(GETNEXT)
+|
+|--14:HASH JOIN [RIGHT OUTER JOIN]
+|  |  hash predicates: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  fk/pk conjuncts: sr_item_sk = ss_item_sk, sr_ticket_number = ss_ticket_number
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=7N,4,5,6 row-size=102B cardinality=58.90K
+|  |  in pipelines: 11(GETNEXT), 08(OPEN)
+|  |
+|  |--13:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=4,5,6 row-size=78B cardinality=58.90K
+|  |  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |  |
+|  |  |--10:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=6 row-size=8B cardinality=373
+|  |  |     in pipelines: 10(GETNEXT)
+|  |  |
+|  |  12:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  runtime filters: RF022[bloom] <- i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=4,5 row-size=70B cardinality=288.04K
+|  |  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |  |
+|  |  |--09:SCAN HDFS [tpcds_parquet.item]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     predicates: i_category = 'Books'
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     parquet statistics predicates: i_category = 'Books'
+|  |  |     parquet dictionary predicates: i_category = 'Books'
+|  |  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=5 row-size=42B cardinality=1.80K
+|  |  |     in pipelines: 09(GETNEXT)
+|  |  |
+|  |  08:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF022[bloom] -> ss_item_sk, RF020[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=4 row-size=28B cardinality=2.88M
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  11:SCAN HDFS [tpcds_parquet.store_returns]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=7 row-size=24B cardinality=287.51K
+|     in pipelines: 11(GETNEXT)
+|
+07:HASH JOIN [RIGHT OUTER JOIN]
+|  hash predicates: cr_item_sk = cs_item_sk, cr_order_number = cs_order_number
+|  fk/pk conjuncts: cr_item_sk = cs_item_sk, cr_order_number = cs_order_number
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=3N,0,1,2 row-size=102B cardinality=29.46K
+|  in pipelines: 04(GETNEXT), 01(OPEN)
+|
+|--06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1,2 row-size=78B cardinality=29.46K
+|  |  in pipelines: 01(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=8B cardinality=373
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=70B cardinality=144.16K
+|  |  in pipelines: 01(GETNEXT), 02(OPEN)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Books'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Books'
+|  |     parquet dictionary predicates: i_category = 'Books'
+|  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=1 row-size=42B cardinality=1.80K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  01:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF014[bloom] -> cs_item_sk, RF012[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=240.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=0 row-size=28B cardinality=1.44M
+|     in pipelines: 01(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.catalog_returns]
+   HDFS partitions=1/1 files=1 size=10.62MB
+   stored statistics:
+     table: rows=144.07K size=10.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=144.07K
+   mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=3 row-size=24B cardinality=144.07K
+   in pipelines: 04(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=136.44MB Threads=56
+Per-Host Resource Estimates: Memory=2.30GB
+F37:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=24.61KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: d_year, d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_cnt, sales_cnt - sales_cnt, sales_amt - sales_amt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+84:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sales_cnt - sales_cnt ASC, sales_amt - sales_amt ASC
+|  limit: 100
+|  mem-estimate=24.61KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=32 row-size=72B cardinality=100
+|  in pipelines: 49(GETNEXT)
+|
+F36:PLAN FRAGMENT [HASH(i_brand_id,i_category_id,i_class_id,i_manufact_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=1.99MB mem-reservation=1.94MB thread-reservation=1
+49:TOP-N [LIMIT=100]
+|  order by: sales_cnt - sales_cnt ASC, sales_amt - sales_amt ASC
+|  mem-estimate=7.03KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=32 row-size=72B cardinality=100
+|  in pipelines: 49(GETNEXT), 65(OPEN)
+|
+48:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: i_brand_id = i_brand_id, i_category_id = i_category_id, i_class_id = i_class_id, i_manufact_id = i_manufact_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CAST(sum(sales_cnt) AS DECIMAL(17,2)) / CAST(sum(sales_cnt) AS DECIMAL(17,2)) < CAST(0.9 AS DECIMAL(1,1))
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=14,30 row-size=88B cardinality=175
+|  in pipelines: 65(GETNEXT), 81(OPEN)
+|
+|--83:EXCHANGE [HASH(i_brand_id,i_category_id,i_class_id,i_manufact_id)]
+|  |  mem-estimate=27.12KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=30 row-size=44B cardinality=175
+|  |  in pipelines: 81(GETNEXT)
+|  |
+|  F35:PLAN FRAGMENT [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=11.58MB mem-reservation=4.75MB thread-reservation=1
+|  81:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(sales_cnt), sum:merge(sales_amt)
+|  |  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id
+|  |  having: d_year = CAST(2001 AS INT)
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=30 row-size=44B cardinality=175
+|  |  in pipelines: 81(GETNEXT), 79(OPEN)
+|  |
+|  80:EXCHANGE [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id)]
+|  |  mem-estimate=1.58MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=30 row-size=44B cardinality=103.17K
+|  |  in pipelines: 79(GETNEXT)
+|  |
+|  F34:PLAN FRAGMENT [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=21.15MB mem-reservation=7.88MB thread-reservation=1
+|  47:AGGREGATE [STREAMING]
+|  |  output: sum(sales_cnt), sum(sales_amt)
+|  |  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id
+|  |  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=30 row-size=44B cardinality=103.17K
+|  |  in pipelines: 79(GETNEXT)
+|  |
+|  79:AGGREGATE [FINALIZE]
+|  |  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_amt
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=28 row-size=32B cardinality=103.17K
+|  |  in pipelines: 79(GETNEXT), 25(OPEN), 32(OPEN), 39(OPEN)
+|  |
+|  78:EXCHANGE [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt)]
+|  |  mem-estimate=1.15MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=32B cardinality=103.17K
+|  |  in pipelines: 25(GETNEXT), 32(GETNEXT), 39(GETNEXT)
+|  |
+|  F33:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=23.08MB mem-reservation=7.75MB thread-reservation=1
+|  46:AGGREGATE [STREAMING]
+|  |  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_amt
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=28 row-size=32B cardinality=103.17K
+|  |  in pipelines: 25(GETNEXT), 32(GETNEXT), 39(GETNEXT)
+|  |
+|  24:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=32B cardinality=103.17K
+|  |  in pipelines: 25(GETNEXT), 32(GETNEXT), 39(GETNEXT)
+|  |
+|  |--45:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  |  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=24,25,26,27N row-size=102B cardinality=14.80K
+|  |  |  in pipelines: 39(GETNEXT), 42(OPEN)
+|  |  |
+|  |  |--77:EXCHANGE [HASH(wr_item_sk,wr_order_number)]
+|  |  |  |  mem-estimate=1.67MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=27 row-size=24B cardinality=71.76K
+|  |  |  |  in pipelines: 42(GETNEXT)
+|  |  |  |
+|  |  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  |  42:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |  |     stored statistics:
+|  |  |       table: rows=71.76K size=5.66MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |     tuple-ids=27 row-size=24B cardinality=71.76K
+|  |  |     in pipelines: 42(GETNEXT)
+|  |  |
+|  |  76:EXCHANGE [HASH(ws_item_sk,ws_order_number)]
+|  |  |  mem-estimate=742.74KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=24,25,26 row-size=78B cardinality=14.80K
+|  |  |  in pipelines: 39(GETNEXT)
+|  |  |
+|  |  F28:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=165.01MB mem-reservation=12.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  44:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=24,25,26 row-size=78B cardinality=14.80K
+|  |  |  in pipelines: 39(GETNEXT), 41(OPEN)
+|  |  |
+|  |  |--75:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=26 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 41(GETNEXT)
+|  |  |  |
+|  |  |  F30:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  41:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=26 row-size=8B cardinality=373
+|  |  |     in pipelines: 41(GETNEXT)
+|  |  |
+|  |  43:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  |  runtime filters: RF030[bloom] <- i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=24,25 row-size=70B cardinality=71.94K
+|  |  |  in pipelines: 39(GETNEXT), 40(OPEN)
+|  |  |
+|  |  |--74:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=25 row-size=42B cardinality=1.80K
+|  |  |  |  in pipelines: 40(GETNEXT)
+|  |  |  |
+|  |  |  F29:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  40:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     predicates: i_category = 'Books'
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     parquet statistics predicates: i_category = 'Books'
+|  |  |     parquet dictionary predicates: i_category = 'Books'
+|  |  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=25 row-size=42B cardinality=1.80K
+|  |  |     in pipelines: 40(GETNEXT)
+|  |  |
+|  |  39:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF030[bloom] -> ws_item_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=160.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=24 row-size=28B cardinality=719.38K
+|  |     in pipelines: 39(GETNEXT)
+|  |
+|  |--38:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  |  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=20,21,22,23N row-size=102B cardinality=58.90K
+|  |  |  in pipelines: 32(GETNEXT), 35(OPEN)
+|  |  |
+|  |  |--73:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  |  |  mem-estimate=6.61MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=23 row-size=24B cardinality=287.51K
+|  |  |  |  in pipelines: 35(GETNEXT)
+|  |  |  |
+|  |  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  |  35:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |  |     stored statistics:
+|  |  |       table: rows=287.51K size=15.43MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=23 row-size=24B cardinality=287.51K
+|  |  |     in pipelines: 35(GETNEXT)
+|  |  |
+|  |  72:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  |  |  mem-estimate=1.72MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20,21,22 row-size=78B cardinality=58.90K
+|  |  |  in pipelines: 32(GETNEXT)
+|  |  |
+|  |  F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=70.01MB mem-reservation=7.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  37:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF024[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=20,21,22 row-size=78B cardinality=58.90K
+|  |  |  in pipelines: 32(GETNEXT), 34(OPEN)
+|  |  |
+|  |  |--71:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 34(GETNEXT)
+|  |  |  |
+|  |  |  F25:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  34:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=22 row-size=8B cardinality=373
+|  |  |     in pipelines: 34(GETNEXT)
+|  |  |
+|  |  36:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  runtime filters: RF026[bloom] <- i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=20,21 row-size=70B cardinality=288.04K
+|  |  |  in pipelines: 32(GETNEXT), 33(OPEN)
+|  |  |
+|  |  |--70:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=21 row-size=42B cardinality=1.80K
+|  |  |  |  in pipelines: 33(GETNEXT)
+|  |  |  |
+|  |  |  F24:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  33:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     predicates: i_category = 'Books'
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     parquet statistics predicates: i_category = 'Books'
+|  |  |     parquet dictionary predicates: i_category = 'Books'
+|  |  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=21 row-size=42B cardinality=1.80K
+|  |  |     in pipelines: 33(GETNEXT)
+|  |  |
+|  |  32:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF026[bloom] -> ss_item_sk, RF024[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=20 row-size=28B cardinality=2.88M
+|  |     in pipelines: 32(GETNEXT)
+|  |
+|  31:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19N row-size=102B cardinality=29.46K
+|  |  in pipelines: 25(GETNEXT), 28(OPEN)
+|  |
+|  |--69:EXCHANGE [HASH(cr_item_sk,cr_order_number)]
+|  |  |  mem-estimate=3.32MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=24B cardinality=144.07K
+|  |  |  in pipelines: 28(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  28:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=19 row-size=24B cardinality=144.07K
+|  |     in pipelines: 28(GETNEXT)
+|  |
+|  68:EXCHANGE [HASH(cs_item_sk,cs_order_number)]
+|  |  mem-estimate=1016.76KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=78B cardinality=29.46K
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=246.01MB mem-reservation=13.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  30:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=78B cardinality=29.46K
+|  |  in pipelines: 25(GETNEXT), 27(OPEN)
+|  |
+|  |--67:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=8B cardinality=373
+|  |  |  in pipelines: 27(GETNEXT)
+|  |  |
+|  |  F20:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  27:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=8B cardinality=373
+|  |     in pipelines: 27(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  runtime filters: RF022[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17 row-size=70B cardinality=144.16K
+|  |  in pipelines: 25(GETNEXT), 26(OPEN)
+|  |
+|  |--66:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=17 row-size=42B cardinality=1.80K
+|  |  |  in pipelines: 26(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  26:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Books'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Books'
+|  |     parquet dictionary predicates: i_category = 'Books'
+|  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=17 row-size=42B cardinality=1.80K
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  25:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF022[bloom] -> cs_item_sk, RF020[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=240.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=16 row-size=28B cardinality=1.44M
+|     in pipelines: 25(GETNEXT)
+|
+82:EXCHANGE [HASH(i_brand_id,i_category_id,i_class_id,i_manufact_id)]
+|  mem-estimate=27.12KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=44B cardinality=175
+|  in pipelines: 65(GETNEXT)
+|
+F17:PLAN FRAGMENT [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=11.58MB mem-reservation=4.75MB thread-reservation=1
+65:AGGREGATE [FINALIZE]
+|  output: sum:merge(sales_cnt), sum:merge(sales_amt)
+|  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id
+|  having: d_year = CAST(2002 AS INT)
+|  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=14 row-size=44B cardinality=175
+|  in pipelines: 65(GETNEXT), 63(OPEN)
+|
+64:EXCHANGE [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id)]
+|  mem-estimate=1.58MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=44B cardinality=103.17K
+|  in pipelines: 63(GETNEXT)
+|
+F16:PLAN FRAGMENT [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=21.15MB mem-reservation=7.88MB thread-reservation=1
+23:AGGREGATE [STREAMING]
+|  output: sum(sales_cnt), sum(sales_amt)
+|  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id
+|  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=14 row-size=44B cardinality=103.17K
+|  in pipelines: 63(GETNEXT)
+|
+63:AGGREGATE [FINALIZE]
+|  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_amt
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=12 row-size=32B cardinality=103.17K
+|  in pipelines: 63(GETNEXT), 01(OPEN), 08(OPEN), 15(OPEN)
+|
+62:EXCHANGE [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt)]
+|  mem-estimate=1.15MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=32B cardinality=103.17K
+|  in pipelines: 01(GETNEXT), 08(GETNEXT), 15(GETNEXT)
+|
+F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=23.08MB mem-reservation=7.75MB thread-reservation=1
+22:AGGREGATE [STREAMING]
+|  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_amt
+|  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=12 row-size=32B cardinality=103.17K
+|  in pipelines: 01(GETNEXT), 08(GETNEXT), 15(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=32B cardinality=103.17K
+|  in pipelines: 01(GETNEXT), 08(GETNEXT), 15(GETNEXT)
+|
+|--21:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11N row-size=102B cardinality=14.80K
+|  |  in pipelines: 15(GETNEXT), 18(OPEN)
+|  |
+|  |--61:EXCHANGE [HASH(wr_item_sk,wr_order_number)]
+|  |  |  mem-estimate=1.67MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=24B cardinality=71.76K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  18:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=24B cardinality=71.76K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  60:EXCHANGE [HASH(ws_item_sk,ws_order_number)]
+|  |  mem-estimate=742.74KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=78B cardinality=14.80K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=165.01MB mem-reservation=12.88MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=78B cardinality=14.80K
+|  |  in pipelines: 15(GETNEXT), 17(OPEN)
+|  |
+|  |--59:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=8B cardinality=373
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  17:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=8B cardinality=373
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  runtime filters: RF018[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=70B cardinality=71.94K
+|  |  in pipelines: 15(GETNEXT), 16(OPEN)
+|  |
+|  |--58:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=42B cardinality=1.80K
+|  |  |  in pipelines: 16(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  16:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Books'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Books'
+|  |     parquet dictionary predicates: i_category = 'Books'
+|  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=42B cardinality=1.80K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  15:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF018[bloom] -> ws_item_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=160.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=8 row-size=28B cardinality=719.38K
+|     in pipelines: 15(GETNEXT)
+|
+|--14:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6,7N row-size=102B cardinality=58.90K
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--57:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  |  mem-estimate=6.61MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=24B cardinality=287.51K
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  11:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=7 row-size=24B cardinality=287.51K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  56:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  |  mem-estimate=1.72MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=78B cardinality=58.90K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=70.01MB mem-reservation=7.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=78B cardinality=58.90K
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--55:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=8B cardinality=373
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  10:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=8B cardinality=373
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=70B cardinality=288.04K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--54:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=42B cardinality=1.80K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  09:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Books'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Books'
+|  |     parquet dictionary predicates: i_category = 'Books'
+|  |     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=42B cardinality=1.80K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF014[bloom] -> ss_item_sk, RF012[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=4 row-size=28B cardinality=2.88M
+|     in pipelines: 08(GETNEXT)
+|
+07:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3N row-size=102B cardinality=29.46K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--53:EXCHANGE [HASH(cr_item_sk,cr_order_number)]
+|  |  mem-estimate=3.32MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=24B cardinality=144.07K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=3 row-size=24B cardinality=144.07K
+|     in pipelines: 04(GETNEXT)
+|
+52:EXCHANGE [HASH(cs_item_sk,cs_order_number)]
+|  mem-estimate=1016.76KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=29.46K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=246.01MB mem-reservation=13.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF008[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=29.46K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--51:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  runtime filters: RF010[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=70B cardinality=144.16K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--50:EXCHANGE [BROADCAST]
+|  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=42B cardinality=1.80K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category = 'Books'
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category = 'Books'
+|     parquet dictionary predicates: i_category = 'Books'
+|     mem-estimate=96.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=42B cardinality=1.80K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF010[bloom] -> cs_item_sk, RF008[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=240.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=1.44M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=201.12MB Threads=67
+Per-Host Resource Estimates: Memory=869MB
+F37:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=46.88KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: d_year, d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_cnt, sales_cnt - sales_cnt, sales_amt - sales_amt
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+84:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sales_cnt - sales_cnt ASC, sales_amt - sales_amt ASC
+|  limit: 100
+|  mem-estimate=46.88KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=32 row-size=72B cardinality=100
+|  in pipelines: 49(GETNEXT)
+|
+F36:PLAN FRAGMENT [HASH(i_brand_id,i_category_id,i_class_id,i_manufact_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=58.76KB mem-reservation=0B thread-reservation=1
+49:TOP-N [LIMIT=100]
+|  order by: sales_cnt - sales_cnt ASC, sales_amt - sales_amt ASC
+|  mem-estimate=7.03KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=32 row-size=72B cardinality=100
+|  in pipelines: 49(GETNEXT), 65(OPEN)
+|
+48:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: i_brand_id = i_brand_id, i_category_id = i_category_id, i_class_id = i_class_id, i_manufact_id = i_manufact_id
+|  fk/pk conjuncts: assumed fk/pk
+|  other predicates: CAST(sum(sales_cnt) AS DECIMAL(17,2)) / CAST(sum(sales_cnt) AS DECIMAL(17,2)) < CAST(0.9 AS DECIMAL(1,1))
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=14,30 row-size=88B cardinality=175
+|  in pipelines: 65(GETNEXT), 81(OPEN)
+|
+|--F38:PLAN FRAGMENT [HASH(i_brand_id,i_category_id,i_class_id,i_manufact_id)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=1.99MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_brand_id, i_category_id, i_class_id, i_manufact_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  83:EXCHANGE [HASH(i_brand_id,i_category_id,i_class_id,i_manufact_id)]
+|  |  mem-estimate=51.72KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=30 row-size=44B cardinality=175
+|  |  in pipelines: 81(GETNEXT)
+|  |
+|  F35:PLAN FRAGMENT [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=11.72MB mem-reservation=2.88MB thread-reservation=1
+|  81:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(sales_cnt), sum:merge(sales_amt)
+|  |  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id
+|  |  having: d_year = CAST(2001 AS INT)
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=30 row-size=44B cardinality=175
+|  |  in pipelines: 81(GETNEXT), 79(OPEN)
+|  |
+|  80:EXCHANGE [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id)]
+|  |  mem-estimate=1.72MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=30 row-size=44B cardinality=103.17K
+|  |  in pipelines: 79(GETNEXT)
+|  |
+|  F34:PLAN FRAGMENT [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=21.26MB mem-reservation=4.94MB thread-reservation=1
+|  47:AGGREGATE [STREAMING]
+|  |  output: sum(sales_cnt), sum(sales_amt)
+|  |  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id
+|  |  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=30 row-size=44B cardinality=103.17K
+|  |  in pipelines: 79(GETNEXT)
+|  |
+|  79:AGGREGATE [FINALIZE]
+|  |  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_amt
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=28 row-size=32B cardinality=103.17K
+|  |  in pipelines: 79(GETNEXT), 25(OPEN), 32(OPEN), 39(OPEN)
+|  |
+|  78:EXCHANGE [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt)]
+|  |  mem-estimate=1.26MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=32B cardinality=103.17K
+|  |  in pipelines: 25(GETNEXT), 32(GETNEXT), 39(GETNEXT)
+|  |
+|  F33:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=11.99MB mem-reservation=2.00MB thread-reservation=1
+|  46:AGGREGATE [STREAMING]
+|  |  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_amt
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=28 row-size=32B cardinality=103.17K
+|  |  in pipelines: 25(GETNEXT), 32(GETNEXT), 39(GETNEXT)
+|  |
+|  24:UNION
+|  |  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=32B cardinality=103.17K
+|  |  in pipelines: 25(GETNEXT), 32(GETNEXT), 39(GETNEXT)
+|  |
+|  |--45:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  |  |  hash-table-id=03
+|  |  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=24,25,26,27N row-size=102B cardinality=14.80K
+|  |  |  in pipelines: 39(GETNEXT), 42(OPEN)
+|  |  |
+|  |  |--F41:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  |  |  Per-Instance Resources: mem-estimate=3.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  |  build expressions: wr_item_sk, wr_order_number
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  77:EXCHANGE [HASH(wr_item_sk,wr_order_number)]
+|  |  |  |  mem-estimate=1.67MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=27 row-size=24B cardinality=71.76K
+|  |  |  |  in pipelines: 42(GETNEXT)
+|  |  |  |
+|  |  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  |  42:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |  |     stored statistics:
+|  |  |       table: rows=71.76K size=5.66MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |  |     tuple-ids=27 row-size=24B cardinality=71.76K
+|  |  |     in pipelines: 42(GETNEXT)
+|  |  |
+|  |  76:EXCHANGE [HASH(ws_item_sk,ws_order_number)]
+|  |  |  mem-estimate=742.74KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=24,25,26 row-size=78B cardinality=14.80K
+|  |  |  in pipelines: 39(GETNEXT)
+|  |  |
+|  |  F28:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  44:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=08
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=24,25,26 row-size=78B cardinality=14.80K
+|  |  |  in pipelines: 39(GETNEXT), 41(OPEN)
+|  |  |
+|  |  |--F46:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=08 plan-id=09 cohort-id=02
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  75:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=26 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 41(GETNEXT)
+|  |  |  |
+|  |  |  F30:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  41:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=26 row-size=8B cardinality=373
+|  |  |     in pipelines: 41(GETNEXT)
+|  |  |
+|  |  43:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=09
+|  |  |  hash predicates: ws_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=24,25 row-size=70B cardinality=71.94K
+|  |  |  in pipelines: 39(GETNEXT), 40(OPEN)
+|  |  |
+|  |  |--F47:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  |  Per-Instance Resources: mem-estimate=4.99MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=09 plan-id=10 cohort-id=02
+|  |  |  |  build expressions: i_item_sk
+|  |  |  |  runtime filters: RF030[bloom] <- i_item_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  74:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=25 row-size=42B cardinality=1.80K
+|  |  |  |  in pipelines: 40(GETNEXT)
+|  |  |  |
+|  |  |  F29:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  40:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     predicates: i_category = 'Books'
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     parquet statistics predicates: i_category = 'Books'
+|  |  |     parquet dictionary predicates: i_category = 'Books'
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=25 row-size=42B cardinality=1.80K
+|  |  |     in pipelines: 40(GETNEXT)
+|  |  |
+|  |  39:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF030[bloom] -> ws_item_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=24 row-size=28B cardinality=719.38K
+|  |     in pipelines: 39(GETNEXT)
+|  |
+|  |--38:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  |  tuple-ids=20,21,22,23N row-size=102B cardinality=58.90K
+|  |  |  in pipelines: 32(GETNEXT), 35(OPEN)
+|  |  |
+|  |  |--F40:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  |  |  Per-Instance Resources: mem-estimate=9.48MB mem-reservation=2.88MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  |  build expressions: sr_item_sk, sr_ticket_number
+|  |  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |  |
+|  |  |  73:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  |  |  mem-estimate=6.61MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=23 row-size=24B cardinality=287.51K
+|  |  |  |  in pipelines: 35(GETNEXT)
+|  |  |  |
+|  |  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |  35:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |  |     stored statistics:
+|  |  |       table: rows=287.51K size=15.43MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |  |     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=23 row-size=24B cardinality=287.51K
+|  |  |     in pipelines: 35(GETNEXT)
+|  |  |
+|  |  72:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  |  |  mem-estimate=1.99MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20,21,22 row-size=78B cardinality=58.90K
+|  |  |  in pipelines: 32(GETNEXT)
+|  |  |
+|  |  F23:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  37:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=06
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=20,21,22 row-size=78B cardinality=58.90K
+|  |  |  in pipelines: 32(GETNEXT), 34(OPEN)
+|  |  |
+|  |  |--F44:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=06 plan-id=07 cohort-id=02
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  runtime filters: RF024[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  71:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 34(GETNEXT)
+|  |  |  |
+|  |  |  F25:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  34:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=22 row-size=8B cardinality=373
+|  |  |     in pipelines: 34(GETNEXT)
+|  |  |
+|  |  36:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=07
+|  |  |  hash predicates: ss_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=20,21 row-size=70B cardinality=288.04K
+|  |  |  in pipelines: 32(GETNEXT), 33(OPEN)
+|  |  |
+|  |  |--F45:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=4.99MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=07 plan-id=08 cohort-id=02
+|  |  |  |  build expressions: i_item_sk
+|  |  |  |  runtime filters: RF026[bloom] <- i_item_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  70:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=21 row-size=42B cardinality=1.80K
+|  |  |  |  in pipelines: 33(GETNEXT)
+|  |  |  |
+|  |  |  F24:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |  33:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     predicates: i_category = 'Books'
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     parquet statistics predicates: i_category = 'Books'
+|  |  |     parquet dictionary predicates: i_category = 'Books'
+|  |  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |  |     tuple-ids=21 row-size=42B cardinality=1.80K
+|  |  |     in pipelines: 33(GETNEXT)
+|  |  |
+|  |  32:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF026[bloom] -> ss_item_sk, RF024[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=20 row-size=28B cardinality=2.88M
+|  |     in pipelines: 32(GETNEXT)
+|  |
+|  31:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18,19N row-size=102B cardinality=29.46K
+|  |  in pipelines: 25(GETNEXT), 28(OPEN)
+|  |
+|  |--F39:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=5.26MB mem-reservation=1.94MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: cr_item_sk, cr_order_number
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  69:EXCHANGE [HASH(cr_item_sk,cr_order_number)]
+|  |  |  mem-estimate=3.32MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=24B cardinality=144.07K
+|  |  |  in pipelines: 28(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  28:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=19 row-size=24B cardinality=144.07K
+|  |     in pipelines: 28(GETNEXT)
+|  |
+|  68:EXCHANGE [HASH(cs_item_sk,cs_order_number)]
+|  |  mem-estimate=1016.76KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=78B cardinality=29.46K
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F18:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+|  30:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17,18 row-size=78B cardinality=29.46K
+|  |  in pipelines: 25(GETNEXT), 27(OPEN)
+|  |
+|  |--F42:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF020[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  67:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=8B cardinality=373
+|  |  |  in pipelines: 27(GETNEXT)
+|  |  |
+|  |  F20:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  27:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2001 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=18 row-size=8B cardinality=373
+|  |     in pipelines: 27(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17 row-size=70B cardinality=144.16K
+|  |  in pipelines: 25(GETNEXT), 26(OPEN)
+|  |
+|  |--F43:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.99MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF022[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  66:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=17 row-size=42B cardinality=1.80K
+|  |  |  in pipelines: 26(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  26:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Books'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Books'
+|  |     parquet dictionary predicates: i_category = 'Books'
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=17 row-size=42B cardinality=1.80K
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  25:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF022[bloom] -> cs_item_sk, RF020[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=16 row-size=28B cardinality=1.44M
+|     in pipelines: 25(GETNEXT)
+|
+82:EXCHANGE [HASH(i_brand_id,i_category_id,i_class_id,i_manufact_id)]
+|  mem-estimate=51.72KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=44B cardinality=175
+|  in pipelines: 65(GETNEXT)
+|
+F17:PLAN FRAGMENT [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.72MB mem-reservation=2.88MB thread-reservation=1
+65:AGGREGATE [FINALIZE]
+|  output: sum:merge(sales_cnt), sum:merge(sales_amt)
+|  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id
+|  having: d_year = CAST(2002 AS INT)
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=14 row-size=44B cardinality=175
+|  in pipelines: 65(GETNEXT), 63(OPEN)
+|
+64:EXCHANGE [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id)]
+|  mem-estimate=1.72MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=44B cardinality=103.17K
+|  in pipelines: 63(GETNEXT)
+|
+F16:PLAN FRAGMENT [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=21.26MB mem-reservation=4.94MB thread-reservation=1
+23:AGGREGATE [STREAMING]
+|  output: sum(sales_cnt), sum(sales_amt)
+|  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id
+|  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=14 row-size=44B cardinality=103.17K
+|  in pipelines: 63(GETNEXT)
+|
+63:AGGREGATE [FINALIZE]
+|  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_amt
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=32B cardinality=103.17K
+|  in pipelines: 63(GETNEXT), 01(OPEN), 08(OPEN), 15(OPEN)
+|
+62:EXCHANGE [HASH(d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt)]
+|  mem-estimate=1.26MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=32B cardinality=103.17K
+|  in pipelines: 01(GETNEXT), 08(GETNEXT), 15(GETNEXT)
+|
+F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.99MB mem-reservation=2.00MB thread-reservation=1
+22:AGGREGATE [STREAMING]
+|  group by: d_year, i_brand_id, i_class_id, i_category_id, i_manufact_id, sales_cnt, sales_amt
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=12 row-size=32B cardinality=103.17K
+|  in pipelines: 01(GETNEXT), 08(GETNEXT), 15(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=32B cardinality=103.17K
+|  in pipelines: 01(GETNEXT), 08(GETNEXT), 15(GETNEXT)
+|
+|--21:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  |  hash-table-id=12
+|  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10,11N row-size=102B cardinality=14.80K
+|  |  in pipelines: 15(GETNEXT), 18(OPEN)
+|  |
+|  |--F50:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=3.61MB mem-reservation=1.94MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=12 plan-id=13 cohort-id=01
+|  |  |  build expressions: wr_item_sk, wr_order_number
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  61:EXCHANGE [HASH(wr_item_sk,wr_order_number)]
+|  |  |  mem-estimate=1.67MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=24B cardinality=71.76K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  18:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=11 row-size=24B cardinality=71.76K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  60:EXCHANGE [HASH(ws_item_sk,ws_order_number)]
+|  |  mem-estimate=742.74KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=78B cardinality=14.80K
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=17
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9,10 row-size=78B cardinality=14.80K
+|  |  in pipelines: 15(GETNEXT), 17(OPEN)
+|  |
+|  |--F55:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=17 plan-id=18 cohort-id=01
+|  |  |  build expressions: d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  59:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=8B cardinality=373
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  17:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=10 row-size=8B cardinality=373
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  19:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=18
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9 row-size=70B cardinality=71.94K
+|  |  in pipelines: 15(GETNEXT), 16(OPEN)
+|  |
+|  |--F56:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.99MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=18 plan-id=19 cohort-id=01
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF018[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  58:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=42B cardinality=1.80K
+|  |  |  in pipelines: 16(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  16:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Books'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Books'
+|  |     parquet dictionary predicates: i_category = 'Books'
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=9 row-size=42B cardinality=1.80K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  15:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF018[bloom] -> ws_item_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=8 row-size=28B cardinality=719.38K
+|     in pipelines: 15(GETNEXT)
+|
+|--14:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  |  hash-table-id=11
+|  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6,7N row-size=102B cardinality=58.90K
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--F49:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=9.48MB mem-reservation=2.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=11 plan-id=12 cohort-id=01
+|  |  |  build expressions: sr_item_sk, sr_ticket_number
+|  |  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  57:EXCHANGE [HASH(sr_item_sk,sr_ticket_number)]
+|  |  |  mem-estimate=6.61MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=24B cardinality=287.51K
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  11:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |     stored statistics:
+|  |       table: rows=287.51K size=15.43MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=7 row-size=24B cardinality=287.51K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  56:EXCHANGE [HASH(ss_item_sk,ss_ticket_number)]
+|  |  mem-estimate=1.99MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=78B cardinality=58.90K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=15
+|  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5,6 row-size=78B cardinality=58.90K
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--F53:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=15 plan-id=16 cohort-id=01
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  55:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=8B cardinality=373
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  10:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=6 row-size=8B cardinality=373
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=16
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=70B cardinality=288.04K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--F54:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.99MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=16 plan-id=17 cohort-id=01
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  54:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=42B cardinality=1.80K
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  09:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_category = 'Books'
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_category = 'Books'
+|  |     parquet dictionary predicates: i_category = 'Books'
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=5 row-size=42B cardinality=1.80K
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF014[bloom] -> ss_item_sk, RF012[bloom] -> ss_sold_date_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=4 row-size=28B cardinality=2.88M
+|     in pipelines: 08(GETNEXT)
+|
+07:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  hash-table-id=10
+|  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3N row-size=102B cardinality=29.46K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--F48:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=5.26MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  build expressions: cr_item_sk, cr_order_number
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  53:EXCHANGE [HASH(cr_item_sk,cr_order_number)]
+|  |  mem-estimate=3.32MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=24B cardinality=144.07K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=3 row-size=24B cardinality=144.07K
+|     in pipelines: 04(GETNEXT)
+|
+52:EXCHANGE [HASH(cs_item_sk,cs_order_number)]
+|  mem-estimate=1016.76KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=29.46K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=13
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=29.46K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--F51:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=13 plan-id=14 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  51:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2002 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=8B cardinality=373
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=14
+|  hash predicates: cs_item_sk = i_item_sk
+|  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=70B cardinality=144.16K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F52:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.99MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=14 plan-id=15 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF010[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  50:EXCHANGE [BROADCAST]
+|  |  mem-estimate=119.54KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=42B cardinality=1.80K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category = 'Books'
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category = 'Books'
+|     parquet dictionary predicates: i_category = 'Books'
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=1 row-size=42B cardinality=1.80K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF010[bloom] -> cs_item_sk, RF008[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=0 row-size=28B cardinality=1.44M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q76.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q76.test
new file mode 100644
index 0000000..8b74ae2
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q76.test
@@ -0,0 +1,772 @@
+# TPCDS-Q76
+SELECT channel,
+       col_name,
+       d_year,
+       d_qoy,
+       i_category,
+       COUNT(*) sales_cnt,
+       SUM(ext_sales_price) sales_amt
+FROM
+  ( SELECT 'store' AS channel,
+           'ss_store_sk' col_name,
+                         d_year,
+                         d_qoy,
+                         i_category,
+                         ss_ext_sales_price ext_sales_price
+   FROM store_sales,
+        item,
+        date_dim
+   WHERE ss_store_sk IS NULL
+     AND ss_sold_date_sk=d_date_sk
+     AND ss_item_sk=i_item_sk
+   UNION ALL SELECT 'web' AS channel,
+                    'ws_ship_customer_sk' col_name,
+                                          d_year,
+                                          d_qoy,
+                                          i_category,
+                                          ws_ext_sales_price ext_sales_price
+   FROM web_sales,
+        item,
+        date_dim
+   WHERE ws_ship_customer_sk IS NULL
+     AND ws_sold_date_sk=d_date_sk
+     AND ws_item_sk=i_item_sk
+   UNION ALL SELECT 'catalog' AS channel,
+                    'cs_ship_addr_sk' col_name,
+                                      d_year,
+                                      d_qoy,
+                                      i_category,
+                                      cs_ext_sales_price ext_sales_price
+   FROM catalog_sales,
+        item,
+        date_dim
+   WHERE cs_ship_addr_sk IS NULL
+     AND cs_sold_date_sk=d_date_sk
+     AND cs_item_sk=i_item_sk) foo
+GROUP BY channel,
+         col_name,
+         d_year,
+         d_qoy,
+         i_category
+ORDER BY channel,
+         col_name,
+         d_year,
+         d_qoy,
+         i_category
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=33.69MB Threads=4
+Per-Host Resource Estimates: Memory=297MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=296.94MB mem-reservation=33.69MB thread-reservation=4 runtime-filters-memory=6.00MB
+PLAN-ROOT SINK
+|  output exprs: channel, col_name, d_year, d_qoy, i_category, count(*), sum(ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:TOP-N [LIMIT=100]
+|  order by: channel ASC, col_name ASC, d_year ASC, d_qoy ASC, i_category ASC
+|  mem-estimate=7.22KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=74B cardinality=100
+|  in pipelines: 17(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: count(*), sum(ext_sales_price)
+|  group by: channel, col_name, d_year, d_qoy, i_category
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=11 row-size=74B cardinality=137.37K
+|  in pipelines: 16(GETNEXT), 01(OPEN), 07(OPEN), 12(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=54B cardinality=137.37K
+|  in pipelines: 01(GETNEXT), 07(GETNEXT), 12(GETNEXT)
+|
+|--15:HASH JOIN [INNER JOIN]
+|  |  hash predicates: i_item_sk = cs_item_sk
+|  |  fk/pk conjuncts: i_item_sk = cs_item_sk
+|  |  runtime filters: RF008[bloom] <- cs_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=7,8,6 row-size=58B cardinality=7.17K
+|  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |
+|  |--14:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: d_date_sk = cs_sold_date_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  runtime filters: RF010[bloom] <- cs_sold_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=8,6 row-size=32B cardinality=7.17K
+|  |  |  in pipelines: 13(GETNEXT), 11(OPEN)
+|  |  |
+|  |  |--11:SCAN HDFS [tpcds_parquet.catalog_sales]
+|  |  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |  |     predicates: cs_ship_addr_sk IS NULL
+|  |  |     stored statistics:
+|  |  |       table: rows=1.44M size=96.62MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |  |     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |     tuple-ids=6 row-size=20B cardinality=7.17K
+|  |  |     in pipelines: 11(GETNEXT)
+|  |  |
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF010[bloom] -> d_date_sk
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=8 row-size=12B cardinality=73.05K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF008[bloom] -> i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=7 row-size=26B cardinality=18.00K
+|     in pipelines: 12(GETNEXT)
+|
+|--10:HASH JOIN [INNER JOIN]
+|  |  hash predicates: i_item_sk = ws_item_sk
+|  |  fk/pk conjuncts: i_item_sk = ws_item_sk
+|  |  runtime filters: RF004[bloom] <- ws_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5,3 row-size=58B cardinality=173
+|  |  in pipelines: 07(GETNEXT), 08(OPEN)
+|  |
+|  |--09:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: d_date_sk = ws_sold_date_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  runtime filters: RF006[bloom] <- ws_sold_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=5,3 row-size=32B cardinality=173
+|  |  |  in pipelines: 08(GETNEXT), 06(OPEN)
+|  |  |
+|  |  |--06:SCAN HDFS [tpcds_parquet.web_sales]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     predicates: ws_ship_customer_sk IS NULL
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |     tuple-ids=3 row-size=20B cardinality=173
+|  |  |     in pipelines: 06(GETNEXT)
+|  |  |
+|  |  08:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF006[bloom] -> d_date_sk
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=12B cardinality=73.05K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF004[bloom] -> i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=4 row-size=26B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=58B cardinality=130.03K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=46B cardinality=130.03K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=26B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_store_sk IS NULL
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=130.03K
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=44.44MB Threads=17
+Per-Host Resource Estimates: Memory=585MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=25.23KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: channel, col_name, d_year, d_qoy, i_category, count(*), sum(ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: channel ASC, col_name ASC, d_year ASC, d_qoy ASC, i_category ASC
+|  limit: 100
+|  mem-estimate=25.23KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=74B cardinality=100
+|  in pipelines: 17(GETNEXT)
+|
+F11:PLAN FRAGMENT [HASH(channel,col_name,d_year,d_qoy,i_category)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=13.46MB mem-reservation=1.94MB thread-reservation=1
+17:TOP-N [LIMIT=100]
+|  order by: channel ASC, col_name ASC, d_year ASC, d_qoy ASC, i_category ASC
+|  mem-estimate=7.22KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=74B cardinality=100
+|  in pipelines: 17(GETNEXT), 26(OPEN)
+|
+26:AGGREGATE [FINALIZE]
+|  output: count:merge(*), sum:merge(ext_sales_price)
+|  group by: channel, col_name, d_year, d_qoy, i_category
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11 row-size=74B cardinality=137.37K
+|  in pipelines: 26(GETNEXT), 01(OPEN), 07(OPEN), 12(OPEN)
+|
+25:EXCHANGE [HASH(channel,col_name,d_year,d_qoy,i_category)]
+|  mem-estimate=3.46MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11 row-size=74B cardinality=137.37K
+|  in pipelines: 01(GETNEXT), 07(GETNEXT), 12(GETNEXT)
+|
+F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=67.20MB mem-reservation=17.88MB thread-reservation=2 runtime-filters-memory=4.00MB
+16:AGGREGATE [STREAMING]
+|  output: count(*), sum(ext_sales_price)
+|  group by: channel, col_name, d_year, d_qoy, i_category
+|  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=11 row-size=74B cardinality=137.37K
+|  in pipelines: 01(GETNEXT), 07(GETNEXT), 12(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=54B cardinality=137.37K
+|  in pipelines: 01(GETNEXT), 07(GETNEXT), 12(GETNEXT)
+|
+|--15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: i_item_sk = cs_item_sk
+|  |  fk/pk conjuncts: i_item_sk = cs_item_sk
+|  |  runtime filters: RF008[bloom] <- cs_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=7,6,8 row-size=58B cardinality=7.17K
+|  |  in pipelines: 12(GETNEXT), 11(OPEN)
+|  |
+|  |--24:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=263.91KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6,8 row-size=32B cardinality=7.17K
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [HASH(cs_sold_date_sk)] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=3.90MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  14:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=6,8 row-size=32B cardinality=7.17K
+|  |  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |  |
+|  |  |--23:EXCHANGE [HASH(d_date_sk)]
+|  |  |  |  mem-estimate=872.04KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=8 row-size=12B cardinality=73.05K
+|  |  |  |  in pipelines: 13(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=8 row-size=12B cardinality=73.05K
+|  |  |     in pipelines: 13(GETNEXT)
+|  |  |
+|  |  22:EXCHANGE [HASH(cs_sold_date_sk)]
+|  |  |  mem-estimate=118.65KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=20B cardinality=7.17K
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=193.00MB mem-reservation=9.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  11:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     predicates: cs_ship_addr_sk IS NULL
+|  |     runtime filters: RF010[bloom] -> cs_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=20B cardinality=7.17K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF008[bloom] -> i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=7 row-size=26B cardinality=18.00K
+|     in pipelines: 12(GETNEXT)
+|
+|--10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: i_item_sk = ws_item_sk
+|  |  fk/pk conjuncts: i_item_sk = ws_item_sk
+|  |  runtime filters: RF004[bloom] <- ws_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5,3 row-size=58B cardinality=173
+|  |  in pipelines: 07(GETNEXT), 08(OPEN)
+|  |
+|  |--21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5,3 row-size=32B cardinality=173
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=50.95MB mem-reservation=3.44MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  09:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: d_date_sk = ws_sold_date_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  runtime filters: RF006[bloom] <- ws_sold_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=5,3 row-size=32B cardinality=173
+|  |  |  in pipelines: 08(GETNEXT), 06(OPEN)
+|  |  |
+|  |  |--20:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=3 row-size=20B cardinality=173
+|  |  |  |  in pipelines: 06(GETNEXT)
+|  |  |  |
+|  |  |  F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Host Resources: mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=2
+|  |  |  06:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     predicates: ws_ship_customer_sk IS NULL
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |     tuple-ids=3 row-size=20B cardinality=173
+|  |  |     in pipelines: 06(GETNEXT)
+|  |  |
+|  |  08:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF006[bloom] -> d_date_sk
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=12B cardinality=73.05K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF004[bloom] -> i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=4 row-size=26B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=58B cardinality=130.03K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=872.04KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=73.05K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=46B cardinality=130.03K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=485.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=26B cardinality=18.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=1 row-size=26B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_store_sk IS NULL
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=130.03K
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=66.94MB Threads=18
+Per-Host Resource Estimates: Memory=259MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=48.05KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: channel, col_name, d_year, d_qoy, i_category, count(*), sum(ext_sales_price)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: channel ASC, col_name ASC, d_year ASC, d_qoy ASC, i_category ASC
+|  limit: 100
+|  mem-estimate=48.05KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=74B cardinality=100
+|  in pipelines: 17(GETNEXT)
+|
+F11:PLAN FRAGMENT [HASH(channel,col_name,d_year,d_qoy,i_category)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=13.68MB mem-reservation=1.94MB thread-reservation=1
+17:TOP-N [LIMIT=100]
+|  order by: channel ASC, col_name ASC, d_year ASC, d_qoy ASC, i_category ASC
+|  mem-estimate=7.22KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=74B cardinality=100
+|  in pipelines: 17(GETNEXT), 26(OPEN)
+|
+26:AGGREGATE [FINALIZE]
+|  output: count:merge(*), sum:merge(ext_sales_price)
+|  group by: channel, col_name, d_year, d_qoy, i_category
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=11 row-size=74B cardinality=137.37K
+|  in pipelines: 26(GETNEXT), 01(OPEN), 07(OPEN), 12(OPEN)
+|
+25:EXCHANGE [HASH(channel,col_name,d_year,d_qoy,i_category)]
+|  mem-estimate=3.68MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=11 row-size=74B cardinality=137.37K
+|  in pipelines: 01(GETNEXT), 07(GETNEXT), 12(GETNEXT)
+|
+F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+16:AGGREGATE [STREAMING]
+|  output: count(*), sum(ext_sales_price)
+|  group by: channel, col_name, d_year, d_qoy, i_category
+|  mem-estimate=10.00MB mem-reservation=5.00MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=11 row-size=74B cardinality=137.37K
+|  in pipelines: 01(GETNEXT), 07(GETNEXT), 12(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=54B cardinality=137.37K
+|  in pipelines: 01(GETNEXT), 07(GETNEXT), 12(GETNEXT)
+|
+|--15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: i_item_sk = cs_item_sk
+|  |  fk/pk conjuncts: i_item_sk = cs_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=7,6,8 row-size=58B cardinality=7.17K
+|  |  in pipelines: 12(GETNEXT), 11(OPEN)
+|  |
+|  |--F17:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=5.13MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  |  build expressions: cs_item_sk
+|  |  |  runtime filters: RF008[bloom] <- cs_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  24:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=263.91KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6,8 row-size=32B cardinality=7.17K
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [HASH(cs_sold_date_sk)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=118.65KB mem-reservation=0B thread-reservation=1
+|  |  14:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash-table-id=05
+|  |  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=6,8 row-size=32B cardinality=7.17K
+|  |  |  in pipelines: 11(GETNEXT), 13(OPEN)
+|  |  |
+|  |  |--F18:PLAN FRAGMENT [HASH(cs_sold_date_sk)] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=3.79MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  23:EXCHANGE [HASH(d_date_sk)]
+|  |  |  |  mem-estimate=872.04KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=8 row-size=12B cardinality=73.05K
+|  |  |  |  in pipelines: 13(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=8 row-size=12B cardinality=73.05K
+|  |  |     in pipelines: 13(GETNEXT)
+|  |  |
+|  |  22:EXCHANGE [HASH(cs_sold_date_sk)]
+|  |  |  mem-estimate=118.65KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=20B cardinality=7.17K
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  11:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=3 size=96.62MB
+|  |     predicates: cs_ship_addr_sk IS NULL
+|  |     runtime filters: RF010[bloom] -> cs_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=1.44M size=96.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|  |     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=0
+|  |     tuple-ids=6 row-size=20B cardinality=7.17K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF008[bloom] -> i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=7 row-size=26B cardinality=18.00K
+|     in pipelines: 12(GETNEXT)
+|
+|--10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: i_item_sk = ws_item_sk
+|  |  fk/pk conjuncts: i_item_sk = ws_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5,3 row-size=58B cardinality=173
+|  |  in pipelines: 07(GETNEXT), 08(OPEN)
+|  |
+|  |--F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  |  build expressions: ws_item_sk
+|  |  |  runtime filters: RF004[bloom] <- ws_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5,3 row-size=32B cardinality=173
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  09:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=03
+|  |  |  hash predicates: d_date_sk = ws_sold_date_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=5,3 row-size=32B cardinality=173
+|  |  |  in pipelines: 08(GETNEXT), 06(OPEN)
+|  |  |
+|  |  |--F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  |  build expressions: ws_sold_date_sk
+|  |  |  |  runtime filters: RF006[bloom] <- ws_sold_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  20:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=3 row-size=20B cardinality=173
+|  |  |  |  in pipelines: 06(GETNEXT)
+|  |  |  |
+|  |  |  F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |  06:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     predicates: ws_ship_customer_sk IS NULL
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|  |  |     tuple-ids=3 row-size=20B cardinality=173
+|  |  |     in pipelines: 06(GETNEXT)
+|  |  |
+|  |  08:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF006[bloom] -> d_date_sk
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=5 row-size=12B cardinality=73.05K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF004[bloom] -> i_item_sk
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=4 row-size=26B cardinality=18.00K
+|     in pipelines: 07(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=58B cardinality=130.03K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--F13:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.73MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=872.04KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=73.05K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=12B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=46B cardinality=130.03K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F14:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.35MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=485.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=26B cardinality=18.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=1 row-size=26B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   predicates: ss_store_sk IS NULL
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=0 row-size=20B cardinality=130.03K
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q77.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q77.test
new file mode 100644
index 0000000..e17a94c
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q77.test
@@ -0,0 +1,1027 @@
+# TPCDS-Q77
+with ss as
+ (select s_store_sk,
+         sum(ss_ext_sales_price) as sales,
+         sum(ss_net_profit) as profit
+ from store_sales,
+      date_dim,
+      store
+ where ss_sold_date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  interval 30 days)
+       and ss_store_sk = s_store_sk
+ group by s_store_sk)
+ ,
+ sr as
+ (select s_store_sk,
+         sum(sr_return_amt) as `returns`,
+         sum(sr_net_loss) as profit_loss
+ from store_returns,
+      date_dim,
+      store
+ where sr_returned_date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  interval 30 days)
+       and sr_store_sk = s_store_sk
+ group by s_store_sk),
+ cs as
+ (select cs_call_center_sk,
+        sum(cs_ext_sales_price) as sales,
+        sum(cs_net_profit) as profit
+ from catalog_sales,
+      date_dim
+ where cs_sold_date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  interval 30 days)
+ group by cs_call_center_sk
+ ),
+ cr as
+ (select
+        sum(cr_return_amount) as `returns`,
+        sum(cr_net_loss) as profit_loss
+ from catalog_returns,
+      date_dim
+ where cr_returned_date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  interval 30 days)
+ ),
+ ws as
+ ( select wp_web_page_sk,
+        sum(ws_ext_sales_price) as sales,
+        sum(ws_net_profit) as profit
+ from web_sales,
+      date_dim,
+      web_page
+ where ws_sold_date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  interval 30 days)
+       and ws_web_page_sk = wp_web_page_sk
+ group by wp_web_page_sk),
+ wr as
+ (select wp_web_page_sk,
+        sum(wr_return_amt) as `returns`,
+        sum(wr_net_loss) as profit_loss
+ from web_returns,
+      date_dim,
+      web_page
+ where wr_returned_date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  interval 30 days)
+       and wr_web_page_sk = wp_web_page_sk
+ group by wp_web_page_sk)
+  select  channel
+        , id
+        , sum(sales) as sales
+        , sum(`returns`) as `returns`
+        , sum(profit) as profit
+ from
+ (select 'store channel' as channel
+        , ss.s_store_sk as id
+        , sales
+        , coalesce(`returns`, 0) as `returns`
+        , (profit - coalesce(profit_loss,0)) as profit
+ from   ss left join sr
+        on  ss.s_store_sk = sr.s_store_sk
+ union all
+ select 'catalog channel' as channel
+        , cs_call_center_sk as id
+        , sales
+        , `returns`
+        , (profit - profit_loss) as profit
+ from  cs
+       , cr
+ union all
+ select 'web channel' as channel
+        , ws.wp_web_page_sk as id
+        , sales
+        , coalesce(`returns`, 0) `returns`
+        , (profit - coalesce(profit_loss,0)) as profit
+ from   ws left join wr
+        on  ws.wp_web_page_sk = wr.wp_web_page_sk
+ ) x
+ group by rollup (channel, id)
+ order by channel
+         ,id
+         ,sales desc
+ limit 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=36.44MB Threads=7
+Per-Host Resource Estimates: Memory=372MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=371.88MB mem-reservation=36.44MB thread-reservation=7 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(32,30,31) WHEN 30 THEN channel WHEN 31 THEN channel WHEN 32 THEN NULL END, CASE valid_tid(32,30,31) WHEN 30 THEN id WHEN 31 THEN NULL WHEN 32 THEN NULL END, aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(sales) WHEN 31 THEN sum(sales) WHEN 32 THEN sum(sales) END), aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(`returns`) WHEN 31 THEN sum(`returns`) WHEN 32 THEN sum(`returns`) END), aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(profit) WHEN 31 THEN sum(profit) WHEN 32 THEN sum(profit) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+38:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(32,30,31) WHEN 30 THEN channel WHEN 31 THEN channel WHEN 32 THEN NULL END ASC, CASE valid_tid(32,30,31) WHEN 30 THEN id WHEN 31 THEN NULL WHEN 32 THEN NULL END ASC, aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(sales) WHEN 31 THEN sum(sales) WHEN 32 THEN sum(sales) END) DESC
+|  mem-estimate=5.12KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=34 row-size=64B cardinality=82
+|  in pipelines: 38(GETNEXT), 37(OPEN)
+|
+37:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(32,30,31) IN (CAST(30 AS INT), CAST(31 AS INT), CAST(32 AS INT)), CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN sum(sales) WHEN CAST(31 AS INT) THEN sum(sales) WHEN CAST(32 AS INT) THEN sum(sales) END), aggif(valid_tid(32,30,31) IN (CAST(30 AS INT), CAST(31 AS INT), CAST(32 AS INT)), CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN sum(`returns`) WHEN CAST(31 AS INT) THEN sum(`returns`) WHEN CAST(32 AS INT) THEN sum(`returns`) END), aggif(valid_tid(32,30,31) IN (CAST(30 AS INT), CAST(31 AS INT), CAST(32 AS INT)), CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN sum(profit) WHEN CAST(31 AS INT) THEN sum(profit) WHEN CAST(32 AS INT) THEN sum(profit) END)
+|  group by: CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN channel WHEN CAST(31 AS INT) THEN channel WHEN CAST(32 AS INT) THEN NULL END, CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN id WHEN CAST(31 AS INT) THEN NULL WHEN CAST(32 AS INT) THEN NULL END, CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN CAST(30 AS INT) WHEN CAST(31 AS INT) THEN CAST(31 AS INT) WHEN CAST(32 AS INT) THEN CAST(32 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=33 row-size=68B cardinality=82
+|  in pipelines: 37(GETNEXT), 36(OPEN)
+|
+36:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, id
+|  Class 1
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, NULL
+|  Class 2
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=5.81MB thread-reservation=0
+|  tuple-ids=30N,31N,32N row-size=192B cardinality=82
+|  in pipelines: 36(GETNEXT), 06(OPEN), 17(OPEN), 28(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=28 row-size=64B cardinality=78
+|  in pipelines: 06(GETNEXT), 17(GETNEXT), 28(GETNEXT)
+|
+|--35:HASH JOIN [LEFT OUTER JOIN]
+|  |  hash predicates: wp_web_page_sk = wp_web_page_sk
+|  |  fk/pk conjuncts: wp_web_page_sk = wp_web_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=21,26N row-size=72B cardinality=60
+|  |  in pipelines: 28(GETNEXT), 34(OPEN)
+|  |
+|  |--34:AGGREGATE [FINALIZE]
+|  |  |  output: sum(wr_return_amt), sum(wr_net_loss)
+|  |  |  group by: wp_web_page_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=26 row-size=36B cardinality=60
+|  |  |  in pipelines: 34(GETNEXT), 29(OPEN)
+|  |  |
+|  |  33:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: wr_web_page_sk = wp_web_page_sk
+|  |  |  fk/pk conjuncts: wr_web_page_sk = wp_web_page_sk
+|  |  |  runtime filters: RF016[bloom] <- wp_web_page_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=23,24,25 row-size=46B cardinality=71.76K
+|  |  |  in pipelines: 29(GETNEXT), 31(OPEN)
+|  |  |
+|  |  |--31:SCAN HDFS [tpcds_parquet.web_page]
+|  |  |     HDFS partitions=1/1 files=1 size=5.56KB
+|  |  |     stored statistics:
+|  |  |       table: rows=60 size=5.56KB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=60
+|  |  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |  |     tuple-ids=25 row-size=4B cardinality=60
+|  |  |     in pipelines: 31(GETNEXT)
+|  |  |
+|  |  32:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: wr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: wr_returned_date_sk = d_date_sk
+|  |  |  runtime filters: RF018[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=23,24 row-size=42B cardinality=71.76K
+|  |  |  in pipelines: 29(GETNEXT), 30(OPEN)
+|  |  |
+|  |  |--30:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=24 row-size=26B cardinality=7.30K
+|  |  |     in pipelines: 30(GETNEXT)
+|  |  |
+|  |  29:SCAN HDFS [tpcds_parquet.web_returns]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF016[bloom] -> wr_web_page_sk, RF018[bloom] -> wr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=64.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=23 row-size=16B cardinality=71.76K
+|  |     in pipelines: 29(GETNEXT)
+|  |
+|  28:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_ext_sales_price), sum(ws_net_profit)
+|  |  group by: wp_web_page_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=21 row-size=36B cardinality=60
+|  |  in pipelines: 28(GETNEXT), 23(OPEN)
+|  |
+|  27:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_web_page_sk = wp_web_page_sk
+|  |  fk/pk conjuncts: ws_web_page_sk = wp_web_page_sk
+|  |  runtime filters: RF012[bloom] <- wp_web_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,19,20 row-size=46B cardinality=719.38K
+|  |  in pipelines: 23(GETNEXT), 25(OPEN)
+|  |
+|  |--25:SCAN HDFS [tpcds_parquet.web_page]
+|  |     HDFS partitions=1/1 files=1 size=5.56KB
+|  |     stored statistics:
+|  |       table: rows=60 size=5.56KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=60
+|  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=4B cardinality=60
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,19 row-size=42B cardinality=719.38K
+|  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |
+|  |--24:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=19 row-size=26B cardinality=7.30K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF012[bloom] -> ws_web_page_sk, RF014[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=18 row-size=16B cardinality=719.38K
+|     in pipelines: 23(GETNEXT)
+|
+|--22:NESTED LOOP JOIN [CROSS JOIN]
+|  |  mem-estimate=32B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12,16 row-size=68B cardinality=6
+|  |  in pipelines: 17(GETNEXT), 21(OPEN)
+|  |
+|  |--21:AGGREGATE [FINALIZE]
+|  |  |  output: sum(cr_return_amount), sum(cr_net_loss)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=16 row-size=32B cardinality=1
+|  |  |  in pipelines: 21(GETNEXT), 18(OPEN)
+|  |  |
+|  |  20:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=14,15 row-size=38B cardinality=144.07K
+|  |  |  in pipelines: 18(GETNEXT), 19(OPEN)
+|  |  |
+|  |  |--19:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=15 row-size=26B cardinality=7.30K
+|  |  |     in pipelines: 19(GETNEXT)
+|  |  |
+|  |  18:SCAN HDFS [tpcds_parquet.catalog_returns]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     runtime filters: RF010[bloom] -> cr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=72.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=14 row-size=12B cardinality=144.07K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  17:AGGREGATE [FINALIZE]
+|  |  output: sum(cs_ext_sales_price), sum(cs_net_profit)
+|  |  group by: cs_call_center_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12 row-size=36B cardinality=6
+|  |  in pipelines: 17(GETNEXT), 14(OPEN)
+|  |
+|  16:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,11 row-size=42B cardinality=1.44M
+|  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |
+|  |--15:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=26B cardinality=7.30K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF008[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=10 row-size=16B cardinality=1.44M
+|     in pipelines: 14(GETNEXT)
+|
+13:HASH JOIN [LEFT OUTER JOIN]
+|  hash predicates: s_store_sk = s_store_sk
+|  fk/pk conjuncts: s_store_sk = s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,8N row-size=72B cardinality=12
+|  in pipelines: 06(GETNEXT), 12(OPEN)
+|
+|--12:AGGREGATE [FINALIZE]
+|  |  output: sum(sr_return_amt), sum(sr_net_loss)
+|  |  group by: s_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=36B cardinality=12
+|  |  in pipelines: 12(GETNEXT), 07(OPEN)
+|  |
+|  11:HASH JOIN [INNER JOIN]
+|  |  hash predicates: sr_store_sk = s_store_sk
+|  |  fk/pk conjuncts: sr_store_sk = s_store_sk
+|  |  runtime filters: RF004[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6,7 row-size=46B cardinality=287.51K
+|  |  in pipelines: 07(GETNEXT), 09(OPEN)
+|  |
+|  |--09:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=4B cardinality=12
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  10:HASH JOIN [INNER JOIN]
+|  |  hash predicates: sr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=42B cardinality=287.51K
+|  |  in pipelines: 07(GETNEXT), 08(OPEN)
+|  |
+|  |--08:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=26B cardinality=7.30K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.store_returns]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF004[bloom] -> sr_store_sk, RF006[bloom] -> sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=5 row-size=16B cardinality=287.51K
+|     in pipelines: 07(GETNEXT)
+|
+06:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price), sum(ss_net_profit)
+|  group by: s_store_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=36B cardinality=12
+|  in pipelines: 06(GETNEXT), 01(OPEN)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=46B cardinality=2.88M
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=4B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=42B cardinality=2.88M
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=89.98MB Threads=36
+Per-Host Resource Estimates: Memory=1.02GB
+F24:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=18.04KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(32,30,31) WHEN 30 THEN channel WHEN 31 THEN channel WHEN 32 THEN NULL END, CASE valid_tid(32,30,31) WHEN 30 THEN id WHEN 31 THEN NULL WHEN 32 THEN NULL END, aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(sales) WHEN 31 THEN sum(sales) WHEN 32 THEN sum(sales) END), aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(`returns`) WHEN 31 THEN sum(`returns`) WHEN 32 THEN sum(`returns`) END), aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(profit) WHEN 31 THEN sum(profit) WHEN 32 THEN sum(profit) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+64:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: CASE valid_tid(32,30,31) WHEN 30 THEN channel WHEN 31 THEN channel WHEN 32 THEN NULL END ASC, CASE valid_tid(32,30,31) WHEN 30 THEN id WHEN 31 THEN NULL WHEN 32 THEN NULL END ASC, aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(sales) WHEN 31 THEN sum(sales) WHEN 32 THEN sum(sales) END) DESC
+|  limit: 100
+|  mem-estimate=18.04KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=34 row-size=64B cardinality=82
+|  in pipelines: 38(GETNEXT)
+|
+F23:PLAN FRAGMENT [HASH(CASE valid_tid(32,30,31) WHEN 30 THEN murmur_hash(channel) WHEN 31 THEN murmur_hash(channel) WHEN 32 THEN murmur_hash(NULL) END,CASE valid_tid(32,30,31) WHEN 30 THEN murmur_hash(id) WHEN 31 THEN murmur_hash(NULL) WHEN 32 THEN murmur_hash(NULL) END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=40.00MB mem-reservation=7.75MB thread-reservation=1
+38:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(32,30,31) WHEN 30 THEN channel WHEN 31 THEN channel WHEN 32 THEN NULL END ASC, CASE valid_tid(32,30,31) WHEN 30 THEN id WHEN 31 THEN NULL WHEN 32 THEN NULL END ASC, aggif(valid_tid(32,30,31) IN (30, 31, 32), CASE valid_tid(32,30,31) WHEN 30 THEN sum(sales) WHEN 31 THEN sum(sales) WHEN 32 THEN sum(sales) END) DESC
+|  mem-estimate=5.12KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=34 row-size=64B cardinality=82
+|  in pipelines: 38(GETNEXT), 37(OPEN)
+|
+37:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(32,30,31) IN (CAST(30 AS INT), CAST(31 AS INT), CAST(32 AS INT)), CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN sum(sales) WHEN CAST(31 AS INT) THEN sum(sales) WHEN CAST(32 AS INT) THEN sum(sales) END), aggif(valid_tid(32,30,31) IN (CAST(30 AS INT), CAST(31 AS INT), CAST(32 AS INT)), CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN sum(`returns`) WHEN CAST(31 AS INT) THEN sum(`returns`) WHEN CAST(32 AS INT) THEN sum(`returns`) END), aggif(valid_tid(32,30,31) IN (CAST(30 AS INT), CAST(31 AS INT), CAST(32 AS INT)), CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN sum(profit) WHEN CAST(31 AS INT) THEN sum(profit) WHEN CAST(32 AS INT) THEN sum(profit) END)
+|  group by: CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN channel WHEN CAST(31 AS INT) THEN channel WHEN CAST(32 AS INT) THEN NULL END, CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN id WHEN CAST(31 AS INT) THEN NULL WHEN CAST(32 AS INT) THEN NULL END, CASE valid_tid(32,30,31) WHEN CAST(30 AS INT) THEN CAST(30 AS INT) WHEN CAST(31 AS INT) THEN CAST(31 AS INT) WHEN CAST(32 AS INT) THEN CAST(32 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=33 row-size=68B cardinality=82
+|  in pipelines: 37(GETNEXT), 63(OPEN)
+|
+63:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
+|    group by: channel, id
+|  Class 1
+|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
+|    group by: channel, NULL
+|  Class 2
+|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=5.81MB thread-reservation=0
+|  tuple-ids=30N,31N,32N row-size=192B cardinality=82
+|  in pipelines: 63(GETNEXT), 42(OPEN), 49(OPEN), 57(OPEN)
+|
+62:EXCHANGE [HASH(CASE valid_tid(32,30,31) WHEN 30 THEN murmur_hash(channel) WHEN 31 THEN murmur_hash(channel) WHEN 32 THEN murmur_hash(NULL) END,CASE valid_tid(32,30,31) WHEN 30 THEN murmur_hash(id) WHEN 31 THEN murmur_hash(NULL) WHEN 32 THEN murmur_hash(NULL) END)]
+|  mem-estimate=54.13KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=30N,31N,32N row-size=192B cardinality=82
+|  in pipelines: 42(GETNEXT), 49(GETNEXT), 57(GETNEXT)
+|
+F22:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=51.95MB mem-reservation=11.81MB thread-reservation=1
+36:AGGREGATE [STREAMING]
+|  Class 0
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, id
+|  Class 1
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, NULL
+|  Class 2
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=6.00MB thread-reservation=0
+|  tuple-ids=30N,31N,32N row-size=192B cardinality=82
+|  in pipelines: 42(GETNEXT), 49(GETNEXT), 57(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=28 row-size=64B cardinality=78
+|  in pipelines: 42(GETNEXT), 49(GETNEXT), 57(GETNEXT)
+|
+|--35:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  |  hash predicates: wp_web_page_sk = wp_web_page_sk
+|  |  fk/pk conjuncts: wp_web_page_sk = wp_web_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=21,26N row-size=72B cardinality=60
+|  |  in pipelines: 57(GETNEXT), 61(OPEN)
+|  |
+|  |--61:AGGREGATE [FINALIZE]
+|  |  |  output: sum:merge(wr_return_amt), sum:merge(wr_net_loss)
+|  |  |  group by: wp_web_page_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=26 row-size=36B cardinality=60
+|  |  |  in pipelines: 61(GETNEXT), 29(OPEN)
+|  |  |
+|  |  60:EXCHANGE [HASH(wp_web_page_sk)]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=26 row-size=36B cardinality=60
+|  |  |  in pipelines: 29(GETNEXT)
+|  |  |
+|  |  F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=80.10MB mem-reservation=8.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  34:AGGREGATE [STREAMING]
+|  |  |  output: sum(wr_return_amt), sum(wr_net_loss)
+|  |  |  group by: wp_web_page_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=26 row-size=36B cardinality=60
+|  |  |  in pipelines: 29(GETNEXT)
+|  |  |
+|  |  33:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: wr_web_page_sk = wp_web_page_sk
+|  |  |  fk/pk conjuncts: wr_web_page_sk = wp_web_page_sk
+|  |  |  runtime filters: RF016[bloom] <- wp_web_page_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=23,24,25 row-size=46B cardinality=71.76K
+|  |  |  in pipelines: 29(GETNEXT), 31(OPEN)
+|  |  |
+|  |  |--59:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=25 row-size=4B cardinality=60
+|  |  |  |  in pipelines: 31(GETNEXT)
+|  |  |  |
+|  |  |  F20:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=2
+|  |  |  31:SCAN HDFS [tpcds_parquet.web_page, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=5.56KB
+|  |  |     stored statistics:
+|  |  |       table: rows=60 size=5.56KB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=60
+|  |  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |  |     tuple-ids=25 row-size=4B cardinality=60
+|  |  |     in pipelines: 31(GETNEXT)
+|  |  |
+|  |  32:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: wr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: wr_returned_date_sk = d_date_sk
+|  |  |  runtime filters: RF018[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=23,24 row-size=42B cardinality=71.76K
+|  |  |  in pipelines: 29(GETNEXT), 30(OPEN)
+|  |  |
+|  |  |--58:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=24 row-size=26B cardinality=7.30K
+|  |  |  |  in pipelines: 30(GETNEXT)
+|  |  |  |
+|  |  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  |  30:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=24 row-size=26B cardinality=7.30K
+|  |  |     in pipelines: 30(GETNEXT)
+|  |  |
+|  |  29:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF016[bloom] -> wr_web_page_sk, RF018[bloom] -> wr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=64.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=23 row-size=16B cardinality=71.76K
+|  |     in pipelines: 29(GETNEXT)
+|  |
+|  57:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price), sum:merge(ws_net_profit)
+|  |  group by: wp_web_page_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=21 row-size=36B cardinality=60
+|  |  in pipelines: 57(GETNEXT), 23(OPEN)
+|  |
+|  56:EXCHANGE [HASH(wp_web_page_sk)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=21 row-size=36B cardinality=60
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=144.10MB mem-reservation=15.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  28:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price), sum(ws_net_profit)
+|  |  group by: wp_web_page_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=21 row-size=36B cardinality=60
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_web_page_sk = wp_web_page_sk
+|  |  fk/pk conjuncts: ws_web_page_sk = wp_web_page_sk
+|  |  runtime filters: RF012[bloom] <- wp_web_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,19,20 row-size=46B cardinality=719.38K
+|  |  in pipelines: 23(GETNEXT), 25(OPEN)
+|  |
+|  |--55:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20 row-size=4B cardinality=60
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=2
+|  |  25:SCAN HDFS [tpcds_parquet.web_page, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.56KB
+|  |     stored statistics:
+|  |       table: rows=60 size=5.56KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=60
+|  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=4B cardinality=60
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,19 row-size=42B cardinality=719.38K
+|  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |
+|  |--54:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 24(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  24:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=19 row-size=26B cardinality=7.30K
+|  |     in pipelines: 24(GETNEXT)
+|  |
+|  23:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF012[bloom] -> ws_web_page_sk, RF014[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=128.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=18 row-size=16B cardinality=719.38K
+|     in pipelines: 23(GETNEXT)
+|
+|--22:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  |  mem-estimate=32B mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12,16 row-size=68B cardinality=6
+|  |  in pipelines: 49(GETNEXT), 52(OPEN)
+|  |
+|  |--53:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=16 row-size=32B cardinality=1
+|  |  |  in pipelines: 52(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  |  52:AGGREGATE [FINALIZE]
+|  |  |  output: sum:merge(cr_return_amount), sum:merge(cr_net_loss)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=16 row-size=32B cardinality=1
+|  |  |  in pipelines: 52(GETNEXT), 21(OPEN)
+|  |  |
+|  |  51:EXCHANGE [UNPARTITIONED]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=16 row-size=32B cardinality=1
+|  |  |  in pipelines: 21(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=84.94MB mem-reservation=4.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  21:AGGREGATE
+|  |  |  output: sum(cr_return_amount), sum(cr_net_loss)
+|  |  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=16 row-size=32B cardinality=1
+|  |  |  in pipelines: 21(GETNEXT), 18(OPEN)
+|  |  |
+|  |  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: cr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=14,15 row-size=38B cardinality=144.07K
+|  |  |  in pipelines: 18(GETNEXT), 19(OPEN)
+|  |  |
+|  |  |--50:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=15 row-size=26B cardinality=7.30K
+|  |  |  |  in pipelines: 19(GETNEXT)
+|  |  |  |
+|  |  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  |  19:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=15 row-size=26B cardinality=7.30K
+|  |  |     in pipelines: 19(GETNEXT)
+|  |  |
+|  |  18:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     runtime filters: RF010[bloom] -> cr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=72.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=14 row-size=12B cardinality=144.07K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  49:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_ext_sales_price), sum:merge(cs_net_profit)
+|  |  group by: cs_call_center_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12 row-size=36B cardinality=6
+|  |  in pipelines: 49(GETNEXT), 14(OPEN)
+|  |
+|  48:EXCHANGE [HASH(cs_call_center_sk)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=36B cardinality=6
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=205.15MB mem-reservation=12.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  17:AGGREGATE [STREAMING]
+|  |  output: sum(cs_ext_sales_price), sum(cs_net_profit)
+|  |  group by: cs_call_center_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12 row-size=36B cardinality=6
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF008[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,11 row-size=42B cardinality=1.44M
+|  |  in pipelines: 14(GETNEXT), 15(OPEN)
+|  |
+|  |--47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  15:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=26B cardinality=7.30K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  14:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF008[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=192.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=10 row-size=16B cardinality=1.44M
+|     in pipelines: 14(GETNEXT)
+|
+13:HASH JOIN [LEFT OUTER JOIN, PARTITIONED]
+|  hash predicates: s_store_sk = s_store_sk
+|  fk/pk conjuncts: s_store_sk = s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,8N row-size=72B cardinality=12
+|  in pipelines: 42(GETNEXT), 46(OPEN)
+|
+|--46:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(sr_return_amt), sum:merge(sr_net_loss)
+|  |  group by: s_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=36B cardinality=12
+|  |  in pipelines: 46(GETNEXT), 07(OPEN)
+|  |
+|  45:EXCHANGE [HASH(s_store_sk)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=36B cardinality=12
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=112.10MB mem-reservation=11.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  12:AGGREGATE [STREAMING]
+|  |  output: sum(sr_return_amt), sum(sr_net_loss)
+|  |  group by: s_store_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=36B cardinality=12
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: sr_store_sk = s_store_sk
+|  |  fk/pk conjuncts: sr_store_sk = s_store_sk
+|  |  runtime filters: RF004[bloom] <- s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6,7 row-size=46B cardinality=287.51K
+|  |  in pipelines: 07(GETNEXT), 09(OPEN)
+|  |
+|  |--44:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=4B cardinality=12
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  09:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=4B cardinality=12
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: sr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: sr_returned_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=42B cardinality=287.51K
+|  |  in pipelines: 07(GETNEXT), 08(OPEN)
+|  |
+|  |--43:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  08:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=26B cardinality=7.30K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF004[bloom] -> sr_store_sk, RF006[bloom] -> sr_returned_date_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=5 row-size=16B cardinality=287.51K
+|     in pipelines: 07(GETNEXT)
+|
+42:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price), sum:merge(ss_net_profit)
+|  group by: s_store_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=36B cardinality=12
+|  in pipelines: 42(GETNEXT), 01(OPEN)
+|
+41:EXCHANGE [HASH(s_store_sk)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=36B cardinality=12
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=64.10MB mem-reservation=9.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+06:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price), sum(ss_net_profit)
+|  group by: s_store_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=36B cardinality=12
+|  in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=46B cardinality=2.88M
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--40:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=4B cardinality=12
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=4B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=42B cardinality=2.88M
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--39:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q78.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q78.test
new file mode 100644
index 0000000..198fb1b
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q78.test
@@ -0,0 +1,991 @@
+# TPCDS-Q78
+WITH ws AS
+  (SELECT d_year AS ws_sold_year,
+          ws_item_sk,
+          ws_bill_customer_sk ws_customer_sk,
+          sum(ws_quantity) ws_qty,
+          sum(ws_wholesale_cost) ws_wc,
+          sum(ws_sales_price) ws_sp
+   FROM web_sales
+   LEFT JOIN web_returns ON wr_order_number=ws_order_number
+   AND ws_item_sk=wr_item_sk
+   JOIN date_dim ON ws_sold_date_sk = d_date_sk
+   WHERE wr_order_number IS NULL
+   GROUP BY d_year,
+            ws_item_sk,
+            ws_bill_customer_sk ),
+     cs AS
+  (SELECT d_year AS cs_sold_year,
+          cs_item_sk,
+          cs_bill_customer_sk cs_customer_sk,
+          sum(cs_quantity) cs_qty,
+          sum(cs_wholesale_cost) cs_wc,
+          sum(cs_sales_price) cs_sp
+   FROM catalog_sales
+   LEFT JOIN catalog_returns ON cr_order_number=cs_order_number
+   AND cs_item_sk=cr_item_sk
+   JOIN date_dim ON cs_sold_date_sk = d_date_sk
+   WHERE cr_order_number IS NULL
+   GROUP BY d_year,
+            cs_item_sk,
+            cs_bill_customer_sk ),
+     ss AS
+  (SELECT d_year AS ss_sold_year,
+          ss_item_sk,
+          ss_customer_sk,
+          sum(ss_quantity) ss_qty,
+          sum(ss_wholesale_cost) ss_wc,
+          sum(ss_sales_price) ss_sp
+   FROM store_sales
+   LEFT JOIN store_returns ON sr_ticket_number=ss_ticket_number
+   AND ss_item_sk=sr_item_sk
+   JOIN date_dim ON ss_sold_date_sk = d_date_sk
+   WHERE sr_ticket_number IS NULL
+   GROUP BY d_year,
+            ss_item_sk,
+            ss_customer_sk )
+SELECT ss_sold_year,
+       ss_item_sk,
+       ss_customer_sk,
+       round((ss_qty*1.00)/(coalesce(ws_qty,0)+coalesce(cs_qty,0)),2) ratio,
+       ss_qty store_qty,
+       ss_wc store_wholesale_cost,
+       ss_sp store_sales_price,
+       coalesce(ws_qty,0)+coalesce(cs_qty,0) other_chan_qty,
+       coalesce(ws_wc,0)+coalesce(cs_wc,0) other_chan_wholesale_cost,
+       coalesce(ws_sp,0)+coalesce(cs_sp,0) other_chan_sales_price
+FROM ss
+LEFT JOIN ws ON (ws_sold_year=ss_sold_year
+                 AND ws_item_sk=ss_item_sk
+                 AND ws_customer_sk=ss_customer_sk)
+LEFT JOIN cs ON (cs_sold_year=ss_sold_year
+                 AND cs_item_sk=ss_item_sk
+                 AND cs_customer_sk=ss_customer_sk)
+WHERE (coalesce(ws_qty,0)>0
+       OR coalesce(cs_qty, 0)>0)
+  AND ss_sold_year=2000
+ORDER BY ss_sold_year,
+         ss_item_sk,
+         ss_customer_sk,
+         ss_qty DESC,
+         ss_wc DESC,
+         ss_sp DESC,
+         other_chan_qty,
+         other_chan_wholesale_cost,
+         other_chan_sales_price,
+         ratio
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=126.44MB Threads=10
+Per-Host Resource Estimates: Memory=911MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=910.94MB mem-reservation=126.44MB thread-reservation=10 runtime-filters-memory=9.00MB
+PLAN-ROOT SINK
+|  output exprs: ss_sold_year, ss_item_sk, ss_customer_sk, round((ss_qty * 1.00) / (coalesce(ws_qty, 0) + coalesce(cs_qty, 0)), 2), ss_qty, ss_wc, ss_sp, coalesce(ws_qty, 0) + coalesce(cs_qty, 0), coalesce(ws_wc, 0) + coalesce(cs_wc, 0), coalesce(ws_sp, 0) + coalesce(cs_sp, 0)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+20:TOP-N [LIMIT=100]
+|  order by: ss_sold_year ASC, ss_item_sk ASC, ss_customer_sk ASC, ss_qty DESC, ss_wc DESC, ss_sp DESC, coalesce(ws_qty, 0) + coalesce(cs_qty, 0) ASC, coalesce(ws_wc, 0) + coalesce(cs_wc, 0) ASC, coalesce(ws_sp, 0) + coalesce(cs_sp, 0) ASC, round((ss_qty * 1.00) / (coalesce(ws_qty, 0) + coalesce(cs_qty, 0)), 2) ASC
+|  materialized: coalesce(ws_qty, 0) + coalesce(cs_qty, 0), coalesce(ws_wc, 0) + coalesce(cs_wc, 0), coalesce(ws_sp, 0) + coalesce(cs_sp, 0), round((ss_qty * 1.00) / (coalesce(ws_qty, 0) + coalesce(cs_qty, 0)), 2)
+|  mem-estimate=10.94KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=112B cardinality=100
+|  in pipelines: 20(GETNEXT), 17(OPEN)
+|
+19:HASH JOIN [RIGHT OUTER JOIN]
+|  hash predicates: d_year = d_year, cs_bill_customer_sk = ss_customer_sk, cs_item_sk = ss_item_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = ss_customer_sk, cs_item_sk = ss_item_sk
+|  other predicates: (coalesce(sum(ws_quantity), CAST(0 AS BIGINT)) > CAST(0 AS BIGINT) OR coalesce(sum(cs_quantity), CAST(0 AS BIGINT)) > CAST(0 AS BIGINT))
+|  runtime filters: RF000[bloom] <- d_year, RF001[bloom] <- ss_customer_sk, RF002[bloom] <- ss_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13N,8N,3 row-size=168B cardinality=3.00K
+|  in pipelines: 17(GETNEXT), 11(OPEN)
+|
+|--18:HASH JOIN [RIGHT OUTER JOIN]
+|  |  hash predicates: d_year = d_year, ws_bill_customer_sk = ss_customer_sk, ws_item_sk = ss_item_sk
+|  |  fk/pk conjuncts: ws_bill_customer_sk = ss_customer_sk, ws_item_sk = ss_item_sk
+|  |  runtime filters: RF008[bloom] <- d_year, RF009[bloom] <- ss_customer_sk, RF010[bloom] <- ss_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8N,3 row-size=112B cardinality=3.00K
+|  |  in pipelines: 11(GETNEXT), 05(OPEN)
+|  |
+|  |--05:AGGREGATE [FINALIZE]
+|  |  |  output: sum(CAST(ss_quantity AS BIGINT)), sum(ss_wholesale_cost), sum(ss_sales_price)
+|  |  |  group by: d_year, ss_item_sk, ss_customer_sk
+|  |  |  having: d_year = CAST(2000 AS INT)
+|  |  |  mem-estimate=34.60MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  |  tuple-ids=3 row-size=56B cardinality=3.00K
+|  |  |  in pipelines: 05(GETNEXT), 00(OPEN)
+|  |  |
+|  |  04:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1N,2 row-size=60B cardinality=589.03K
+|  |  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |  |
+|  |  |--02:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=2 row-size=8B cardinality=373
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  03:HASH JOIN [LEFT OUTER JOIN]
+|  |  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  |  other predicates: sr_ticket_number IS NULL
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1N row-size=52B cardinality=2.88M
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--01:SCAN HDFS [tpcds_parquet.store_returns]
+|  |  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |  |     stored statistics:
+|  |  |       table: rows=287.51K size=15.43MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.store_sales]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF016[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=36B cardinality=2.88M
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  11:AGGREGATE [FINALIZE]
+|  |  output: sum(CAST(ws_quantity AS BIGINT)), sum(ws_wholesale_cost), sum(ws_sales_price)
+|  |  group by: d_year, ws_item_sk, ws_bill_customer_sk
+|  |  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=56B cardinality=148.00K
+|  |  in pipelines: 11(GETNEXT), 06(OPEN)
+|  |
+|  10:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6N,7 row-size=60B cardinality=148.00K
+|  |  in pipelines: 06(GETNEXT), 08(OPEN)
+|  |
+|  |--08:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |     runtime filters: RF008[bloom] -> tpcds_parquet.date_dim.d_year
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=8B cardinality=373
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  09:HASH JOIN [LEFT OUTER JOIN]
+|  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  other predicates: wr_order_number IS NULL
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=5,6N row-size=52B cardinality=719.38K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--07:SCAN HDFS [tpcds_parquet.web_returns]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF010[bloom] -> tpcds_parquet.web_returns.wr_item_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=16B cardinality=71.76K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF009[bloom] -> tpcds_parquet.web_sales.ws_bill_customer_sk, RF010[bloom] -> tpcds_parquet.web_sales.ws_item_sk, RF014[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=224.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=5 row-size=36B cardinality=719.38K
+|     in pipelines: 06(GETNEXT)
+|
+17:AGGREGATE [FINALIZE]
+|  output: sum(CAST(cs_quantity AS BIGINT)), sum(cs_wholesale_cost), sum(cs_sales_price)
+|  group by: d_year, cs_item_sk, cs_bill_customer_sk
+|  mem-estimate=17.31MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=13 row-size=56B cardinality=294.63K
+|  in pipelines: 17(GETNEXT), 12(OPEN)
+|
+16:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=10,11N,12 row-size=60B cardinality=294.63K
+|  in pipelines: 12(GETNEXT), 14(OPEN)
+|
+|--14:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_year
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=12 row-size=8B cardinality=373
+|     in pipelines: 14(GETNEXT)
+|
+15:HASH JOIN [LEFT OUTER JOIN]
+|  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  other predicates: cr_order_number IS NULL
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=10,11N row-size=52B cardinality=1.44M
+|  in pipelines: 12(GETNEXT), 13(OPEN)
+|
+|--13:SCAN HDFS [tpcds_parquet.catalog_returns]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.catalog_returns.cr_item_sk
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=11 row-size=16B cardinality=144.07K
+|     in pipelines: 13(GETNEXT)
+|
+12:SCAN HDFS [tpcds_parquet.catalog_sales]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF001[bloom] -> tpcds_parquet.catalog_sales.cs_bill_customer_sk, RF002[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF006[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=336.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=10 row-size=36B cardinality=1.44M
+   in pipelines: 12(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=152.56MB Threads=22
+Per-Host Resource Estimates: Memory=1.00GB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=37.63KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: ss_sold_year, ss_item_sk, ss_customer_sk, round((ss_qty * 1.00) / (coalesce(ws_qty, 0) + coalesce(cs_qty, 0)), 2), ss_qty, ss_wc, ss_sp, coalesce(ws_qty, 0) + coalesce(cs_qty, 0), coalesce(ws_wc, 0) + coalesce(cs_wc, 0), coalesce(ws_sp, 0) + coalesce(cs_sp, 0)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+35:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: ss_sold_year ASC, ss_item_sk ASC, ss_customer_sk ASC, ss_qty DESC, ss_wc DESC, ss_sp DESC, coalesce(ws_qty, 0) + coalesce(cs_qty, 0) ASC, coalesce(ws_wc, 0) + coalesce(cs_wc, 0) ASC, coalesce(ws_sp, 0) + coalesce(cs_sp, 0) ASC, round((ss_qty * 1.00) / (coalesce(ws_qty, 0) + coalesce(cs_qty, 0)), 2) ASC
+|  limit: 100
+|  mem-estimate=37.63KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=112B cardinality=100
+|  in pipelines: 20(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(d_year,cs_item_sk,cs_bill_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=20.82MB mem-reservation=13.44MB thread-reservation=1 runtime-filters-memory=3.00MB
+20:TOP-N [LIMIT=100]
+|  order by: ss_sold_year ASC, ss_item_sk ASC, ss_customer_sk ASC, ss_qty DESC, ss_wc DESC, ss_sp DESC, coalesce(ws_qty, 0) + coalesce(cs_qty, 0) ASC, coalesce(ws_wc, 0) + coalesce(cs_wc, 0) ASC, coalesce(ws_sp, 0) + coalesce(cs_sp, 0) ASC, round((ss_qty * 1.00) / (coalesce(ws_qty, 0) + coalesce(cs_qty, 0)), 2) ASC
+|  materialized: coalesce(ws_qty, 0) + coalesce(cs_qty, 0), coalesce(ws_wc, 0) + coalesce(cs_wc, 0), coalesce(ws_sp, 0) + coalesce(cs_sp, 0), round((ss_qty * 1.00) / (coalesce(ws_qty, 0) + coalesce(cs_qty, 0)), 2)
+|  mem-estimate=10.94KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=112B cardinality=100
+|  in pipelines: 20(GETNEXT), 24(OPEN)
+|
+19:HASH JOIN [RIGHT OUTER JOIN, PARTITIONED]
+|  hash predicates: d_year = d_year, cs_bill_customer_sk = ss_customer_sk, cs_item_sk = ss_item_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = ss_customer_sk, cs_item_sk = ss_item_sk
+|  other predicates: (coalesce(sum(ws_quantity), CAST(0 AS BIGINT)) > CAST(0 AS BIGINT) OR coalesce(sum(cs_quantity), CAST(0 AS BIGINT)) > CAST(0 AS BIGINT))
+|  runtime filters: RF000[bloom] <- d_year, RF001[bloom] <- ss_customer_sk, RF002[bloom] <- ss_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13N,8N,3 row-size=168B cardinality=3.00K
+|  in pipelines: 24(GETNEXT), 28(OPEN)
+|
+|--34:EXCHANGE [HASH(d_year,ss_item_sk,ss_customer_sk)]
+|  |  mem-estimate=469.56KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8N,3 row-size=112B cardinality=3.00K
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(d_year,ws_item_sk,ws_bill_customer_sk)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=19.24MB mem-reservation=9.69MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  18:HASH JOIN [RIGHT OUTER JOIN, PARTITIONED]
+|  |  hash predicates: d_year = d_year, ws_bill_customer_sk = ss_customer_sk, ws_item_sk = ss_item_sk
+|  |  fk/pk conjuncts: ws_bill_customer_sk = ss_customer_sk, ws_item_sk = ss_item_sk
+|  |  runtime filters: RF008[bloom] <- d_year, RF009[bloom] <- ss_customer_sk, RF010[bloom] <- ss_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8N,3 row-size=112B cardinality=3.00K
+|  |  in pipelines: 28(GETNEXT), 32(OPEN)
+|  |
+|  |--33:EXCHANGE [HASH(d_year,ss_item_sk,ss_customer_sk)]
+|  |  |  mem-estimate=234.78KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=56B cardinality=3.00K
+|  |  |  in pipelines: 32(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [HASH(d_year,ss_item_sk,ss_customer_sk)] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=27.48MB mem-reservation=17.00MB thread-reservation=1
+|  |  32:AGGREGATE [FINALIZE]
+|  |  |  output: sum:merge(ss_quantity), sum:merge(ss_wholesale_cost), sum:merge(ss_sales_price)
+|  |  |  group by: d_year, ss_item_sk, ss_customer_sk
+|  |  |  having: d_year = CAST(2000 AS INT)
+|  |  |  mem-estimate=17.30MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  |  tuple-ids=3 row-size=56B cardinality=3.00K
+|  |  |  in pipelines: 32(GETNEXT), 00(OPEN)
+|  |  |
+|  |  31:EXCHANGE [HASH(d_year,ss_item_sk,ss_customer_sk)]
+|  |  |  mem-estimate=10.18MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=56B cardinality=589.03K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Host Resources: mem-estimate=129.16MB mem-reservation=32.44MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  05:AGGREGATE [STREAMING]
+|  |  |  output: sum(CAST(ss_quantity AS BIGINT)), sum(ss_wholesale_cost), sum(ss_sales_price)
+|  |  |  group by: d_year, ss_item_sk, ss_customer_sk
+|  |  |  mem-estimate=17.30MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  |  tuple-ids=3 row-size=56B cardinality=589.03K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1N,2 row-size=60B cardinality=589.03K
+|  |  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |  |
+|  |  |--30:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 02(GETNEXT)
+|  |  |  |
+|  |  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=2 row-size=8B cardinality=373
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  03:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  |  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  |  other predicates: sr_ticket_number IS NULL
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1N row-size=52B cardinality=2.88M
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--29:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=2
+|  |  |  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |  |     stored statistics:
+|  |  |       table: rows=287.51K size=15.43MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |  |     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF016[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=36B cardinality=2.88M
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  28:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_quantity), sum:merge(ws_wholesale_cost), sum:merge(ws_sales_price)
+|  |  group by: d_year, ws_item_sk, ws_bill_customer_sk
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=56B cardinality=148.00K
+|  |  in pipelines: 28(GETNEXT), 06(OPEN)
+|  |
+|  27:EXCHANGE [HASH(d_year,ws_item_sk,ws_bill_customer_sk)]
+|  |  mem-estimate=4.07MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=56B cardinality=148.00K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=242.94MB mem-reservation=32.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  11:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(ws_quantity AS BIGINT)), sum(ws_wholesale_cost), sum(ws_sales_price)
+|  |  group by: d_year, ws_item_sk, ws_bill_customer_sk
+|  |  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=56B cardinality=148.00K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6N,7 row-size=60B cardinality=148.00K
+|  |  in pipelines: 06(GETNEXT), 08(OPEN)
+|  |
+|  |--26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=8B cardinality=373
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  08:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |     runtime filters: RF008[bloom] -> tpcds_parquet.date_dim.d_year
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=8B cardinality=373
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  09:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  other predicates: wr_order_number IS NULL
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=5,6N row-size=52B cardinality=719.38K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.11MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=16B cardinality=71.76K
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  07:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF010[bloom] -> tpcds_parquet.web_returns.wr_item_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=16B cardinality=71.76K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF009[bloom] -> tpcds_parquet.web_sales.ws_bill_customer_sk, RF010[bloom] -> tpcds_parquet.web_sales.ws_item_sk, RF014[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=224.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=5 row-size=36B cardinality=719.38K
+|     in pipelines: 06(GETNEXT)
+|
+24:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_quantity), sum:merge(cs_wholesale_cost), sum:merge(cs_sales_price)
+|  group by: d_year, cs_item_sk, cs_bill_customer_sk
+|  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=13 row-size=56B cardinality=294.63K
+|  in pipelines: 24(GETNEXT), 12(OPEN)
+|
+23:EXCHANGE [HASH(d_year,cs_item_sk,cs_bill_customer_sk)]
+|  mem-estimate=5.42MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=56B cardinality=294.63K
+|  in pipelines: 12(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=357.92MB mem-reservation=34.69MB thread-reservation=2 runtime-filters-memory=3.00MB
+17:AGGREGATE [STREAMING]
+|  output: sum(CAST(cs_quantity AS BIGINT)), sum(cs_wholesale_cost), sum(cs_sales_price)
+|  group by: d_year, cs_item_sk, cs_bill_customer_sk
+|  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=13 row-size=56B cardinality=294.63K
+|  in pipelines: 12(GETNEXT)
+|
+16:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=10,11N,12 row-size=60B cardinality=294.63K
+|  in pipelines: 12(GETNEXT), 14(OPEN)
+|
+|--22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=8B cardinality=373
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_year
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=12 row-size=8B cardinality=373
+|     in pipelines: 14(GETNEXT)
+|
+15:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  other predicates: cr_order_number IS NULL
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=10,11N row-size=52B cardinality=1.44M
+|  in pipelines: 12(GETNEXT), 13(OPEN)
+|
+|--21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=16B cardinality=144.07K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=49.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  13:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.catalog_returns.cr_item_sk
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=11 row-size=16B cardinality=144.07K
+|     in pipelines: 13(GETNEXT)
+|
+12:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF001[bloom] -> tpcds_parquet.catalog_sales.cs_bill_customer_sk, RF002[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF006[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=336.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=10 row-size=36B cardinality=1.44M
+   in pipelines: 12(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=194.38MB Threads=27
+Per-Host Resource Estimates: Memory=452MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=71.61KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: ss_sold_year, ss_item_sk, ss_customer_sk, round((ss_qty * 1.00) / (coalesce(ws_qty, 0) + coalesce(cs_qty, 0)), 2), ss_qty, ss_wc, ss_sp, coalesce(ws_qty, 0) + coalesce(cs_qty, 0), coalesce(ws_wc, 0) + coalesce(cs_wc, 0), coalesce(ws_sp, 0) + coalesce(cs_sp, 0)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+35:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: ss_sold_year ASC, ss_item_sk ASC, ss_customer_sk ASC, ss_qty DESC, ss_wc DESC, ss_sp DESC, coalesce(ws_qty, 0) + coalesce(cs_qty, 0) ASC, coalesce(ws_wc, 0) + coalesce(cs_wc, 0) ASC, coalesce(ws_sp, 0) + coalesce(cs_sp, 0) ASC, round((ss_qty * 1.00) / (coalesce(ws_qty, 0) + coalesce(cs_qty, 0)), 2) ASC
+|  limit: 100
+|  mem-estimate=71.61KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=112B cardinality=100
+|  in pipelines: 20(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(d_year,cs_item_sk,cs_bill_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=15.42MB mem-reservation=4.75MB thread-reservation=1
+20:TOP-N [LIMIT=100]
+|  order by: ss_sold_year ASC, ss_item_sk ASC, ss_customer_sk ASC, ss_qty DESC, ss_wc DESC, ss_sp DESC, coalesce(ws_qty, 0) + coalesce(cs_qty, 0) ASC, coalesce(ws_wc, 0) + coalesce(cs_wc, 0) ASC, coalesce(ws_sp, 0) + coalesce(cs_sp, 0) ASC, round((ss_qty * 1.00) / (coalesce(ws_qty, 0) + coalesce(cs_qty, 0)), 2) ASC
+|  materialized: coalesce(ws_qty, 0) + coalesce(cs_qty, 0), coalesce(ws_wc, 0) + coalesce(cs_wc, 0), coalesce(ws_sp, 0) + coalesce(cs_sp, 0), round((ss_qty * 1.00) / (coalesce(ws_qty, 0) + coalesce(cs_qty, 0)), 2)
+|  mem-estimate=10.94KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=112B cardinality=100
+|  in pipelines: 20(GETNEXT), 24(OPEN)
+|
+19:HASH JOIN [RIGHT OUTER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: d_year = d_year, cs_bill_customer_sk = ss_customer_sk, cs_item_sk = ss_item_sk
+|  fk/pk conjuncts: cs_bill_customer_sk = ss_customer_sk, cs_item_sk = ss_item_sk
+|  other predicates: (coalesce(sum(ws_quantity), CAST(0 AS BIGINT)) > CAST(0 AS BIGINT) OR coalesce(sum(cs_quantity), CAST(0 AS BIGINT)) > CAST(0 AS BIGINT))
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13N,8N,3 row-size=168B cardinality=3.00K
+|  in pipelines: 24(GETNEXT), 28(OPEN)
+|
+|--F13:PLAN FRAGMENT [HASH(d_year,cs_item_sk,cs_bill_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=5.75MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_year, ss_customer_sk, ss_item_sk
+|  |  runtime filters: RF000[bloom] <- d_year, RF001[bloom] <- ss_customer_sk, RF002[bloom] <- ss_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  34:EXCHANGE [HASH(d_year,ss_item_sk,ss_customer_sk)]
+|  |  mem-estimate=829.56KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8N,3 row-size=112B cardinality=3.00K
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(d_year,ws_item_sk,ws_bill_customer_sk)] hosts=3 instances=6
+|  Per-Instance Resources: mem-estimate=14.07MB mem-reservation=2.88MB thread-reservation=1
+|  18:HASH JOIN [RIGHT OUTER JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: d_year = d_year, ws_bill_customer_sk = ss_customer_sk, ws_item_sk = ss_item_sk
+|  |  fk/pk conjuncts: ws_bill_customer_sk = ss_customer_sk, ws_item_sk = ss_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8N,3 row-size=112B cardinality=3.00K
+|  |  in pipelines: 28(GETNEXT), 32(OPEN)
+|  |
+|  |--F14:PLAN FRAGMENT [HASH(d_year,ws_item_sk,ws_bill_customer_sk)] hosts=3 instances=6
+|  |  |  Per-Instance Resources: mem-estimate=5.34MB mem-reservation=4.94MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_year, ss_customer_sk, ss_item_sk
+|  |  |  runtime filters: RF008[bloom] <- d_year, RF009[bloom] <- ss_customer_sk, RF010[bloom] <- ss_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  33:EXCHANGE [HASH(d_year,ss_item_sk,ss_customer_sk)]
+|  |  |  mem-estimate=414.78KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=56B cardinality=3.00K
+|  |  |  in pipelines: 32(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [HASH(d_year,ss_item_sk,ss_customer_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=20.35MB mem-reservation=8.50MB thread-reservation=1
+|  |  32:AGGREGATE [FINALIZE]
+|  |  |  output: sum:merge(ss_quantity), sum:merge(ss_wholesale_cost), sum:merge(ss_sales_price)
+|  |  |  group by: d_year, ss_item_sk, ss_customer_sk
+|  |  |  having: d_year = CAST(2000 AS INT)
+|  |  |  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |  tuple-ids=3 row-size=56B cardinality=3.00K
+|  |  |  in pipelines: 32(GETNEXT), 00(OPEN)
+|  |  |
+|  |  31:EXCHANGE [HASH(d_year,ss_item_sk,ss_customer_sk)]
+|  |  |  mem-estimate=10.35MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=56B cardinality=589.03K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=13.00MB thread-reservation=1
+|  |  05:AGGREGATE [STREAMING]
+|  |  |  output: sum(CAST(ss_quantity AS BIGINT)), sum(ss_wholesale_cost), sum(ss_sales_price)
+|  |  |  group by: d_year, ss_item_sk, ss_customer_sk
+|  |  |  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  |  tuple-ids=3 row-size=56B cardinality=589.03K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: ss_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1N,2 row-size=60B cardinality=589.03K
+|  |  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |  |
+|  |  |--F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  runtime filters: RF016[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  30:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=2 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 02(GETNEXT)
+|  |  |  |
+|  |  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=2 row-size=8B cardinality=373
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  03:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  |  |  hash-table-id=03
+|  |  |  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  |  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  |  |  other predicates: sr_ticket_number IS NULL
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1N row-size=52B cardinality=2.88M
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--F16:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  |  Per-Instance Resources: mem-estimate=21.41MB mem-reservation=17.00MB thread-reservation=1
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=03 plan-id=04 cohort-id=03
+|  |  |  |  build expressions: sr_item_sk, sr_ticket_number
+|  |  |  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  |  |
+|  |  |  29:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=4.41MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=15.43MB
+|  |  |     stored statistics:
+|  |  |       table: rows=287.51K size=15.43MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|  |  |     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |     tuple-ids=1 row-size=16B cardinality=287.51K
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|  |     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|  |     runtime filters: RF016[bloom] -> ss_sold_date_sk
+|  |     stored statistics:
+|  |       table: rows=2.88M size=201.02MB
+|  |       partitions: 1824/1824 rows=2.88M
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|  |     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=0 row-size=36B cardinality=2.88M
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  28:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_quantity), sum:merge(ws_wholesale_cost), sum:merge(ws_sales_price)
+|  |  group by: d_year, ws_item_sk, ws_bill_customer_sk
+|  |  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=56B cardinality=148.00K
+|  |  in pipelines: 28(GETNEXT), 06(OPEN)
+|  |
+|  27:EXCHANGE [HASH(d_year,ws_item_sk,ws_bill_customer_sk)]
+|  |  mem-estimate=4.07MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=56B cardinality=148.00K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=42.00MB mem-reservation=25.00MB thread-reservation=1
+|  11:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(ws_quantity AS BIGINT)), sum(ws_wholesale_cost), sum(ws_sales_price)
+|  |  group by: d_year, ws_item_sk, ws_bill_customer_sk
+|  |  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=8 row-size=56B cardinality=148.00K
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6N,7 row-size=60B cardinality=148.00K
+|  |  in pipelines: 06(GETNEXT), 08(OPEN)
+|  |
+|  |--F17:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF014[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=8B cardinality=373
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  08:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |     runtime filters: RF008[bloom] -> tpcds_parquet.date_dim.d_year
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=7 row-size=8B cardinality=373
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  09:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  other predicates: wr_order_number IS NULL
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=5,6N row-size=52B cardinality=719.38K
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--F18:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=6.86MB mem-reservation=5.75MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: wr_item_sk, wr_order_number
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.11MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=16B cardinality=71.76K
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  07:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF010[bloom] -> tpcds_parquet.web_returns.wr_item_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=6 row-size=16B cardinality=71.76K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF009[bloom] -> tpcds_parquet.web_sales.ws_bill_customer_sk, RF010[bloom] -> tpcds_parquet.web_sales.ws_item_sk, RF014[bloom] -> ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=5 row-size=36B cardinality=719.38K
+|     in pipelines: 06(GETNEXT)
+|
+24:AGGREGATE [FINALIZE]
+|  output: sum:merge(cs_quantity), sum:merge(cs_wholesale_cost), sum:merge(cs_sales_price)
+|  group by: d_year, cs_item_sk, cs_bill_customer_sk
+|  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=13 row-size=56B cardinality=294.63K
+|  in pipelines: 24(GETNEXT), 12(OPEN)
+|
+23:EXCHANGE [HASH(d_year,cs_item_sk,cs_bill_customer_sk)]
+|  mem-estimate=5.42MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=13 row-size=56B cardinality=294.63K
+|  in pipelines: 12(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=58.00MB mem-reservation=25.00MB thread-reservation=1
+17:AGGREGATE [STREAMING]
+|  output: sum(CAST(cs_quantity AS BIGINT)), sum(cs_wholesale_cost), sum(cs_sales_price)
+|  group by: d_year, cs_item_sk, cs_bill_customer_sk
+|  mem-estimate=10.00MB mem-reservation=9.00MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=13 row-size=56B cardinality=294.63K
+|  in pipelines: 12(GETNEXT)
+|
+16:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=06
+|  hash predicates: cs_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=10,11N,12 row-size=60B cardinality=294.63K
+|  in pipelines: 12(GETNEXT), 14(OPEN)
+|
+|--F19:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=8B cardinality=373
+|  |  in pipelines: 14(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|     runtime filters: RF000[bloom] -> tpcds_parquet.date_dim.d_year
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|     parquet dictionary predicates: tpcds_parquet.date_dim.d_year = CAST(2000 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=12 row-size=8B cardinality=373
+|     in pipelines: 14(GETNEXT)
+|
+15:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash-table-id=07
+|  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  other predicates: cr_order_number IS NULL
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=10,11N row-size=52B cardinality=1.44M
+|  in pipelines: 12(GETNEXT), 13(OPEN)
+|
+|--F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=11.72MB mem-reservation=9.50MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=07 plan-id=08 cohort-id=01
+|  |  build expressions: cr_item_sk, cr_order_number
+|  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=2.22MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=11 row-size=16B cardinality=144.07K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=1
+|  13:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.catalog_returns.cr_item_sk
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=11 row-size=16B cardinality=144.07K
+|     in pipelines: 13(GETNEXT)
+|
+12:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF001[bloom] -> tpcds_parquet.catalog_sales.cs_bill_customer_sk, RF002[bloom] -> tpcds_parquet.catalog_sales.cs_item_sk, RF006[bloom] -> cs_sold_date_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=16.00MB thread-reservation=0
+   tuple-ids=10 row-size=36B cardinality=1.44M
+   in pipelines: 12(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q79.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q79.test
new file mode 100644
index 0000000..46a78cd
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q79.test
@@ -0,0 +1,533 @@
+# TPCDS-Q79
+select
+  c_last_name,
+  c_first_name,
+  substr(s_city, 1, 30),
+  ss_ticket_number,
+  amt,
+  profit
+from
+  (select
+    ss_ticket_number,
+    ss_customer_sk,
+    store.s_city,
+    sum(ss_coupon_amt) amt,
+    sum(ss_net_profit) profit
+  from
+    store_sales,
+    date_dim,
+    store,
+    household_demographics
+  where
+    store_sales.ss_sold_date_sk = date_dim.d_date_sk
+    and store_sales.ss_store_sk = store.s_store_sk
+    and store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+    and (household_demographics.hd_dep_count = 8
+      or household_demographics.hd_vehicle_count > 0)
+    and store.s_number_employees between 200 and 295
+    and d_date between '1999-01-01' and '1999-03-31'
+  group by
+    ss_ticket_number,
+    ss_customer_sk,
+    ss_addr_sk,
+    store.s_city
+  ) ms,
+  customer
+where
+  ss_customer_sk = c_customer_sk
+order by
+  c_last_name,
+  c_first_name,
+  substr(s_city, 1, 30),
+  profit
+limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=19.56MB Threads=6
+Per-Host Resource Estimates: Memory=298MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=297.81MB mem-reservation=19.56MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, substr(s_city, 1, 30), ss_ticket_number, amt, profit
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+10:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, c_first_name ASC, substr(s_city, 1, 30) ASC, profit ASC
+|  materialized: substr(s_city, 1, 30)
+|  mem-estimate=8.59KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=88B cardinality=100
+|  in pipelines: 10(GETNEXT), 08(OPEN)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: c_customer_sk = ss_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- ss_customer_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=6,4 row-size=106B cardinality=46.86K
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+|--07:AGGREGATE [FINALIZE]
+|  |  output: sum(ss_coupon_amt), sum(ss_net_profit)
+|  |  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, store.s_city
+|  |  mem-estimate=10.00MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=4 row-size=67B cardinality=46.86K
+|  |  in pipelines: 07(GETNEXT), 00(OPEN)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  |  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  |  runtime filters: RF002[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,2,1 row-size=101B cardinality=46.86K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--01:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|  |     parquet dictionary predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=26B cardinality=7.30K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  05:HASH JOIN [INNER JOIN]
+|  |  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  |  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  |  runtime filters: RF004[bloom] <- store.s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3,2 row-size=75B cardinality=46.86K
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_number_employees <= CAST(295 AS INT), store.s_number_employees >= CAST(200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_number_employees <= CAST(295 AS INT), store.s_number_employees >= CAST(200 AS INT)
+|  |     parquet dictionary predicates: store.s_number_employees <= CAST(295 AS INT), store.s_number_employees >= CAST(200 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=27B cardinality=1
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  runtime filters: RF006[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,3 row-size=48B cardinality=281.17K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: (household_demographics.hd_dep_count = CAST(8 AS INT) OR household_demographics.hd_vehicle_count > CAST(0 AS INT))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=12B cardinality=720
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF002[bloom] -> store_sales.ss_sold_date_sk, RF004[bloom] -> store_sales.ss_store_sk, RF006[bloom] -> store_sales.ss_hdemo_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=112.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=0 row-size=36B cardinality=2.88M
+|     in pipelines: 00(GETNEXT)
+|
+08:SCAN HDFS [tpcds_parquet.customer]
+   HDFS partitions=1/1 files=1 size=5.49MB
+   runtime filters: RF000[bloom] -> c_customer_sk
+   stored statistics:
+     table: rows=100.00K size=5.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=100.00K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=6 row-size=40B cardinality=100.00K
+   in pipelines: 08(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=27.52MB Threads=13
+Per-Host Resource Estimates: Memory=330MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=17.57KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, substr(s_city, 1, 30), ss_ticket_number, amt, profit
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_last_name ASC, c_first_name ASC, substr(s_city, 1, 30) ASC, profit ASC
+|  limit: 100
+|  mem-estimate=17.57KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=88B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=10.80MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+10:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, c_first_name ASC, substr(s_city, 1, 30) ASC, profit ASC
+|  materialized: substr(s_city, 1, 30)
+|  mem-estimate=8.59KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=88B cardinality=100
+|  in pipelines: 10(GETNEXT), 15(OPEN)
+|
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- c_customer_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=4,6 row-size=106B cardinality=46.86K
+|  in pipelines: 15(GETNEXT), 08(OPEN)
+|
+|--17:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=40B cardinality=100.00K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=2
+|  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=6 row-size=40B cardinality=100.00K
+|     in pipelines: 08(GETNEXT)
+|
+16:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=1.20MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=67B cardinality=46.86K
+|  in pipelines: 15(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,store.s_city)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=11.20MB mem-reservation=2.88MB thread-reservation=1
+15:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_coupon_amt), sum:merge(ss_net_profit)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, store.s_city
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=4 row-size=67B cardinality=46.86K
+|  in pipelines: 15(GETNEXT), 00(OPEN)
+|
+14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,store.s_city)]
+|  mem-estimate=1.20MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=67B cardinality=46.86K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=132.06MB mem-reservation=16.81MB thread-reservation=2 runtime-filters-memory=4.00MB
+07:AGGREGATE [STREAMING]
+|  output: sum(ss_coupon_amt), sum(ss_net_profit)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, store.s_city
+|  mem-estimate=10.00MB mem-reservation=3.00MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=4 row-size=67B cardinality=46.86K
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  runtime filters: RF002[bloom] <- date_dim.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1 row-size=101B cardinality=46.86K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     parquet dictionary predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=1 row-size=26B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  runtime filters: RF004[bloom] <- store.s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2 row-size=75B cardinality=46.86K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=27B cardinality=1
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_number_employees <= CAST(295 AS INT), store.s_number_employees >= CAST(200 AS INT)
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_number_employees <= CAST(295 AS INT), store.s_number_employees >= CAST(200 AS INT)
+|     parquet dictionary predicates: store.s_number_employees <= CAST(295 AS INT), store.s_number_employees >= CAST(200 AS INT)
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=2 row-size=27B cardinality=1
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  runtime filters: RF006[bloom] <- household_demographics.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=48B cardinality=281.17K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=720
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: (household_demographics.hd_dep_count = CAST(8 AS INT) OR household_demographics.hd_vehicle_count > CAST(0 AS INT))
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=3 row-size=12B cardinality=720
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF002[bloom] -> store_sales.ss_sold_date_sk, RF004[bloom] -> store_sales.ss_store_sk, RF006[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=112.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=42.34MB Threads=14
+Per-Host Resource Estimates: Memory=169MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=17.57KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_last_name, c_first_name, substr(s_city, 1, 30), ss_ticket_number, amt, profit
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_last_name ASC, c_first_name ASC, substr(s_city, 1, 30) ASC, profit ASC
+|  limit: 100
+|  mem-estimate=17.57KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=88B cardinality=100
+|  in pipelines: 10(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=1.41MB mem-reservation=0B thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: c_last_name ASC, c_first_name ASC, substr(s_city, 1, 30) ASC, profit ASC
+|  materialized: substr(s_city, 1, 30)
+|  mem-estimate=8.59KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=88B cardinality=100
+|  in pipelines: 10(GETNEXT), 15(OPEN)
+|
+09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: ss_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=4,6 row-size=106B cardinality=46.86K
+|  in pipelines: 15(GETNEXT), 08(OPEN)
+|
+|--F08:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=9.60MB mem-reservation=5.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF000[bloom] <- c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  17:EXCHANGE [HASH(c_customer_sk)]
+|  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=40B cardinality=100.00K
+|  |  in pipelines: 08(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=6 row-size=40B cardinality=100.00K
+|     in pipelines: 08(GETNEXT)
+|
+16:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=1.40MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=67B cardinality=46.86K
+|  in pipelines: 15(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,store.s_city)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=11.40MB mem-reservation=1.94MB thread-reservation=1
+15:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_coupon_amt), sum:merge(ss_net_profit)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, store.s_city
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=67B cardinality=46.86K
+|  in pipelines: 15(GETNEXT), 00(OPEN)
+|
+14:EXCHANGE [HASH(ss_ticket_number,ss_customer_sk,ss_addr_sk,store.s_city)]
+|  mem-estimate=1.40MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=67B cardinality=46.86K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  output: sum(ss_coupon_amt), sum(ss_net_profit)
+|  group by: ss_ticket_number, ss_customer_sk, ss_addr_sk, store.s_city
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=67B cardinality=46.86K
+|  in pipelines: 00(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2,1 row-size=101B cardinality=46.86K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.09MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: date_dim.d_date_sk
+|  |  runtime filters: RF002[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     parquet dictionary predicates: d_date <= '1999-03-31', d_date >= '1999-01-01'
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=1 row-size=26B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: store_sales.ss_store_sk = store.s_store_sk
+|  fk/pk conjuncts: store_sales.ss_store_sk = store.s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3,2 row-size=75B cardinality=46.86K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: store.s_store_sk
+|  |  runtime filters: RF004[bloom] <- store.s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=27B cardinality=1
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_number_employees <= CAST(295 AS INT), store.s_number_employees >= CAST(200 AS INT)
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_number_employees <= CAST(295 AS INT), store.s_number_employees >= CAST(200 AS INT)
+|     parquet dictionary predicates: store.s_number_employees <= CAST(295 AS INT), store.s_number_employees >= CAST(200 AS INT)
+|     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|     tuple-ids=2 row-size=27B cardinality=1
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: store_sales.ss_hdemo_sk = household_demographics.hd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,3 row-size=48B cardinality=281.17K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F11:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: household_demographics.hd_demo_sk
+|  |  runtime filters: RF006[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=12B cardinality=720
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: (household_demographics.hd_dep_count = CAST(8 AS INT) OR household_demographics.hd_vehicle_count > CAST(0 AS INT))
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=3 row-size=12B cardinality=720
+|     in pipelines: 03(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.store_sales.ss_customer_sk, RF002[bloom] -> store_sales.ss_sold_date_sk, RF004[bloom] -> store_sales.ss_store_sk, RF006[bloom] -> store_sales.ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q80.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q80.test
new file mode 100644
index 0000000..507b58e
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q80.test
@@ -0,0 +1,1052 @@
+# TPCDS-Q80
+with ssr as
+ (select  s_store_id as store_id,
+          sum(ss_ext_sales_price) as sales,
+          sum(coalesce(sr_return_amt, 0)) as `returns`,
+          sum(ss_net_profit - coalesce(sr_net_loss, 0)) as profit
+  from store_sales left outer join store_returns on
+         (ss_item_sk = sr_item_sk and ss_ticket_number = sr_ticket_number),
+     date_dim,
+     store,
+     item,
+     promotion
+ where ss_sold_date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  interval 30 days)
+       and ss_store_sk = s_store_sk
+       and ss_item_sk = i_item_sk
+       and i_current_price > 50
+       and ss_promo_sk = p_promo_sk
+       and p_channel_tv = 'N'
+ group by s_store_id)
+ ,
+ csr as
+ (select  cp_catalog_page_id as catalog_page_id,
+          sum(cs_ext_sales_price) as sales,
+          sum(coalesce(cr_return_amount, 0)) as `returns`,
+          sum(cs_net_profit - coalesce(cr_net_loss, 0)) as profit
+  from catalog_sales left outer join catalog_returns on
+         (cs_item_sk = cr_item_sk and cs_order_number = cr_order_number),
+     date_dim,
+     catalog_page,
+     item,
+     promotion
+ where cs_sold_date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  interval 30 days)
+        and cs_catalog_page_sk = cp_catalog_page_sk
+       and cs_item_sk = i_item_sk
+       and i_current_price > 50
+       and cs_promo_sk = p_promo_sk
+       and p_channel_tv = 'N'
+group by cp_catalog_page_id)
+ ,
+ wsr as
+ (select  web_site_id,
+          sum(ws_ext_sales_price) as sales,
+          sum(coalesce(wr_return_amt, 0)) as `returns`,
+          sum(ws_net_profit - coalesce(wr_net_loss, 0)) as profit
+  from web_sales left outer join web_returns on
+         (ws_item_sk = wr_item_sk and ws_order_number = wr_order_number),
+     date_dim,
+     web_site,
+     item,
+     promotion
+ where ws_sold_date_sk = d_date_sk
+       and d_date between cast('1998-08-04' as date)
+                  and (cast('1998-08-04' as date) +  interval 30 days)
+        and ws_web_site_sk = web_site_sk
+       and ws_item_sk = i_item_sk
+       and i_current_price > 50
+       and ws_promo_sk = p_promo_sk
+       and p_channel_tv = 'N'
+group by web_site_id)
+  select  channel
+        , id
+        , sum(sales) as sales
+        , sum(`returns`) as `returns`
+        , sum(profit) as profit
+ from
+ (select 'store channel' as channel
+        , 'store' || store_id as id
+        , sales
+        , `returns`
+        , profit
+ from   ssr
+ union all
+ select 'catalog channel' as channel
+        , 'catalog_page' || catalog_page_id as id
+        , sales
+        , `returns`
+        , profit
+ from  csr
+ union all
+ select 'web channel' as channel
+        , 'web_site' || web_site_id as id
+        , sales
+        , `returns`
+        , profit
+ from   wsr
+ ) x
+ group by rollup (channel, id)
+ order by channel
+         ,id
+ limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=52.66MB Threads=7
+Per-Host Resource Estimates: Memory=612MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=612.50MB mem-reservation=52.66MB thread-reservation=7 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(26,27,28) WHEN 26 THEN channel WHEN 27 THEN channel WHEN 28 THEN NULL END, CASE valid_tid(26,27,28) WHEN 26 THEN id WHEN 27 THEN NULL WHEN 28 THEN NULL END, aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(sales) WHEN 27 THEN sum(sales) WHEN 28 THEN sum(sales) END), aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(`returns`) WHEN 27 THEN sum(`returns`) WHEN 28 THEN sum(`returns`) END), aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(profit) WHEN 27 THEN sum(profit) WHEN 28 THEN sum(profit) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+39:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(26,27,28) WHEN 26 THEN channel WHEN 27 THEN channel WHEN 28 THEN NULL END ASC, CASE valid_tid(26,27,28) WHEN 26 THEN id WHEN 27 THEN NULL WHEN 28 THEN NULL END ASC
+|  mem-estimate=7.03KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=30 row-size=72B cardinality=100
+|  in pipelines: 39(GETNEXT), 38(OPEN)
+|
+38:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(26,27,28) IN (CAST(26 AS INT), CAST(27 AS INT), CAST(28 AS INT)), CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN sum(sales) WHEN CAST(27 AS INT) THEN sum(sales) WHEN CAST(28 AS INT) THEN sum(sales) END), aggif(valid_tid(26,27,28) IN (CAST(26 AS INT), CAST(27 AS INT), CAST(28 AS INT)), CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN sum(`returns`) WHEN CAST(27 AS INT) THEN sum(`returns`) WHEN CAST(28 AS INT) THEN sum(`returns`) END), aggif(valid_tid(26,27,28) IN (CAST(26 AS INT), CAST(27 AS INT), CAST(28 AS INT)), CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN sum(profit) WHEN CAST(27 AS INT) THEN sum(profit) WHEN CAST(28 AS INT) THEN sum(profit) END)
+|  group by: CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN channel WHEN CAST(27 AS INT) THEN channel WHEN CAST(28 AS INT) THEN NULL END, CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN id WHEN CAST(27 AS INT) THEN NULL WHEN CAST(28 AS INT) THEN NULL END, CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN CAST(26 AS INT) WHEN CAST(27 AS INT) THEN CAST(27 AS INT) WHEN CAST(28 AS INT) THEN CAST(28 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=29 row-size=76B cardinality=11.56K
+|  in pipelines: 38(GETNEXT), 37(OPEN)
+|
+37:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, id
+|  Class 1
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, NULL
+|  Class 2
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=8.62MB thread-reservation=0
+|  tuple-ids=26N,27N,28N row-size=216B cardinality=11.56K
+|  in pipelines: 37(GETNEXT), 12(OPEN), 24(OPEN), 36(OPEN)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=72B cardinality=11.56K
+|  in pipelines: 12(GETNEXT), 24(GETNEXT), 36(GETNEXT)
+|
+|--36:AGGREGATE [FINALIZE]
+|  |  output: sum(ws_ext_sales_price), sum(coalesce(wr_return_amt, CAST(0 AS DECIMAL(7,2)))), sum(ws_net_profit - coalesce(wr_net_loss, CAST(0 AS DECIMAL(7,2))))
+|  |  group by: web_site_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=76B cardinality=15
+|  |  in pipelines: 36(GETNEXT), 25(OPEN)
+|  |
+|  35:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_web_site_sk = web_site_sk
+|  |  fk/pk conjuncts: ws_web_site_sk = web_site_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N,20,21,18,19 row-size=147B cardinality=71.46K
+|  |  in pipelines: 25(GETNEXT), 28(OPEN)
+|  |
+|  |--28:SCAN HDFS [tpcds_parquet.web_site]
+|  |     HDFS partitions=1/1 files=1 size=11.91KB
+|  |     stored statistics:
+|  |       table: rows=30 size=11.91KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=30
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=32B cardinality=30
+|  |     in pipelines: 28(GETNEXT)
+|  |
+|  34:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N,20,21,18 row-size=115B cardinality=71.46K
+|  |  in pipelines: 25(GETNEXT), 27(OPEN)
+|  |
+|  |--27:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=18 row-size=26B cardinality=7.30K
+|  |     in pipelines: 27(GETNEXT)
+|  |
+|  33:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_promo_sk = p_promo_sk
+|  |  fk/pk conjuncts: ws_promo_sk = p_promo_sk
+|  |  runtime filters: RF020[bloom] <- p_promo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N,20,21 row-size=89B cardinality=71.46K
+|  |  in pipelines: 25(GETNEXT), 30(OPEN)
+|  |
+|  |--30:SCAN HDFS [tpcds_parquet.promotion]
+|  |     HDFS partitions=1/1 files=1 size=23.30KB
+|  |     predicates: p_channel_tv = 'N'
+|  |     stored statistics:
+|  |       table: rows=300 size=23.30KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=300
+|  |     parquet statistics predicates: p_channel_tv = 'N'
+|  |     parquet dictionary predicates: p_channel_tv = 'N'
+|  |     mem-estimate=32.00MB mem-reservation=32.00KB thread-reservation=1
+|  |     tuple-ids=21 row-size=17B cardinality=300
+|  |     in pipelines: 30(GETNEXT)
+|  |
+|  32:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  runtime filters: RF022[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N,20 row-size=72B cardinality=71.94K
+|  |  in pipelines: 25(GETNEXT), 29(OPEN)
+|  |
+|  |--29:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=12B cardinality=1.80K
+|  |     in pipelines: 29(GETNEXT)
+|  |
+|  31:HASH JOIN [LEFT OUTER JOIN]
+|  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16,17N row-size=60B cardinality=719.38K
+|  |  in pipelines: 25(GETNEXT), 26(OPEN)
+|  |
+|  |--26:SCAN HDFS [tpcds_parquet.web_returns]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF022[bloom] -> tpcds_parquet.web_returns.wr_item_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=17 row-size=24B cardinality=71.76K
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  25:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF022[bloom] -> ws_item_sk, RF020[bloom] -> ws_promo_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=224.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=16 row-size=36B cardinality=719.38K
+|     in pipelines: 25(GETNEXT)
+|
+|--24:AGGREGATE [FINALIZE]
+|  |  output: sum(cs_ext_sales_price), sum(coalesce(cr_return_amount, CAST(0 AS DECIMAL(7,2)))), sum(cs_net_profit - coalesce(cr_net_loss, CAST(0 AS DECIMAL(7,2))))
+|  |  group by: cp_catalog_page_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=76B cardinality=11.54K
+|  |  in pipelines: 24(GETNEXT), 13(OPEN)
+|  |
+|  23:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_catalog_page_sk = cp_catalog_page_sk
+|  |  fk/pk conjuncts: cs_catalog_page_sk = cp_catalog_page_sk
+|  |  runtime filters: RF008[bloom] <- cp_catalog_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N,12,13,10,11 row-size=147B cardinality=143.20K
+|  |  in pipelines: 13(GETNEXT), 16(OPEN)
+|  |
+|  |--16:SCAN HDFS [tpcds_parquet.catalog_page]
+|  |     HDFS partitions=1/1 files=1 size=739.17KB
+|  |     stored statistics:
+|  |       table: rows=11.72K size=739.17KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=11.72K
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=32B cardinality=11.72K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N,12,13,10 row-size=115B cardinality=143.20K
+|  |  in pipelines: 13(GETNEXT), 15(OPEN)
+|  |
+|  |--15:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=10 row-size=26B cardinality=7.30K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_promo_sk = p_promo_sk
+|  |  fk/pk conjuncts: cs_promo_sk = p_promo_sk
+|  |  runtime filters: RF012[bloom] <- p_promo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N,12,13 row-size=89B cardinality=143.20K
+|  |  in pipelines: 13(GETNEXT), 18(OPEN)
+|  |
+|  |--18:SCAN HDFS [tpcds_parquet.promotion]
+|  |     HDFS partitions=1/1 files=1 size=23.30KB
+|  |     predicates: p_channel_tv = 'N'
+|  |     stored statistics:
+|  |       table: rows=300 size=23.30KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=300
+|  |     parquet statistics predicates: p_channel_tv = 'N'
+|  |     parquet dictionary predicates: p_channel_tv = 'N'
+|  |     mem-estimate=32.00MB mem-reservation=32.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=17B cardinality=300
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N,12 row-size=72B cardinality=144.16K
+|  |  in pipelines: 13(GETNEXT), 17(OPEN)
+|  |
+|  |--17:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=12B cardinality=1.80K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  19:HASH JOIN [LEFT OUTER JOIN]
+|  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=8,9N row-size=60B cardinality=1.44M
+|  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |
+|  |--14:SCAN HDFS [tpcds_parquet.catalog_returns]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     runtime filters: RF014[bloom] -> tpcds_parquet.catalog_returns.cr_item_sk
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=9 row-size=24B cardinality=144.07K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF014[bloom] -> cs_item_sk, RF012[bloom] -> cs_promo_sk, RF008[bloom] -> cs_catalog_page_sk, RF010[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=336.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=8 row-size=36B cardinality=1.44M
+|     in pipelines: 13(GETNEXT)
+|
+12:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price), sum(coalesce(sr_return_amt, CAST(0 AS DECIMAL(7,2)))), sum(ss_net_profit - coalesce(sr_net_loss, CAST(0 AS DECIMAL(7,2))))
+|  group by: s_store_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=76B cardinality=6
+|  in pipelines: 12(GETNEXT), 01(OPEN)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,4,5,2,3 row-size=147B cardinality=286.13K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=32B cardinality=12
+|     in pipelines: 04(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,4,5,2 row-size=115B cardinality=286.13K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 03(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  runtime filters: RF004[bloom] <- p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,4,5 row-size=89B cardinality=286.13K
+|  in pipelines: 01(GETNEXT), 06(OPEN)
+|
+|--06:SCAN HDFS [tpcds_parquet.promotion]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: p_channel_tv = 'N'
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     parquet statistics predicates: p_channel_tv = 'N'
+|     parquet dictionary predicates: p_channel_tv = 'N'
+|     mem-estimate=32.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=5 row-size=17B cardinality=300
+|     in pipelines: 06(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF006[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,4 row-size=72B cardinality=288.04K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--05:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|     parquet dictionary predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=4 row-size=12B cardinality=1.80K
+|     in pipelines: 05(GETNEXT)
+|
+07:HASH JOIN [LEFT OUTER JOIN]
+|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,1N row-size=60B cardinality=2.88M
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.store_returns]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF006[bloom] -> tpcds_parquet.store_returns.sr_item_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=1 row-size=24B cardinality=287.51K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_item_sk, RF004[bloom] -> ss_promo_sk, RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=130.12MB Threads=39
+Per-Host Resource Estimates: Memory=1.44GB
+F23:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=24.61KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CASE valid_tid(26,27,28) WHEN 26 THEN channel WHEN 27 THEN channel WHEN 28 THEN NULL END, CASE valid_tid(26,27,28) WHEN 26 THEN id WHEN 27 THEN NULL WHEN 28 THEN NULL END, aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(sales) WHEN 27 THEN sum(sales) WHEN 28 THEN sum(sales) END), aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(`returns`) WHEN 27 THEN sum(`returns`) WHEN 28 THEN sum(`returns`) END), aggif(valid_tid(26,27,28) IN (26, 27, 28), CASE valid_tid(26,27,28) WHEN 26 THEN sum(profit) WHEN 27 THEN sum(profit) WHEN 28 THEN sum(profit) END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+63:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: CASE valid_tid(26,27,28) WHEN 26 THEN channel WHEN 27 THEN channel WHEN 28 THEN NULL END ASC, CASE valid_tid(26,27,28) WHEN 26 THEN id WHEN 27 THEN NULL WHEN 28 THEN NULL END ASC
+|  limit: 100
+|  mem-estimate=24.61KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=30 row-size=72B cardinality=100
+|  in pipelines: 39(GETNEXT)
+|
+F22:PLAN FRAGMENT [HASH(CASE valid_tid(26,27,28) WHEN 26 THEN murmur_hash(channel) WHEN 27 THEN murmur_hash(channel) WHEN 28 THEN murmur_hash(NULL) END,CASE valid_tid(26,27,28) WHEN 26 THEN murmur_hash(id) WHEN 27 THEN murmur_hash(NULL) WHEN 28 THEN murmur_hash(NULL) END)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=40.00MB mem-reservation=8.69MB thread-reservation=1
+39:TOP-N [LIMIT=100]
+|  order by: CASE valid_tid(26,27,28) WHEN 26 THEN channel WHEN 27 THEN channel WHEN 28 THEN NULL END ASC, CASE valid_tid(26,27,28) WHEN 26 THEN id WHEN 27 THEN NULL WHEN 28 THEN NULL END ASC
+|  mem-estimate=7.03KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=30 row-size=72B cardinality=100
+|  in pipelines: 39(GETNEXT), 38(OPEN)
+|
+38:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(26,27,28) IN (CAST(26 AS INT), CAST(27 AS INT), CAST(28 AS INT)), CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN sum(sales) WHEN CAST(27 AS INT) THEN sum(sales) WHEN CAST(28 AS INT) THEN sum(sales) END), aggif(valid_tid(26,27,28) IN (CAST(26 AS INT), CAST(27 AS INT), CAST(28 AS INT)), CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN sum(`returns`) WHEN CAST(27 AS INT) THEN sum(`returns`) WHEN CAST(28 AS INT) THEN sum(`returns`) END), aggif(valid_tid(26,27,28) IN (CAST(26 AS INT), CAST(27 AS INT), CAST(28 AS INT)), CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN sum(profit) WHEN CAST(27 AS INT) THEN sum(profit) WHEN CAST(28 AS INT) THEN sum(profit) END)
+|  group by: CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN channel WHEN CAST(27 AS INT) THEN channel WHEN CAST(28 AS INT) THEN NULL END, CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN id WHEN CAST(27 AS INT) THEN NULL WHEN CAST(28 AS INT) THEN NULL END, CASE valid_tid(26,27,28) WHEN CAST(26 AS INT) THEN CAST(26 AS INT) WHEN CAST(27 AS INT) THEN CAST(27 AS INT) WHEN CAST(28 AS INT) THEN CAST(28 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=29 row-size=76B cardinality=11.56K
+|  in pipelines: 38(GETNEXT), 62(OPEN)
+|
+62:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
+|    group by: channel, id
+|  Class 1
+|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
+|    group by: channel, NULL
+|  Class 2
+|    output: sum:merge(sales), sum:merge(`returns`), sum:merge(profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=6.75MB thread-reservation=0
+|  tuple-ids=26N,27N,28N row-size=216B cardinality=11.56K
+|  in pipelines: 62(GETNEXT), 46(OPEN), 53(OPEN), 60(OPEN)
+|
+61:EXCHANGE [HASH(CASE valid_tid(26,27,28) WHEN 26 THEN murmur_hash(channel) WHEN 27 THEN murmur_hash(channel) WHEN 28 THEN murmur_hash(NULL) END,CASE valid_tid(26,27,28) WHEN 26 THEN murmur_hash(id) WHEN 27 THEN murmur_hash(NULL) WHEN 28 THEN murmur_hash(NULL) END)]
+|  mem-estimate=1.46MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=26N,27N,28N row-size=216B cardinality=11.56K
+|  in pipelines: 46(GETNEXT), 53(GETNEXT), 60(GETNEXT)
+|
+F21:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=40.51MB mem-reservation=8.94MB thread-reservation=1
+37:AGGREGATE [STREAMING]
+|  Class 0
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, id
+|  Class 1
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: channel, NULL
+|  Class 2
+|    output: sum(sales), sum(returns), sum(profit)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=7.00MB thread-reservation=0
+|  tuple-ids=26N,27N,28N row-size=216B cardinality=11.56K
+|  in pipelines: 46(GETNEXT), 53(GETNEXT), 60(GETNEXT)
+|
+00:UNION
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=24 row-size=72B cardinality=11.56K
+|  in pipelines: 46(GETNEXT), 53(GETNEXT), 60(GETNEXT)
+|
+|--60:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(ws_ext_sales_price), sum:merge(coalesce(wr_return_amt, 0)), sum:merge(ws_net_profit - coalesce(wr_net_loss, 0))
+|  |  group by: web_site_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=76B cardinality=15
+|  |  in pipelines: 60(GETNEXT), 25(OPEN)
+|  |
+|  59:EXCHANGE [HASH(web_site_id)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=22 row-size=76B cardinality=15
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=248.57MB mem-reservation=30.62MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  36:AGGREGATE [STREAMING]
+|  |  output: sum(ws_ext_sales_price), sum(coalesce(wr_return_amt, CAST(0 AS DECIMAL(7,2)))), sum(ws_net_profit - coalesce(wr_net_loss, CAST(0 AS DECIMAL(7,2))))
+|  |  group by: web_site_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=22 row-size=76B cardinality=15
+|  |  in pipelines: 25(GETNEXT)
+|  |
+|  35:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_web_site_sk = web_site_sk
+|  |  fk/pk conjuncts: ws_web_site_sk = web_site_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N,20,21,18,19 row-size=147B cardinality=71.46K
+|  |  in pipelines: 25(GETNEXT), 28(OPEN)
+|  |
+|  |--58:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=32B cardinality=30
+|  |  |  in pipelines: 28(GETNEXT)
+|  |  |
+|  |  F19:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  28:SCAN HDFS [tpcds_parquet.web_site, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=11.91KB
+|  |     stored statistics:
+|  |       table: rows=30 size=11.91KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=30
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=32B cardinality=30
+|  |     in pipelines: 28(GETNEXT)
+|  |
+|  34:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N,20,21,18 row-size=115B cardinality=71.46K
+|  |  in pipelines: 25(GETNEXT), 27(OPEN)
+|  |
+|  |--57:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 27(GETNEXT)
+|  |  |
+|  |  F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  27:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=18 row-size=26B cardinality=7.30K
+|  |     in pipelines: 27(GETNEXT)
+|  |
+|  33:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_promo_sk = p_promo_sk
+|  |  fk/pk conjuncts: ws_promo_sk = p_promo_sk
+|  |  runtime filters: RF020[bloom] <- p_promo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N,20,21 row-size=89B cardinality=71.46K
+|  |  in pipelines: 25(GETNEXT), 30(OPEN)
+|  |
+|  |--56:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21 row-size=17B cardinality=300
+|  |  |  in pipelines: 30(GETNEXT)
+|  |  |
+|  |  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=32.00KB thread-reservation=2
+|  |  30:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=23.30KB
+|  |     predicates: p_channel_tv = 'N'
+|  |     stored statistics:
+|  |       table: rows=300 size=23.30KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=300
+|  |     parquet statistics predicates: p_channel_tv = 'N'
+|  |     parquet dictionary predicates: p_channel_tv = 'N'
+|  |     mem-estimate=32.00MB mem-reservation=32.00KB thread-reservation=1
+|  |     tuple-ids=21 row-size=17B cardinality=300
+|  |     in pipelines: 30(GETNEXT)
+|  |
+|  32:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  runtime filters: RF022[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16,17N,20 row-size=72B cardinality=71.94K
+|  |  in pipelines: 25(GETNEXT), 29(OPEN)
+|  |
+|  |--55:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=37.09KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20 row-size=12B cardinality=1.80K
+|  |  |  in pipelines: 29(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  29:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=12B cardinality=1.80K
+|  |     in pipelines: 29(GETNEXT)
+|  |
+|  31:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=16,17N row-size=60B cardinality=719.38K
+|  |  in pipelines: 25(GETNEXT), 26(OPEN)
+|  |
+|  |--54:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.67MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=17 row-size=24B cardinality=71.76K
+|  |  |  in pipelines: 26(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=65.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  26:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     runtime filters: RF022[bloom] -> tpcds_parquet.web_returns.wr_item_sk
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=17 row-size=24B cardinality=71.76K
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  25:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF022[bloom] -> ws_item_sk, RF020[bloom] -> ws_promo_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=224.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=16 row-size=36B cardinality=719.38K
+|     in pipelines: 25(GETNEXT)
+|
+|--53:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cs_ext_sales_price), sum:merge(coalesce(cr_return_amount, 0)), sum:merge(cs_net_profit - coalesce(cr_net_loss, 0))
+|  |  group by: cp_catalog_page_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=76B cardinality=11.54K
+|  |  in pipelines: 53(GETNEXT), 13(OPEN)
+|  |
+|  52:EXCHANGE [HASH(cp_catalog_page_id)]
+|  |  mem-estimate=525.47KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=14 row-size=76B cardinality=11.54K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=366.48MB mem-reservation=34.50MB thread-reservation=2 runtime-filters-memory=4.00MB
+|  24:AGGREGATE [STREAMING]
+|  |  output: sum(cs_ext_sales_price), sum(coalesce(cr_return_amount, CAST(0 AS DECIMAL(7,2)))), sum(cs_net_profit - coalesce(cr_net_loss, CAST(0 AS DECIMAL(7,2))))
+|  |  group by: cp_catalog_page_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=14 row-size=76B cardinality=11.54K
+|  |  in pipelines: 13(GETNEXT)
+|  |
+|  23:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_catalog_page_sk = cp_catalog_page_sk
+|  |  fk/pk conjuncts: cs_catalog_page_sk = cp_catalog_page_sk
+|  |  runtime filters: RF008[bloom] <- cp_catalog_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N,12,13,10,11 row-size=147B cardinality=143.20K
+|  |  in pipelines: 13(GETNEXT), 16(OPEN)
+|  |
+|  |--51:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=402.19KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=32B cardinality=11.72K
+|  |  |  in pipelines: 16(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  16:SCAN HDFS [tpcds_parquet.catalog_page, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=739.17KB
+|  |     stored statistics:
+|  |       table: rows=11.72K size=739.17KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=11.72K
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=11 row-size=32B cardinality=11.72K
+|  |     in pipelines: 16(GETNEXT)
+|  |
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N,12,13,10 row-size=115B cardinality=143.20K
+|  |  in pipelines: 13(GETNEXT), 15(OPEN)
+|  |
+|  |--50:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 15(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  15:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=10 row-size=26B cardinality=7.30K
+|  |     in pipelines: 15(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_promo_sk = p_promo_sk
+|  |  fk/pk conjuncts: cs_promo_sk = p_promo_sk
+|  |  runtime filters: RF012[bloom] <- p_promo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N,12,13 row-size=89B cardinality=143.20K
+|  |  in pipelines: 13(GETNEXT), 18(OPEN)
+|  |
+|  |--49:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=17B cardinality=300
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=32.00KB thread-reservation=2
+|  |  18:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=23.30KB
+|  |     predicates: p_channel_tv = 'N'
+|  |     stored statistics:
+|  |       table: rows=300 size=23.30KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=300
+|  |     parquet statistics predicates: p_channel_tv = 'N'
+|  |     parquet dictionary predicates: p_channel_tv = 'N'
+|  |     mem-estimate=32.00MB mem-reservation=32.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=17B cardinality=300
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cs_item_sk = i_item_sk
+|  |  runtime filters: RF014[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=8,9N,12 row-size=72B cardinality=144.16K
+|  |  in pipelines: 13(GETNEXT), 17(OPEN)
+|  |
+|  |--48:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=37.09KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=12B cardinality=1.80K
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  17:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=12 row-size=12B cardinality=1.80K
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  19:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  |  hash predicates: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  fk/pk conjuncts: cs_item_sk = cr_item_sk, cs_order_number = cr_order_number
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=8,9N row-size=60B cardinality=1.44M
+|  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |
+|  |--47:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=3.32MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=24B cardinality=144.07K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=97.00MB mem-reservation=5.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  14:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     runtime filters: RF014[bloom] -> tpcds_parquet.catalog_returns.cr_item_sk
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=9 row-size=24B cardinality=144.07K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  13:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF014[bloom] -> cs_item_sk, RF012[bloom] -> cs_promo_sk, RF008[bloom] -> cs_catalog_page_sk, RF010[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=336.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=8 row-size=36B cardinality=1.44M
+|     in pipelines: 13(GETNEXT)
+|
+46:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price), sum:merge(coalesce(sr_return_amt, 0)), sum:merge(ss_net_profit - coalesce(sr_net_loss, 0))
+|  group by: s_store_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=76B cardinality=6
+|  in pipelines: 46(GETNEXT), 01(OPEN)
+|
+45:EXCHANGE [HASH(s_store_id)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=76B cardinality=6
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=133.14MB mem-reservation=26.25MB thread-reservation=2 runtime-filters-memory=4.00MB
+12:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price), sum(coalesce(sr_return_amt, CAST(0 AS DECIMAL(7,2)))), sum(ss_net_profit - coalesce(sr_net_loss, CAST(0 AS DECIMAL(7,2))))
+|  group by: s_store_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=76B cardinality=6
+|  in pipelines: 01(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,4,5,2,3 row-size=147B cardinality=286.13K
+|  in pipelines: 01(GETNEXT), 04(OPEN)
+|
+|--44:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=32B cardinality=12
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=32B cardinality=12
+|     in pipelines: 04(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,4,5,2 row-size=115B cardinality=286.13K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--43:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1998-09-03', CAST(d_date AS DATE) >= DATE '1998-08-04'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 03(GETNEXT)
+|
+09:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_promo_sk = p_promo_sk
+|  fk/pk conjuncts: ss_promo_sk = p_promo_sk
+|  runtime filters: RF004[bloom] <- p_promo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,4,5 row-size=89B cardinality=286.13K
+|  in pipelines: 01(GETNEXT), 06(OPEN)
+|
+|--42:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=17B cardinality=300
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=32.00KB thread-reservation=2
+|  06:SCAN HDFS [tpcds_parquet.promotion, RANDOM]
+|     HDFS partitions=1/1 files=1 size=23.30KB
+|     predicates: p_channel_tv = 'N'
+|     stored statistics:
+|       table: rows=300 size=23.30KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=300
+|     parquet statistics predicates: p_channel_tv = 'N'
+|     parquet dictionary predicates: p_channel_tv = 'N'
+|     mem-estimate=32.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=5 row-size=17B cardinality=300
+|     in pipelines: 06(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF006[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,4 row-size=72B cardinality=288.04K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--41:EXCHANGE [BROADCAST]
+|  |  mem-estimate=37.09KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=12B cardinality=1.80K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|     parquet dictionary predicates: i_current_price > CAST(50 AS DECIMAL(3,0))
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=4 row-size=12B cardinality=1.80K
+|     in pipelines: 05(GETNEXT)
+|
+07:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,1N row-size=60B cardinality=2.88M
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--40:EXCHANGE [BROADCAST]
+|  |  mem-estimate=6.61MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=24B cardinality=287.51K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=97.00MB mem-reservation=9.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  02:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF006[bloom] -> tpcds_parquet.store_returns.sr_item_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=1 row-size=24B cardinality=287.51K
+|     in pipelines: 02(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF006[bloom] -> ss_item_sk, RF004[bloom] -> ss_promo_sk, RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=36B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q81.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q81.test
new file mode 100644
index 0000000..d3b058c
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q81.test
@@ -0,0 +1,874 @@
+# TPCDS-Q81
+WITH customer_total_return AS
+  (SELECT cr_returning_customer_sk AS ctr_customer_sk ,
+          ca_state AS ctr_state,
+          sum(cr_return_amt_inc_tax) AS ctr_total_return
+   FROM catalog_returns ,
+        date_dim ,
+        customer_address
+   WHERE cr_returned_date_sk = d_date_sk
+     AND d_year = 2000
+     AND cr_returning_addr_sk = ca_address_sk
+   GROUP BY cr_returning_customer_sk ,
+            ca_state)
+SELECT c_customer_id,
+       c_salutation,
+       c_first_name,
+       c_last_name,
+       ca_street_number,
+       ca_street_name ,
+       ca_street_type,
+       ca_suite_number,
+       ca_city,
+       ca_county,
+       ca_state,
+       ca_zip,
+       ca_country,
+       ca_gmt_offset ,
+       ca_location_type,
+       ctr_total_return
+FROM customer_total_return ctr1 ,
+     customer_address ,
+     customer
+WHERE ctr1.ctr_total_return >
+    (SELECT avg(ctr_total_return)*1.2
+     FROM customer_total_return ctr2
+     WHERE ctr1.ctr_state = ctr2.ctr_state)
+  AND ca_address_sk = c_current_addr_sk
+  AND ca_state = 'GA'
+  AND ctr1.ctr_customer_sk = c_customer_sk
+ORDER BY c_customer_id,
+         c_salutation,
+         c_first_name,
+         c_last_name,
+         ca_street_number,
+         ca_street_name ,
+         ca_street_type,
+         ca_suite_number,
+         ca_city,
+         ca_county,
+         ca_state,
+         ca_zip,
+         ca_country,
+         ca_gmt_offset ,
+         ca_location_type,
+         ctr_total_return
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=27.12MB Threads=9
+Per-Host Resource Estimates: Memory=557MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=556.81MB mem-reservation=27.12MB thread-reservation=9 runtime-filters-memory=7.00MB
+PLAN-ROOT SINK
+|  output exprs: c_customer_id, c_salutation, c_first_name, c_last_name, ca_street_number, ca_street_name, ca_street_type, ca_suite_number, ca_city, ca_county, ca_state, ca_zip, ca_country, ca_gmt_offset, ca_location_type, ctr_total_return
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+18:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC, c_salutation ASC, c_first_name ASC, c_last_name ASC, ca_street_number ASC, ca_street_name ASC, ca_street_type ASC, ca_suite_number ASC, ca_city ASC, ca_county ASC, ca_state ASC, ca_zip ASC, ca_country ASC, ca_gmt_offset ASC, ca_location_type ASC, ctr_total_return ASC
+|  mem-estimate=28.79KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=295B cardinality=100
+|  in pipelines: 18(GETNEXT), 05(OPEN)
+|
+17:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: ca_state = ctr2.ctr_state
+|  other join predicates: sum(cr_return_amt_inc_tax) > avg(ctr_total_return) * CAST(1.2 AS DECIMAL(2,1))
+|  runtime filters: RF000[bloom] <- ctr2.ctr_state
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,6,5 row-size=325B cardinality=4.35K
+|  in pipelines: 05(GETNEXT), 14(OPEN)
+|
+|--14:AGGREGATE [FINALIZE]
+|  |  output: avg(sum(cr_return_amt_inc_tax))
+|  |  group by: ca_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=30B cardinality=51
+|  |  in pipelines: 14(GETNEXT), 13(OPEN)
+|  |
+|  13:AGGREGATE [FINALIZE]
+|  |  output: sum(cr_return_amt_inc_tax)
+|  |  group by: cr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=26.27K
+|  |  in pipelines: 13(GETNEXT), 10(OPEN)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ca_address_sk = cr_returning_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = cr_returning_addr_sk
+|  |  runtime filters: RF010[bloom] <- cr_returning_addr_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,7,8 row-size=42B cardinality=26.27K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  |--11:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=7,8 row-size=24B cardinality=26.27K
+|  |  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |  |
+|  |  |--09:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2000 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=8 row-size=8B cardinality=373
+|  |  |     in pipelines: 09(GETNEXT)
+|  |  |
+|  |  08:SCAN HDFS [tpcds_parquet.catalog_returns]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     runtime filters: RF012[bloom] -> cr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=7 row-size=16B cardinality=144.07K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF010[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=9 row-size=18B cardinality=50.00K
+|     in pipelines: 10(GETNEXT)
+|
+16:HASH JOIN [INNER JOIN]
+|  hash predicates: cr_returning_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,6,5 row-size=325B cardinality=4.35K
+|  in pipelines: 05(GETNEXT), 07(OPEN)
+|
+|--15:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  runtime filters: RF008[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,5 row-size=291B cardinality=2.27K
+|  |  in pipelines: 07(GETNEXT), 06(OPEN)
+|  |
+|  |--06:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_state = 'GA'
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_state = 'GA'
+|  |     parquet dictionary predicates: ca_state = 'GA'
+|  |     mem-estimate=128.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=5 row-size=204B cardinality=980
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF008[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=6 row-size=87B cardinality=100.00K
+|     in pipelines: 07(GETNEXT)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(cr_return_amt_inc_tax)
+|  group by: cr_returning_customer_sk, ca_state
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=34B cardinality=26.27K
+|  in pipelines: 05(GETNEXT), 02(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ca_address_sk = cr_returning_addr_sk
+|  fk/pk conjuncts: ca_address_sk = cr_returning_addr_sk
+|  runtime filters: RF004[bloom] <- cr_returning_addr_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=42B cardinality=26.27K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--03:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=24B cardinality=26.27K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--01:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=1 row-size=8B cardinality=373
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.catalog_returns]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.catalog_returns.cr_returning_customer_sk, RF006[bloom] -> cr_returned_date_sk
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=0 row-size=16B cardinality=144.07K
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.customer_address]
+   HDFS partitions=1/1 files=1 size=1.16MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.customer_address.ca_state, RF004[bloom] -> ca_address_sk
+   stored statistics:
+     table: rows=50.00K size=1.16MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=50.00K
+   mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+   tuple-ids=2 row-size=18B cardinality=50.00K
+   in pipelines: 02(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=44.88MB Threads=20
+Per-Host Resource Estimates: Memory=631MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=57.97KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_customer_id, c_salutation, c_first_name, c_last_name, ca_street_number, ca_street_name, ca_street_type, ca_suite_number, ca_city, ca_county, ca_state, ca_zip, ca_country, ca_gmt_offset, ca_location_type, ctr_total_return
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+32:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_customer_id ASC, c_salutation ASC, c_first_name ASC, c_last_name ASC, ca_street_number ASC, ca_street_name ASC, ca_street_type ASC, ca_suite_number ASC, ca_city ASC, ca_county ASC, ca_state ASC, ca_zip ASC, ca_country ASC, ca_gmt_offset ASC, ca_location_type ASC, ctr_total_return ASC
+|  limit: 100
+|  mem-estimate=57.97KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=295B cardinality=100
+|  in pipelines: 18(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(cr_returning_customer_sk,ca_state)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=17.70MB mem-reservation=7.81MB thread-reservation=1 runtime-filters-memory=2.00MB
+18:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC, c_salutation ASC, c_first_name ASC, c_last_name ASC, ca_street_number ASC, ca_street_name ASC, ca_street_type ASC, ca_suite_number ASC, ca_city ASC, ca_county ASC, ca_state ASC, ca_zip ASC, ca_country ASC, ca_gmt_offset ASC, ca_location_type ASC, ctr_total_return ASC
+|  mem-estimate=28.79KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=295B cardinality=100
+|  in pipelines: 18(GETNEXT), 22(OPEN)
+|
+17:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: ca_state = ctr2.ctr_state
+|  other join predicates: sum(cr_return_amt_inc_tax) > avg(ctr_total_return) * CAST(1.2 AS DECIMAL(2,1))
+|  runtime filters: RF000[bloom] <- ctr2.ctr_state
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,6,5 row-size=325B cardinality=4.35K
+|  in pipelines: 22(GETNEXT), 30(OPEN)
+|
+|--31:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=30B cardinality=51
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [HASH(ctr2.ctr_state)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  30:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ctr_total_return)
+|  |  group by: ctr2.ctr_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=30B cardinality=51
+|  |  in pipelines: 30(GETNEXT), 28(OPEN)
+|  |
+|  29:EXCHANGE [HASH(ctr2.ctr_state)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=30B cardinality=51
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(cr_returning_customer_sk,ca_state)] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=20.89MB mem-reservation=3.94MB thread-reservation=1
+|  14:AGGREGATE [STREAMING]
+|  |  output: avg(sum(cr_return_amt_inc_tax))
+|  |  group by: ca_state
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12 row-size=30B cardinality=51
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  28:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cr_return_amt_inc_tax)
+|  |  group by: cr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=26.27K
+|  |  in pipelines: 28(GETNEXT), 10(OPEN)
+|  |
+|  27:EXCHANGE [HASH(cr_returning_customer_sk,ca_state)]
+|  |  mem-estimate=910.08KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=26.27K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=45.57MB mem-reservation=5.19MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  13:AGGREGATE [STREAMING]
+|  |  output: sum(cr_return_amt_inc_tax)
+|  |  group by: cr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=26.27K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ca_address_sk = cr_returning_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = cr_returning_addr_sk
+|  |  runtime filters: RF010[bloom] <- cr_returning_addr_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,7,8 row-size=42B cardinality=26.27K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  |--26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=647.59KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7,8 row-size=24B cardinality=26.27K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=98.95MB mem-reservation=4.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: cr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=7,8 row-size=24B cardinality=26.27K
+|  |  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |  |
+|  |  |--25:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=8 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 09(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  09:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2000 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=8 row-size=8B cardinality=373
+|  |  |     in pipelines: 09(GETNEXT)
+|  |  |
+|  |  08:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     runtime filters: RF012[bloom] -> cr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=7 row-size=16B cardinality=144.07K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF010[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=9 row-size=18B cardinality=50.00K
+|     in pipelines: 10(GETNEXT)
+|
+16:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cr_returning_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,6,5 row-size=325B cardinality=4.35K
+|  in pipelines: 22(GETNEXT), 07(OPEN)
+|
+|--24:EXCHANGE [BROADCAST]
+|  |  mem-estimate=944.87KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6,5 row-size=291B cardinality=2.27K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=99.32MB mem-reservation=6.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  runtime filters: RF008[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,5 row-size=291B cardinality=2.27K
+|  |  in pipelines: 07(GETNEXT), 06(OPEN)
+|  |
+|  |--23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=393.52KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=204B cardinality=980
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=128.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  06:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_state = 'GA'
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_state = 'GA'
+|  |     parquet dictionary predicates: ca_state = 'GA'
+|  |     mem-estimate=128.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=5 row-size=204B cardinality=980
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF008[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=6 row-size=87B cardinality=100.00K
+|     in pipelines: 07(GETNEXT)
+|
+22:AGGREGATE [FINALIZE]
+|  output: sum:merge(cr_return_amt_inc_tax)
+|  group by: cr_returning_customer_sk, ca_state
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=34B cardinality=26.27K
+|  in pipelines: 22(GETNEXT), 02(OPEN)
+|
+21:EXCHANGE [HASH(cr_returning_customer_sk,ca_state)]
+|  mem-estimate=910.08KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=34B cardinality=26.27K
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Resources: mem-estimate=46.57MB mem-reservation=6.19MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(cr_return_amt_inc_tax)
+|  group by: cr_returning_customer_sk, ca_state
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=34B cardinality=26.27K
+|  in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ca_address_sk = cr_returning_addr_sk
+|  fk/pk conjuncts: ca_address_sk = cr_returning_addr_sk
+|  runtime filters: RF004[bloom] <- cr_returning_addr_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=42B cardinality=26.27K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=647.59KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,1 row-size=24B cardinality=26.27K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=99.95MB mem-reservation=5.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  03:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=24B cardinality=26.27K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--19:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=8B cardinality=373
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=1 row-size=8B cardinality=373
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.catalog_returns.cr_returning_customer_sk, RF006[bloom] -> cr_returned_date_sk
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=0 row-size=16B cardinality=144.07K
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+   HDFS partitions=1/1 files=1 size=1.16MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.customer_address.ca_state, RF004[bloom] -> ca_address_sk
+   stored statistics:
+     table: rows=50.00K size=1.16MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=50.00K
+   mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+   tuple-ids=2 row-size=18B cardinality=50.00K
+   in pipelines: 02(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=63.44MB Threads=19
+Per-Host Resource Estimates: Memory=250MB
+F11:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=57.97KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_customer_id, c_salutation, c_first_name, c_last_name, ca_street_number, ca_street_name, ca_street_type, ca_suite_number, ca_city, ca_county, ca_state, ca_zip, ca_country, ca_gmt_offset, ca_location_type, ctr_total_return
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+32:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_customer_id ASC, c_salutation ASC, c_first_name ASC, c_last_name ASC, ca_street_number ASC, ca_street_name ASC, ca_street_type ASC, ca_suite_number ASC, ca_city ASC, ca_county ASC, ca_state ASC, ca_zip ASC, ca_country ASC, ca_gmt_offset ASC, ca_location_type ASC, ctr_total_return ASC
+|  limit: 100
+|  mem-estimate=57.97KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=295B cardinality=100
+|  in pipelines: 18(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(cr_returning_customer_sk,ca_state)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=10.89MB mem-reservation=1.94MB thread-reservation=1
+18:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC, c_salutation ASC, c_first_name ASC, c_last_name ASC, ca_street_number ASC, ca_street_name ASC, ca_street_type ASC, ca_suite_number ASC, ca_city ASC, ca_county ASC, ca_state ASC, ca_zip ASC, ca_country ASC, ca_gmt_offset ASC, ca_location_type ASC, ctr_total_return ASC
+|  mem-estimate=28.79KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=295B cardinality=100
+|  in pipelines: 18(GETNEXT), 22(OPEN)
+|
+17:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ca_state = ctr2.ctr_state
+|  other join predicates: sum(cr_return_amt_inc_tax) > avg(ctr_total_return) * CAST(1.2 AS DECIMAL(2,1))
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,6,5 row-size=325B cardinality=4.35K
+|  in pipelines: 22(GETNEXT), 30(OPEN)
+|
+|--F12:PLAN FRAGMENT [HASH(cr_returning_customer_sk,ca_state)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: ctr2.ctr_state
+|  |  runtime filters: RF000[bloom] <- ctr2.ctr_state
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  31:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=30B cardinality=51
+|  |  in pipelines: 30(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [HASH(ctr2.ctr_state)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+|  30:AGGREGATE [FINALIZE]
+|  |  output: avg:merge(ctr_total_return)
+|  |  group by: ctr2.ctr_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=13 row-size=30B cardinality=51
+|  |  in pipelines: 30(GETNEXT), 28(OPEN)
+|  |
+|  29:EXCHANGE [HASH(ctr2.ctr_state)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=12 row-size=30B cardinality=51
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [HASH(cr_returning_customer_sk,ca_state)] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=20.89MB mem-reservation=3.94MB thread-reservation=1
+|  14:AGGREGATE [STREAMING]
+|  |  output: avg(sum(cr_return_amt_inc_tax))
+|  |  group by: ca_state
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12 row-size=30B cardinality=51
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  28:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cr_return_amt_inc_tax)
+|  |  group by: cr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=26.27K
+|  |  in pipelines: 28(GETNEXT), 10(OPEN)
+|  |
+|  27:EXCHANGE [HASH(cr_returning_customer_sk,ca_state)]
+|  |  mem-estimate=910.08KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=26.27K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.25MB thread-reservation=1
+|  13:AGGREGATE [STREAMING]
+|  |  output: sum(cr_return_amt_inc_tax)
+|  |  group by: cr_returning_customer_sk, ca_state
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10 row-size=34B cardinality=26.27K
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ca_address_sk = cr_returning_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = cr_returning_addr_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,7,8 row-size=42B cardinality=26.27K
+|  |  in pipelines: 10(GETNEXT), 08(OPEN)
+|  |
+|  |--F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=5.51MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: cr_returning_addr_sk
+|  |  |  runtime filters: RF010[bloom] <- cr_returning_addr_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=647.59KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7,8 row-size=24B cardinality=26.27K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: cr_returned_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=7,8 row-size=24B cardinality=26.27K
+|  |  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |  |
+|  |  |--F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  25:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=8 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 09(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  09:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2000 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=8 row-size=8B cardinality=373
+|  |  |     in pipelines: 09(GETNEXT)
+|  |  |
+|  |  08:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=10.62MB
+|  |     runtime filters: RF012[bloom] -> cr_returned_date_sk
+|  |     stored statistics:
+|  |       table: rows=144.07K size=10.62MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|  |     mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=7 row-size=16B cardinality=144.07K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     runtime filters: RF010[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=9 row-size=18B cardinality=50.00K
+|     in pipelines: 10(GETNEXT)
+|
+16:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: cr_returning_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,6,5 row-size=325B cardinality=4.35K
+|  in pipelines: 22(GETNEXT), 07(OPEN)
+|
+|--F15:PLAN FRAGMENT [HASH(cr_returning_customer_sk,ca_state)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=5.80MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF002[bloom] <- c_customer_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  24:EXCHANGE [BROADCAST]
+|  |  mem-estimate=944.87KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6,5 row-size=291B cardinality=2.27K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|  15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,5 row-size=291B cardinality=2.27K
+|  |  in pipelines: 07(GETNEXT), 06(OPEN)
+|  |
+|  |--F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=5.26MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=04
+|  |  |  build expressions: ca_address_sk
+|  |  |  runtime filters: RF008[bloom] <- ca_address_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=393.52KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=204B cardinality=980
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  06:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_state = 'GA'
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_state = 'GA'
+|  |     parquet dictionary predicates: ca_state = 'GA'
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=5 row-size=204B cardinality=980
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  07:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     runtime filters: RF008[bloom] -> c_current_addr_sk
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=6 row-size=87B cardinality=100.00K
+|     in pipelines: 07(GETNEXT)
+|
+22:AGGREGATE [FINALIZE]
+|  output: sum:merge(cr_return_amt_inc_tax)
+|  group by: cr_returning_customer_sk, ca_state
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=34B cardinality=26.27K
+|  in pipelines: 22(GETNEXT), 02(OPEN)
+|
+21:EXCHANGE [HASH(cr_returning_customer_sk,ca_state)]
+|  mem-estimate=910.08KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=34B cardinality=26.27K
+|  in pipelines: 02(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=2.25MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(cr_return_amt_inc_tax)
+|  group by: cr_returning_customer_sk, ca_state
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3 row-size=34B cardinality=26.27K
+|  in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=05
+|  hash predicates: ca_address_sk = cr_returning_addr_sk
+|  fk/pk conjuncts: ca_address_sk = cr_returning_addr_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=42B cardinality=26.27K
+|  in pipelines: 02(GETNEXT), 00(OPEN)
+|
+|--F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=5.51MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: cr_returning_addr_sk
+|  |  runtime filters: RF004[bloom] <- cr_returning_addr_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=647.59KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,1 row-size=24B cardinality=26.27K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=1
+|  03:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: cr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=24B cardinality=26.27K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=05
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  19:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=8B cardinality=373
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_year = CAST(2000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=1 row-size=8B cardinality=373
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.catalog_returns.cr_returning_customer_sk, RF006[bloom] -> cr_returned_date_sk
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=0 row-size=16B cardinality=144.07K
+|     in pipelines: 00(GETNEXT)
+|
+02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+   HDFS partitions=1/1 files=1 size=1.16MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.customer_address.ca_state, RF004[bloom] -> ca_address_sk
+   stored statistics:
+     table: rows=50.00K size=1.16MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=50.00K
+   mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+   tuple-ids=2 row-size=18B cardinality=50.00K
+   in pipelines: 02(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q82.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q82.test
new file mode 100644
index 0000000..07e5a92
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q82.test
@@ -0,0 +1,426 @@
+# TPCDS-Q82
+
+SELECT i_item_id ,
+       i_item_desc ,
+       i_current_price
+FROM item,
+     inventory,
+     date_dim,
+     store_sales
+WHERE i_current_price BETWEEN 62 AND 62+30
+  AND inv_item_sk = i_item_sk
+  AND d_date_sk=inv_date_sk
+  AND d_date BETWEEN cast('2000-05-25' AS date) AND cast('2000-07-24' AS date)
+  AND i_manufact_id IN (129,
+                        270,
+                        821,
+                        423)
+  AND inv_quantity_on_hand BETWEEN 100 AND 500
+  AND ss_item_sk = i_item_sk
+GROUP BY i_item_id,
+         i_item_desc,
+         i_current_price
+ORDER BY i_item_id
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=56.88MB Threads=5
+Per-Host Resource Estimates: Memory=281MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=281.08MB mem-reservation=56.88MB thread-reservation=5 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+08:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=14.11KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=144B cardinality=100
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+07:AGGREGATE [FINALIZE]
+|  group by: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=178.21MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=1.18M
+|  in pipelines: 07(GETNEXT), 01(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,3,0,2 row-size=206B cardinality=1.18M
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-07-24', CAST(d_date AS DATE) >= DATE '2000-05-25'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-07-24', CAST(d_date AS DATE) >= DATE '2000-05-25'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-07-24', CAST(d_date AS DATE) >= DATE '2000-05-25'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,3,0 row-size=180B cardinality=1.18M
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--04:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF004[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,0 row-size=164B cardinality=3.84K
+|  |  in pipelines: 03(GETNEXT), 00(OPEN)
+|  |
+|  |--00:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_current_price <= CAST(92 AS DECIMAL(3,0)), i_current_price >= CAST(62 AS DECIMAL(3,0)), i_manufact_id IN (CAST(129 AS INT), CAST(270 AS INT), CAST(821 AS INT), CAST(423 AS INT))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_current_price <= CAST(92 AS DECIMAL(3,0)), i_current_price >= CAST(62 AS DECIMAL(3,0)), i_manufact_id IN (CAST(129 AS INT), CAST(270 AS INT), CAST(821 AS INT), CAST(423 AS INT))
+|  |     parquet dictionary predicates: i_current_price <= CAST(92 AS DECIMAL(3,0)), i_current_price >= CAST(62 AS DECIMAL(3,0)), i_manufact_id IN (CAST(129 AS INT), CAST(270 AS INT), CAST(821 AS INT), CAST(423 AS INT))
+|  |     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=156B cardinality=24
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF004[bloom] -> ss_item_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=2.88M
+|     in pipelines: 03(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.inventory]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+   runtime filters: RF000[bloom] -> inv_date_sk, RF002[bloom] -> inv_item_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   parquet statistics predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+   parquet dictionary predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+   mem-estimate=96.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=1.17M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=96.31MB Threads=10
+Per-Host Resource Estimates: Memory=423MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.19KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC
+|  limit: 100
+|  mem-estimate=48.19KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=144B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,i_current_price)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=99.54MB mem-reservation=34.00MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=14.11KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=144B cardinality=100
+|  in pipelines: 08(GETNEXT), 13(OPEN)
+|
+13:AGGREGATE [FINALIZE]
+|  group by: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=89.10MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=1.18M
+|  in pipelines: 13(GETNEXT), 01(OPEN)
+|
+12:EXCHANGE [HASH(i_item_id,i_item_desc,i_current_price)]
+|  mem-estimate=10.43MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=1.18M
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=192.30MB mem-reservation=55.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+07:AGGREGATE [STREAMING]
+|  group by: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=89.10MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=1.18M
+|  in pipelines: 01(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,3,0,2 row-size=206B cardinality=1.18M
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-07-24', CAST(d_date AS DATE) >= DATE '2000-05-25'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-07-24', CAST(d_date AS DATE) >= DATE '2000-05-25'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-07-24', CAST(d_date AS DATE) >= DATE '2000-05-25'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,3,0 row-size=180B cardinality=1.18M
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.11MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3,0 row-size=164B cardinality=3.84K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=18.95MB mem-reservation=3.44MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  runtime filters: RF004[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,0 row-size=164B cardinality=3.84K
+|  |  in pipelines: 03(GETNEXT), 00(OPEN)
+|  |
+|  |--09:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=156B cardinality=24
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_current_price <= CAST(92 AS DECIMAL(3,0)), i_current_price >= CAST(62 AS DECIMAL(3,0)), i_manufact_id IN (CAST(129 AS INT), CAST(270 AS INT), CAST(821 AS INT), CAST(423 AS INT))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_current_price <= CAST(92 AS DECIMAL(3,0)), i_current_price >= CAST(62 AS DECIMAL(3,0)), i_manufact_id IN (CAST(129 AS INT), CAST(270 AS INT), CAST(821 AS INT), CAST(423 AS INT))
+|  |     parquet dictionary predicates: i_current_price <= CAST(92 AS DECIMAL(3,0)), i_current_price >= CAST(62 AS DECIMAL(3,0)), i_manufact_id IN (CAST(129 AS INT), CAST(270 AS INT), CAST(821 AS INT), CAST(423 AS INT))
+|  |     mem-estimate=80.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=156B cardinality=24
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF004[bloom] -> ss_item_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=2.88M
+|     in pipelines: 03(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+   runtime filters: RF000[bloom] -> inv_date_sk, RF002[bloom] -> inv_item_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   parquet statistics predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+   parquet dictionary predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+   mem-estimate=96.00MB mem-reservation=16.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=1.17M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=189.62MB Threads=12
+Per-Host Resource Estimates: Memory=347MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=91.68KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_item_id ASC
+|  limit: 100
+|  mem-estimate=91.68KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=144B cardinality=100
+|  in pipelines: 08(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_item_id,i_item_desc,i_current_price)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=55.42MB mem-reservation=34.00MB thread-reservation=1
+08:TOP-N [LIMIT=100]
+|  order by: i_item_id ASC
+|  mem-estimate=14.11KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=144B cardinality=100
+|  in pipelines: 08(GETNEXT), 13(OPEN)
+|
+13:AGGREGATE [FINALIZE]
+|  group by: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=44.55MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=1.18M
+|  in pipelines: 13(GETNEXT), 01(OPEN)
+|
+12:EXCHANGE [HASH(i_item_id,i_item_desc,i_current_price)]
+|  mem-estimate=10.87MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=1.18M
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=76.55MB mem-reservation=50.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  group by: i_item_id, i_item_desc, i_current_price
+|  mem-estimate=44.55MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=144B cardinality=1.18M
+|  in pipelines: 01(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: inv_date_sk = d_date_sk
+|  fk/pk conjuncts: inv_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,3,0,2 row-size=206B cardinality=1.18M
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.09MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-07-24', CAST(d_date AS DATE) >= DATE '2000-05-25'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-07-24', CAST(d_date AS DATE) >= DATE '2000-05-25'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-07-24', CAST(d_date AS DATE) >= DATE '2000-05-25'
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: inv_item_sk = i_item_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,3,0 row-size=180B cardinality=1.18M
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=6.49MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.61MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3,0 row-size=164B cardinality=3.84K
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  04:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: ss_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3,0 row-size=164B cardinality=3.84K
+|  |  in pipelines: 03(GETNEXT), 00(OPEN)
+|  |
+|  |--F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF004[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  09:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=156B cardinality=24
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_current_price <= CAST(92 AS DECIMAL(3,0)), i_current_price >= CAST(62 AS DECIMAL(3,0)), i_manufact_id IN (CAST(129 AS INT), CAST(270 AS INT), CAST(821 AS INT), CAST(423 AS INT))
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_current_price <= CAST(92 AS DECIMAL(3,0)), i_current_price >= CAST(62 AS DECIMAL(3,0)), i_manufact_id IN (CAST(129 AS INT), CAST(270 AS INT), CAST(821 AS INT), CAST(423 AS INT))
+|  |     parquet dictionary predicates: i_current_price <= CAST(92 AS DECIMAL(3,0)), i_current_price >= CAST(62 AS DECIMAL(3,0)), i_manufact_id IN (CAST(129 AS INT), CAST(270 AS INT), CAST(821 AS INT), CAST(423 AS INT))
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=0 row-size=156B cardinality=24
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF004[bloom] -> ss_item_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=3 row-size=8B cardinality=2.88M
+|     in pipelines: 03(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.inventory, RANDOM]
+   HDFS partitions=1/1 files=2 size=34.09MB
+   predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+   runtime filters: RF000[bloom] -> inv_date_sk, RF002[bloom] -> inv_item_sk
+   stored statistics:
+     table: rows=11.74M size=34.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=6.66M
+   parquet statistics predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+   parquet dictionary predicates: inv_quantity_on_hand <= CAST(500 AS INT), inv_quantity_on_hand >= CAST(100 AS INT)
+   mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+   tuple-ids=1 row-size=16B cardinality=1.17M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q83.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q83.test
new file mode 100644
index 0000000..45862fc
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q83.test
@@ -0,0 +1,1375 @@
+# TPCDS-Q83
+WITH sr_items AS
+  (SELECT i_item_id item_id,
+          sum(sr_return_quantity) sr_item_qty
+   FROM store_returns,
+        item,
+        date_dim
+   WHERE sr_item_sk = i_item_sk
+     AND d_date IN
+       (SELECT d_date
+        FROM date_dim
+        WHERE d_week_seq IN
+            (SELECT d_week_seq
+             FROM date_dim
+             WHERE d_date IN ('2000-06-30',
+                              '2000-09-27',
+                              '2000-11-17')))
+     AND sr_returned_date_sk = d_date_sk
+   GROUP BY i_item_id),
+     cr_items AS
+  (SELECT i_item_id item_id,
+          sum(cr_return_quantity) cr_item_qty
+   FROM catalog_returns,
+        item,
+        date_dim
+   WHERE cr_item_sk = i_item_sk
+     AND d_date IN
+       (SELECT d_date
+        FROM date_dim
+        WHERE d_week_seq IN
+            (SELECT d_week_seq
+             FROM date_dim
+             WHERE d_date IN ('2000-06-30',
+                              '2000-09-27',
+                              '2000-11-17')))
+     AND cr_returned_date_sk = d_date_sk
+   GROUP BY i_item_id),
+     wr_items AS
+  (SELECT i_item_id item_id,
+          sum(wr_return_quantity) wr_item_qty
+   FROM web_returns,
+        item,
+        date_dim
+   WHERE wr_item_sk = i_item_sk
+     AND d_date IN
+       (SELECT d_date
+        FROM date_dim
+        WHERE d_week_seq IN
+            (SELECT d_week_seq
+             FROM date_dim
+             WHERE d_date IN ('2000-06-30',
+                              '2000-09-27',
+                              '2000-11-17')))
+     AND wr_returned_date_sk = d_date_sk
+   GROUP BY i_item_id)
+SELECT sr_items.item_id ,
+       sr_item_qty ,
+       (sr_item_qty*1.0000)/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0000 * 100 sr_dev ,
+       cr_item_qty ,
+       (cr_item_qty*1.0000)/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0000 * 100 cr_dev ,
+       wr_item_qty ,
+       (wr_item_qty*1.0000)/(sr_item_qty+cr_item_qty+wr_item_qty)/3.0000 * 100 wr_dev ,
+       (sr_item_qty+cr_item_qty+wr_item_qty)/3.0 average
+FROM sr_items ,
+     cr_items ,
+     wr_items
+WHERE sr_items.item_id=cr_items.item_id
+  AND sr_items.item_id=wr_items.item_id
+ORDER BY sr_items.item_id ,
+         sr_item_qty
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=47.06MB Threads=16
+Per-Host Resource Estimates: Memory=606MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=606.25MB mem-reservation=47.06MB thread-reservation=16 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: item_id, sr_item_qty, (CAST(sr_item_qty AS DECIMAL(19,0)) * CAST(1.0000 AS DECIMAL(5,4))) / CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0000 AS DECIMAL(5,4)) * CAST(100 AS DECIMAL(3,0)), cr_item_qty, (CAST(cr_item_qty AS DECIMAL(19,0)) * CAST(1.0000 AS DECIMAL(5,4))) / CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0000 AS DECIMAL(5,4)) * CAST(100 AS DECIMAL(3,0)), wr_item_qty, (CAST(wr_item_qty AS DECIMAL(19,0)) * CAST(1.0000 AS DECIMAL(5,4))) / CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0000 AS DECIMAL(5,4)) * CAST(100 AS DECIMAL(3,0)), CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0 AS DECIMAL(2,1))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+32:TOP-N [LIMIT=100]
+|  order by: item_id ASC, sr_item_qty ASC
+|  mem-estimate=4.21KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=52B cardinality=83
+|  in pipelines: 32(GETNEXT), 09(OPEN)
+|
+31:HASH JOIN [INNER JOIN]
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25,16 row-size=108B cardinality=83
+|  in pipelines: 09(GETNEXT), 19(OPEN)
+|
+|--19:AGGREGATE [FINALIZE]
+|  |  output: sum(CAST(cr_return_quantity AS BIGINT))
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=36B cardinality=41
+|  |  in pipelines: 19(GETNEXT), 10(OPEN)
+|  |
+|  18:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: d_date = d_date
+|  |  runtime filters: RF020[bloom] <- d_date
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=41
+|  |  in pipelines: 10(GETNEXT), 13(OPEN)
+|  |
+|  |--15:HASH JOIN [LEFT SEMI JOIN]
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  runtime filters: RF026[bloom] <- d_week_seq
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12 row-size=26B cardinality=21
+|  |  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |  |
+|  |  |--14:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     parquet dictionary predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=13 row-size=26B cardinality=3
+|  |  |     in pipelines: 14(GETNEXT)
+|  |  |
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF026[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=26B cardinality=73.05K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  17:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=144.07K
+|  |  in pipelines: 10(GETNEXT), 12(OPEN)
+|  |
+|  |--12:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF020[bloom] -> d_date
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=26B cardinality=73.05K
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cr_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cr_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10 row-size=52B cardinality=144.07K
+|  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |
+|  |--11:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=36B cardinality=18.00K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.catalog_returns]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=72.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=9 row-size=16B cardinality=144.07K
+|     in pipelines: 10(GETNEXT)
+|
+30:HASH JOIN [INNER JOIN]
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- i_item_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25 row-size=72B cardinality=43
+|  in pipelines: 09(GETNEXT), 29(OPEN)
+|
+|--29:AGGREGATE [FINALIZE]
+|  |  output: sum(CAST(wr_return_quantity AS BIGINT))
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=36B cardinality=21
+|  |  in pipelines: 29(GETNEXT), 22(OPEN)
+|  |
+|  28:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: d_date = d_date
+|  |  runtime filters: RF012[bloom] <- d_date
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=20,18,19 row-size=78B cardinality=21
+|  |  in pipelines: 22(GETNEXT), 23(OPEN)
+|  |
+|  |--25:HASH JOIN [LEFT SEMI JOIN]
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  runtime filters: RF018[bloom] <- d_week_seq
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=21 row-size=26B cardinality=21
+|  |  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |  |
+|  |  |--24:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     parquet dictionary predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=22 row-size=26B cardinality=3
+|  |  |     in pipelines: 24(GETNEXT)
+|  |  |
+|  |  23:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF018[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=21 row-size=26B cardinality=73.05K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN]
+|  |  hash predicates: wr_item_sk = i_item_sk
+|  |  fk/pk conjuncts: wr_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=20,18,19 row-size=78B cardinality=71.76K
+|  |  in pipelines: 22(GETNEXT), 21(OPEN)
+|  |
+|  |--21:SCAN HDFS [tpcds_parquet.item]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=36B cardinality=18.00K
+|  |     in pipelines: 21(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN]
+|  |  hash predicates: d_date_sk = wr_returned_date_sk
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF016[bloom] <- wr_returned_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=20,18 row-size=42B cardinality=71.76K
+|  |  in pipelines: 22(GETNEXT), 20(OPEN)
+|  |
+|  |--20:SCAN HDFS [tpcds_parquet.web_returns]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=16B cardinality=71.76K
+|  |     in pipelines: 20(GETNEXT)
+|  |
+|  22:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF012[bloom] -> d_date, RF016[bloom] -> d_date_sk
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=20 row-size=26B cardinality=73.05K
+|     in pipelines: 22(GETNEXT)
+|
+09:AGGREGATE [FINALIZE]
+|  output: sum(CAST(sr_return_quantity AS BIGINT))
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=36B cardinality=83
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [LEFT SEMI JOIN]
+|  hash predicates: d_date = d_date
+|  runtime filters: RF004[bloom] <- d_date
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=83
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--05:HASH JOIN [LEFT SEMI JOIN]
+|  |  hash predicates: d_week_seq = d_week_seq
+|  |  runtime filters: RF010[bloom] <- d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=21
+|  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |
+|  |--04:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |     parquet dictionary predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=4 row-size=26B cardinality=3
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF010[bloom] -> d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=26B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: sr_returned_date_sk = d_date_sk
+|  fk/pk conjuncts: sr_returned_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=287.51K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF004[bloom] -> d_date
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=73.05K
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: sr_item_sk = i_item_sk
+|  fk/pk conjuncts: sr_item_sk = i_item_sk
+|  runtime filters: RF008[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=52B cardinality=287.51K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.item.i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=36B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_returns]
+   HDFS partitions=1/1 files=1 size=15.43MB
+   runtime filters: RF006[bloom] -> sr_returned_date_sk, RF008[bloom] -> sr_item_sk
+   stored statistics:
+     table: rows=287.51K size=15.43MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=287.51K
+   mem-estimate=72.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=287.51K
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=68.75MB Threads=32
+Per-Host Resource Estimates: Memory=686MB
+F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: item_id, sr_item_qty, (CAST(sr_item_qty AS DECIMAL(19,0)) * CAST(1.0000 AS DECIMAL(5,4))) / CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0000 AS DECIMAL(5,4)) * CAST(100 AS DECIMAL(3,0)), cr_item_qty, (CAST(cr_item_qty AS DECIMAL(19,0)) * CAST(1.0000 AS DECIMAL(5,4))) / CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0000 AS DECIMAL(5,4)) * CAST(100 AS DECIMAL(3,0)), wr_item_qty, (CAST(wr_item_qty AS DECIMAL(19,0)) * CAST(1.0000 AS DECIMAL(5,4))) / CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0000 AS DECIMAL(5,4)) * CAST(100 AS DECIMAL(3,0)), CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0 AS DECIMAL(2,1))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+51:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: item_id ASC, sr_item_qty ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=52B cardinality=83
+|  in pipelines: 32(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(i_item_id)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=34.89MB mem-reservation=10.69MB thread-reservation=1 runtime-filters-memory=1.00MB
+32:TOP-N [LIMIT=100]
+|  order by: item_id ASC, sr_item_qty ASC
+|  mem-estimate=4.21KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=52B cardinality=83
+|  in pipelines: 32(GETNEXT), 38(OPEN)
+|
+31:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25,16 row-size=108B cardinality=83
+|  in pipelines: 38(GETNEXT), 50(OPEN)
+|
+|--50:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cr_return_quantity)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=36B cardinality=41
+|  |  in pipelines: 50(GETNEXT), 10(OPEN)
+|  |
+|  49:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=36B cardinality=41
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=92.26MB mem-reservation=10.75MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  19:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(cr_return_quantity AS BIGINT))
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=36B cardinality=41
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  18:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: d_date = d_date
+|  |  runtime filters: RF020[bloom] <- d_date
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=41
+|  |  in pipelines: 10(GETNEXT), 13(OPEN)
+|  |
+|  |--48:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=26B cardinality=21
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=34.95MB mem-reservation=3.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  15:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  runtime filters: RF026[bloom] <- d_week_seq
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12 row-size=26B cardinality=21
+|  |  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |  |
+|  |  |--47:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=26B cardinality=3
+|  |  |  |  in pipelines: 14(GETNEXT)
+|  |  |  |
+|  |  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  |  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     parquet dictionary predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=13 row-size=26B cardinality=3
+|  |  |     in pipelines: 14(GETNEXT)
+|  |  |
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF026[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=26B cardinality=73.05K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  17:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=144.07K
+|  |  in pipelines: 10(GETNEXT), 12(OPEN)
+|  |
+|  |--46:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=26B cardinality=73.05K
+|  |  |  in pipelines: 12(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  12:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF020[bloom] -> d_date
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=26B cardinality=73.05K
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cr_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cr_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10 row-size=52B cardinality=144.07K
+|  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |
+|  |--45:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  11:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=10 row-size=36B cardinality=18.00K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=72.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=9 row-size=16B cardinality=144.07K
+|     in pipelines: 10(GETNEXT)
+|
+30:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- i_item_id
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25 row-size=72B cardinality=43
+|  in pipelines: 38(GETNEXT), 44(OPEN)
+|
+|--44:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(wr_return_quantity)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=36B cardinality=21
+|  |  in pipelines: 44(GETNEXT), 22(OPEN)
+|  |
+|  43:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25 row-size=36B cardinality=21
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=52.54MB mem-reservation=11.75MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  29:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(wr_return_quantity AS BIGINT))
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=36B cardinality=21
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  28:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: d_date = d_date
+|  |  runtime filters: RF012[bloom] <- d_date
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=20,18,19 row-size=78B cardinality=21
+|  |  in pipelines: 22(GETNEXT), 23(OPEN)
+|  |
+|  |--42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21 row-size=26B cardinality=21
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=34.95MB mem-reservation=3.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  25:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  runtime filters: RF018[bloom] <- d_week_seq
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=21 row-size=26B cardinality=21
+|  |  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |  |
+|  |  |--41:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=26B cardinality=3
+|  |  |  |  in pipelines: 24(GETNEXT)
+|  |  |  |
+|  |  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  |  24:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     parquet dictionary predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=22 row-size=26B cardinality=3
+|  |  |     in pipelines: 24(GETNEXT)
+|  |  |
+|  |  23:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF018[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=21 row-size=26B cardinality=73.05K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: wr_item_sk = i_item_sk
+|  |  fk/pk conjuncts: wr_item_sk = i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=20,18,19 row-size=78B cardinality=71.76K
+|  |  in pipelines: 22(GETNEXT), 21(OPEN)
+|  |
+|  |--40:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 21(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  21:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=36B cardinality=18.00K
+|  |     in pipelines: 21(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: d_date_sk = wr_returned_date_sk
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF016[bloom] <- wr_returned_date_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=20,18 row-size=42B cardinality=71.76K
+|  |  in pipelines: 22(GETNEXT), 20(OPEN)
+|  |
+|  |--39:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.11MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=16B cardinality=71.76K
+|  |  |  in pipelines: 20(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  20:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=18 row-size=16B cardinality=71.76K
+|  |     in pipelines: 20(GETNEXT)
+|  |
+|  22:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF012[bloom] -> d_date, RF016[bloom] -> d_date_sk
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=20 row-size=26B cardinality=73.05K
+|     in pipelines: 22(GETNEXT)
+|
+38:AGGREGATE [FINALIZE]
+|  output: sum:merge(sr_return_quantity)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=36B cardinality=83
+|  in pipelines: 38(GETNEXT), 00(OPEN)
+|
+37:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=36B cardinality=83
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Resources: mem-estimate=94.26MB mem-reservation=13.75MB thread-reservation=2 runtime-filters-memory=3.00MB
+09:AGGREGATE [STREAMING]
+|  output: sum(CAST(sr_return_quantity AS BIGINT))
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=36B cardinality=83
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash predicates: d_date = d_date
+|  runtime filters: RF004[bloom] <- d_date
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=83
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=21
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=34.95MB mem-reservation=3.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  05:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash predicates: d_week_seq = d_week_seq
+|  |  runtime filters: RF010[bloom] <- d_week_seq
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=21
+|  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |
+|  |--35:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=26B cardinality=3
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |     parquet dictionary predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=4 row-size=26B cardinality=3
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF010[bloom] -> d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=3 row-size=26B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: sr_returned_date_sk = d_date_sk
+|  fk/pk conjuncts: sr_returned_date_sk = d_date_sk
+|  runtime filters: RF006[bloom] <- d_date_sk
+|  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=287.51K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--34:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=73.05K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=2.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF004[bloom] -> d_date
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=73.05K
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: sr_item_sk = i_item_sk
+|  fk/pk conjuncts: sr_item_sk = i_item_sk
+|  runtime filters: RF008[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=52B cardinality=287.51K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--33:EXCHANGE [BROADCAST]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=36B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=33.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.item.i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=36B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+   HDFS partitions=1/1 files=1 size=15.43MB
+   runtime filters: RF006[bloom] -> sr_returned_date_sk, RF008[bloom] -> sr_item_sk
+   stored statistics:
+     table: rows=287.51K size=15.43MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=287.51K
+   mem-estimate=72.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=287.51K
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=101.81MB Threads=31
+Per-Host Resource Estimates: Memory=399MB
+F18:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: item_id, sr_item_qty, (CAST(sr_item_qty AS DECIMAL(19,0)) * CAST(1.0000 AS DECIMAL(5,4))) / CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0000 AS DECIMAL(5,4)) * CAST(100 AS DECIMAL(3,0)), cr_item_qty, (CAST(cr_item_qty AS DECIMAL(19,0)) * CAST(1.0000 AS DECIMAL(5,4))) / CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0000 AS DECIMAL(5,4)) * CAST(100 AS DECIMAL(3,0)), wr_item_qty, (CAST(wr_item_qty AS DECIMAL(19,0)) * CAST(1.0000 AS DECIMAL(5,4))) / CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0000 AS DECIMAL(5,4)) * CAST(100 AS DECIMAL(3,0)), CAST((sr_item_qty + cr_item_qty + wr_item_qty) AS DECIMAL(19,0)) / CAST(3.0 AS DECIMAL(2,1))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+51:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: item_id ASC, sr_item_qty ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=52B cardinality=83
+|  in pipelines: 32(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(i_item_id)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+32:TOP-N [LIMIT=100]
+|  order by: item_id ASC, sr_item_qty ASC
+|  mem-estimate=4.21KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=27 row-size=52B cardinality=83
+|  in pipelines: 32(GETNEXT), 38(OPEN)
+|
+31:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25,16 row-size=108B cardinality=83
+|  in pipelines: 38(GETNEXT), 50(OPEN)
+|
+|--F19:PLAN FRAGMENT [HASH(i_item_id)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=11.94MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  50:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(cr_return_quantity)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=36B cardinality=41
+|  |  in pipelines: 50(GETNEXT), 10(OPEN)
+|  |
+|  49:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=36B cardinality=41
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=34.00MB mem-reservation=3.00MB thread-reservation=1
+|  19:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(cr_return_quantity AS BIGINT))
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=16 row-size=36B cardinality=41
+|  |  in pipelines: 10(GETNEXT)
+|  |
+|  18:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: d_date = d_date
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=41
+|  |  in pipelines: 10(GETNEXT), 13(OPEN)
+|  |
+|  |--F20:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_date
+|  |  |  runtime filters: RF020[bloom] <- d_date
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  48:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=26B cardinality=21
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F15:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  15:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash-table-id=02
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=12 row-size=26B cardinality=21
+|  |  |  in pipelines: 13(GETNEXT), 14(OPEN)
+|  |  |
+|  |  |--F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=02 plan-id=03 cohort-id=03
+|  |  |  |  build expressions: d_week_seq
+|  |  |  |  runtime filters: RF026[bloom] <- d_week_seq
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  47:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=13 row-size=26B cardinality=3
+|  |  |  |  in pipelines: 14(GETNEXT)
+|  |  |  |
+|  |  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |  14:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     parquet dictionary predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |  |     tuple-ids=13 row-size=26B cardinality=3
+|  |  |     in pipelines: 14(GETNEXT)
+|  |  |
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF026[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=12 row-size=26B cardinality=73.05K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  17:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: cr_returned_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=9,10,11 row-size=78B cardinality=144.07K
+|  |  in pipelines: 10(GETNEXT), 12(OPEN)
+|  |
+|  |--F22:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=7.59MB mem-reservation=5.75MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  46:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=26B cardinality=73.05K
+|  |  |  in pipelines: 12(GETNEXT)
+|  |  |
+|  |  F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  12:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF020[bloom] -> d_date
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=11 row-size=26B cardinality=73.05K
+|  |     in pipelines: 12(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: cr_item_sk = i_item_sk
+|  |  fk/pk conjuncts: cr_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=9,10 row-size=52B cardinality=144.07K
+|  |  in pipelines: 10(GETNEXT), 11(OPEN)
+|  |
+|  |--F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.53MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  45:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=10 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  11:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=10 row-size=36B cardinality=18.00K
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  10:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.62MB
+|     stored statistics:
+|       table: rows=144.07K size=10.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=144.07K
+|     mem-estimate=24.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=9 row-size=16B cardinality=144.07K
+|     in pipelines: 10(GETNEXT)
+|
+30:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash-table-id=05
+|  hash predicates: i_item_id = i_item_id
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7,25 row-size=72B cardinality=43
+|  in pipelines: 38(GETNEXT), 44(OPEN)
+|
+|--F24:PLAN FRAGMENT [HASH(i_item_id)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=12.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: i_item_id
+|  |  runtime filters: RF002[bloom] <- i_item_id
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  44:AGGREGATE [FINALIZE]
+|  |  output: sum:merge(wr_return_quantity)
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=36B cardinality=21
+|  |  in pipelines: 44(GETNEXT), 22(OPEN)
+|  |
+|  43:EXCHANGE [HASH(i_item_id)]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=25 row-size=36B cardinality=21
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+|  29:AGGREGATE [STREAMING]
+|  |  output: sum(CAST(wr_return_quantity AS BIGINT))
+|  |  group by: i_item_id
+|  |  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=36B cardinality=21
+|  |  in pipelines: 22(GETNEXT)
+|  |
+|  28:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: d_date = d_date
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=20,18,19 row-size=78B cardinality=21
+|  |  in pipelines: 22(GETNEXT), 23(OPEN)
+|  |
+|  |--F25:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=04
+|  |  |  build expressions: d_date
+|  |  |  runtime filters: RF012[bloom] <- d_date
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  42:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21 row-size=26B cardinality=21
+|  |  |  in pipelines: 23(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  25:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  |  hash-table-id=07
+|  |  |  hash predicates: d_week_seq = d_week_seq
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=21 row-size=26B cardinality=21
+|  |  |  in pipelines: 23(GETNEXT), 24(OPEN)
+|  |  |
+|  |  |--F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=07 plan-id=08 cohort-id=05
+|  |  |  |  build expressions: d_week_seq
+|  |  |  |  runtime filters: RF018[bloom] <- d_week_seq
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  41:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=22 row-size=26B cardinality=3
+|  |  |  |  in pipelines: 24(GETNEXT)
+|  |  |  |
+|  |  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |  24:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     parquet dictionary predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |  |     tuple-ids=22 row-size=26B cardinality=3
+|  |  |     in pipelines: 24(GETNEXT)
+|  |  |
+|  |  23:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     runtime filters: RF018[bloom] -> d_week_seq
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=21 row-size=26B cardinality=73.05K
+|  |     in pipelines: 23(GETNEXT)
+|  |
+|  27:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=08
+|  |  hash predicates: wr_item_sk = i_item_sk
+|  |  fk/pk conjuncts: wr_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=20,18,19 row-size=78B cardinality=71.76K
+|  |  in pipelines: 22(GETNEXT), 21(OPEN)
+|  |
+|  |--F27:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.53MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=08 plan-id=09 cohort-id=04
+|  |  |  build expressions: i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  40:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=36B cardinality=18.00K
+|  |  |  in pipelines: 21(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  21:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=19 row-size=36B cardinality=18.00K
+|  |     in pipelines: 21(GETNEXT)
+|  |
+|  26:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=09
+|  |  hash predicates: d_date_sk = wr_returned_date_sk
+|  |  fk/pk conjuncts: none
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=20,18 row-size=42B cardinality=71.76K
+|  |  in pipelines: 22(GETNEXT), 20(OPEN)
+|  |
+|  |--F28:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=7.86MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=09 plan-id=10 cohort-id=04
+|  |  |  build expressions: wr_returned_date_sk
+|  |  |  runtime filters: RF016[bloom] <- wr_returned_date_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  39:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.11MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=18 row-size=16B cardinality=71.76K
+|  |  |  in pipelines: 20(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  20:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |     stored statistics:
+|  |       table: rows=71.76K size=5.66MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=18 row-size=16B cardinality=71.76K
+|  |     in pipelines: 20(GETNEXT)
+|  |
+|  22:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF012[bloom] -> d_date, RF016[bloom] -> d_date_sk
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=20 row-size=26B cardinality=73.05K
+|     in pipelines: 22(GETNEXT)
+|
+38:AGGREGATE [FINALIZE]
+|  output: sum:merge(sr_return_quantity)
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=36B cardinality=83
+|  in pipelines: 38(GETNEXT), 00(OPEN)
+|
+37:EXCHANGE [HASH(i_item_id)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=36B cardinality=83
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=34.00MB mem-reservation=4.00MB thread-reservation=1
+09:AGGREGATE [STREAMING]
+|  output: sum(CAST(sr_return_quantity AS BIGINT))
+|  group by: i_item_id
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=36B cardinality=83
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  hash-table-id=10
+|  hash predicates: d_date = d_date
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=83
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F29:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=10 plan-id=11 cohort-id=01
+|  |  build expressions: d_date
+|  |  runtime filters: RF004[bloom] <- d_date
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  36:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=21
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  05:HASH JOIN [LEFT SEMI JOIN, BROADCAST]
+|  |  hash-table-id=11
+|  |  hash predicates: d_week_seq = d_week_seq
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=3 row-size=26B cardinality=21
+|  |  in pipelines: 03(GETNEXT), 04(OPEN)
+|  |
+|  |--F30:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=11 plan-id=12 cohort-id=06
+|  |  |  build expressions: d_week_seq
+|  |  |  runtime filters: RF010[bloom] <- d_week_seq
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  35:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=26B cardinality=3
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |     parquet dictionary predicates: d_date IN ('2000-06-30', '2000-09-27', '2000-11-17')
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=4 row-size=26B cardinality=3
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  03:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF010[bloom] -> d_week_seq
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=3 row-size=26B cardinality=73.05K
+|     in pipelines: 03(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=12
+|  hash predicates: sr_returned_date_sk = d_date_sk
+|  fk/pk conjuncts: sr_returned_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=287.51K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=8.59MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=12 plan-id=13 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF006[bloom] <- d_date_sk
+|  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |
+|  34:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.84MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=73.05K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     runtime filters: RF004[bloom] -> d_date
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=2 row-size=26B cardinality=73.05K
+|     in pipelines: 02(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=13
+|  hash predicates: sr_item_sk = i_item_sk
+|  fk/pk conjuncts: sr_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=52B cardinality=287.51K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F32:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=5.53MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=13 plan-id=14 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF008[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  33:EXCHANGE [BROADCAST]
+|  |  mem-estimate=672.81KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=36B cardinality=18.00K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     runtime filters: RF002[bloom] -> tpcds_parquet.item.i_item_id
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=1 row-size=36B cardinality=18.00K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+   HDFS partitions=1/1 files=1 size=15.43MB
+   runtime filters: RF006[bloom] -> sr_returned_date_sk, RF008[bloom] -> sr_item_sk
+   stored statistics:
+     table: rows=287.51K size=15.43MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=287.51K
+   mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=0 row-size=16B cardinality=287.51K
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q84.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q84.test
new file mode 100644
index 0000000..77f4a7d
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q84.test
@@ -0,0 +1,442 @@
+# TPCDS-Q84
+SELECT c_customer_id AS customer_id ,
+       concat(concat(coalesce(c_last_name, '') , ', '), coalesce(c_first_name, '')) AS customername
+FROM customer ,
+     customer_address ,
+     household_demographics ,
+     income_band ,
+     store_returns
+WHERE ca_city = 'Edgewood'
+  AND c_current_addr_sk = ca_address_sk
+  AND ib_lower_bound >= 38128
+  AND ib_upper_bound <= 38128 + 50000
+  AND ib_income_band_sk = hd_income_band_sk
+  AND sr_cdemo_sk = c_current_cdemo_sk
+  AND hd_demo_sk = c_current_hdemo_sk
+ORDER BY c_customer_id
+LIMIT 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=15.90MB Threads=6
+Per-Host Resource Estimates: Memory=240MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=239.88MB mem-reservation=15.90MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: c_customer_id, concat(concat(coalesce(c_last_name, ''), ', '), coalesce(c_first_name, ''))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+09:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC
+|  mem-estimate=1.25KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=64B cardinality=20
+|  in pipelines: 09(GETNEXT), 04(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: sr_cdemo_sk = c_current_cdemo_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- c_current_cdemo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4,2,0,1,3 row-size=125B cardinality=20
+|  in pipelines: 04(GETNEXT), 02(OPEN)
+|
+|--07:HASH JOIN [INNER JOIN]
+|  |  hash predicates: hd_income_band_sk = ib_income_band_sk
+|  |  fk/pk conjuncts: hd_income_band_sk = ib_income_band_sk
+|  |  runtime filters: RF002[bloom] <- ib_income_band_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1,3 row-size=121B cardinality=18
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.income_band]
+|  |     HDFS partitions=1/1 files=1 size=1.21KB
+|  |     predicates: ib_lower_bound >= CAST(38128 AS INT), ib_upper_bound <= CAST(88128 AS INT)
+|  |     stored statistics:
+|  |       table: rows=20 size=1.21KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=20
+|  |     parquet statistics predicates: ib_lower_bound >= CAST(38128 AS INT), ib_upper_bound <= CAST(88128 AS INT)
+|  |     parquet dictionary predicates: ib_lower_bound >= CAST(38128 AS INT), ib_upper_bound <= CAST(88128 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=12B cardinality=2
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: hd_demo_sk = c_current_hdemo_sk
+|  |  fk/pk conjuncts: hd_demo_sk = c_current_hdemo_sk
+|  |  runtime filters: RF004[bloom] <- c_current_hdemo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=109B cardinality=173
+|  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |
+|  |--05:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=101B cardinality=177
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--01:SCAN HDFS [tpcds_parquet.customer_address]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_city = 'Edgewood'
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_city = 'Edgewood'
+|  |  |     parquet dictionary predicates: ca_city = 'Edgewood'
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=25B cardinality=76
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF006[bloom] -> c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=76B cardinality=100.00K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.household_demographics]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     runtime filters: RF002[bloom] -> hd_income_band_sk, RF004[bloom] -> hd_demo_sk
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=7.20K
+|     in pipelines: 02(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.store_returns]
+   HDFS partitions=1/1 files=1 size=15.43MB
+   runtime filters: RF000[bloom] -> sr_cdemo_sk
+   stored statistics:
+     table: rows=287.51K size=15.43MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=287.51K
+   mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=4 row-size=4B cardinality=287.51K
+   in pipelines: 04(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=18.34MB Threads=11
+Per-Host Resource Estimates: Memory=244MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_customer_id, concat(concat(coalesce(c_last_name, ''), ', '), coalesce(c_first_name, ''))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_customer_id ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=64B cardinality=20
+|  in pipelines: 09(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Resources: mem-estimate=26.95MB mem-reservation=4.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+09:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC
+|  mem-estimate=1.25KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=64B cardinality=20
+|  in pipelines: 09(GETNEXT), 04(OPEN)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: sr_cdemo_sk = c_current_cdemo_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF000[bloom] <- c_current_cdemo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4,2,0,1,3 row-size=125B cardinality=20
+|  in pipelines: 04(GETNEXT), 02(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2,0,1,3 row-size=121B cardinality=18
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=37.93MB mem-reservation=5.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: hd_income_band_sk = ib_income_band_sk
+|  |  fk/pk conjuncts: hd_income_band_sk = ib_income_band_sk
+|  |  runtime filters: RF002[bloom] <- ib_income_band_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1,3 row-size=121B cardinality=18
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--12:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=12B cardinality=2
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.income_band, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.21KB
+|  |     predicates: ib_lower_bound >= CAST(38128 AS INT), ib_upper_bound <= CAST(88128 AS INT)
+|  |     stored statistics:
+|  |       table: rows=20 size=1.21KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=20
+|  |     parquet statistics predicates: ib_lower_bound >= CAST(38128 AS INT), ib_upper_bound <= CAST(88128 AS INT)
+|  |     parquet dictionary predicates: ib_lower_bound >= CAST(38128 AS INT), ib_upper_bound <= CAST(88128 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=12B cardinality=2
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: hd_demo_sk = c_current_hdemo_sk
+|  |  fk/pk conjuncts: hd_demo_sk = c_current_hdemo_sk
+|  |  runtime filters: RF004[bloom] <- c_current_hdemo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=109B cardinality=173
+|  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |
+|  |--11:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=36.27KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=101B cardinality=177
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=98.95MB mem-reservation=6.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=101B cardinality=177
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--10:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=1 row-size=25B cardinality=76
+|  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  01:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_city = 'Edgewood'
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_city = 'Edgewood'
+|  |  |     parquet dictionary predicates: ca_city = 'Edgewood'
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=25B cardinality=76
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF006[bloom] -> c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=76B cardinality=100.00K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     runtime filters: RF002[bloom] -> hd_income_band_sk, RF004[bloom] -> hd_demo_sk
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=7.20K
+|     in pipelines: 02(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+   HDFS partitions=1/1 files=1 size=15.43MB
+   runtime filters: RF000[bloom] -> sr_cdemo_sk
+   stored statistics:
+     table: rows=287.51K size=15.43MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=287.51K
+   mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=4 row-size=4B cardinality=287.51K
+   in pipelines: 04(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=30.09MB Threads=10
+Per-Host Resource Estimates: Memory=112MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: c_customer_id, concat(concat(coalesce(c_last_name, ''), ', '), coalesce(c_first_name, ''))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: c_customer_id ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=64B cardinality=20
+|  in pipelines: 09(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+Per-Instance Resources: mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=1
+09:TOP-N [LIMIT=100]
+|  order by: c_customer_id ASC
+|  mem-estimate=1.25KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=64B cardinality=20
+|  in pipelines: 09(GETNEXT), 04(OPEN)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: sr_cdemo_sk = c_current_cdemo_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4,2,0,1,3 row-size=125B cardinality=20
+|  in pipelines: 04(GETNEXT), 02(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: c_current_cdemo_sk
+|  |  runtime filters: RF000[bloom] <- c_current_cdemo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2,0,1,3 row-size=121B cardinality=18
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: hd_income_band_sk = ib_income_band_sk
+|  |  fk/pk conjuncts: hd_income_band_sk = ib_income_band_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1,3 row-size=121B cardinality=18
+|  |  in pipelines: 02(GETNEXT), 03(OPEN)
+|  |
+|  |--F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: ib_income_band_sk
+|  |  |  runtime filters: RF002[bloom] <- ib_income_band_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  12:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=12B cardinality=2
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.income_band, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.21KB
+|  |     predicates: ib_lower_bound >= CAST(38128 AS INT), ib_upper_bound <= CAST(88128 AS INT)
+|  |     stored statistics:
+|  |       table: rows=20 size=1.21KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=20
+|  |     parquet statistics predicates: ib_lower_bound >= CAST(38128 AS INT), ib_upper_bound <= CAST(88128 AS INT)
+|  |     parquet dictionary predicates: ib_lower_bound >= CAST(38128 AS INT), ib_upper_bound <= CAST(88128 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=12B cardinality=2
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: hd_demo_sk = c_current_hdemo_sk
+|  |  fk/pk conjuncts: hd_demo_sk = c_current_hdemo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=109B cardinality=173
+|  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |
+|  |--F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.91MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: c_current_hdemo_sk
+|  |  |  runtime filters: RF004[bloom] <- c_current_hdemo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  11:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=36.27KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=101B cardinality=177
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  05:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=03
+|  |  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=101B cardinality=177
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=03 plan-id=04 cohort-id=03
+|  |  |  |  build expressions: ca_address_sk
+|  |  |  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  10:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=1 row-size=25B cardinality=76
+|  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  01:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_city = 'Edgewood'
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_city = 'Edgewood'
+|  |  |     parquet dictionary predicates: ca_city = 'Edgewood'
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=1 row-size=25B cardinality=76
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF006[bloom] -> c_current_addr_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|  |     tuple-ids=0 row-size=76B cardinality=100.00K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     runtime filters: RF002[bloom] -> hd_income_band_sk, RF004[bloom] -> hd_demo_sk
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=2 row-size=8B cardinality=7.20K
+|     in pipelines: 02(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+   HDFS partitions=1/1 files=1 size=15.43MB
+   runtime filters: RF000[bloom] -> sr_cdemo_sk
+   stored statistics:
+     table: rows=287.51K size=15.43MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=287.51K
+   mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=4 row-size=4B cardinality=287.51K
+   in pipelines: 04(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q85.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q85.test
new file mode 100644
index 0000000..cfc0cc4
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q85.test
@@ -0,0 +1,804 @@
+# TPCDS-Q85
+
+SELECT SUBSTRING(r_reason_desc,1,20) ,
+       avg(ws_quantity) ,
+       avg(wr_refunded_cash) ,
+       avg(wr_fee)
+FROM web_sales,
+     web_returns,
+     web_page,
+     customer_demographics cd1,
+     customer_demographics cd2,
+     customer_address,
+     date_dim,
+     reason
+WHERE ws_web_page_sk = wp_web_page_sk
+  AND ws_item_sk = wr_item_sk
+  AND ws_order_number = wr_order_number
+  AND ws_sold_date_sk = d_date_sk
+  AND d_year = 2000
+  AND cd1.cd_demo_sk = wr_refunded_cdemo_sk
+  AND cd2.cd_demo_sk = wr_returning_cdemo_sk
+  AND ca_address_sk = wr_refunded_addr_sk
+  AND r_reason_sk = wr_reason_sk
+  AND ( ( cd1.cd_marital_status = 'M'
+         AND cd1.cd_marital_status = cd2.cd_marital_status
+         AND cd1.cd_education_status = 'Advanced Degree'
+         AND cd1.cd_education_status = cd2.cd_education_status
+         AND ws_sales_price BETWEEN 100.00 AND 150.00 )
+       OR ( cd1.cd_marital_status = 'S'
+           AND cd1.cd_marital_status = cd2.cd_marital_status
+           AND cd1.cd_education_status = 'College'
+           AND cd1.cd_education_status = cd2.cd_education_status
+           AND ws_sales_price BETWEEN 50.00 AND 100.00 )
+       OR ( cd1.cd_marital_status = 'W'
+           AND cd1.cd_marital_status = cd2.cd_marital_status
+           AND cd1.cd_education_status = '2 yr Degree'
+           AND cd1.cd_education_status = cd2.cd_education_status
+           AND ws_sales_price BETWEEN 150.00 AND 200.00 ) )
+  AND ( ( ca_country = 'United States'
+         AND ca_state IN ('IN',
+                          'OH',
+                          'NJ')
+         AND ws_net_profit BETWEEN 100 AND 200)
+       OR ( ca_country = 'United States'
+           AND ca_state IN ('WI',
+                            'CT',
+                            'KY')
+           AND ws_net_profit BETWEEN 150 AND 300)
+       OR ( ca_country = 'United States'
+           AND ca_state IN ('LA',
+                            'IA',
+                            'AR')
+           AND ws_net_profit BETWEEN 50 AND 250) )
+GROUP BY r_reason_desc
+ORDER BY SUBSTRING(r_reason_desc,1,20) ,
+         avg(ws_quantity) ,
+         avg(wr_refunded_cash) ,
+         avg(wr_fee)
+LIMIT 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=62.09MB Threads=9
+Per-Host Resource Estimates: Memory=601MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=601.31MB mem-reservation=62.09MB thread-reservation=9 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: substring(r_reason_desc, 1, 20), avg(ws_quantity), avg(wr_refunded_cash), avg(wr_fee)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+16:TOP-N [LIMIT=100]
+|  order by: substring(r_reason_desc, 1, 20) ASC, avg(ws_quantity) ASC, avg(wr_refunded_cash) ASC, avg(wr_fee) ASC
+|  materialized: substring(r_reason_desc, 1, 20)
+|  mem-estimate=1.16KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=36B cardinality=33
+|  in pipelines: 16(GETNEXT), 15(OPEN)
+|
+15:AGGREGATE [FINALIZE]
+|  output: avg(CAST(ws_quantity AS BIGINT)), avg(wr_refunded_cash), avg(wr_fee)
+|  group by: r_reason_desc
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9 row-size=53B cardinality=33
+|  in pipelines: 15(GETNEXT), 04(OPEN)
+|
+14:HASH JOIN [INNER JOIN]
+|  hash predicates: wr_reason_sk = r_reason_sk
+|  fk/pk conjuncts: wr_reason_sk = r_reason_sk
+|  runtime filters: RF000[bloom] <- r_reason_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4,5,3,1,0,6,2,7 row-size=241B cardinality=365
+|  in pipelines: 04(GETNEXT), 07(OPEN)
+|
+|--07:SCAN HDFS [tpcds_parquet.reason]
+|     HDFS partitions=1/1 files=1 size=1.92KB
+|     stored statistics:
+|       table: rows=35 size=1.92KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=35
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=7 row-size=33B cardinality=35
+|     in pipelines: 07(GETNEXT)
+|
+13:HASH JOIN [INNER JOIN]
+|  hash predicates: cd2.cd_demo_sk = wr_returning_cdemo_sk, cd2.cd_marital_status = cd1.cd_marital_status, cd2.cd_education_status = cd1.cd_education_status
+|  fk/pk conjuncts: cd2.cd_demo_sk = wr_returning_cdemo_sk
+|  runtime filters: RF002[bloom] <- wr_returning_cdemo_sk, RF003[bloom] <- cd1.cd_marital_status, RF004[bloom] <- cd1.cd_education_status
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4,5,3,1,0,6,2 row-size=208B cardinality=365
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_web_page_sk = wp_web_page_sk
+|  |  fk/pk conjuncts: ws_web_page_sk = wp_web_page_sk
+|  |  runtime filters: RF008[bloom] <- wp_web_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,3,1,0,6,2 row-size=170B cardinality=365
+|  |  in pipelines: 05(GETNEXT), 02(OPEN)
+|  |
+|  |--02:SCAN HDFS [tpcds_parquet.web_page]
+|  |     HDFS partitions=1/1 files=1 size=5.56KB
+|  |     stored statistics:
+|  |       table: rows=60 size=5.56KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=60
+|  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=4B cardinality=60
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  11:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ca_address_sk = wr_refunded_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = wr_refunded_addr_sk
+|  |  other predicates: ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY') OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY') OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ca_state IN ('LA', 'IA', 'AR')
+|  |  runtime filters: RF010[bloom] <- wr_refunded_addr_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,3,1,0,6 row-size=166B cardinality=365
+|  |  in pipelines: 05(GETNEXT), 03(OPEN)
+|  |
+|  |--10:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=3,1,0,6 row-size=123B cardinality=1.59K
+|  |  |  in pipelines: 03(GETNEXT), 06(OPEN)
+|  |  |
+|  |  |--06:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2000 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=6 row-size=8B cardinality=373
+|  |  |     in pipelines: 06(GETNEXT)
+|  |  |
+|  |  09:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: wr_item_sk = ws_item_sk, wr_order_number = ws_order_number
+|  |  |  fk/pk conjuncts: wr_item_sk = ws_item_sk, wr_order_number = ws_order_number
+|  |  |  other predicates: cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_education_status = '2 yr Degree', cd1.cd_marital_status = 'M' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  |  |  runtime filters: RF014[bloom] <- ws_item_sk, RF015[bloom] <- ws_order_number
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=3,1,0 row-size=115B cardinality=7.72K
+|  |  |  in pipelines: 03(GETNEXT), 00(OPEN)
+|  |  |
+|  |  |--00:SCAN HDFS [tpcds_parquet.web_sales]
+|  |  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |  |     predicates: ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  |  |     runtime filters: RF008[bloom] -> ws_web_page_sk, RF012[bloom] -> ws_sold_date_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=719.38K size=45.09MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |  |     parquet dictionary predicates: ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  |  |     mem-estimate=224.00MB mem-reservation=16.00MB thread-reservation=1
+|  |  |     tuple-ids=0 row-size=36B cardinality=71.94K
+|  |  |     in pipelines: 00(GETNEXT)
+|  |  |
+|  |  08:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: cd1.cd_demo_sk = wr_refunded_cdemo_sk
+|  |  |  fk/pk conjuncts: none
+|  |  |  runtime filters: RF018[bloom] <- wr_refunded_cdemo_sk
+|  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  tuple-ids=3,1 row-size=79B cardinality=71.76K
+|  |  |  in pipelines: 03(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--01:SCAN HDFS [tpcds_parquet.web_returns]
+|  |  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |  |     runtime filters: RF000[bloom] -> wr_reason_sk, RF014[bloom] -> wr_item_sk, RF015[bloom] -> wr_order_number
+|  |  |     stored statistics:
+|  |  |       table: rows=71.76K size=5.66MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |  |     mem-estimate=128.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=40B cardinality=71.76K
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  03:SCAN HDFS [tpcds_parquet.customer_demographics cd1]
+|  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |     predicates: cd1.cd_marital_status = 'M' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W' AND cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W' AND cd1.cd_education_status = '2 yr Degree'
+|  |     runtime filters: RF018[bloom] -> cd1.cd_demo_sk
+|  |     stored statistics:
+|  |       table: rows=1.92M size=7.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=3 row-size=39B cardinality=181.75K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.customer_address]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY', 'LA', 'IA', 'AR'), ca_country = 'United States'
+|     runtime filters: RF010[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY', 'LA', 'IA', 'AR'), ca_country = 'United States'
+|     parquet dictionary predicates: ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY', 'LA', 'IA', 'AR'), ca_country = 'United States'
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=5 row-size=43B cardinality=8.82K
+|     in pipelines: 05(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.customer_demographics cd2]
+   HDFS partitions=1/1 files=1 size=7.49MB
+   predicates: cd2.cd_marital_status = 'M' OR cd2.cd_marital_status = 'S' AND cd2.cd_education_status = 'College' OR cd2.cd_marital_status = 'W' AND cd2.cd_education_status = '2 yr Degree', cd2.cd_education_status = 'Advanced Degree' OR cd2.cd_marital_status = 'S' AND cd2.cd_education_status = 'College' OR cd2.cd_marital_status = 'W' AND cd2.cd_education_status = '2 yr Degree'
+   runtime filters: RF002[bloom] -> cd2.cd_demo_sk, RF003[bloom] -> cd2.cd_marital_status, RF004[bloom] -> cd2.cd_education_status
+   stored statistics:
+     table: rows=1.92M size=7.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=1.92M
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=4 row-size=39B cardinality=181.75K
+   in pipelines: 04(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=78.65MB Threads=19
+Per-Host Resource Estimates: Memory=644MB
+F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: substring(r_reason_desc, 1, 20), avg(ws_quantity), avg(wr_refunded_cash), avg(wr_fee)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: substring(r_reason_desc, 1, 20) ASC, avg(ws_quantity) ASC, avg(wr_refunded_cash) ASC, avg(wr_fee) ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=36B cardinality=33
+|  in pipelines: 16(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(r_reason_desc)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: substring(r_reason_desc, 1, 20) ASC, avg(ws_quantity) ASC, avg(wr_refunded_cash) ASC, avg(wr_fee) ASC
+|  materialized: substring(r_reason_desc, 1, 20)
+|  mem-estimate=1.16KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=36B cardinality=33
+|  in pipelines: 16(GETNEXT), 26(OPEN)
+|
+26:AGGREGATE [FINALIZE]
+|  output: avg:merge(ws_quantity), avg:merge(wr_refunded_cash), avg:merge(wr_fee)
+|  group by: r_reason_desc
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9 row-size=53B cardinality=33
+|  in pipelines: 26(GETNEXT), 04(OPEN)
+|
+25:EXCHANGE [HASH(r_reason_desc)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=53B cardinality=33
+|  in pipelines: 04(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Resources: mem-estimate=66.02MB mem-reservation=17.88MB thread-reservation=2 runtime-filters-memory=4.00MB
+15:AGGREGATE [STREAMING]
+|  output: avg(CAST(ws_quantity AS BIGINT)), avg(wr_refunded_cash), avg(wr_fee)
+|  group by: r_reason_desc
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=53B cardinality=33
+|  in pipelines: 04(GETNEXT)
+|
+14:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: wr_reason_sk = r_reason_sk
+|  fk/pk conjuncts: wr_reason_sk = r_reason_sk
+|  runtime filters: RF000[bloom] <- r_reason_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4,5,0,3,1,6,2,7 row-size=241B cardinality=365
+|  in pipelines: 04(GETNEXT), 07(OPEN)
+|
+|--24:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=33B cardinality=35
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  07:SCAN HDFS [tpcds_parquet.reason, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.92KB
+|     stored statistics:
+|       table: rows=35 size=1.92KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=35
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=7 row-size=33B cardinality=35
+|     in pipelines: 07(GETNEXT)
+|
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cd2.cd_demo_sk = wr_returning_cdemo_sk, cd2.cd_marital_status = cd1.cd_marital_status, cd2.cd_education_status = cd1.cd_education_status
+|  fk/pk conjuncts: cd2.cd_demo_sk = wr_returning_cdemo_sk
+|  runtime filters: RF002[bloom] <- wr_returning_cdemo_sk, RF003[bloom] <- cd1.cd_marital_status, RF004[bloom] <- cd1.cd_education_status
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4,5,0,3,1,6,2 row-size=208B cardinality=365
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=129.44KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5,0,3,1,6,2 row-size=170B cardinality=365
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=54.21MB mem-reservation=6.12MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_web_page_sk = wp_web_page_sk
+|  |  fk/pk conjuncts: ws_web_page_sk = wp_web_page_sk
+|  |  runtime filters: RF008[bloom] <- wp_web_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,0,3,1,6,2 row-size=170B cardinality=365
+|  |  in pipelines: 05(GETNEXT), 02(OPEN)
+|  |
+|  |--22:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=4B cardinality=60
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=2
+|  |  02:SCAN HDFS [tpcds_parquet.web_page, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.56KB
+|  |     stored statistics:
+|  |       table: rows=60 size=5.56KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=60
+|  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=4B cardinality=60
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ca_address_sk = wr_refunded_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = wr_refunded_addr_sk
+|  |  other predicates: ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY') OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY') OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ca_state IN ('LA', 'IA', 'AR')
+|  |  runtime filters: RF010[bloom] <- wr_refunded_addr_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,0,3,1,6 row-size=166B cardinality=365
+|  |  in pipelines: 05(GETNEXT), 00(OPEN)
+|  |
+|  |--21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=328.65KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0,3,1,6 row-size=123B cardinality=1.59K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [HASH(ws_item_sk,ws_order_number)] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=20.23MB mem-reservation=13.44MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  |  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,3,1,6 row-size=123B cardinality=1.59K
+|  |  |  in pipelines: 00(GETNEXT), 06(OPEN)
+|  |  |
+|  |  |--20:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 06(GETNEXT)
+|  |  |  |
+|  |  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  |  06:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2000 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |     tuple-ids=6 row-size=8B cardinality=373
+|  |  |     in pipelines: 06(GETNEXT)
+|  |  |
+|  |  09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  other predicates: cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_education_status = '2 yr Degree', cd1.cd_marital_status = 'M' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  |  |  runtime filters: RF014[bloom] <- wr_item_sk, RF015[bloom] <- wr_order_number
+|  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |  tuple-ids=0,3,1 row-size=115B cardinality=7.72K
+|  |  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |  |
+|  |  |--19:EXCHANGE [HASH(wr_item_sk,wr_order_number)]
+|  |  |  |  mem-estimate=5.46MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=3,1 row-size=79B cardinality=71.76K
+|  |  |  |  in pipelines: 03(GETNEXT)
+|  |  |  |
+|  |  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=56.53MB mem-reservation=13.75MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  |  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash predicates: cd1.cd_demo_sk = wr_refunded_cdemo_sk
+|  |  |  |  fk/pk conjuncts: none
+|  |  |  |  runtime filters: RF018[bloom] <- wr_refunded_cdemo_sk
+|  |  |  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  |  tuple-ids=3,1 row-size=79B cardinality=71.76K
+|  |  |  |  in pipelines: 03(GETNEXT), 01(OPEN)
+|  |  |  |
+|  |  |  |--17:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=2.78MB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=1 row-size=40B cardinality=71.76K
+|  |  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Resources: mem-estimate=129.00MB mem-reservation=5.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  |  |  01:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |  |  |     runtime filters: RF000[bloom] -> wr_reason_sk
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=71.76K size=5.66MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |  |  |     mem-estimate=128.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |  |     tuple-ids=1 row-size=40B cardinality=71.76K
+|  |  |  |     in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  03:SCAN HDFS [tpcds_parquet.customer_demographics cd1, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |  |     predicates: cd1.cd_marital_status = 'M' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W' AND cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W' AND cd1.cd_education_status = '2 yr Degree'
+|  |  |     runtime filters: RF018[bloom] -> cd1.cd_demo_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=1.92M size=7.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |  |     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |     tuple-ids=3 row-size=39B cardinality=181.75K
+|  |  |     in pipelines: 03(GETNEXT)
+|  |  |
+|  |  18:EXCHANGE [HASH(ws_item_sk,ws_order_number)]
+|  |  |  mem-estimate=1.31MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=36B cardinality=71.94K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=228.00MB mem-reservation=20.00MB thread-reservation=2 runtime-filters-memory=4.00MB
+|  |  00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     predicates: ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  |     runtime filters: RF008[bloom] -> ws_web_page_sk, RF012[bloom] -> ws_sold_date_sk, RF014[bloom] -> ws_item_sk, RF015[bloom] -> ws_order_number
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     parquet dictionary predicates: ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  |     mem-estimate=224.00MB mem-reservation=16.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=36B cardinality=71.94K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY', 'LA', 'IA', 'AR'), ca_country = 'United States'
+|     runtime filters: RF010[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY', 'LA', 'IA', 'AR'), ca_country = 'United States'
+|     parquet dictionary predicates: ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY', 'LA', 'IA', 'AR'), ca_country = 'United States'
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=5 row-size=43B cardinality=8.82K
+|     in pipelines: 05(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.customer_demographics cd2, RANDOM]
+   HDFS partitions=1/1 files=1 size=7.49MB
+   predicates: cd2.cd_marital_status = 'M' OR cd2.cd_marital_status = 'S' AND cd2.cd_education_status = 'College' OR cd2.cd_marital_status = 'W' AND cd2.cd_education_status = '2 yr Degree', cd2.cd_education_status = 'Advanced Degree' OR cd2.cd_marital_status = 'S' AND cd2.cd_education_status = 'College' OR cd2.cd_marital_status = 'W' AND cd2.cd_education_status = '2 yr Degree'
+   runtime filters: RF002[bloom] -> cd2.cd_demo_sk, RF003[bloom] -> cd2.cd_marital_status, RF004[bloom] -> cd2.cd_education_status
+   stored statistics:
+     table: rows=1.92M size=7.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=1.92M
+   mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=4 row-size=39B cardinality=181.75K
+   in pipelines: 04(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=98.09MB Threads=18
+Per-Host Resource Estimates: Memory=231MB
+F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: substring(r_reason_desc, 1, 20), avg(ws_quantity), avg(wr_refunded_cash), avg(wr_fee)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+27:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: substring(r_reason_desc, 1, 20) ASC, avg(ws_quantity) ASC, avg(wr_refunded_cash) ASC, avg(wr_fee) ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=36B cardinality=33
+|  in pipelines: 16(GETNEXT)
+|
+F09:PLAN FRAGMENT [HASH(r_reason_desc)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+16:TOP-N [LIMIT=100]
+|  order by: substring(r_reason_desc, 1, 20) ASC, avg(ws_quantity) ASC, avg(wr_refunded_cash) ASC, avg(wr_fee) ASC
+|  materialized: substring(r_reason_desc, 1, 20)
+|  mem-estimate=1.16KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=36B cardinality=33
+|  in pipelines: 16(GETNEXT), 26(OPEN)
+|
+26:AGGREGATE [FINALIZE]
+|  output: avg:merge(ws_quantity), avg:merge(wr_refunded_cash), avg:merge(wr_fee)
+|  group by: r_reason_desc
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9 row-size=53B cardinality=33
+|  in pipelines: 26(GETNEXT), 04(OPEN)
+|
+25:EXCHANGE [HASH(r_reason_desc)]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=53B cardinality=33
+|  in pipelines: 04(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=10.00MB thread-reservation=1
+15:AGGREGATE [STREAMING]
+|  output: avg(CAST(ws_quantity AS BIGINT)), avg(wr_refunded_cash), avg(wr_fee)
+|  group by: r_reason_desc
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=53B cardinality=33
+|  in pipelines: 04(GETNEXT)
+|
+14:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: wr_reason_sk = r_reason_sk
+|  fk/pk conjuncts: wr_reason_sk = r_reason_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4,5,0,3,1,6,2,7 row-size=241B cardinality=365
+|  in pipelines: 04(GETNEXT), 07(OPEN)
+|
+|--F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: r_reason_sk
+|  |  runtime filters: RF000[bloom] <- r_reason_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  24:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=7 row-size=33B cardinality=35
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  07:SCAN HDFS [tpcds_parquet.reason, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.92KB
+|     stored statistics:
+|       table: rows=35 size=1.92KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=35
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=7 row-size=33B cardinality=35
+|     in pipelines: 07(GETNEXT)
+|
+13:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: cd2.cd_demo_sk = wr_returning_cdemo_sk, cd2.cd_marital_status = cd1.cd_marital_status, cd2.cd_education_status = cd1.cd_education_status
+|  fk/pk conjuncts: cd2.cd_demo_sk = wr_returning_cdemo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4,5,0,3,1,6,2 row-size=208B cardinality=365
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=7.00MB mem-reservation=6.88MB thread-reservation=1 runtime-filters-memory=3.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: wr_returning_cdemo_sk, cd1.cd_marital_status, cd1.cd_education_status
+|  |  runtime filters: RF002[bloom] <- wr_returning_cdemo_sk, RF003[bloom] <- cd1.cd_marital_status, RF004[bloom] <- cd1.cd_education_status
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  23:EXCHANGE [BROADCAST]
+|  |  mem-estimate=129.44KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5,0,3,1,6,2 row-size=170B cardinality=365
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: ws_web_page_sk = wp_web_page_sk
+|  |  fk/pk conjuncts: ws_web_page_sk = wp_web_page_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,0,3,1,6,2 row-size=170B cardinality=365
+|  |  in pipelines: 05(GETNEXT), 02(OPEN)
+|  |
+|  |--F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: wp_web_page_sk
+|  |  |  runtime filters: RF008[bloom] <- wp_web_page_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  22:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=4B cardinality=60
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=1
+|  |  02:SCAN HDFS [tpcds_parquet.web_page, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.56KB
+|  |     stored statistics:
+|  |       table: rows=60 size=5.56KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=60
+|  |     mem-estimate=16.00MB mem-reservation=8.00KB thread-reservation=0
+|  |     tuple-ids=2 row-size=4B cardinality=60
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  11:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: ca_address_sk = wr_refunded_addr_sk
+|  |  fk/pk conjuncts: ca_address_sk = wr_refunded_addr_sk
+|  |  other predicates: ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY') OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY') OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ca_state IN ('IN', 'OH', 'NJ') OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ca_state IN ('LA', 'IA', 'AR'), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ca_state IN ('WI', 'CT', 'KY') OR ca_state IN ('LA', 'IA', 'AR')
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,0,3,1,6 row-size=166B cardinality=365
+|  |  in pipelines: 05(GETNEXT), 00(OPEN)
+|  |
+|  |--F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=5.20MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: wr_refunded_addr_sk
+|  |  |  runtime filters: RF010[bloom] <- wr_refunded_addr_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  21:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=328.65KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0,3,1,6 row-size=123B cardinality=1.59K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [HASH(ws_item_sk,ws_order_number)] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=1.31MB mem-reservation=0B thread-reservation=1
+|  |  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash-table-id=04
+|  |  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,3,1,6 row-size=123B cardinality=1.59K
+|  |  |  in pipelines: 00(GETNEXT), 06(OPEN)
+|  |  |
+|  |  |--F15:PLAN FRAGMENT [HASH(ws_item_sk,ws_order_number)] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=04 plan-id=05 cohort-id=03
+|  |  |  |  build expressions: d_date_sk
+|  |  |  |  runtime filters: RF012[bloom] <- d_date_sk
+|  |  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  |
+|  |  |  20:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=6 row-size=8B cardinality=373
+|  |  |  |  in pipelines: 06(GETNEXT)
+|  |  |  |
+|  |  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  |  06:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: d_year = CAST(2000 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: d_year = CAST(2000 AS INT)
+|  |  |     parquet dictionary predicates: d_year = CAST(2000 AS INT)
+|  |  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |  |     tuple-ids=6 row-size=8B cardinality=373
+|  |  |     in pipelines: 06(GETNEXT)
+|  |  |
+|  |  09:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash-table-id=05
+|  |  |  hash predicates: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  fk/pk conjuncts: ws_item_sk = wr_item_sk, ws_order_number = wr_order_number
+|  |  |  other predicates: cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_marital_status = 'M' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_marital_status = 'M' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'S' OR cd1.cd_education_status = '2 yr Degree', cd1.cd_marital_status = 'M' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_marital_status = 'M' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_marital_status = 'W', cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_marital_status = 'W', ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_education_status = '2 yr Degree', ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = 'College' OR cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), cd1.cd_education_status = 'Advanced Degree' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  |  |  tuple-ids=0,3,1 row-size=115B cardinality=7.72K
+|  |  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |  |
+|  |  |--F16:PLAN FRAGMENT [HASH(ws_item_sk,ws_order_number)] hosts=1 instances=1
+|  |  |  |  Per-Instance Resources: mem-estimate=15.96MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=2.00MB
+|  |  |  JOIN BUILD
+|  |  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  |  build expressions: wr_item_sk, wr_order_number
+|  |  |  |  runtime filters: RF014[bloom] <- wr_item_sk, RF015[bloom] <- wr_order_number
+|  |  |  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  |  |
+|  |  |  19:EXCHANGE [HASH(wr_item_sk,wr_order_number)]
+|  |  |  |  mem-estimate=5.46MB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=3,1 row-size=79B cardinality=71.76K
+|  |  |  |  in pipelines: 03(GETNEXT)
+|  |  |  |
+|  |  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  |  |  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  |  hash-table-id=06
+|  |  |  |  hash predicates: cd1.cd_demo_sk = wr_refunded_cdemo_sk
+|  |  |  |  fk/pk conjuncts: none
+|  |  |  |  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  |  |  |  tuple-ids=3,1 row-size=79B cardinality=71.76K
+|  |  |  |  in pipelines: 03(GETNEXT), 01(OPEN)
+|  |  |  |
+|  |  |  |--F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  |  Per-Instance Resources: mem-estimate=13.28MB mem-reservation=10.50MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  |  |  JOIN BUILD
+|  |  |  |  |  join-table-id=06 plan-id=07 cohort-id=04
+|  |  |  |  |  build expressions: wr_refunded_cdemo_sk
+|  |  |  |  |  runtime filters: RF018[bloom] <- wr_refunded_cdemo_sk
+|  |  |  |  |  mem-estimate=9.50MB mem-reservation=9.50MB spill-buffer=256.00KB thread-reservation=0
+|  |  |  |  |
+|  |  |  |  17:EXCHANGE [BROADCAST]
+|  |  |  |  |  mem-estimate=2.78MB mem-reservation=0B thread-reservation=0
+|  |  |  |  |  tuple-ids=1 row-size=40B cardinality=71.76K
+|  |  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |  |
+|  |  |  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  |  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  |  |  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=1
+|  |  |  |  01:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|  |  |  |     HDFS partitions=1/1 files=1 size=5.66MB
+|  |  |  |     runtime filters: RF000[bloom] -> wr_reason_sk
+|  |  |  |     stored statistics:
+|  |  |  |       table: rows=71.76K size=5.66MB
+|  |  |  |       columns: all
+|  |  |  |     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|  |  |  |     mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+|  |  |  |     tuple-ids=1 row-size=40B cardinality=71.76K
+|  |  |  |     in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  03:SCAN HDFS [tpcds_parquet.customer_demographics cd1, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=7.49MB
+|  |  |     predicates: cd1.cd_marital_status = 'M' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W' AND cd1.cd_education_status = '2 yr Degree', cd1.cd_education_status = 'Advanced Degree' OR cd1.cd_marital_status = 'S' AND cd1.cd_education_status = 'College' OR cd1.cd_marital_status = 'W' AND cd1.cd_education_status = '2 yr Degree'
+|  |  |     runtime filters: RF018[bloom] -> cd1.cd_demo_sk
+|  |  |     stored statistics:
+|  |  |       table: rows=1.92M size=7.49MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|  |  |     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|  |  |     tuple-ids=3 row-size=39B cardinality=181.75K
+|  |  |     in pipelines: 03(GETNEXT)
+|  |  |
+|  |  18:EXCHANGE [HASH(ws_item_sk,ws_order_number)]
+|  |  |  mem-estimate=1.31MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0 row-size=36B cardinality=71.94K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+|  |  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=1
+|  |  00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     predicates: ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  |     runtime filters: RF008[bloom] -> ws_web_page_sk, RF012[bloom] -> ws_sold_date_sk, RF014[bloom] -> ws_item_sk, RF015[bloom] -> ws_order_number
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     parquet dictionary predicates: ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit <= CAST(200 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit <= CAST(300 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit <= CAST(250 AS DECIMAL(5,0)), ws_net_profit >= CAST(100 AS DECIMAL(3,0)) OR ws_net_profit >= CAST(150 AS DECIMAL(5,0)) OR ws_net_profit >= CAST(50 AS DECIMAL(3,0)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price <= CAST(150.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price <= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price <= CAST(200.00 AS DECIMAL(5,2)), ws_sales_price >= CAST(100.00 AS DECIMAL(5,2)) OR ws_sales_price >= CAST(50.00 AS DECIMAL(4,2)) OR ws_sales_price >= CAST(150.00 AS DECIMAL(5,2))
+|  |     mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+|  |     tuple-ids=0 row-size=36B cardinality=71.94K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.16MB
+|     predicates: ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY', 'LA', 'IA', 'AR'), ca_country = 'United States'
+|     runtime filters: RF010[bloom] -> ca_address_sk
+|     stored statistics:
+|       table: rows=50.00K size=1.16MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|     parquet statistics predicates: ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY', 'LA', 'IA', 'AR'), ca_country = 'United States'
+|     parquet dictionary predicates: ca_state IN ('IN', 'OH', 'NJ', 'WI', 'CT', 'KY', 'LA', 'IA', 'AR'), ca_country = 'United States'
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=5 row-size=43B cardinality=8.82K
+|     in pipelines: 05(GETNEXT)
+|
+04:SCAN HDFS [tpcds_parquet.customer_demographics cd2, RANDOM]
+   HDFS partitions=1/1 files=1 size=7.49MB
+   predicates: cd2.cd_marital_status = 'M' OR cd2.cd_marital_status = 'S' AND cd2.cd_education_status = 'College' OR cd2.cd_marital_status = 'W' AND cd2.cd_education_status = '2 yr Degree', cd2.cd_education_status = 'Advanced Degree' OR cd2.cd_marital_status = 'S' AND cd2.cd_education_status = 'College' OR cd2.cd_marital_status = 'W' AND cd2.cd_education_status = '2 yr Degree'
+   runtime filters: RF002[bloom] -> cd2.cd_demo_sk, RF003[bloom] -> cd2.cd_marital_status, RF004[bloom] -> cd2.cd_education_status
+   stored statistics:
+     table: rows=1.92M size=7.49MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=1.92M
+   mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=4 row-size=39B cardinality=181.75K
+   in pipelines: 04(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q86.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q86.test
new file mode 100644
index 0000000..49430fd
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q86.test
@@ -0,0 +1,278 @@
+# TPCDS-Q86
+select
+    sum(ws_net_paid) as total_sum
+   ,i_category
+   ,i_class
+   ,grouping(i_category)+grouping(i_class) as lochierarchy
+   ,rank() over (
+        partition by grouping(i_category)+grouping(i_class),
+        case when grouping(i_class) = 0 then i_category end
+        order by sum(ws_net_paid) desc) as rank_within_parent
+ from
+    web_sales
+   ,date_dim       d1
+   ,item
+ where
+    d1.d_month_seq between 1212 and 1212+11
+ and d1.d_date_sk = ws_sold_date_sk
+ and i_item_sk  = ws_item_sk
+ group by rollup(i_category,i_class)
+ order by
+   lochierarchy desc,
+  -- Modified from original because Impala does not allow aliases within order by
+  -- expressions, except at the top level.
+   case when grouping(i_category)+grouping(i_class) = 0 then i_category end,
+   rank_within_parent
+ limit 100
+---- PLAN
+Max Per-Host Resource Reservation: Memory=23.69MB Threads=4
+Per-Host Resource Estimates: Memory=186MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=185.88MB mem-reservation=23.69MB thread-reservation=4 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END), CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END, CASE valid_tid(3,4,5) WHEN 3 THEN i_class WHEN 4 THEN NULL WHEN 5 THEN NULL END, CAST(aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) AS SMALLINT) + CAST(aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) AS SMALLINT), rank()
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+09:TOP-N [LIMIT=100]
+|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END ASC, rank() ASC
+|  mem-estimate=4.88KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=50B cardinality=100
+|  in pipelines: 09(GETNEXT), 07(OPEN)
+|
+08:ANALYTIC
+|  functions: rank()
+|  partition by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END), CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END
+|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END) DESC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=15,14 row-size=54B cardinality=1.00K
+|  in pipelines: 07(GETNEXT)
+|
+07:SORT
+|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END) DESC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=15 row-size=46B cardinality=1.00K
+|  in pipelines: 07(GETNEXT), 06(OPEN)
+|
+06:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(3,4,5) IN (CAST(3 AS INT), CAST(4 AS INT), CAST(5 AS INT)), CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN sum(ws_net_paid) WHEN CAST(4 AS INT) THEN sum(ws_net_paid) WHEN CAST(5 AS INT) THEN sum(ws_net_paid) END), aggif(valid_tid(3,4,5) IN (CAST(3 AS INT), CAST(4 AS INT), CAST(5 AS INT)), CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(4 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(5 AS INT) THEN CAST(1 AS TINYINT) END), aggif(valid_tid(3,4,5) IN (CAST(3 AS INT), CAST(4 AS INT), CAST(5 AS INT)), CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(4 AS INT) THEN CAST(1 AS TINYINT) WHEN CAST(5 AS INT) THEN CAST(1 AS TINYINT) END)
+|  group by: CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN i_category WHEN CAST(4 AS INT) THEN i_category WHEN CAST(5 AS INT) THEN NULL END, CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN i_class WHEN CAST(4 AS INT) THEN NULL WHEN CAST(5 AS INT) THEN NULL END, CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN CAST(3 AS INT) WHEN CAST(4 AS INT) THEN CAST(4 AS INT) WHEN CAST(5 AS INT) THEN CAST(5 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=46B cardinality=1.00K
+|  in pipelines: 06(GETNEXT), 05(OPEN)
+|
+05:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum(ws_net_paid)
+|    group by: i_category, i_class
+|  Class 1
+|    output: sum(ws_net_paid)
+|    group by: i_category, NULL
+|  Class 2
+|    output: sum(ws_net_paid)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=5.81MB thread-reservation=0
+|  tuple-ids=3N,4N,5N row-size=140B cardinality=1.00K
+|  in pipelines: 05(GETNEXT), 00(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_item_sk = i_item_sk
+|  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=70B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=46B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_sold_date_sk = d1.d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d1.d_date_sk
+|  runtime filters: RF002[bloom] <- d1.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim d1]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     parquet dictionary predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_item_sk, RF002[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=44.38MB Threads=9
+Per-Host Resource Estimates: Memory=269MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END), CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END, CASE valid_tid(3,4,5) WHEN 3 THEN i_class WHEN 4 THEN NULL WHEN 5 THEN NULL END, CAST(aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) AS SMALLINT) + CAST(aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) AS SMALLINT), rank()
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+15:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END ASC, rank() ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=50B cardinality=100
+|  in pipelines: 09(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END),CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=16.12MB mem-reservation=16.00MB thread-reservation=1
+09:TOP-N [LIMIT=100]
+|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) DESC, CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END ASC, rank() ASC
+|  mem-estimate=4.88KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=50B cardinality=100
+|  in pipelines: 09(GETNEXT), 07(OPEN)
+|
+08:ANALYTIC
+|  functions: rank()
+|  partition by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END), CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END
+|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END) DESC
+|  window: RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=15,14 row-size=54B cardinality=1.00K
+|  in pipelines: 07(GETNEXT)
+|
+07:SORT
+|  order by: aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) ASC NULLS LAST, CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END ASC NULLS LAST, aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN sum(ws_net_paid) WHEN 4 THEN sum(ws_net_paid) WHEN 5 THEN sum(ws_net_paid) END) DESC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=15 row-size=46B cardinality=1.00K
+|  in pipelines: 07(GETNEXT), 06(OPEN)
+|
+14:EXCHANGE [HASH(aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 0 WHEN 5 THEN 1 END) + aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END),CASE WHEN aggif(valid_tid(3,4,5) IN (3, 4, 5), CASE valid_tid(3,4,5) WHEN 3 THEN 0 WHEN 4 THEN 1 WHEN 5 THEN 1 END) = 0 THEN CASE valid_tid(3,4,5) WHEN 3 THEN i_category WHEN 4 THEN i_category WHEN 5 THEN NULL END END)]
+|  mem-estimate=120.24KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=46B cardinality=1.00K
+|  in pipelines: 06(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(CASE valid_tid(3,4,5) WHEN 3 THEN murmur_hash(i_category) WHEN 4 THEN murmur_hash(i_category) WHEN 5 THEN murmur_hash(NULL) END,CASE valid_tid(3,4,5) WHEN 3 THEN murmur_hash(i_class) WHEN 4 THEN murmur_hash(NULL) WHEN 5 THEN murmur_hash(NULL) END)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=40.00MB mem-reservation=7.75MB thread-reservation=1
+06:AGGREGATE [FINALIZE]
+|  output: aggif(valid_tid(3,4,5) IN (CAST(3 AS INT), CAST(4 AS INT), CAST(5 AS INT)), CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN sum(ws_net_paid) WHEN CAST(4 AS INT) THEN sum(ws_net_paid) WHEN CAST(5 AS INT) THEN sum(ws_net_paid) END), aggif(valid_tid(3,4,5) IN (CAST(3 AS INT), CAST(4 AS INT), CAST(5 AS INT)), CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(4 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(5 AS INT) THEN CAST(1 AS TINYINT) END), aggif(valid_tid(3,4,5) IN (CAST(3 AS INT), CAST(4 AS INT), CAST(5 AS INT)), CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN CAST(0 AS TINYINT) WHEN CAST(4 AS INT) THEN CAST(1 AS TINYINT) WHEN CAST(5 AS INT) THEN CAST(1 AS TINYINT) END)
+|  group by: CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN i_category WHEN CAST(4 AS INT) THEN i_category WHEN CAST(5 AS INT) THEN NULL END, CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN i_class WHEN CAST(4 AS INT) THEN NULL WHEN CAST(5 AS INT) THEN NULL END, CASE valid_tid(3,4,5) WHEN CAST(3 AS INT) THEN CAST(3 AS INT) WHEN CAST(4 AS INT) THEN CAST(4 AS INT) WHEN CAST(5 AS INT) THEN CAST(5 AS INT) END
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=46B cardinality=1.00K
+|  in pipelines: 06(GETNEXT), 13(OPEN)
+|
+13:AGGREGATE [FINALIZE]
+|  Class 0
+|    output: sum:merge(ws_net_paid)
+|    group by: i_category, i_class
+|  Class 1
+|    output: sum:merge(ws_net_paid)
+|    group by: i_category, NULL
+|  Class 2
+|    output: sum:merge(ws_net_paid)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=5.81MB thread-reservation=0
+|  tuple-ids=3N,4N,5N row-size=140B cardinality=1.00K
+|  in pipelines: 13(GETNEXT), 00(OPEN)
+|
+12:EXCHANGE [HASH(CASE valid_tid(3,4,5) WHEN 3 THEN murmur_hash(i_category) WHEN 4 THEN murmur_hash(i_category) WHEN 5 THEN murmur_hash(NULL) END,CASE valid_tid(3,4,5) WHEN 3 THEN murmur_hash(i_class) WHEN 4 THEN murmur_hash(NULL) WHEN 5 THEN murmur_hash(NULL) END)]
+|  mem-estimate=364.54KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3N,4N,5N row-size=140B cardinality=1.00K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=132.77MB mem-reservation=19.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  Class 0
+|    output: sum(ws_net_paid)
+|    group by: i_category, i_class
+|  Class 1
+|    output: sum(ws_net_paid)
+|    group by: i_category, NULL
+|  Class 2
+|    output: sum(ws_net_paid)
+|    group by: NULL, NULL
+|  mem-estimate=30.00MB mem-reservation=6.00MB thread-reservation=0
+|  tuple-ids=3N,4N,5N row-size=140B cardinality=1.00K
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_item_sk = i_item_sk
+|  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=70B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=852.50KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=46B cardinality=18.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=48.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=2 row-size=46B cardinality=18.00K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_sold_date_sk = d1.d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d1.d_date_sk
+|  runtime filters: RF002[bloom] <- d1.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=719.38K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim d1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     parquet dictionary predicates: d1.d_month_seq <= CAST(1223 AS INT), d1.d_month_seq >= CAST(1212 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_item_sk, RF002[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q87.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q87.test
new file mode 100644
index 0000000..4a2c958
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q87.test
@@ -0,0 +1,530 @@
+# TPCDS-Q87
+SELECT count(*)
+FROM ((SELECT DISTINCT c_last_name,
+                         c_first_name,
+                         d_date
+         FROM store_sales,
+              date_dim,
+              customer
+         WHERE store_sales.ss_sold_date_sk = date_dim.d_date_sk
+           AND store_sales.ss_customer_sk = customer.c_customer_sk
+           AND d_month_seq BETWEEN 1200 AND 1200+11)
+      EXCEPT
+        (SELECT DISTINCT c_last_name,
+                         c_first_name,
+                         d_date
+         FROM catalog_sales,
+              date_dim,
+              customer
+         WHERE catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+           AND catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+           AND d_month_seq BETWEEN 1200 AND 1200+11)
+      EXCEPT
+        (SELECT DISTINCT c_last_name,
+                         c_first_name,
+                         d_date
+         FROM web_sales,
+              date_dim,
+              customer
+         WHERE web_sales.ws_sold_date_sk = date_dim.d_date_sk
+           AND web_sales.ws_bill_customer_sk = customer.c_customer_sk
+           AND d_month_seq BETWEEN 1200 AND 1200+11)) cool_cust;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=183.19MB Threads=10
+Per-Host Resource Estimates: Memory=569MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=569.21MB mem-reservation=183.19MB thread-reservation=10 runtime-filters-memory=6.00MB
+PLAN-ROOT SINK
+|  output exprs: count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+20:AGGREGATE [FINALIZE]
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=8B cardinality=1
+|  in pipelines: 20(GETNEXT), 05(OPEN)
+|
+19:HASH JOIN [LEFT ANTI JOIN]
+|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
+|  mem-estimate=43.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 05(GETNEXT), 17(OPEN)
+|
+|--17:AGGREGATE [FINALIZE]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=43.74MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=58B cardinality=719.38K
+|  |  in pipelines: 17(GETNEXT), 12(OPEN)
+|  |
+|  16:HASH JOIN [INNER JOIN]
+|  |  hash predicates: web_sales.ws_bill_customer_sk = customer.c_customer_sk
+|  |  fk/pk conjuncts: web_sales.ws_bill_customer_sk = customer.c_customer_sk
+|  |  runtime filters: RF008[bloom] <- customer.c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=10,11,12 row-size=78B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |
+|  |--14:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=40B cardinality=100.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  15:HASH JOIN [INNER JOIN]
+|  |  hash predicates: web_sales.ws_sold_date_sk = date_dim.d_date_sk
+|  |  fk/pk conjuncts: web_sales.ws_sold_date_sk = date_dim.d_date_sk
+|  |  runtime filters: RF010[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,11 row-size=38B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |
+|  |--13:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=30B cardinality=7.30K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF008[bloom] -> web_sales.ws_bill_customer_sk, RF010[bloom] -> web_sales.ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=8B cardinality=719.38K
+|     in pipelines: 12(GETNEXT)
+|
+18:HASH JOIN [LEFT ANTI JOIN]
+|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
+|  mem-estimate=87.66MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 05(GETNEXT), 11(OPEN)
+|
+|--11:AGGREGATE [FINALIZE]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=87.66MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=8 row-size=58B cardinality=1.44M
+|  |  in pipelines: 11(GETNEXT), 06(OPEN)
+|  |
+|  10:HASH JOIN [INNER JOIN]
+|  |  hash predicates: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+|  |  fk/pk conjuncts: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+|  |  runtime filters: RF004[bloom] <- customer.c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=5,6,7 row-size=78B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT), 08(OPEN)
+|  |
+|  |--08:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=7 row-size=40B cardinality=100.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN]
+|  |  hash predicates: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+|  |  fk/pk conjuncts: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+|  |  runtime filters: RF006[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=38B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--07:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=30B cardinality=7.30K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> catalog_sales.cs_bill_customer_sk, RF006[bloom] -> catalog_sales.cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=1.44M
+|     in pipelines: 06(GETNEXT)
+|
+05:AGGREGATE [FINALIZE]
+|  group by: c_last_name, c_first_name, d_date
+|  mem-estimate=175.15MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 05(GETNEXT), 00(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_customer_sk = customer.c_customer_sk
+|  fk/pk conjuncts: store_sales.ss_customer_sk = customer.c_customer_sk
+|  runtime filters: RF000[bloom] <- customer.c_customer_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.customer]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=40B cardinality=100.00K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  runtime filters: RF002[bloom] <- date_dim.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=38B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=30B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> store_sales.ss_customer_sk, RF002[bloom] -> store_sales.ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=0 row-size=8B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=298.56MB Threads=22
+Per-Host Resource Estimates: Memory=945MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+36:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=8B cardinality=1
+|  in pipelines: 36(GETNEXT), 20(OPEN)
+|
+35:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=16 row-size=8B cardinality=1
+|  in pipelines: 20(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(c_last_name,c_first_name,d_date)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=169.06MB mem-reservation=85.00MB thread-reservation=1
+20:AGGREGATE
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=8B cardinality=1
+|  in pipelines: 20(GETNEXT), 24(OPEN)
+|
+19:HASH JOIN [LEFT ANTI JOIN, PARTITIONED]
+|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 24(GETNEXT), 33(OPEN)
+|
+|--34:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
+|  |  mem-estimate=10.12MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=58B cardinality=719.38K
+|  |  in pipelines: 33(GETNEXT)
+|  |
+|  F11:PLAN FRAGMENT [HASH(c_last_name,c_first_name,d_date)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=44.12MB mem-reservation=34.00MB thread-reservation=1
+|  33:AGGREGATE [FINALIZE]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=58B cardinality=719.38K
+|  |  in pipelines: 33(GETNEXT), 12(OPEN)
+|  |
+|  32:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
+|  |  mem-estimate=10.12MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=13 row-size=58B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  F08:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=110.78MB mem-reservation=46.69MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  17:AGGREGATE [STREAMING]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=13 row-size=58B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT)
+|  |
+|  16:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: web_sales.ws_bill_customer_sk = customer.c_customer_sk
+|  |  fk/pk conjuncts: web_sales.ws_bill_customer_sk = customer.c_customer_sk
+|  |  runtime filters: RF008[bloom] <- customer.c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=10,11,12 row-size=78B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT), 14(OPEN)
+|  |
+|  |--31:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=12 row-size=40B cardinality=100.00K
+|  |  |  in pipelines: 14(GETNEXT)
+|  |  |
+|  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  14:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=12 row-size=40B cardinality=100.00K
+|  |     in pipelines: 14(GETNEXT)
+|  |
+|  15:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: web_sales.ws_sold_date_sk = date_dim.d_date_sk
+|  |  fk/pk conjuncts: web_sales.ws_sold_date_sk = date_dim.d_date_sk
+|  |  runtime filters: RF010[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=10,11 row-size=38B cardinality=719.38K
+|  |  in pipelines: 12(GETNEXT), 13(OPEN)
+|  |
+|  |--30:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=248.01KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=11 row-size=30B cardinality=7.30K
+|  |  |  in pipelines: 13(GETNEXT)
+|  |  |
+|  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  13:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=11 row-size=30B cardinality=7.30K
+|  |     in pipelines: 13(GETNEXT)
+|  |
+|  12:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF008[bloom] -> web_sales.ws_bill_customer_sk, RF010[bloom] -> web_sales.ws_sold_date_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=10 row-size=8B cardinality=719.38K
+|     in pipelines: 12(GETNEXT)
+|
+18:HASH JOIN [LEFT ANTI JOIN, PARTITIONED]
+|  hash predicates: c_first_name IS NOT DISTINCT FROM c_first_name, c_last_name IS NOT DISTINCT FROM c_last_name, d_date IS NOT DISTINCT FROM d_date
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 24(GETNEXT), 28(OPEN)
+|
+|--29:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
+|  |  mem-estimate=10.18MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=58B cardinality=1.44M
+|  |  in pipelines: 28(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [HASH(c_last_name,c_first_name,d_date)] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=54.01MB mem-reservation=34.00MB thread-reservation=1
+|  28:AGGREGATE [FINALIZE]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=43.83MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=8 row-size=58B cardinality=1.44M
+|  |  in pipelines: 28(GETNEXT), 06(OPEN)
+|  |
+|  27:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
+|  |  mem-estimate=10.18MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=58B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=152.61MB mem-reservation=46.69MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  11:AGGREGATE [STREAMING]
+|  |  group by: c_last_name, c_first_name, d_date
+|  |  mem-estimate=43.83MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=8 row-size=58B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT)
+|  |
+|  10:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+|  |  fk/pk conjuncts: catalog_sales.cs_bill_customer_sk = customer.c_customer_sk
+|  |  runtime filters: RF004[bloom] <- customer.c_customer_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |  tuple-ids=5,6,7 row-size=78B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT), 08(OPEN)
+|  |
+|  |--26:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=40B cardinality=100.00K
+|  |  |  in pipelines: 08(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  08:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=7 row-size=40B cardinality=100.00K
+|  |     in pipelines: 08(GETNEXT)
+|  |
+|  09:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+|  |  fk/pk conjuncts: catalog_sales.cs_sold_date_sk = date_dim.d_date_sk
+|  |  runtime filters: RF006[bloom] <- date_dim.d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,6 row-size=38B cardinality=1.44M
+|  |  in pipelines: 06(GETNEXT), 07(OPEN)
+|  |
+|  |--25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=248.01KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=30B cardinality=7.30K
+|  |  |  in pipelines: 07(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  |  07:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=6 row-size=30B cardinality=7.30K
+|  |     in pipelines: 07(GETNEXT)
+|  |
+|  06:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF004[bloom] -> catalog_sales.cs_bill_customer_sk, RF006[bloom] -> catalog_sales.cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=1.44M
+|     in pipelines: 06(GETNEXT)
+|
+24:AGGREGATE [FINALIZE]
+|  group by: c_last_name, c_first_name, d_date
+|  mem-estimate=87.57MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 24(GETNEXT), 00(OPEN)
+|
+23:EXCHANGE [HASH(c_last_name,c_first_name,d_date)]
+|  mem-estimate=10.18MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=116.36MB mem-reservation=43.19MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  group by: c_last_name, c_first_name, d_date
+|  mem-estimate=87.57MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=58B cardinality=2.88M
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_customer_sk = customer.c_customer_sk
+|  fk/pk conjuncts: store_sales.ss_customer_sk = customer.c_customer_sk
+|  runtime filters: RF000[bloom] <- customer.c_customer_sk
+|  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=78B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--22:EXCHANGE [BROADCAST]
+|  |  mem-estimate=3.85MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=40B cardinality=100.00K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.49MB
+|     stored statistics:
+|       table: rows=100.00K size=5.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=40B cardinality=100.00K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  fk/pk conjuncts: store_sales.ss_sold_date_sk = date_dim.d_date_sk
+|  runtime filters: RF002[bloom] <- date_dim.d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=38B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--21:EXCHANGE [BROADCAST]
+|  |  mem-estimate=248.01KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=30B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=48.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=30B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> store_sales.ss_customer_sk, RF002[bloom] -> store_sales.ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=0 row-size=8B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q88.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q88.test
new file mode 100644
index 0000000..e92f2ac
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q88.test
@@ -0,0 +1,2966 @@
+# TPCDS-Q88
+select  *
+from
+ (select count(*) h8_30_to_9
+ from store_sales, household_demographics , time_dim, store
+ where ss_sold_time_sk = time_dim.t_time_sk
+     and ss_hdemo_sk = household_demographics.hd_demo_sk
+     and ss_store_sk = s_store_sk
+     and time_dim.t_hour = 8
+     and time_dim.t_minute >= 30
+     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
+          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
+     and store.s_store_name = 'ese') s1,
+ (select count(*) h9_to_9_30
+ from store_sales, household_demographics , time_dim, store
+ where ss_sold_time_sk = time_dim.t_time_sk
+     and ss_hdemo_sk = household_demographics.hd_demo_sk
+     and ss_store_sk = s_store_sk
+     and time_dim.t_hour = 9
+     and time_dim.t_minute < 30
+     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
+          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
+     and store.s_store_name = 'ese') s2,
+ (select count(*) h9_30_to_10
+ from store_sales, household_demographics , time_dim, store
+ where ss_sold_time_sk = time_dim.t_time_sk
+     and ss_hdemo_sk = household_demographics.hd_demo_sk
+     and ss_store_sk = s_store_sk
+     and time_dim.t_hour = 9
+     and time_dim.t_minute >= 30
+     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
+          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
+     and store.s_store_name = 'ese') s3,
+ (select count(*) h10_to_10_30
+ from store_sales, household_demographics , time_dim, store
+ where ss_sold_time_sk = time_dim.t_time_sk
+     and ss_hdemo_sk = household_demographics.hd_demo_sk
+     and ss_store_sk = s_store_sk
+     and time_dim.t_hour = 10
+     and time_dim.t_minute < 30
+     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
+          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
+     and store.s_store_name = 'ese') s4,
+ (select count(*) h10_30_to_11
+ from store_sales, household_demographics , time_dim, store
+ where ss_sold_time_sk = time_dim.t_time_sk
+     and ss_hdemo_sk = household_demographics.hd_demo_sk
+     and ss_store_sk = s_store_sk
+     and time_dim.t_hour = 10
+     and time_dim.t_minute >= 30
+     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
+          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
+     and store.s_store_name = 'ese') s5,
+ (select count(*) h11_to_11_30
+ from store_sales, household_demographics , time_dim, store
+ where ss_sold_time_sk = time_dim.t_time_sk
+     and ss_hdemo_sk = household_demographics.hd_demo_sk
+     and ss_store_sk = s_store_sk
+     and time_dim.t_hour = 11
+     and time_dim.t_minute < 30
+     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
+          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
+     and store.s_store_name = 'ese') s6,
+ (select count(*) h11_30_to_12
+ from store_sales, household_demographics , time_dim, store
+ where ss_sold_time_sk = time_dim.t_time_sk
+     and ss_hdemo_sk = household_demographics.hd_demo_sk
+     and ss_store_sk = s_store_sk
+     and time_dim.t_hour = 11
+     and time_dim.t_minute >= 30
+     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
+          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
+     and store.s_store_name = 'ese') s7,
+ (select count(*) h12_to_12_30
+ from store_sales, household_demographics , time_dim, store
+ where ss_sold_time_sk = time_dim.t_time_sk
+     and ss_hdemo_sk = household_demographics.hd_demo_sk
+     and ss_store_sk = s_store_sk
+     and time_dim.t_hour = 12
+     and time_dim.t_minute < 30
+     and ((household_demographics.hd_dep_count = 1 and household_demographics.hd_vehicle_count<=1+2) or
+          (household_demographics.hd_dep_count = 0 and household_demographics.hd_vehicle_count<=0+2) or
+          (household_demographics.hd_dep_count = 2 and household_demographics.hd_vehicle_count<=2+2))
+     and store.s_store_name = 'ese') s8
+---- PLAN
+Max Per-Host Resource Reservation: Memory=69.12MB Threads=33
+Per-Host Resource Estimates: Memory=1.43GB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=1.43GB mem-reservation=69.12MB thread-reservation=33 runtime-filters-memory=10.00MB
+PLAN-ROOT SINK
+|  output exprs: count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+70:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34,40,46 row-size=64B cardinality=1
+|  in pipelines: 07(GETNEXT), 63(OPEN)
+|
+|--63:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 63(GETNEXT), 56(OPEN)
+|  |
+|  62:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=42,44,43,45 row-size=56B cardinality=2.27K
+|  |  in pipelines: 56(GETNEXT), 59(OPEN)
+|  |
+|  |--59:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=45 row-size=20B cardinality=2
+|  |     in pipelines: 59(GETNEXT)
+|  |
+|  61:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=42,44,43 row-size=36B cardinality=6.82K
+|  |  in pipelines: 56(GETNEXT), 57(OPEN)
+|  |
+|  |--57:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=43 row-size=12B cardinality=720
+|  |     in pipelines: 57(GETNEXT)
+|  |
+|  60:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF046[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=42,44 row-size=24B cardinality=69.82K
+|  |  in pipelines: 56(GETNEXT), 58(OPEN)
+|  |
+|  |--58:SCAN HDFS [tpcds_parquet.time_dim]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(12 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(12 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(12 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=44 row-size=12B cardinality=1.14K
+|  |     in pipelines: 58(GETNEXT)
+|  |
+|  56:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF046[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=42 row-size=12B cardinality=2.88M
+|     in pipelines: 56(GETNEXT)
+|
+69:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34,40 row-size=56B cardinality=1
+|  in pipelines: 07(GETNEXT), 55(OPEN)
+|
+|--55:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=40 row-size=8B cardinality=1
+|  |  in pipelines: 55(GETNEXT), 48(OPEN)
+|  |
+|  54:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=36,38,37,39 row-size=56B cardinality=2.27K
+|  |  in pipelines: 48(GETNEXT), 51(OPEN)
+|  |
+|  |--51:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=39 row-size=20B cardinality=2
+|  |     in pipelines: 51(GETNEXT)
+|  |
+|  53:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=36,38,37 row-size=36B cardinality=6.82K
+|  |  in pipelines: 48(GETNEXT), 49(OPEN)
+|  |
+|  |--49:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=37 row-size=12B cardinality=720
+|  |     in pipelines: 49(GETNEXT)
+|  |
+|  52:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF040[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=36,38 row-size=24B cardinality=69.82K
+|  |  in pipelines: 48(GETNEXT), 50(OPEN)
+|  |
+|  |--50:SCAN HDFS [tpcds_parquet.time_dim]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=38 row-size=12B cardinality=1.14K
+|  |     in pipelines: 50(GETNEXT)
+|  |
+|  48:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF040[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=36 row-size=12B cardinality=2.88M
+|     in pipelines: 48(GETNEXT)
+|
+68:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34 row-size=48B cardinality=1
+|  in pipelines: 07(GETNEXT), 47(OPEN)
+|
+|--47:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34 row-size=8B cardinality=1
+|  |  in pipelines: 47(GETNEXT), 40(OPEN)
+|  |
+|  46:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=30,32,31,33 row-size=56B cardinality=2.27K
+|  |  in pipelines: 40(GETNEXT), 43(OPEN)
+|  |
+|  |--43:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=33 row-size=20B cardinality=2
+|  |     in pipelines: 43(GETNEXT)
+|  |
+|  45:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=30,32,31 row-size=36B cardinality=6.82K
+|  |  in pipelines: 40(GETNEXT), 41(OPEN)
+|  |
+|  |--41:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=31 row-size=12B cardinality=720
+|  |     in pipelines: 41(GETNEXT)
+|  |
+|  44:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF034[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=30,32 row-size=24B cardinality=69.82K
+|  |  in pipelines: 40(GETNEXT), 42(OPEN)
+|  |
+|  |--42:SCAN HDFS [tpcds_parquet.time_dim]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=32 row-size=12B cardinality=1.14K
+|  |     in pipelines: 42(GETNEXT)
+|  |
+|  40:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF034[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=30 row-size=12B cardinality=2.88M
+|     in pipelines: 40(GETNEXT)
+|
+67:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28 row-size=40B cardinality=1
+|  in pipelines: 07(GETNEXT), 39(OPEN)
+|
+|--39:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 39(GETNEXT), 32(OPEN)
+|  |
+|  38:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,26,25,27 row-size=56B cardinality=2.27K
+|  |  in pipelines: 32(GETNEXT), 35(OPEN)
+|  |
+|  |--35:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=27 row-size=20B cardinality=2
+|  |     in pipelines: 35(GETNEXT)
+|  |
+|  37:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,26,25 row-size=36B cardinality=6.82K
+|  |  in pipelines: 32(GETNEXT), 33(OPEN)
+|  |
+|  |--33:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=25 row-size=12B cardinality=720
+|  |     in pipelines: 33(GETNEXT)
+|  |
+|  36:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF028[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,26 row-size=24B cardinality=69.82K
+|  |  in pipelines: 32(GETNEXT), 34(OPEN)
+|  |
+|  |--34:SCAN HDFS [tpcds_parquet.time_dim]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=26 row-size=12B cardinality=1.14K
+|  |     in pipelines: 34(GETNEXT)
+|  |
+|  32:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF028[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=24 row-size=12B cardinality=2.88M
+|     in pipelines: 32(GETNEXT)
+|
+66:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22 row-size=32B cardinality=1
+|  in pipelines: 07(GETNEXT), 31(OPEN)
+|
+|--31:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=22 row-size=8B cardinality=1
+|  |  in pipelines: 31(GETNEXT), 24(OPEN)
+|  |
+|  30:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,20,19,21 row-size=56B cardinality=2.27K
+|  |  in pipelines: 24(GETNEXT), 27(OPEN)
+|  |
+|  |--27:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=21 row-size=20B cardinality=2
+|  |     in pipelines: 27(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,20,19 row-size=36B cardinality=6.82K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--25:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=12B cardinality=720
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF022[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,20 row-size=24B cardinality=69.82K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--26:SCAN HDFS [tpcds_parquet.time_dim]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=12B cardinality=1.14K
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF022[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=18 row-size=12B cardinality=2.88M
+|     in pipelines: 24(GETNEXT)
+|
+65:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16 row-size=24B cardinality=1
+|  in pipelines: 07(GETNEXT), 23(OPEN)
+|
+|--23:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 23(GETNEXT), 16(OPEN)
+|  |
+|  22:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14,13,15 row-size=56B cardinality=2.27K
+|  |  in pipelines: 16(GETNEXT), 19(OPEN)
+|  |
+|  |--19:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=15 row-size=20B cardinality=2
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14,13 row-size=36B cardinality=6.82K
+|  |  in pipelines: 16(GETNEXT), 17(OPEN)
+|  |
+|  |--17:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=12B cardinality=720
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF016[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14 row-size=24B cardinality=69.82K
+|  |  in pipelines: 16(GETNEXT), 18(OPEN)
+|  |
+|  |--18:SCAN HDFS [tpcds_parquet.time_dim]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=14 row-size=12B cardinality=1.14K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  16:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF016[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=12 row-size=12B cardinality=2.88M
+|     in pipelines: 16(GETNEXT)
+|
+64:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10 row-size=16B cardinality=1
+|  in pipelines: 07(GETNEXT), 15(OPEN)
+|
+|--15:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 15(GETNEXT), 08(OPEN)
+|  |
+|  14:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,8,7,9 row-size=56B cardinality=2.27K
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--11:SCAN HDFS [tpcds_parquet.store]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=20B cardinality=2
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  runtime filters: RF008[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,8,7 row-size=36B cardinality=6.82K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--09:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=12B cardinality=720
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF010[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,8 row-size=24B cardinality=69.82K
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--10:SCAN HDFS [tpcds_parquet.time_dim]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=8 row-size=12B cardinality=1.14K
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.store_sales]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF010[bloom] -> ss_sold_time_sk, RF008[bloom] -> ss_hdemo_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=6 row-size=12B cardinality=2.88M
+|     in pipelines: 08(GETNEXT)
+|
+07:AGGREGATE [FINALIZE]
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=56B cardinality=2.27K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_store_name = 'ese'
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_store_name = 'ese'
+|     parquet dictionary predicates: store.s_store_name = 'ese'
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=20B cardinality=2
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  runtime filters: RF002[bloom] <- household_demographics.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=36B cardinality=6.82K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.household_demographics]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=720
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  runtime filters: RF004[bloom] <- time_dim.t_time_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=24B cardinality=69.82K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.time_dim]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: time_dim.t_hour = CAST(8 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: time_dim.t_hour = CAST(8 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|     parquet dictionary predicates: time_dim.t_hour = CAST(8 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=1.14K
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> ss_sold_time_sk, RF002[bloom] -> ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=69.12MB Threads=72
+Per-Host Resource Estimates: Memory=1.59GB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.13MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+70:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34,40,46 row-size=64B cardinality=1
+|  in pipelines: 75(GETNEXT), 116(OPEN)
+|
+|--117:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 116(GETNEXT)
+|  |
+|  F39:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  116:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 116(GETNEXT), 63(OPEN)
+|  |
+|  115:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 63(GETNEXT)
+|  |
+|  F35:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=64.81MB mem-reservation=7.81MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  63:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 63(GETNEXT), 56(OPEN)
+|  |
+|  62:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=42,44,43,45 row-size=56B cardinality=2.27K
+|  |  in pipelines: 56(GETNEXT), 59(OPEN)
+|  |
+|  |--114:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=45 row-size=20B cardinality=2
+|  |  |  in pipelines: 59(GETNEXT)
+|  |  |
+|  |  F38:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  59:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=45 row-size=20B cardinality=2
+|  |     in pipelines: 59(GETNEXT)
+|  |
+|  61:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=42,44,43 row-size=36B cardinality=6.82K
+|  |  in pipelines: 56(GETNEXT), 57(OPEN)
+|  |
+|  |--113:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=43 row-size=12B cardinality=720
+|  |  |  in pipelines: 57(GETNEXT)
+|  |  |
+|  |  F37:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=2
+|  |  57:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=43 row-size=12B cardinality=720
+|  |     in pipelines: 57(GETNEXT)
+|  |
+|  60:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF046[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=42,44 row-size=24B cardinality=69.82K
+|  |  in pipelines: 56(GETNEXT), 58(OPEN)
+|  |
+|  |--112:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=44 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 58(GETNEXT)
+|  |  |
+|  |  F36:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  58:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(12 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(12 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(12 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=44 row-size=12B cardinality=1.14K
+|  |     in pipelines: 58(GETNEXT)
+|  |
+|  56:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF046[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=42 row-size=12B cardinality=2.88M
+|     in pipelines: 56(GETNEXT)
+|
+69:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34,40 row-size=56B cardinality=1
+|  in pipelines: 75(GETNEXT), 110(OPEN)
+|
+|--111:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=40 row-size=8B cardinality=1
+|  |  in pipelines: 110(GETNEXT)
+|  |
+|  F34:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  110:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=40 row-size=8B cardinality=1
+|  |  in pipelines: 110(GETNEXT), 55(OPEN)
+|  |
+|  109:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=40 row-size=8B cardinality=1
+|  |  in pipelines: 55(GETNEXT)
+|  |
+|  F30:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=64.81MB mem-reservation=7.81MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  55:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=40 row-size=8B cardinality=1
+|  |  in pipelines: 55(GETNEXT), 48(OPEN)
+|  |
+|  54:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=36,38,37,39 row-size=56B cardinality=2.27K
+|  |  in pipelines: 48(GETNEXT), 51(OPEN)
+|  |
+|  |--108:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=39 row-size=20B cardinality=2
+|  |  |  in pipelines: 51(GETNEXT)
+|  |  |
+|  |  F33:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  51:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=39 row-size=20B cardinality=2
+|  |     in pipelines: 51(GETNEXT)
+|  |
+|  53:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=36,38,37 row-size=36B cardinality=6.82K
+|  |  in pipelines: 48(GETNEXT), 49(OPEN)
+|  |
+|  |--107:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=37 row-size=12B cardinality=720
+|  |  |  in pipelines: 49(GETNEXT)
+|  |  |
+|  |  F32:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=2
+|  |  49:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=37 row-size=12B cardinality=720
+|  |     in pipelines: 49(GETNEXT)
+|  |
+|  52:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF040[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=36,38 row-size=24B cardinality=69.82K
+|  |  in pipelines: 48(GETNEXT), 50(OPEN)
+|  |
+|  |--106:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=38 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 50(GETNEXT)
+|  |  |
+|  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  50:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=38 row-size=12B cardinality=1.14K
+|  |     in pipelines: 50(GETNEXT)
+|  |
+|  48:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF040[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=36 row-size=12B cardinality=2.88M
+|     in pipelines: 48(GETNEXT)
+|
+68:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34 row-size=48B cardinality=1
+|  in pipelines: 75(GETNEXT), 104(OPEN)
+|
+|--105:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=34 row-size=8B cardinality=1
+|  |  in pipelines: 104(GETNEXT)
+|  |
+|  F29:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  104:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34 row-size=8B cardinality=1
+|  |  in pipelines: 104(GETNEXT), 47(OPEN)
+|  |
+|  103:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=34 row-size=8B cardinality=1
+|  |  in pipelines: 47(GETNEXT)
+|  |
+|  F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=64.81MB mem-reservation=7.81MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  47:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34 row-size=8B cardinality=1
+|  |  in pipelines: 47(GETNEXT), 40(OPEN)
+|  |
+|  46:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=30,32,31,33 row-size=56B cardinality=2.27K
+|  |  in pipelines: 40(GETNEXT), 43(OPEN)
+|  |
+|  |--102:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=33 row-size=20B cardinality=2
+|  |  |  in pipelines: 43(GETNEXT)
+|  |  |
+|  |  F28:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  43:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=33 row-size=20B cardinality=2
+|  |     in pipelines: 43(GETNEXT)
+|  |
+|  45:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=30,32,31 row-size=36B cardinality=6.82K
+|  |  in pipelines: 40(GETNEXT), 41(OPEN)
+|  |
+|  |--101:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=31 row-size=12B cardinality=720
+|  |  |  in pipelines: 41(GETNEXT)
+|  |  |
+|  |  F27:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=2
+|  |  41:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=31 row-size=12B cardinality=720
+|  |     in pipelines: 41(GETNEXT)
+|  |
+|  44:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF034[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=30,32 row-size=24B cardinality=69.82K
+|  |  in pipelines: 40(GETNEXT), 42(OPEN)
+|  |
+|  |--100:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=32 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 42(GETNEXT)
+|  |  |
+|  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  42:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=32 row-size=12B cardinality=1.14K
+|  |     in pipelines: 42(GETNEXT)
+|  |
+|  40:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF034[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=30 row-size=12B cardinality=2.88M
+|     in pipelines: 40(GETNEXT)
+|
+67:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28 row-size=40B cardinality=1
+|  in pipelines: 75(GETNEXT), 98(OPEN)
+|
+|--99:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 98(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  98:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 98(GETNEXT), 39(OPEN)
+|  |
+|  97:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=64.81MB mem-reservation=7.81MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  39:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 39(GETNEXT), 32(OPEN)
+|  |
+|  38:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,26,25,27 row-size=56B cardinality=2.27K
+|  |  in pipelines: 32(GETNEXT), 35(OPEN)
+|  |
+|  |--96:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=27 row-size=20B cardinality=2
+|  |  |  in pipelines: 35(GETNEXT)
+|  |  |
+|  |  F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  35:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=27 row-size=20B cardinality=2
+|  |     in pipelines: 35(GETNEXT)
+|  |
+|  37:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,26,25 row-size=36B cardinality=6.82K
+|  |  in pipelines: 32(GETNEXT), 33(OPEN)
+|  |
+|  |--95:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=25 row-size=12B cardinality=720
+|  |  |  in pipelines: 33(GETNEXT)
+|  |  |
+|  |  F22:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=2
+|  |  33:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=25 row-size=12B cardinality=720
+|  |     in pipelines: 33(GETNEXT)
+|  |
+|  36:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF028[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,26 row-size=24B cardinality=69.82K
+|  |  in pipelines: 32(GETNEXT), 34(OPEN)
+|  |
+|  |--94:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=26 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 34(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  34:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=26 row-size=12B cardinality=1.14K
+|  |     in pipelines: 34(GETNEXT)
+|  |
+|  32:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF028[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=24 row-size=12B cardinality=2.88M
+|     in pipelines: 32(GETNEXT)
+|
+66:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22 row-size=32B cardinality=1
+|  in pipelines: 75(GETNEXT), 92(OPEN)
+|
+|--93:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=22 row-size=8B cardinality=1
+|  |  in pipelines: 92(GETNEXT)
+|  |
+|  F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  92:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=22 row-size=8B cardinality=1
+|  |  in pipelines: 92(GETNEXT), 31(OPEN)
+|  |
+|  91:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=22 row-size=8B cardinality=1
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=64.81MB mem-reservation=7.81MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  31:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=22 row-size=8B cardinality=1
+|  |  in pipelines: 31(GETNEXT), 24(OPEN)
+|  |
+|  30:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,20,19,21 row-size=56B cardinality=2.27K
+|  |  in pipelines: 24(GETNEXT), 27(OPEN)
+|  |
+|  |--90:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21 row-size=20B cardinality=2
+|  |  |  in pipelines: 27(GETNEXT)
+|  |  |
+|  |  F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  27:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=21 row-size=20B cardinality=2
+|  |     in pipelines: 27(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,20,19 row-size=36B cardinality=6.82K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--89:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=12B cardinality=720
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=2
+|  |  25:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=19 row-size=12B cardinality=720
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF022[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,20 row-size=24B cardinality=69.82K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--88:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 26(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  26:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=20 row-size=12B cardinality=1.14K
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF022[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=18 row-size=12B cardinality=2.88M
+|     in pipelines: 24(GETNEXT)
+|
+65:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16 row-size=24B cardinality=1
+|  in pipelines: 75(GETNEXT), 86(OPEN)
+|
+|--87:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 86(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  86:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 86(GETNEXT), 23(OPEN)
+|  |
+|  85:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=64.81MB mem-reservation=7.81MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  23:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 23(GETNEXT), 16(OPEN)
+|  |
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14,13,15 row-size=56B cardinality=2.27K
+|  |  in pipelines: 16(GETNEXT), 19(OPEN)
+|  |
+|  |--84:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=15 row-size=20B cardinality=2
+|  |  |  in pipelines: 19(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  19:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=15 row-size=20B cardinality=2
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14,13 row-size=36B cardinality=6.82K
+|  |  in pipelines: 16(GETNEXT), 17(OPEN)
+|  |
+|  |--83:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=12B cardinality=720
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=2
+|  |  17:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=13 row-size=12B cardinality=720
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF016[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14 row-size=24B cardinality=69.82K
+|  |  in pipelines: 16(GETNEXT), 18(OPEN)
+|  |
+|  |--82:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  18:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=14 row-size=12B cardinality=1.14K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  16:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF016[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=12 row-size=12B cardinality=2.88M
+|     in pipelines: 16(GETNEXT)
+|
+64:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10 row-size=16B cardinality=1
+|  in pipelines: 75(GETNEXT), 80(OPEN)
+|
+|--81:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 80(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  80:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 80(GETNEXT), 15(OPEN)
+|  |
+|  79:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=65.81MB mem-reservation=8.81MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  15:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 15(GETNEXT), 08(OPEN)
+|  |
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,8,7,9 row-size=56B cardinality=2.27K
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--78:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=20B cardinality=2
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  11:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=20B cardinality=2
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  runtime filters: RF008[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,8,7 row-size=36B cardinality=6.82K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--77:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=12B cardinality=720
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=2
+|  |  09:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=12B cardinality=720
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF010[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,8 row-size=24B cardinality=69.82K
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--76:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=8 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  10:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=8 row-size=12B cardinality=1.14K
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF010[bloom] -> ss_sold_time_sk, RF008[bloom] -> ss_hdemo_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=6 row-size=12B cardinality=2.88M
+|     in pipelines: 08(GETNEXT)
+|
+75:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 75(GETNEXT), 07(OPEN)
+|
+74:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=65.81MB mem-reservation=8.81MB thread-reservation=2 runtime-filters-memory=2.00MB
+07:AGGREGATE
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=56B cardinality=2.27K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--73:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=20B cardinality=2
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_store_name = 'ese'
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_store_name = 'ese'
+|     parquet dictionary predicates: store.s_store_name = 'ese'
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=20B cardinality=2
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  runtime filters: RF002[bloom] <- household_demographics.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=36B cardinality=6.82K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--72:EXCHANGE [BROADCAST]
+|  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=720
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=48.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=720
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  runtime filters: RF004[bloom] <- time_dim.t_time_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=24B cardinality=69.82K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--71:EXCHANGE [BROADCAST]
+|  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=1.14K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: time_dim.t_hour = CAST(8 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: time_dim.t_hour = CAST(8 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|     parquet dictionary predicates: time_dim.t_hour = CAST(8 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=1.14K
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> ss_sold_time_sk, RF002[bloom] -> ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=133.62MB Threads=79
+Per-Host Resource Estimates: Memory=994MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(*), count(*), count(*), count(*), count(*), count(*), count(*), count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+70:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 00
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34,40,46 row-size=64B cardinality=1
+|  in pipelines: 75(GETNEXT), 116(OPEN)
+|
+|--F40:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  117:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 116(GETNEXT)
+|  |
+|  F39:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  116:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 116(GETNEXT), 63(OPEN)
+|  |
+|  115:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 63(GETNEXT)
+|  |
+|  F35:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  63:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=46 row-size=8B cardinality=1
+|  |  in pipelines: 63(GETNEXT), 56(OPEN)
+|  |
+|  62:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=42,44,43,45 row-size=56B cardinality=2.27K
+|  |  in pipelines: 56(GETNEXT), 59(OPEN)
+|  |
+|  |--F41:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  114:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=45 row-size=20B cardinality=2
+|  |  |  in pipelines: 59(GETNEXT)
+|  |  |
+|  |  F38:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  59:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=45 row-size=20B cardinality=2
+|  |     in pipelines: 59(GETNEXT)
+|  |
+|  61:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=42,44,43 row-size=36B cardinality=6.82K
+|  |  in pipelines: 56(GETNEXT), 57(OPEN)
+|  |
+|  |--F42:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: household_demographics.hd_demo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  113:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=43 row-size=12B cardinality=720
+|  |  |  in pipelines: 57(GETNEXT)
+|  |  |
+|  |  F37:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  57:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|  |     tuple-ids=43 row-size=12B cardinality=720
+|  |     in pipelines: 57(GETNEXT)
+|  |
+|  60:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=42,44 row-size=24B cardinality=69.82K
+|  |  in pipelines: 56(GETNEXT), 58(OPEN)
+|  |
+|  |--F43:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: time_dim.t_time_sk
+|  |  |  runtime filters: RF046[bloom] <- time_dim.t_time_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  112:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=44 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 58(GETNEXT)
+|  |  |
+|  |  F36:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  58:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(12 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(12 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(12 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=44 row-size=12B cardinality=1.14K
+|  |     in pipelines: 58(GETNEXT)
+|  |
+|  56:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF046[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=42 row-size=12B cardinality=2.88M
+|     in pipelines: 56(GETNEXT)
+|
+69:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 04
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34,40 row-size=56B cardinality=1
+|  in pipelines: 75(GETNEXT), 110(OPEN)
+|
+|--F44:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  111:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=40 row-size=8B cardinality=1
+|  |  in pipelines: 110(GETNEXT)
+|  |
+|  F34:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  110:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=40 row-size=8B cardinality=1
+|  |  in pipelines: 110(GETNEXT), 55(OPEN)
+|  |
+|  109:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=40 row-size=8B cardinality=1
+|  |  in pipelines: 55(GETNEXT)
+|  |
+|  F30:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  55:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=40 row-size=8B cardinality=1
+|  |  in pipelines: 55(GETNEXT), 48(OPEN)
+|  |
+|  54:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=36,38,37,39 row-size=56B cardinality=2.27K
+|  |  in pipelines: 48(GETNEXT), 51(OPEN)
+|  |
+|  |--F45:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=03
+|  |  |  build expressions: s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  108:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=39 row-size=20B cardinality=2
+|  |  |  in pipelines: 51(GETNEXT)
+|  |  |
+|  |  F33:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  51:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=39 row-size=20B cardinality=2
+|  |     in pipelines: 51(GETNEXT)
+|  |
+|  53:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=06
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=36,38,37 row-size=36B cardinality=6.82K
+|  |  in pipelines: 48(GETNEXT), 49(OPEN)
+|  |
+|  |--F46:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=06 plan-id=07 cohort-id=03
+|  |  |  build expressions: household_demographics.hd_demo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  107:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=37 row-size=12B cardinality=720
+|  |  |  in pipelines: 49(GETNEXT)
+|  |  |
+|  |  F32:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  49:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|  |     tuple-ids=37 row-size=12B cardinality=720
+|  |     in pipelines: 49(GETNEXT)
+|  |
+|  52:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=07
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=36,38 row-size=24B cardinality=69.82K
+|  |  in pipelines: 48(GETNEXT), 50(OPEN)
+|  |
+|  |--F47:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=07 plan-id=08 cohort-id=03
+|  |  |  build expressions: time_dim.t_time_sk
+|  |  |  runtime filters: RF040[bloom] <- time_dim.t_time_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  106:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=38 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 50(GETNEXT)
+|  |  |
+|  |  F31:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  50:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=38 row-size=12B cardinality=1.14K
+|  |     in pipelines: 50(GETNEXT)
+|  |
+|  48:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF040[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=36 row-size=12B cardinality=2.88M
+|     in pipelines: 48(GETNEXT)
+|
+68:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 08
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28,34 row-size=48B cardinality=1
+|  in pipelines: 75(GETNEXT), 104(OPEN)
+|
+|--F48:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=08 plan-id=09 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  105:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=34 row-size=8B cardinality=1
+|  |  in pipelines: 104(GETNEXT)
+|  |
+|  F29:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  104:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34 row-size=8B cardinality=1
+|  |  in pipelines: 104(GETNEXT), 47(OPEN)
+|  |
+|  103:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=34 row-size=8B cardinality=1
+|  |  in pipelines: 47(GETNEXT)
+|  |
+|  F25:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  47:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=34 row-size=8B cardinality=1
+|  |  in pipelines: 47(GETNEXT), 40(OPEN)
+|  |
+|  46:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=09
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=30,32,31,33 row-size=56B cardinality=2.27K
+|  |  in pipelines: 40(GETNEXT), 43(OPEN)
+|  |
+|  |--F49:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=09 plan-id=10 cohort-id=04
+|  |  |  build expressions: s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  102:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=33 row-size=20B cardinality=2
+|  |  |  in pipelines: 43(GETNEXT)
+|  |  |
+|  |  F28:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  43:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=33 row-size=20B cardinality=2
+|  |     in pipelines: 43(GETNEXT)
+|  |
+|  45:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=10
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=30,32,31 row-size=36B cardinality=6.82K
+|  |  in pipelines: 40(GETNEXT), 41(OPEN)
+|  |
+|  |--F50:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=10 plan-id=11 cohort-id=04
+|  |  |  build expressions: household_demographics.hd_demo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  101:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=31 row-size=12B cardinality=720
+|  |  |  in pipelines: 41(GETNEXT)
+|  |  |
+|  |  F27:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  41:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|  |     tuple-ids=31 row-size=12B cardinality=720
+|  |     in pipelines: 41(GETNEXT)
+|  |
+|  44:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=11
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=30,32 row-size=24B cardinality=69.82K
+|  |  in pipelines: 40(GETNEXT), 42(OPEN)
+|  |
+|  |--F51:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=11 plan-id=12 cohort-id=04
+|  |  |  build expressions: time_dim.t_time_sk
+|  |  |  runtime filters: RF034[bloom] <- time_dim.t_time_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  100:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=32 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 42(GETNEXT)
+|  |  |
+|  |  F26:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  42:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(11 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=32 row-size=12B cardinality=1.14K
+|  |     in pipelines: 42(GETNEXT)
+|  |
+|  40:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF034[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=30 row-size=12B cardinality=2.88M
+|     in pipelines: 40(GETNEXT)
+|
+67:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 12
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22,28 row-size=40B cardinality=1
+|  in pipelines: 75(GETNEXT), 98(OPEN)
+|
+|--F52:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=12 plan-id=13 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  99:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 98(GETNEXT)
+|  |
+|  F24:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  98:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 98(GETNEXT), 39(OPEN)
+|  |
+|  97:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 39(GETNEXT)
+|  |
+|  F20:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  39:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=28 row-size=8B cardinality=1
+|  |  in pipelines: 39(GETNEXT), 32(OPEN)
+|  |
+|  38:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=13
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,26,25,27 row-size=56B cardinality=2.27K
+|  |  in pipelines: 32(GETNEXT), 35(OPEN)
+|  |
+|  |--F53:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=13 plan-id=14 cohort-id=05
+|  |  |  build expressions: s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  96:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=27 row-size=20B cardinality=2
+|  |  |  in pipelines: 35(GETNEXT)
+|  |  |
+|  |  F23:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  35:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=27 row-size=20B cardinality=2
+|  |     in pipelines: 35(GETNEXT)
+|  |
+|  37:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=14
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,26,25 row-size=36B cardinality=6.82K
+|  |  in pipelines: 32(GETNEXT), 33(OPEN)
+|  |
+|  |--F54:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=14 plan-id=15 cohort-id=05
+|  |  |  build expressions: household_demographics.hd_demo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  95:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=25 row-size=12B cardinality=720
+|  |  |  in pipelines: 33(GETNEXT)
+|  |  |
+|  |  F22:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  33:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|  |     tuple-ids=25 row-size=12B cardinality=720
+|  |     in pipelines: 33(GETNEXT)
+|  |
+|  36:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=15
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=24,26 row-size=24B cardinality=69.82K
+|  |  in pipelines: 32(GETNEXT), 34(OPEN)
+|  |
+|  |--F55:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=15 plan-id=16 cohort-id=05
+|  |  |  build expressions: time_dim.t_time_sk
+|  |  |  runtime filters: RF028[bloom] <- time_dim.t_time_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  94:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=26 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 34(GETNEXT)
+|  |  |
+|  |  F21:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  34:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=26 row-size=12B cardinality=1.14K
+|  |     in pipelines: 34(GETNEXT)
+|  |
+|  32:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF028[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=24 row-size=12B cardinality=2.88M
+|     in pipelines: 32(GETNEXT)
+|
+66:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 16
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16,22 row-size=32B cardinality=1
+|  in pipelines: 75(GETNEXT), 92(OPEN)
+|
+|--F56:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=16 plan-id=17 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  93:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=22 row-size=8B cardinality=1
+|  |  in pipelines: 92(GETNEXT)
+|  |
+|  F19:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  92:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=22 row-size=8B cardinality=1
+|  |  in pipelines: 92(GETNEXT), 31(OPEN)
+|  |
+|  91:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=22 row-size=8B cardinality=1
+|  |  in pipelines: 31(GETNEXT)
+|  |
+|  F15:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  31:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=22 row-size=8B cardinality=1
+|  |  in pipelines: 31(GETNEXT), 24(OPEN)
+|  |
+|  30:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=17
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,20,19,21 row-size=56B cardinality=2.27K
+|  |  in pipelines: 24(GETNEXT), 27(OPEN)
+|  |
+|  |--F57:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=17 plan-id=18 cohort-id=06
+|  |  |  build expressions: s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  90:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=21 row-size=20B cardinality=2
+|  |  |  in pipelines: 27(GETNEXT)
+|  |  |
+|  |  F18:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  27:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=21 row-size=20B cardinality=2
+|  |     in pipelines: 27(GETNEXT)
+|  |
+|  29:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=18
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,20,19 row-size=36B cardinality=6.82K
+|  |  in pipelines: 24(GETNEXT), 25(OPEN)
+|  |
+|  |--F58:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=18 plan-id=19 cohort-id=06
+|  |  |  build expressions: household_demographics.hd_demo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  89:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=19 row-size=12B cardinality=720
+|  |  |  in pipelines: 25(GETNEXT)
+|  |  |
+|  |  F17:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  25:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|  |     tuple-ids=19 row-size=12B cardinality=720
+|  |     in pipelines: 25(GETNEXT)
+|  |
+|  28:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=19
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=18,20 row-size=24B cardinality=69.82K
+|  |  in pipelines: 24(GETNEXT), 26(OPEN)
+|  |
+|  |--F59:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=19 plan-id=20 cohort-id=06
+|  |  |  build expressions: time_dim.t_time_sk
+|  |  |  runtime filters: RF022[bloom] <- time_dim.t_time_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  88:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=20 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 26(GETNEXT)
+|  |  |
+|  |  F16:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  26:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(10 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=20 row-size=12B cardinality=1.14K
+|  |     in pipelines: 26(GETNEXT)
+|  |
+|  24:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF022[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=18 row-size=12B cardinality=2.88M
+|     in pipelines: 24(GETNEXT)
+|
+65:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 20
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10,16 row-size=24B cardinality=1
+|  in pipelines: 75(GETNEXT), 86(OPEN)
+|
+|--F60:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=20 plan-id=21 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  87:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 86(GETNEXT)
+|  |
+|  F14:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  86:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 86(GETNEXT), 23(OPEN)
+|  |
+|  85:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 23(GETNEXT)
+|  |
+|  F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  23:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=16 row-size=8B cardinality=1
+|  |  in pipelines: 23(GETNEXT), 16(OPEN)
+|  |
+|  22:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=21
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14,13,15 row-size=56B cardinality=2.27K
+|  |  in pipelines: 16(GETNEXT), 19(OPEN)
+|  |
+|  |--F61:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=21 plan-id=22 cohort-id=07
+|  |  |  build expressions: s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  84:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=15 row-size=20B cardinality=2
+|  |  |  in pipelines: 19(GETNEXT)
+|  |  |
+|  |  F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  19:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=15 row-size=20B cardinality=2
+|  |     in pipelines: 19(GETNEXT)
+|  |
+|  21:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=22
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14,13 row-size=36B cardinality=6.82K
+|  |  in pipelines: 16(GETNEXT), 17(OPEN)
+|  |
+|  |--F62:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=22 plan-id=23 cohort-id=07
+|  |  |  build expressions: household_demographics.hd_demo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  83:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=13 row-size=12B cardinality=720
+|  |  |  in pipelines: 17(GETNEXT)
+|  |  |
+|  |  F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  17:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|  |     tuple-ids=13 row-size=12B cardinality=720
+|  |     in pipelines: 17(GETNEXT)
+|  |
+|  20:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=23
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=12,14 row-size=24B cardinality=69.82K
+|  |  in pipelines: 16(GETNEXT), 18(OPEN)
+|  |
+|  |--F63:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=23 plan-id=24 cohort-id=07
+|  |  |  build expressions: time_dim.t_time_sk
+|  |  |  runtime filters: RF016[bloom] <- time_dim.t_time_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  82:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=14 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 18(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  18:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=14 row-size=12B cardinality=1.14K
+|  |     in pipelines: 18(GETNEXT)
+|  |
+|  16:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF016[bloom] -> ss_sold_time_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=12 row-size=12B cardinality=2.88M
+|     in pipelines: 16(GETNEXT)
+|
+64:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 24
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10 row-size=16B cardinality=1
+|  in pipelines: 75(GETNEXT), 80(OPEN)
+|
+|--F64:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=24 plan-id=25 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  81:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 80(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  80:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 80(GETNEXT), 15(OPEN)
+|  |
+|  79:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+|  15:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 15(GETNEXT), 08(OPEN)
+|  |
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=25
+|  |  hash predicates: ss_store_sk = s_store_sk
+|  |  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,8,7,9 row-size=56B cardinality=2.27K
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--F65:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  |  JOIN BUILD
+|  |  |  join-table-id=25 plan-id=26 cohort-id=08
+|  |  |  build expressions: s_store_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  78:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=20B cardinality=2
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  11:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=9.93KB
+|  |     predicates: store.s_store_name = 'ese'
+|  |     stored statistics:
+|  |       table: rows=12 size=9.93KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=12
+|  |     parquet statistics predicates: store.s_store_name = 'ese'
+|  |     parquet dictionary predicates: store.s_store_name = 'ese'
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=9 row-size=20B cardinality=2
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=26
+|  |  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,8,7 row-size=36B cardinality=6.82K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--F66:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=26 plan-id=27 cohort-id=08
+|  |  |  build expressions: household_demographics.hd_demo_sk
+|  |  |  runtime filters: RF008[bloom] <- household_demographics.hd_demo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  77:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=12B cardinality=720
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  09:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|  |     tuple-ids=7 row-size=12B cardinality=720
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=27
+|  |  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,8 row-size=24B cardinality=69.82K
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--F67:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=27 plan-id=28 cohort-id=08
+|  |  |  build expressions: time_dim.t_time_sk
+|  |  |  runtime filters: RF010[bloom] <- time_dim.t_time_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  76:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=8 row-size=12B cardinality=1.14K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  10:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour = CAST(9 AS INT), time_dim.t_minute < CAST(30 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=8 row-size=12B cardinality=1.14K
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+|     HDFS partitions=1824/1824 files=1824 size=201.02MB
+|     runtime filters: RF010[bloom] -> ss_sold_time_sk, RF008[bloom] -> ss_hdemo_sk
+|     stored statistics:
+|       table: rows=2.88M size=201.02MB
+|       partitions: 1824/1824 rows=2.88M
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=130.09K
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=6 row-size=12B cardinality=2.88M
+|     in pipelines: 08(GETNEXT)
+|
+75:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 75(GETNEXT), 07(OPEN)
+|
+74:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+07:AGGREGATE
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=28
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1,3 row-size=56B cardinality=2.27K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F68:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=3.89MB mem-reservation=3.88MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=28 plan-id=29 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  73:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=20B cardinality=2
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: store.s_store_name = 'ese'
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: store.s_store_name = 'ese'
+|     parquet dictionary predicates: store.s_store_name = 'ese'
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=3 row-size=20B cardinality=2
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=29
+|  hash predicates: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: ss_hdemo_sk = household_demographics.hd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,1 row-size=36B cardinality=6.82K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F69:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=29 plan-id=30 cohort-id=01
+|  |  build expressions: household_demographics.hd_demo_sk
+|  |  runtime filters: RF002[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  72:EXCHANGE [BROADCAST]
+|  |  mem-estimate=19.69KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=720
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: ((household_demographics.hd_dep_count = CAST(1 AS INT) AND household_demographics.hd_vehicle_count <= CAST(3 AS INT)) OR (household_demographics.hd_dep_count = CAST(0 AS INT) AND household_demographics.hd_vehicle_count <= CAST(2 AS INT)) OR (household_demographics.hd_dep_count = CAST(2 AS INT) AND household_demographics.hd_vehicle_count <= CAST(4 AS INT)))
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=1 row-size=12B cardinality=720
+|     in pipelines: 01(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=30
+|  hash predicates: ss_sold_time_sk = time_dim.t_time_sk
+|  fk/pk conjuncts: ss_sold_time_sk = time_dim.t_time_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2 row-size=24B cardinality=69.82K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F70:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=30 plan-id=31 cohort-id=01
+|  |  build expressions: time_dim.t_time_sk
+|  |  runtime filters: RF004[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  71:EXCHANGE [BROADCAST]
+|  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=1.14K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: time_dim.t_hour = CAST(8 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: time_dim.t_hour = CAST(8 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|     parquet dictionary predicates: time_dim.t_hour = CAST(8 AS INT), time_dim.t_minute >= CAST(30 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=12B cardinality=1.14K
+|     in pipelines: 02(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF004[bloom] -> ss_sold_time_sk, RF002[bloom] -> ss_hdemo_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q89.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q89.test
new file mode 100644
index 0000000..7518b1c
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q89.test
@@ -0,0 +1,470 @@
+# TPCDS-Q89
+select * from (select  *
+from (
+select i_category, i_class, i_brand,
+       s_store_name, s_company_name,
+       d_moy,
+       sum(ss_sales_price) sum_sales,
+       avg(sum(ss_sales_price)) over
+         (partition by i_category, i_brand, s_store_name, s_company_name)
+         avg_monthly_sales
+from item, store_sales, date_dim, store
+where ss_item_sk = i_item_sk and
+      ss_sold_date_sk = d_date_sk and
+      ss_store_sk = s_store_sk and
+      d_year in (2000) and
+        ((i_category in ('Children','Music','Home') and
+          i_class in ('toddlers','pop','lighting')
+         )
+      or (i_category in ('Jewelry','Books','Sports') and
+          i_class in ('costume','travel','football')
+        ))
+group by i_category, i_class, i_brand,
+         s_store_name, s_company_name, d_moy) tmp1
+where case when (avg_monthly_sales <> 0) then (abs(sum_sales - avg_monthly_sales) / avg_monthly_sales) else null end > 0.1
+order by sum_sales - avg_monthly_sales, s_store_name
+limit 100) tmp2
+---- PLAN
+Max Per-Host Resource Reservation: Memory=21.88MB Threads=5
+Per-Host Resource Estimates: Memory=221MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=220.81MB mem-reservation=21.88MB thread-reservation=5 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy, sum_sales, avg_monthly_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:TOP-N [LIMIT=100]
+|  order by: sum_sales - avg_monthly_sales ASC, s_store_name ASC
+|  mem-estimate=13.39KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=137B cardinality=100
+|  in pipelines: 11(GETNEXT), 08(OPEN)
+|
+10:SELECT
+|  predicates: CASE WHEN (avg(sum(ss_sales_price)) != CAST(0 AS DECIMAL(3,0))) THEN (abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price))) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=16,15 row-size=137B cardinality=1.07K
+|  in pipelines: 08(GETNEXT)
+|
+09:ANALYTIC
+|  functions: avg(sum(ss_sales_price))
+|  partition by: i_category, i_brand, s_store_name, s_company_name
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16,15 row-size=137B cardinality=10.67K
+|  in pipelines: 08(GETNEXT)
+|
+08:SORT
+|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=121B cardinality=10.67K
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+07:AGGREGATE [FINALIZE]
+|  output: sum(ss_sales_price)
+|  group by: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=4 row-size=121B cardinality=10.67K
+|  in pipelines: 07(GETNEXT), 01(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2,3 row-size=145B cardinality=10.67K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.store]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=3 row-size=39B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=106B cardinality=10.67K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year IN (CAST(2000 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year IN (CAST(2000 AS INT))
+|     parquet dictionary predicates: d_year IN (CAST(2000 AS INT))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=373
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF004[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=94B cardinality=52.17K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category IN ('Children', 'Music', 'Home') AND i_class IN ('toddlers', 'pop', 'lighting')) OR (i_category IN ('Jewelry', 'Books', 'Sports') AND i_class IN ('costume', 'travel', 'football')))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=0 row-size=74B cardinality=326
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=30.52MB Threads=10
+Per-Host Resource Estimates: Memory=253MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=45.81KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy, sum_sales, avg_monthly_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum_sales - avg_monthly_sales ASC, s_store_name ASC
+|  limit: 100
+|  mem-estimate=45.81KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=137B cardinality=100
+|  in pipelines: 11(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_category,i_brand,s_store_name,s_company_name)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=26.00MB mem-reservation=17.94MB thread-reservation=1
+11:TOP-N [LIMIT=100]
+|  order by: sum_sales - avg_monthly_sales ASC, s_store_name ASC
+|  mem-estimate=13.39KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=137B cardinality=100
+|  in pipelines: 11(GETNEXT), 08(OPEN)
+|
+10:SELECT
+|  predicates: CASE WHEN (avg(sum(ss_sales_price)) != CAST(0 AS DECIMAL(3,0))) THEN (abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price))) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=16,15 row-size=137B cardinality=1.07K
+|  in pipelines: 08(GETNEXT)
+|
+09:ANALYTIC
+|  functions: avg(sum(ss_sales_price))
+|  partition by: i_category, i_brand, s_store_name, s_company_name
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16,15 row-size=137B cardinality=10.67K
+|  in pipelines: 08(GETNEXT)
+|
+08:SORT
+|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=121B cardinality=10.67K
+|  in pipelines: 08(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=121B cardinality=10.67K
+|  in pipelines: 16(GETNEXT), 01(OPEN)
+|
+15:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
+|  mem-estimate=796.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=121B cardinality=10.67K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=66.89MB mem-reservation=11.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+07:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=121B cardinality=10.67K
+|  in pipelines: 01(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  runtime filters: RF000[bloom] <- s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2,3 row-size=145B cardinality=10.67K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=39B cardinality=12
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=48.00MB mem-reservation=24.00KB thread-reservation=1
+|     tuple-ids=3 row-size=39B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=106B cardinality=10.67K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=373
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year IN (CAST(2000 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year IN (CAST(2000 AS INT))
+|     parquet dictionary predicates: d_year IN (CAST(2000 AS INT))
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=373
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF004[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=94B cardinality=52.17K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=48.31KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=74B cardinality=326
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category IN ('Children', 'Music', 'Home') AND i_class IN ('toddlers', 'pop', 'lighting')) OR (i_category IN ('Jewelry', 'Books', 'Sports') AND i_class IN ('costume', 'travel', 'football')))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=64.00MB mem-reservation=256.00KB thread-reservation=1
+|     tuple-ids=0 row-size=74B cardinality=326
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=1 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=60.27MB Threads=11
+Per-Host Resource Estimates: Memory=170MB
+F05:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=87.15KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy, sum_sales, avg_monthly_sales
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum_sales - avg_monthly_sales ASC, s_store_name ASC
+|  limit: 100
+|  mem-estimate=87.15KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=137B cardinality=100
+|  in pipelines: 11(GETNEXT)
+|
+F04:PLAN FRAGMENT [HASH(i_category,i_brand,s_store_name,s_company_name)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=17.94MB thread-reservation=1
+11:TOP-N [LIMIT=100]
+|  order by: sum_sales - avg_monthly_sales ASC, s_store_name ASC
+|  mem-estimate=13.39KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=137B cardinality=100
+|  in pipelines: 11(GETNEXT), 08(OPEN)
+|
+10:SELECT
+|  predicates: CASE WHEN (avg(sum(ss_sales_price)) != CAST(0 AS DECIMAL(3,0))) THEN (abs(sum(ss_sales_price) - avg(sum(ss_sales_price))) / avg(sum(ss_sales_price))) ELSE NULL END > CAST(0.1 AS DECIMAL(1,1))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=16,15 row-size=137B cardinality=1.07K
+|  in pipelines: 08(GETNEXT)
+|
+09:ANALYTIC
+|  functions: avg(sum(ss_sales_price))
+|  partition by: i_category, i_brand, s_store_name, s_company_name
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16,15 row-size=137B cardinality=10.67K
+|  in pipelines: 08(GETNEXT)
+|
+08:SORT
+|  order by: i_category ASC NULLS LAST, i_brand ASC NULLS LAST, s_store_name ASC NULLS LAST, s_company_name ASC NULLS LAST
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=16 row-size=121B cardinality=10.67K
+|  in pipelines: 08(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_sales_price)
+|  group by: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=121B cardinality=10.67K
+|  in pipelines: 16(GETNEXT), 01(OPEN)
+|
+15:EXCHANGE [HASH(i_category,i_brand,s_store_name,s_company_name)]
+|  mem-estimate=1.14MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=121B cardinality=10.67K
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=3.00MB thread-reservation=1
+07:AGGREGATE [STREAMING]
+|  output: sum(ss_sales_price)
+|  group by: i_category, i_class, i_brand, s_store_name, s_company_name, d_moy
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=121B cardinality=10.67K
+|  in pipelines: 01(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_store_sk = s_store_sk
+|  fk/pk conjuncts: ss_store_sk = s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2,3 row-size=145B cardinality=10.67K
+|  in pipelines: 01(GETNEXT), 03(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: s_store_sk
+|  |  runtime filters: RF000[bloom] <- s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=39B cardinality=12
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.store, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     mem-estimate=16.00MB mem-reservation=24.00KB thread-reservation=0
+|     tuple-ids=3 row-size=39B cardinality=12
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0,2 row-size=106B cardinality=10.67K
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=373
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year IN (CAST(2000 AS INT))
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year IN (CAST(2000 AS INT))
+|     parquet dictionary predicates: d_year IN (CAST(2000 AS INT))
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=12B cardinality=373
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,0 row-size=94B cardinality=52.17K
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.92MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF004[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=48.31KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=74B cardinality=326
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: ((i_category IN ('Children', 'Music', 'Home') AND i_class IN ('toddlers', 'pop', 'lighting')) OR (i_category IN ('Jewelry', 'Books', 'Sports') AND i_class IN ('costume', 'travel', 'football')))
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|     tuple-ids=0 row-size=74B cardinality=326
+|     in pipelines: 00(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_store_sk, RF002[bloom] -> ss_sold_date_sk, RF004[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=1 row-size=20B cardinality=2.88M
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q90.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q90.test
new file mode 100644
index 0000000..9cbf4dc
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q90.test
@@ -0,0 +1,776 @@
+# TPCDS-Q90
+SELECT cast(amc AS decimal(15,4))/cast(pmc AS decimal(15,4)) am_pm_ratio
+FROM
+  (SELECT count(*) amc
+   FROM web_sales,
+        household_demographics,
+        time_dim,
+        web_page
+   WHERE ws_sold_time_sk = time_dim.t_time_sk
+     AND ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+     AND ws_web_page_sk = web_page.wp_web_page_sk
+     AND time_dim.t_hour BETWEEN 8 AND 8+1
+     AND household_demographics.hd_dep_count = 6
+     AND web_page.wp_char_count BETWEEN 5000 AND 5200) `AT`,
+  (SELECT count(*) pmc
+   FROM web_sales,
+        household_demographics,
+        time_dim,
+        web_page
+   WHERE ws_sold_time_sk = time_dim.t_time_sk
+     AND ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+     AND ws_web_page_sk = web_page.wp_web_page_sk
+     AND time_dim.t_hour BETWEEN 19 AND 19+1
+     AND household_demographics.hd_dep_count = 6
+     AND web_page.wp_char_count BETWEEN 5000 AND 5200) pt
+ORDER BY am_pm_ratio
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=26.78MB Threads=9
+Per-Host Resource Estimates: Memory=402MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=401.62MB mem-reservation=26.78MB thread-reservation=9 runtime-filters-memory=6.00MB
+PLAN-ROOT SINK
+|  output exprs: CAST(amc AS DECIMAL(15,4)) / CAST(pmc AS DECIMAL(15,4))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:TOP-N [LIMIT=100]
+|  order by: CAST(amc AS DECIMAL(15,4)) / CAST(pmc AS DECIMAL(15,4)) ASC
+|  materialized: CAST(amc AS DECIMAL(15,4)) / CAST(pmc AS DECIMAL(15,4))
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=16B cardinality=1
+|  in pipelines: 17(GETNEXT), 07(OPEN)
+|
+16:NESTED LOOP JOIN [CROSS JOIN]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10 row-size=16B cardinality=1
+|  in pipelines: 07(GETNEXT), 15(OPEN)
+|
+|--15:AGGREGATE [FINALIZE]
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 15(GETNEXT), 08(OPEN)
+|  |
+|  14:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ws_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF006[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7,9,8 row-size=36B cardinality=1.53K
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--10:SCAN HDFS [tpcds_parquet.time_dim]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour <= CAST(20 AS INT), time_dim.t_hour >= CAST(19 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour <= CAST(20 AS INT), time_dim.t_hour >= CAST(19 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour <= CAST(20 AS INT), time_dim.t_hour >= CAST(19 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=8 row-size=8B cardinality=8.64K
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_web_page_sk = web_page.wp_web_page_sk
+|  |  fk/pk conjuncts: ws_web_page_sk = web_page.wp_web_page_sk
+|  |  runtime filters: RF008[bloom] <- web_page.wp_web_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7,9 row-size=28B cardinality=7.02K
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--11:SCAN HDFS [tpcds_parquet.web_page]
+|  |     HDFS partitions=1/1 files=1 size=5.56KB
+|  |     predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=60 size=5.56KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=60
+|  |     parquet statistics predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|  |     parquet dictionary predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=8B cardinality=6
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  |  runtime filters: RF010[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7 row-size=20B cardinality=70.22K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--09:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     parquet statistics predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|  |     parquet dictionary predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=8B cardinality=720
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.web_sales]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF006[bloom] -> ws_sold_time_sk, RF008[bloom] -> ws_web_page_sk, RF010[bloom] -> ws_ship_hdemo_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=6 row-size=12B cardinality=719.38K
+|     in pipelines: 08(GETNEXT)
+|
+07:AGGREGATE [FINALIZE]
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_sold_time_sk = time_dim.t_time_sk
+|  fk/pk conjuncts: ws_sold_time_sk = time_dim.t_time_sk
+|  runtime filters: RF000[bloom] <- time_dim.t_time_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,2 row-size=36B cardinality=1.53K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.time_dim]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: time_dim.t_hour <= CAST(9 AS INT), time_dim.t_hour >= CAST(8 AS INT)
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: time_dim.t_hour <= CAST(9 AS INT), time_dim.t_hour >= CAST(8 AS INT)
+|     parquet dictionary predicates: time_dim.t_hour <= CAST(9 AS INT), time_dim.t_hour >= CAST(8 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=8.64K
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_web_page_sk = web_page.wp_web_page_sk
+|  fk/pk conjuncts: ws_web_page_sk = web_page.wp_web_page_sk
+|  runtime filters: RF002[bloom] <- web_page.wp_web_page_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3 row-size=28B cardinality=7.02K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.web_page]
+|     HDFS partitions=1/1 files=1 size=5.56KB
+|     predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|     stored statistics:
+|       table: rows=60 size=5.56KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=60
+|     parquet statistics predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|     parquet dictionary predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=6
+|     in pipelines: 03(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  runtime filters: RF004[bloom] <- household_demographics.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=20B cardinality=70.22K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.household_demographics]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|     parquet dictionary predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=720
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_sold_time_sk, RF002[bloom] -> ws_web_page_sk, RF004[bloom] -> ws_ship_hdemo_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=26.78MB Threads=18
+Per-Host Resource Estimates: Memory=442MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.03MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CAST(amc AS DECIMAL(15,4)) / CAST(pmc AS DECIMAL(15,4))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:TOP-N [LIMIT=100]
+|  order by: CAST(amc AS DECIMAL(15,4)) / CAST(pmc AS DECIMAL(15,4)) ASC
+|  materialized: CAST(amc AS DECIMAL(15,4)) / CAST(pmc AS DECIMAL(15,4))
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=16B cardinality=1
+|  in pipelines: 17(GETNEXT), 22(OPEN)
+|
+16:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10 row-size=16B cardinality=1
+|  in pipelines: 22(GETNEXT), 27(OPEN)
+|
+|--28:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 27(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  27:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 27(GETNEXT), 15(OPEN)
+|  |
+|  26:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=114.81MB mem-reservation=12.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  15:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 15(GETNEXT), 08(OPEN)
+|  |
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ws_sold_time_sk = time_dim.t_time_sk
+|  |  runtime filters: RF006[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7,9,8 row-size=36B cardinality=1.53K
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=79.50KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=8 row-size=8B cardinality=8.64K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  10:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour <= CAST(20 AS INT), time_dim.t_hour >= CAST(19 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour <= CAST(20 AS INT), time_dim.t_hour >= CAST(19 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour <= CAST(20 AS INT), time_dim.t_hour >= CAST(19 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=8 row-size=8B cardinality=8.64K
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_web_page_sk = web_page.wp_web_page_sk
+|  |  fk/pk conjuncts: ws_web_page_sk = web_page.wp_web_page_sk
+|  |  runtime filters: RF008[bloom] <- web_page.wp_web_page_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7,9 row-size=28B cardinality=7.02K
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--24:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=8B cardinality=6
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  11:SCAN HDFS [tpcds_parquet.web_page, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.56KB
+|  |     predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=60 size=5.56KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=60
+|  |     parquet statistics predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|  |     parquet dictionary predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=9 row-size=8B cardinality=6
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  |  runtime filters: RF010[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7 row-size=20B cardinality=70.22K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=8B cardinality=720
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=2
+|  |  09:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     parquet statistics predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|  |     parquet dictionary predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=7 row-size=8B cardinality=720
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF006[bloom] -> ws_sold_time_sk, RF008[bloom] -> ws_web_page_sk, RF010[bloom] -> ws_ship_hdemo_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=6 row-size=12B cardinality=719.38K
+|     in pipelines: 08(GETNEXT)
+|
+22:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 22(GETNEXT), 07(OPEN)
+|
+21:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=114.81MB mem-reservation=12.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+07:AGGREGATE
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_sold_time_sk = time_dim.t_time_sk
+|  fk/pk conjuncts: ws_sold_time_sk = time_dim.t_time_sk
+|  runtime filters: RF000[bloom] <- time_dim.t_time_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,2 row-size=36B cardinality=1.53K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=79.50KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=8.64K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: time_dim.t_hour <= CAST(9 AS INT), time_dim.t_hour >= CAST(8 AS INT)
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: time_dim.t_hour <= CAST(9 AS INT), time_dim.t_hour >= CAST(8 AS INT)
+|     parquet dictionary predicates: time_dim.t_hour <= CAST(9 AS INT), time_dim.t_hour >= CAST(8 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=8.64K
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_web_page_sk = web_page.wp_web_page_sk
+|  fk/pk conjuncts: ws_web_page_sk = web_page.wp_web_page_sk
+|  runtime filters: RF002[bloom] <- web_page.wp_web_page_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3 row-size=28B cardinality=7.02K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=8B cardinality=6
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.web_page, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.56KB
+|     predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|     stored statistics:
+|       table: rows=60 size=5.56KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=60
+|     parquet statistics predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|     parquet dictionary predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=8B cardinality=6
+|     in pipelines: 03(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  runtime filters: RF004[bloom] <- household_demographics.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=20B cardinality=70.22K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=720
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|     parquet dictionary predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=720
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_sold_time_sk, RF002[bloom] -> ws_web_page_sk, RF004[bloom] -> ws_ship_hdemo_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=44.41MB Threads=17
+Per-Host Resource Estimates: Memory=236MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: CAST(amc AS DECIMAL(15,4)) / CAST(pmc AS DECIMAL(15,4))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:TOP-N [LIMIT=100]
+|  order by: CAST(amc AS DECIMAL(15,4)) / CAST(pmc AS DECIMAL(15,4)) ASC
+|  materialized: CAST(amc AS DECIMAL(15,4)) / CAST(pmc AS DECIMAL(15,4))
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=12 row-size=16B cardinality=1
+|  in pipelines: 17(GETNEXT), 22(OPEN)
+|
+16:NESTED LOOP JOIN [CROSS JOIN, BROADCAST]
+|  join table id: 00
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|  tuple-ids=4,10 row-size=16B cardinality=1
+|  in pipelines: 22(GETNEXT), 27(OPEN)
+|
+|--F10:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.01KB mem-reservation=0B thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  mem-estimate=8B mem-reservation=0B thread-reservation=0
+|  |
+|  28:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 27(GETNEXT)
+|  |
+|  F09:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+|  27:AGGREGATE [FINALIZE]
+|  |  output: count:merge(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 27(GETNEXT), 15(OPEN)
+|  |
+|  26:EXCHANGE [UNPARTITIONED]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 15(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=42.00MB mem-reservation=4.00MB thread-reservation=1
+|  15:AGGREGATE
+|  |  output: count(*)
+|  |  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=10 row-size=8B cardinality=1
+|  |  in pipelines: 15(GETNEXT), 08(OPEN)
+|  |
+|  14:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: ws_sold_time_sk = time_dim.t_time_sk
+|  |  fk/pk conjuncts: ws_sold_time_sk = time_dim.t_time_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7,9,8 row-size=36B cardinality=1.53K
+|  |  in pipelines: 08(GETNEXT), 10(OPEN)
+|  |
+|  |--F11:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: time_dim.t_time_sk
+|  |  |  runtime filters: RF006[bloom] <- time_dim.t_time_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  25:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=79.50KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=8 row-size=8B cardinality=8.64K
+|  |  |  in pipelines: 10(GETNEXT)
+|  |  |
+|  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  10:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.31MB
+|  |     predicates: time_dim.t_hour <= CAST(20 AS INT), time_dim.t_hour >= CAST(19 AS INT)
+|  |     stored statistics:
+|  |       table: rows=86.40K size=1.31MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|  |     parquet statistics predicates: time_dim.t_hour <= CAST(20 AS INT), time_dim.t_hour >= CAST(19 AS INT)
+|  |     parquet dictionary predicates: time_dim.t_hour <= CAST(20 AS INT), time_dim.t_hour >= CAST(19 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=8 row-size=8B cardinality=8.64K
+|  |     in pipelines: 10(GETNEXT)
+|  |
+|  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: ws_web_page_sk = web_page.wp_web_page_sk
+|  |  fk/pk conjuncts: ws_web_page_sk = web_page.wp_web_page_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7,9 row-size=28B cardinality=7.02K
+|  |  in pipelines: 08(GETNEXT), 11(OPEN)
+|  |
+|  |--F12:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: web_page.wp_web_page_sk
+|  |  |  runtime filters: RF008[bloom] <- web_page.wp_web_page_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  24:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=9 row-size=8B cardinality=6
+|  |  |  in pipelines: 11(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  11:SCAN HDFS [tpcds_parquet.web_page, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.56KB
+|  |     predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|  |     stored statistics:
+|  |       table: rows=60 size=5.56KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=60
+|  |     parquet statistics predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|  |     parquet dictionary predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=9 row-size=8B cardinality=6
+|  |     in pipelines: 11(GETNEXT)
+|  |
+|  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  |  fk/pk conjuncts: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=6,7 row-size=20B cardinality=70.22K
+|  |  in pipelines: 08(GETNEXT), 09(OPEN)
+|  |
+|  |--F13:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: household_demographics.hd_demo_sk
+|  |  |  runtime filters: RF010[bloom] <- household_demographics.hd_demo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  23:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=7 row-size=8B cardinality=720
+|  |  |  in pipelines: 09(GETNEXT)
+|  |  |
+|  |  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  09:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     parquet statistics predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|  |     parquet dictionary predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|  |     tuple-ids=7 row-size=8B cardinality=720
+|  |     in pipelines: 09(GETNEXT)
+|  |
+|  08:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF006[bloom] -> ws_sold_time_sk, RF008[bloom] -> ws_web_page_sk, RF010[bloom] -> ws_ship_hdemo_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=6 row-size=12B cardinality=719.38K
+|     in pipelines: 08(GETNEXT)
+|
+22:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 22(GETNEXT), 07(OPEN)
+|
+21:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=42.00MB mem-reservation=4.00MB thread-reservation=1
+07:AGGREGATE
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=04
+|  hash predicates: ws_sold_time_sk = time_dim.t_time_sk
+|  fk/pk conjuncts: ws_sold_time_sk = time_dim.t_time_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,2 row-size=36B cardinality=1.53K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F14:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=04 plan-id=05 cohort-id=01
+|  |  build expressions: time_dim.t_time_sk
+|  |  runtime filters: RF000[bloom] <- time_dim.t_time_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=79.50KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=8.64K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.time_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: time_dim.t_hour <= CAST(9 AS INT), time_dim.t_hour >= CAST(8 AS INT)
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: time_dim.t_hour <= CAST(9 AS INT), time_dim.t_hour >= CAST(8 AS INT)
+|     parquet dictionary predicates: time_dim.t_hour <= CAST(9 AS INT), time_dim.t_hour >= CAST(8 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=8B cardinality=8.64K
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=05
+|  hash predicates: ws_web_page_sk = web_page.wp_web_page_sk
+|  fk/pk conjuncts: ws_web_page_sk = web_page.wp_web_page_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3 row-size=28B cardinality=7.02K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F15:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=05 plan-id=06 cohort-id=01
+|  |  build expressions: web_page.wp_web_page_sk
+|  |  runtime filters: RF002[bloom] <- web_page.wp_web_page_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=8B cardinality=6
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.web_page, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.56KB
+|     predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|     stored statistics:
+|       table: rows=60 size=5.56KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=60
+|     parquet statistics predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|     parquet dictionary predicates: web_page.wp_char_count <= CAST(5200 AS INT), web_page.wp_char_count >= CAST(5000 AS INT)
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=3 row-size=8B cardinality=6
+|     in pipelines: 03(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=06
+|  hash predicates: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  fk/pk conjuncts: ws_ship_hdemo_sk = household_demographics.hd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=20B cardinality=70.22K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F16:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=06 plan-id=07 cohort-id=01
+|  |  build expressions: household_demographics.hd_demo_sk
+|  |  runtime filters: RF004[bloom] <- household_demographics.hd_demo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=720
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|     parquet dictionary predicates: household_demographics.hd_dep_count = CAST(6 AS INT)
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=1 row-size=8B cardinality=720
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws_sold_time_sk, RF002[bloom] -> ws_web_page_sk, RF004[bloom] -> ws_ship_hdemo_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=32.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=12B cardinality=719.38K
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q91.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q91.test
new file mode 100644
index 0000000..077aacd
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q91.test
@@ -0,0 +1,665 @@
+# TPCDS-Q91
+SELECT cc_call_center_id Call_Center,
+       cc_name Call_Center_Name,
+       cc_manager Manager,
+       sum(cr_net_loss) Returns_Loss
+FROM call_center,
+     catalog_returns,
+     date_dim,
+     customer,
+     customer_address,
+     customer_demographics,
+     household_demographics
+WHERE cr_call_center_sk = cc_call_center_sk
+  AND cr_returned_date_sk = d_date_sk
+  AND cr_returning_customer_sk= c_customer_sk
+  AND cd_demo_sk = c_current_cdemo_sk
+  AND hd_demo_sk = c_current_hdemo_sk
+  AND ca_address_sk = c_current_addr_sk
+  AND d_year = 1998
+  AND d_moy = 11
+  AND ((cd_marital_status = 'M'
+        AND cd_education_status = 'Unknown') or(cd_marital_status = 'W'
+                                                AND cd_education_status = 'Advanced Degree'))
+  AND hd_buy_potential LIKE 'Unknown%'
+  AND ca_gmt_offset = -7
+GROUP BY cc_call_center_id,
+         cc_name,
+         cc_manager,
+         cd_marital_status,
+         cd_education_status
+ORDER BY sum(cr_net_loss) DESC;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=29.47MB Threads=8
+Per-Host Resource Estimates: Memory=401MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=400.62MB mem-reservation=29.47MB thread-reservation=8 runtime-filters-memory=6.00MB
+PLAN-ROOT SINK
+|  output exprs: cc_call_center_id, cc_name, cc_manager, sum(cr_net_loss)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+14:SORT
+|  order by: sum(cr_net_loss) DESC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=92B cardinality=191
+|  in pipelines: 14(GETNEXT), 13(OPEN)
+|
+13:AGGREGATE [FINALIZE]
+|  output: sum(cr_net_loss)
+|  group by: cc_call_center_id, cc_name, cc_manager, cd_marital_status, cd_education_status
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=127B cardinality=191
+|  in pipelines: 13(GETNEXT), 01(OPEN)
+|
+12:HASH JOIN [INNER JOIN]
+|  hash predicates: cr_call_center_sk = cc_call_center_sk
+|  fk/pk conjuncts: cr_call_center_sk = cc_call_center_sk
+|  runtime filters: RF000[bloom] <- cc_call_center_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,5,3,6,4,2,0 row-size=194B cardinality=191
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--00:SCAN HDFS [tpcds_parquet.call_center]
+|     HDFS partitions=1/1 files=1 size=10.28KB
+|     stored statistics:
+|       table: rows=6 size=10.28KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6
+|     mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=0 row-size=80B cardinality=6
+|     in pipelines: 00(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: cr_returned_date_sk = d_date_sk
+|  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,5,3,6,4,2 row-size=114B cardinality=191
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 02(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: cr_returning_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF004[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,5,3,6,4 row-size=102B cardinality=3.61K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--09:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,3,6,4 row-size=86B cardinality=1.89K
+|  |  in pipelines: 05(GETNEXT), 04(OPEN)
+|  |
+|  |--04:SCAN HDFS [tpcds_parquet.customer_address]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-7 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-7 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-7 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=8B cardinality=8.33K
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN]
+|  |  hash predicates: c_current_hdemo_sk = hd_demo_sk
+|  |  fk/pk conjuncts: c_current_hdemo_sk = hd_demo_sk
+|  |  runtime filters: RF008[bloom] <- hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,3,6 row-size=78B cardinality=9.76K
+|  |  in pipelines: 05(GETNEXT), 06(OPEN)
+|  |
+|  |--06:SCAN HDFS [tpcds_parquet.household_demographics]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: hd_buy_potential LIKE 'Unknown%'
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     parquet dictionary predicates: hd_buy_potential LIKE 'Unknown%'
+|  |     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=24B cardinality=720
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cd_demo_sk = c_current_cdemo_sk
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF010[bloom] <- c_current_cdemo_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=5,3 row-size=55B cardinality=100.00K
+|  |  in pipelines: 05(GETNEXT), 03(OPEN)
+|  |
+|  |--03:SCAN HDFS [tpcds_parquet.customer]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF006[bloom] -> c_current_addr_sk, RF008[bloom] -> c_current_hdemo_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=3 row-size=16B cardinality=100.00K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.customer_demographics]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: ((cd_marital_status = 'M' AND cd_education_status = 'Unknown') OR (cd_marital_status = 'W' AND cd_education_status = 'Advanced Degree'))
+|     runtime filters: RF010[bloom] -> cd_demo_sk
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=5 row-size=39B cardinality=108.19K
+|     in pipelines: 05(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.catalog_returns]
+   HDFS partitions=1/1 files=1 size=10.62MB
+   runtime filters: RF000[bloom] -> cr_call_center_sk, RF002[bloom] -> cr_returned_date_sk, RF004[bloom] -> cr_returning_customer_sk
+   stored statistics:
+     table: rows=144.07K size=10.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=144.07K
+   mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=144.07K
+   in pipelines: 01(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=49.34MB Threads=16
+Per-Host Resource Estimates: Memory=439MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=35.19KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: cc_call_center_id, cc_name, cc_manager, sum(cr_net_loss)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+23:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(cr_net_loss) DESC
+|  mem-estimate=35.19KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=92B cardinality=191
+|  in pipelines: 14(GETNEXT)
+|
+F07:PLAN FRAGMENT [HASH(cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status)] hosts=1 instances=1
+Per-Host Resources: mem-estimate=22.00MB mem-reservation=13.94MB thread-reservation=1
+14:SORT
+|  order by: sum(cr_net_loss) DESC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=92B cardinality=191
+|  in pipelines: 14(GETNEXT), 22(OPEN)
+|
+22:AGGREGATE [FINALIZE]
+|  output: sum:merge(cr_net_loss)
+|  group by: cc_call_center_id, cc_name, cc_manager, cd_marital_status, cd_education_status
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=127B cardinality=191
+|  in pipelines: 22(GETNEXT), 01(OPEN)
+|
+21:EXCHANGE [HASH(cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status)]
+|  mem-estimate=48.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=127B cardinality=191
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Resources: mem-estimate=115.10MB mem-reservation=12.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+13:AGGREGATE [STREAMING]
+|  output: sum(cr_net_loss)
+|  group by: cc_call_center_id, cc_name, cc_manager, cd_marital_status, cd_education_status
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=127B cardinality=191
+|  in pipelines: 01(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cr_call_center_sk = cc_call_center_sk
+|  fk/pk conjuncts: cr_call_center_sk = cc_call_center_sk
+|  runtime filters: RF000[bloom] <- cc_call_center_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,5,3,6,4,2,0 row-size=194B cardinality=191
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=80B cardinality=6
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=2
+|  00:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.28KB
+|     stored statistics:
+|       table: rows=6 size=10.28KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6
+|     mem-estimate=64.00MB mem-reservation=32.00KB thread-reservation=1
+|     tuple-ids=0 row-size=80B cardinality=6
+|     in pipelines: 00(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cr_returned_date_sk = d_date_sk
+|  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,5,3,6,4,2 row-size=114B cardinality=191
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=108
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 02(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cr_returning_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  runtime filters: RF004[bloom] <- c_customer_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,5,3,6,4 row-size=102B cardinality=3.61K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=260.77KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5,3,6,4 row-size=86B cardinality=1.89K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=59.41MB mem-reservation=17.75MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  09:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,3,6,4 row-size=86B cardinality=1.89K
+|  |  in pipelines: 05(GETNEXT), 04(OPEN)
+|  |
+|  |--17:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  04:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-7 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-7 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-7 AS DECIMAL(3,0))
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=4 row-size=8B cardinality=8.33K
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: c_current_hdemo_sk = hd_demo_sk
+|  |  fk/pk conjuncts: c_current_hdemo_sk = hd_demo_sk
+|  |  runtime filters: RF008[bloom] <- hd_demo_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,3,6 row-size=78B cardinality=9.76K
+|  |  in pipelines: 05(GETNEXT), 06(OPEN)
+|  |
+|  |--16:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=35.86KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=24B cardinality=720
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=2
+|  |  06:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: hd_buy_potential LIKE 'Unknown%'
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     parquet dictionary predicates: hd_buy_potential LIKE 'Unknown%'
+|  |     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|  |     tuple-ids=6 row-size=24B cardinality=720
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cd_demo_sk = c_current_cdemo_sk
+|  |  fk/pk conjuncts: none
+|  |  runtime filters: RF010[bloom] <- c_current_cdemo_sk
+|  |  mem-estimate=2.88MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=5,3 row-size=55B cardinality=100.00K
+|  |  in pipelines: 05(GETNEXT), 03(OPEN)
+|  |
+|  |--15:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.55MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=16B cardinality=100.00K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=66.00MB mem-reservation=4.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  |  03:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF006[bloom] -> c_current_addr_sk, RF008[bloom] -> c_current_hdemo_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=3 row-size=16B cardinality=100.00K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: ((cd_marital_status = 'M' AND cd_education_status = 'Unknown') OR (cd_marital_status = 'W' AND cd_education_status = 'Advanced Degree'))
+|     runtime filters: RF010[bloom] -> cd_demo_sk
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     mem-estimate=48.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=5 row-size=39B cardinality=108.19K
+|     in pipelines: 05(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+   HDFS partitions=1/1 files=1 size=10.62MB
+   runtime filters: RF000[bloom] -> cr_call_center_sk, RF002[bloom] -> cr_returned_date_sk, RF004[bloom] -> cr_returning_customer_sk
+   stored statistics:
+     table: rows=144.07K size=10.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=144.07K
+   mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=1 row-size=16B cardinality=144.07K
+   in pipelines: 01(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=65.91MB Threads=15
+Per-Host Resource Estimates: Memory=191MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=35.19KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: cc_call_center_id, cc_name, cc_manager, sum(cr_net_loss)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+23:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(cr_net_loss) DESC
+|  mem-estimate=35.19KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=92B cardinality=191
+|  in pipelines: 14(GETNEXT)
+|
+F07:PLAN FRAGMENT [HASH(cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status)] hosts=1 instances=1
+Per-Instance Resources: mem-estimate=22.00MB mem-reservation=13.94MB thread-reservation=1
+14:SORT
+|  order by: sum(cr_net_loss) DESC
+|  mem-estimate=12.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=92B cardinality=191
+|  in pipelines: 14(GETNEXT), 22(OPEN)
+|
+22:AGGREGATE [FINALIZE]
+|  output: sum:merge(cr_net_loss)
+|  group by: cc_call_center_id, cc_name, cc_manager, cd_marital_status, cd_education_status
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=127B cardinality=191
+|  in pipelines: 22(GETNEXT), 01(OPEN)
+|
+21:EXCHANGE [HASH(cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status)]
+|  mem-estimate=48.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=127B cardinality=191
+|  in pipelines: 01(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=34.00MB mem-reservation=4.00MB thread-reservation=1
+13:AGGREGATE [STREAMING]
+|  output: sum(cr_net_loss)
+|  group by: cc_call_center_id, cc_name, cc_manager, cd_marital_status, cd_education_status
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=7 row-size=127B cardinality=191
+|  in pipelines: 01(GETNEXT)
+|
+12:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: cr_call_center_sk = cc_call_center_sk
+|  fk/pk conjuncts: cr_call_center_sk = cc_call_center_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,5,3,6,4,2,0 row-size=194B cardinality=191
+|  in pipelines: 01(GETNEXT), 00(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: cc_call_center_sk
+|  |  runtime filters: RF000[bloom] <- cc_call_center_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  20:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0 row-size=80B cardinality=6
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=1
+|  00:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.28KB
+|     stored statistics:
+|       table: rows=6 size=10.28KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6
+|     mem-estimate=16.00MB mem-reservation=32.00KB thread-reservation=0
+|     tuple-ids=0 row-size=80B cardinality=6
+|     in pipelines: 00(GETNEXT)
+|
+11:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: cr_returned_date_sk = d_date_sk
+|  fk/pk conjuncts: cr_returned_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,5,3,6,4,2 row-size=114B cardinality=191
+|  in pipelines: 01(GETNEXT), 02(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=12B cardinality=108
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     parquet dictionary predicates: d_year = CAST(1998 AS INT), d_moy = CAST(11 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=2 row-size=12B cardinality=108
+|     in pipelines: 02(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: cr_returning_customer_sk = c_customer_sk
+|  fk/pk conjuncts: none
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=1,5,3,6,4 row-size=102B cardinality=3.61K
+|  in pipelines: 01(GETNEXT), 05(OPEN)
+|
+|--F11:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=5.13MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: c_customer_sk
+|  |  runtime filters: RF004[bloom] <- c_customer_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [BROADCAST]
+|  |  mem-estimate=260.77KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5,3,6,4 row-size=86B cardinality=1.89K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=1
+|  09:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: c_current_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: c_current_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,3,6,4 row-size=86B cardinality=1.89K
+|  |  in pipelines: 05(GETNEXT), 04(OPEN)
+|  |
+|  |--F12:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.95MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: ca_address_sk
+|  |  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  17:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=77.10KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=4 row-size=8B cardinality=8.33K
+|  |  |  in pipelines: 04(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  04:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_gmt_offset = CAST(-7 AS DECIMAL(3,0))
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_gmt_offset = CAST(-7 AS DECIMAL(3,0))
+|  |     parquet dictionary predicates: ca_gmt_offset = CAST(-7 AS DECIMAL(3,0))
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=4 row-size=8B cardinality=8.33K
+|  |     in pipelines: 04(GETNEXT)
+|  |
+|  08:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: c_current_hdemo_sk = hd_demo_sk
+|  |  fk/pk conjuncts: c_current_hdemo_sk = hd_demo_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=5,3,6 row-size=78B cardinality=9.76K
+|  |  in pipelines: 05(GETNEXT), 06(OPEN)
+|  |
+|  |--F13:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=4.91MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: hd_demo_sk
+|  |  |  runtime filters: RF008[bloom] <- hd_demo_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  16:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=35.86KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=6 row-size=24B cardinality=720
+|  |  |  in pipelines: 06(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  |  06:SCAN HDFS [tpcds_parquet.household_demographics, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=41.69KB
+|  |     predicates: hd_buy_potential LIKE 'Unknown%'
+|  |     stored statistics:
+|  |       table: rows=7.20K size=41.69KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|  |     parquet dictionary predicates: hd_buy_potential LIKE 'Unknown%'
+|  |     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|  |     tuple-ids=6 row-size=24B cardinality=720
+|  |     in pipelines: 06(GETNEXT)
+|  |
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=05
+|  |  hash predicates: cd_demo_sk = c_current_cdemo_sk
+|  |  fk/pk conjuncts: none
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=128.00KB thread-reservation=0
+|  |  tuple-ids=5,3 row-size=55B cardinality=100.00K
+|  |  in pipelines: 05(GETNEXT), 03(OPEN)
+|  |
+|  |--F14:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Instance Resources: mem-estimate=8.30MB mem-reservation=6.75MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=05 plan-id=06 cohort-id=02
+|  |  |  build expressions: c_current_cdemo_sk
+|  |  |  runtime filters: RF010[bloom] <- c_current_cdemo_sk
+|  |  |  mem-estimate=5.75MB mem-reservation=5.75MB spill-buffer=128.00KB thread-reservation=0
+|  |  |
+|  |  15:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=1.55MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=16B cardinality=100.00K
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.customer, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=5.49MB
+|  |     runtime filters: RF006[bloom] -> c_current_addr_sk, RF008[bloom] -> c_current_hdemo_sk
+|  |     stored statistics:
+|  |       table: rows=100.00K size=5.49MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=100.00K
+|  |     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|  |     tuple-ids=3 row-size=16B cardinality=100.00K
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  05:SCAN HDFS [tpcds_parquet.customer_demographics, RANDOM]
+|     HDFS partitions=1/1 files=1 size=7.49MB
+|     predicates: ((cd_marital_status = 'M' AND cd_education_status = 'Unknown') OR (cd_marital_status = 'W' AND cd_education_status = 'Advanced Degree'))
+|     runtime filters: RF010[bloom] -> cd_demo_sk
+|     stored statistics:
+|       table: rows=1.92M size=7.49MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=1.92M
+|     mem-estimate=16.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=5 row-size=39B cardinality=108.19K
+|     in pipelines: 05(GETNEXT)
+|
+01:SCAN HDFS [tpcds_parquet.catalog_returns, RANDOM]
+   HDFS partitions=1/1 files=1 size=10.62MB
+   runtime filters: RF000[bloom] -> cr_call_center_sk, RF002[bloom] -> cr_returned_date_sk, RF004[bloom] -> cr_returning_customer_sk
+   stored statistics:
+     table: rows=144.07K size=10.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=144.07K
+   mem-estimate=24.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=1 row-size=16B cardinality=144.07K
+   in pipelines: 01(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q92.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q92.test
new file mode 100644
index 0000000..c1692da
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q92.test
@@ -0,0 +1,539 @@
+# TPCDS-Q92
+SELECT sum(ws_ext_discount_amt) AS "Excess Discount Amount"
+FROM web_sales,
+     item,
+     date_dim
+WHERE i_manufact_id = 350
+  AND i_item_sk = ws_item_sk
+  AND d_date BETWEEN '2000-01-27' AND cast('2000-04-26' AS date)
+  AND d_date_sk = ws_sold_date_sk
+  AND ws_ext_discount_amt >
+    (SELECT 1.3 * avg(ws_ext_discount_amt)
+     FROM web_sales,
+          date_dim
+     WHERE ws_item_sk = i_item_sk
+       AND d_date BETWEEN '2000-01-27' AND cast('2000-04-26' AS date)
+       AND d_date_sk = ws_sold_date_sk )
+ORDER BY sum(ws_ext_discount_amt)
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=28.75MB Threads=6
+Per-Host Resource Estimates: Memory=296MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=295.88MB mem-reservation=28.75MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: sum(ws_ext_discount_amt)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:TOP-N [LIMIT=100]
+|  order by: sum(ws_ext_discount_amt) ASC
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=16B cardinality=1
+|  in pipelines: 11(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum(ws_ext_discount_amt)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 10(GETNEXT), 06(OPEN)
+|
+09:HASH JOIN [RIGHT SEMI JOIN]
+|  hash predicates: ws_item_sk = i_item_sk
+|  other join predicates: ws_ext_discount_amt > CAST(1.3 AS DECIMAL(2,1)) * avg(ws_ext_discount_amt)
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=2,0,1 row-size=54B cardinality=760
+|  in pipelines: 06(GETNEXT), 02(OPEN)
+|
+|--08:HASH JOIN [INNER JOIN]
+|  |  hash predicates: d_date_sk = ws_sold_date_sk
+|  |  fk/pk conjuncts: d_date_sk = ws_sold_date_sk
+|  |  runtime filters: RF004[bloom] <- ws_sold_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=2,0,1 row-size=54B cardinality=760
+|  |  in pipelines: 02(GETNEXT), 00(OPEN)
+|  |
+|  |--07:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws_item_sk = i_item_sk
+|  |  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  |  runtime filters: RF006[bloom] <- i_item_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,1 row-size=28B cardinality=760
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--01:SCAN HDFS [tpcds_parquet.item]
+|  |  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |  |     predicates: i_manufact_id = CAST(350 AS INT)
+|  |  |     stored statistics:
+|  |  |       table: rows=18.00K size=1.73MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |  |     parquet statistics predicates: i_manufact_id = CAST(350 AS INT)
+|  |  |     parquet dictionary predicates: i_manufact_id = CAST(350 AS INT)
+|  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=12B cardinality=19
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.web_sales]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF006[bloom] -> ws_item_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=16B cardinality=719.38K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     runtime filters: RF004[bloom] -> d_date_sk
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+06:AGGREGATE [FINALIZE]
+|  output: avg(ws_ext_discount_amt)
+|  group by: ws_item_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=16B cardinality=17.98K
+|  in pipelines: 06(GETNEXT), 03(OPEN)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,4 row-size=42B cardinality=719.38K
+|  in pipelines: 03(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=26B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+03:SCAN HDFS [tpcds_parquet.web_sales]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.web_sales.ws_item_sk, RF002[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=3 row-size=16B cardinality=719.38K
+   in pipelines: 03(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=35.94MB Threads=13
+Per-Host Resource Estimates: Memory=342MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: sum(ws_ext_discount_amt)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:TOP-N [LIMIT=100]
+|  order by: sum(ws_ext_discount_amt) ASC
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=16B cardinality=1
+|  in pipelines: 11(GETNEXT), 20(OPEN)
+|
+20:AGGREGATE [FINALIZE]
+|  output: sum:merge(ws_ext_discount_amt)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 20(GETNEXT), 10(OPEN)
+|
+19:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 10(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(ws_item_sk)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=22.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+10:AGGREGATE
+|  output: sum(ws_ext_discount_amt)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 10(GETNEXT), 14(OPEN)
+|
+09:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash predicates: ws_item_sk = i_item_sk
+|  other join predicates: ws_ext_discount_amt > CAST(1.3 AS DECIMAL(2,1)) * avg(ws_ext_discount_amt)
+|  runtime filters: RF000[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=54B cardinality=760
+|  in pipelines: 14(GETNEXT), 00(OPEN)
+|
+|--18:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=118.01KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,1,2 row-size=54B cardinality=760
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [HASH(ws_sold_date_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=3.21MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1,2 row-size=54B cardinality=760
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--17:EXCHANGE [HASH(d_date_sk)]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=2 row-size=26B cardinality=7.30K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  16:EXCHANGE [HASH(ws_sold_date_sk)]
+|  |  mem-estimate=63.83KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,1 row-size=28B cardinality=760
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=99.95MB mem-reservation=11.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  runtime filters: RF006[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=28B cardinality=760
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--15:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=12B cardinality=19
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_manufact_id = CAST(350 AS INT)
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_manufact_id = CAST(350 AS INT)
+|  |     parquet dictionary predicates: i_manufact_id = CAST(350 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=1 row-size=12B cardinality=19
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF004[bloom] -> ws_sold_date_sk, RF006[bloom] -> ws_item_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+|     tuple-ids=0 row-size=16B cardinality=719.38K
+|     in pipelines: 00(GETNEXT)
+|
+14:AGGREGATE [FINALIZE]
+|  output: avg:merge(ws_ext_discount_amt)
+|  group by: ws_item_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=16B cardinality=17.98K
+|  in pipelines: 14(GETNEXT), 03(OPEN)
+|
+13:EXCHANGE [HASH(ws_item_sk)]
+|  mem-estimate=180.43KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=16B cardinality=17.98K
+|  in pipelines: 03(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=110.15MB mem-reservation=13.94MB thread-reservation=2 runtime-filters-memory=2.00MB
+06:AGGREGATE [STREAMING]
+|  output: avg(ws_ext_discount_amt)
+|  group by: ws_item_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=16B cardinality=17.98K
+|  in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  runtime filters: RF002[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,4 row-size=42B cardinality=719.38K
+|  in pipelines: 03(GETNEXT), 04(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=26B cardinality=7.30K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=4 row-size=26B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+03:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.web_sales.ws_item_sk, RF002[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=96.00MB mem-reservation=8.00MB thread-reservation=1
+   tuple-ids=3 row-size=16B cardinality=719.38K
+   in pipelines: 03(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=41.81MB Threads=12
+Per-Host Resource Estimates: Memory=172MB
+F07:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: sum(ws_ext_discount_amt)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:TOP-N [LIMIT=100]
+|  order by: sum(ws_ext_discount_amt) ASC
+|  mem-estimate=16B mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=16B cardinality=1
+|  in pipelines: 11(GETNEXT), 20(OPEN)
+|
+20:AGGREGATE [FINALIZE]
+|  output: sum:merge(ws_ext_discount_amt)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 20(GETNEXT), 10(OPEN)
+|
+19:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 10(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(ws_item_sk)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+10:AGGREGATE
+|  output: sum(ws_ext_discount_amt)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=16B cardinality=1
+|  in pipelines: 10(GETNEXT), 14(OPEN)
+|
+09:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: ws_item_sk = i_item_sk
+|  other join predicates: ws_ext_discount_amt > CAST(1.3 AS DECIMAL(2,1)) * avg(ws_ext_discount_amt)
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=54B cardinality=760
+|  in pipelines: 14(GETNEXT), 00(OPEN)
+|
+|--F08:PLAN FRAGMENT [HASH(ws_item_sk)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=3.05MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF000[bloom] <- i_item_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  18:EXCHANGE [HASH(i_item_sk)]
+|  |  mem-estimate=118.01KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,1,2 row-size=54B cardinality=760
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F06:PLAN FRAGMENT [HASH(ws_sold_date_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=63.83KB mem-reservation=0B thread-reservation=1
+|  08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=01
+|  |  hash predicates: ws_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1,2 row-size=54B cardinality=760
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--F09:PLAN FRAGMENT [HASH(ws_sold_date_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=3.15MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF004[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  17:EXCHANGE [HASH(d_date_sk)]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=2 row-size=26B cardinality=7.30K
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  16:EXCHANGE [HASH(ws_sold_date_sk)]
+|  |  mem-estimate=63.83KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,1 row-size=28B cardinality=760
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=1
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=02
+|  |  hash predicates: ws_item_sk = i_item_sk
+|  |  fk/pk conjuncts: ws_item_sk = i_item_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,1 row-size=28B cardinality=760
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--F10:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: i_item_sk
+|  |  |  runtime filters: RF006[bloom] <- i_item_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  15:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=12B cardinality=19
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.73MB
+|  |     predicates: i_manufact_id = CAST(350 AS INT)
+|  |     stored statistics:
+|  |       table: rows=18.00K size=1.73MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|  |     parquet statistics predicates: i_manufact_id = CAST(350 AS INT)
+|  |     parquet dictionary predicates: i_manufact_id = CAST(350 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=1 row-size=12B cardinality=19
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF004[bloom] -> ws_sold_date_sk, RF006[bloom] -> ws_item_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+|     tuple-ids=0 row-size=16B cardinality=719.38K
+|     in pipelines: 00(GETNEXT)
+|
+14:AGGREGATE [FINALIZE]
+|  output: avg:merge(ws_ext_discount_amt)
+|  group by: ws_item_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=16B cardinality=17.98K
+|  in pipelines: 14(GETNEXT), 03(OPEN)
+|
+13:EXCHANGE [HASH(ws_item_sk)]
+|  mem-estimate=180.43KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=16B cardinality=17.98K
+|  in pipelines: 03(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=42.00MB mem-reservation=10.00MB thread-reservation=1
+06:AGGREGATE [STREAMING]
+|  output: avg(ws_ext_discount_amt)
+|  group by: ws_item_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=5 row-size=16B cardinality=17.98K
+|  in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: ws_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ws_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=3,4 row-size=42B cardinality=719.38K
+|  in pipelines: 03(GETNEXT), 04(OPEN)
+|
+|--F11:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=5.09MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=26B cardinality=7.30K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '2000-04-26', CAST(d_date AS DATE) >= DATE '2000-01-27'
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=4 row-size=26B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+03:SCAN HDFS [tpcds_parquet.web_sales, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> tpcds_parquet.web_sales.ws_item_sk, RF002[bloom] -> ws_sold_date_sk
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=32.00MB mem-reservation=8.00MB thread-reservation=0
+   tuple-ids=3 row-size=16B cardinality=719.38K
+   in pipelines: 03(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q93.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q93.test
new file mode 100644
index 0000000..575a201
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q93.test
@@ -0,0 +1,326 @@
+# TPCDS-Q93
+SELECT ss_customer_sk,
+       sum(act_sales) sumsales
+FROM
+  (SELECT ss_item_sk,
+          ss_ticket_number,
+          ss_customer_sk,
+          CASE
+              WHEN sr_return_quantity IS NOT NULL THEN (ss_quantity-sr_return_quantity)*ss_sales_price
+              ELSE (ss_quantity*ss_sales_price)
+          END act_sales
+   FROM store_sales
+   LEFT OUTER JOIN store_returns ON (sr_item_sk = ss_item_sk
+                                     AND sr_ticket_number = ss_ticket_number) ,reason
+   WHERE sr_reason_sk = r_reason_sk
+     AND r_reason_desc = 'reason 28') t
+GROUP BY ss_customer_sk
+ORDER BY sumsales,
+         ss_customer_sk
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=19.45MB Threads=4
+Per-Host Resource Estimates: Memory=219MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=219.44MB mem-reservation=19.45MB thread-reservation=4 runtime-filters-memory=1.00MB
+PLAN-ROOT SINK
+|  output exprs: ss_customer_sk, sum(act_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+06:TOP-N [LIMIT=100]
+|  order by: sum(act_sales) ASC, ss_customer_sk ASC
+|  mem-estimate=1.95KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=20B cardinality=100
+|  in pipelines: 06(GETNEXT), 05(OPEN)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(CASE WHEN sr_return_quantity IS NOT NULL THEN CAST((CAST(ss_quantity AS BIGINT) - CAST(sr_return_quantity AS BIGINT)) AS DECIMAL(19,0)) * ss_sales_price ELSE CAST((CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price) AS DECIMAL(27,2)) END)
+|  group by: ss_customer_sk
+|  mem-estimate=10.00MB mem-reservation=2.88MB spill-buffer=128.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=82.30K
+|  in pipelines: 05(GETNEXT), 00(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: sr_reason_sk = r_reason_sk
+|  fk/pk conjuncts: sr_reason_sk = r_reason_sk
+|  runtime filters: RF000[bloom] <- r_reason_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,2 row-size=85B cardinality=82.30K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.reason]
+|     HDFS partitions=1/1 files=1 size=1.92KB
+|     predicates: r_reason_desc = 'reason 28'
+|     stored statistics:
+|       table: rows=35 size=1.92KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=35
+|     parquet statistics predicates: r_reason_desc = 'reason 28'
+|     parquet dictionary predicates: r_reason_desc = 'reason 28'
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=33B cardinality=1
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [LEFT OUTER JOIN]
+|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,1N row-size=52B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.store_returns]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF000[bloom] -> sr_reason_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=24B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=24.39MB Threads=8
+Per-Host Resource Estimates: Memory=248MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: ss_customer_sk, sum(act_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(act_sales) ASC, ss_customer_sk ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=20B cardinality=100
+|  in pipelines: 06(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.59MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: sum(act_sales) ASC, ss_customer_sk ASC
+|  mem-estimate=1.95KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=20B cardinality=100
+|  in pipelines: 06(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum:merge(act_sales)
+|  group by: ss_customer_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=82.30K
+|  in pipelines: 10(GETNEXT), 00(OPEN)
+|
+09:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=607.79KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=82.30K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=108.06MB mem-reservation=17.44MB thread-reservation=2 runtime-filters-memory=1.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(CASE WHEN sr_return_quantity IS NOT NULL THEN CAST((CAST(ss_quantity AS BIGINT) - CAST(sr_return_quantity AS BIGINT)) AS DECIMAL(19,0)) * ss_sales_price ELSE CAST((CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price) AS DECIMAL(27,2)) END)
+|  group by: ss_customer_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=82.30K
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: sr_reason_sk = r_reason_sk
+|  fk/pk conjuncts: sr_reason_sk = r_reason_sk
+|  runtime filters: RF000[bloom] <- r_reason_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,2 row-size=85B cardinality=82.30K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=33B cardinality=1
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.reason, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.92KB
+|     predicates: r_reason_desc = 'reason 28'
+|     stored statistics:
+|       table: rows=35 size=1.92KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=35
+|     parquet statistics predicates: r_reason_desc = 'reason 28'
+|     parquet dictionary predicates: r_reason_desc = 'reason 28'
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=2 row-size=33B cardinality=1
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,1N row-size=52B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=6.61MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=24B cardinality=287.51K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=97.00MB mem-reservation=5.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF000[bloom] -> sr_reason_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=96.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=1 row-size=24B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=80.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=42.77MB Threads=9
+Per-Host Resource Estimates: Memory=143MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: ss_customer_sk, sum(act_sales)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+11:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: sum(act_sales) ASC, ss_customer_sk ASC
+|  limit: 100
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=20B cardinality=100
+|  in pipelines: 06(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(ss_customer_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=10.66MB mem-reservation=1.94MB thread-reservation=1
+06:TOP-N [LIMIT=100]
+|  order by: sum(act_sales) ASC, ss_customer_sk ASC
+|  mem-estimate=1.95KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=20B cardinality=100
+|  in pipelines: 06(GETNEXT), 10(OPEN)
+|
+10:AGGREGATE [FINALIZE]
+|  output: sum:merge(act_sales)
+|  group by: ss_customer_sk
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=82.30K
+|  in pipelines: 10(GETNEXT), 00(OPEN)
+|
+09:EXCHANGE [HASH(ss_customer_sk)]
+|  mem-estimate=679.79KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=82.30K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=6.00MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(CASE WHEN sr_return_quantity IS NOT NULL THEN CAST((CAST(ss_quantity AS BIGINT) - CAST(sr_return_quantity AS BIGINT)) AS DECIMAL(19,0)) * ss_sales_price ELSE CAST((CAST(ss_quantity AS DECIMAL(10,0)) * ss_sales_price) AS DECIMAL(27,2)) END)
+|  group by: ss_customer_sk
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=4 row-size=20B cardinality=82.30K
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: sr_reason_sk = r_reason_sk
+|  fk/pk conjuncts: sr_reason_sk = r_reason_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1N,2 row-size=85B cardinality=82.30K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: r_reason_sk
+|  |  runtime filters: RF000[bloom] <- r_reason_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=33B cardinality=1
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.reason, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.92KB
+|     predicates: r_reason_desc = 'reason 28'
+|     stored statistics:
+|       table: rows=35 size=1.92KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=35
+|     parquet statistics predicates: r_reason_desc = 'reason 28'
+|     parquet dictionary predicates: r_reason_desc = 'reason 28'
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=2 row-size=33B cardinality=1
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [LEFT OUTER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  fk/pk conjuncts: ss_item_sk = sr_item_sk, ss_ticket_number = sr_ticket_number
+|  mem-estimate=0B mem-reservation=0B spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=0,1N row-size=52B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=23.61MB mem-reservation=17.00MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: sr_item_sk, sr_ticket_number
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=512.00KB thread-reservation=0
+|  |
+|  07:EXCHANGE [BROADCAST]
+|  |  mem-estimate=6.61MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=24B cardinality=287.51K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.store_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=15.43MB
+|     runtime filters: RF000[bloom] -> sr_reason_sk
+|     stored statistics:
+|       table: rows=287.51K size=15.43MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=287.51K
+|     mem-estimate=24.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=1 row-size=24B cardinality=287.51K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=28B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q94.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q94.test
new file mode 100644
index 0000000..d1ebdd1
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q94.test
@@ -0,0 +1,602 @@
+# TPCDS-Q94
+
+SELECT count(DISTINCT ws_order_number) AS "order count" ,
+       sum(ws_ext_ship_cost) AS "total shipping cost" ,
+       sum(ws_net_profit) AS "total net profit"
+FROM web_sales ws1 ,
+     date_dim ,
+     customer_address ,
+     web_site
+WHERE d_date BETWEEN '1999-02-01' AND cast('1999-04-02' AS date)
+  AND ws1.ws_ship_date_sk = d_date_sk
+  AND ws1.ws_ship_addr_sk = ca_address_sk
+  AND ca_state = 'IL'
+  AND ws1.ws_web_site_sk = web_site_sk
+  AND web_company_name = 'pri'
+  AND EXISTS
+    (SELECT *
+     FROM web_sales ws2
+     WHERE ws1.ws_order_number = ws2.ws_order_number
+       AND ws1.ws_warehouse_sk <> ws2.ws_warehouse_sk)
+  AND NOT exists
+    (SELECT *
+     FROM web_returns wr1
+     WHERE ws1.ws_order_number = wr1.wr_order_number)
+ORDER BY count(DISTINCT ws_order_number)
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=30.25MB Threads=7
+Per-Host Resource Estimates: Memory=410MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=409.81MB mem-reservation=30.25MB thread-reservation=7 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: count(ws_order_number), sum(ws_ext_ship_cost), sum(ws_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:TOP-N [LIMIT=100]
+|  order by: count(ws_order_number) ASC
+|  mem-estimate=40B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=40B cardinality=1
+|  in pipelines: 13(GETNEXT), 12(OPEN)
+|
+12:AGGREGATE [FINALIZE]
+|  output: count(ws_order_number), sum:merge(ws_ext_ship_cost), sum:merge(ws_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 12(GETNEXT), 11(OPEN)
+|
+11:AGGREGATE
+|  output: sum(ws_ext_ship_cost), sum(ws_net_profit)
+|  group by: ws_order_number
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=40B cardinality=3.25K
+|  in pipelines: 11(GETNEXT), 05(OPEN)
+|
+10:HASH JOIN [RIGHT ANTI JOIN]
+|  hash predicates: wr1.wr_order_number = ws1.ws_order_number
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,3,1 row-size=96B cardinality=3.25K
+|  in pipelines: 05(GETNEXT), 04(OPEN)
+|
+|--09:HASH JOIN [RIGHT SEMI JOIN]
+|  |  hash predicates: ws2.ws_order_number = ws1.ws_order_number
+|  |  other join predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
+|  |  runtime filters: RF000[bloom] <- ws1.ws_order_number
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,3,1 row-size=96B cardinality=3.25K
+|  |  in pipelines: 04(GETNEXT), 00(OPEN)
+|  |
+|  |--08:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws1.ws_ship_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws1.ws_ship_date_sk = d_date_sk
+|  |  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,2,3,1 row-size=96B cardinality=3.25K
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--01:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: CAST(d_date AS DATE) <= DATE '1999-04-02', CAST(d_date AS DATE) >= DATE '1999-02-01'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1999-04-02', CAST(d_date AS DATE) >= DATE '1999-02-01'
+|  |  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1999-04-02', CAST(d_date AS DATE) >= DATE '1999-02-01'
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  07:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws1.ws_web_site_sk = web_site_sk
+|  |  |  fk/pk conjuncts: ws1.ws_web_site_sk = web_site_sk
+|  |  |  runtime filters: RF004[bloom] <- web_site_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,2,3 row-size=70B cardinality=3.25K
+|  |  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |  |
+|  |  |--03:SCAN HDFS [tpcds_parquet.web_site]
+|  |  |     HDFS partitions=1/1 files=1 size=11.91KB
+|  |  |     predicates: web_company_name = 'pri'
+|  |  |     stored statistics:
+|  |  |       table: rows=30 size=11.91KB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=30
+|  |  |     parquet statistics predicates: web_company_name = 'pri'
+|  |  |     parquet dictionary predicates: web_company_name = 'pri'
+|  |  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  |     tuple-ids=3 row-size=20B cardinality=5
+|  |  |     in pipelines: 03(GETNEXT)
+|  |  |
+|  |  06:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws1.ws_ship_addr_sk = ca_address_sk
+|  |  |  fk/pk conjuncts: ws1.ws_ship_addr_sk = ca_address_sk
+|  |  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,2 row-size=50B cardinality=19.52K
+|  |  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |  |
+|  |  |--02:SCAN HDFS [tpcds_parquet.customer_address]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_state = 'IL'
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_state = 'IL'
+|  |  |     parquet dictionary predicates: ca_state = 'IL'
+|  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=2 row-size=18B cardinality=980
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.web_sales ws1]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF002[bloom] -> ws1.ws_ship_date_sk, RF004[bloom] -> ws1.ws_web_site_sk, RF006[bloom] -> ws1.ws_ship_addr_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=224.00MB mem-reservation=16.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=32B cardinality=719.38K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  04:SCAN HDFS [tpcds_parquet.web_sales ws2]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF000[bloom] -> ws2.ws_order_number
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=4 row-size=12B cardinality=719.38K
+|     in pipelines: 04(GETNEXT)
+|
+05:SCAN HDFS [tpcds_parquet.web_returns wr1]
+   HDFS partitions=1/1 files=1 size=5.66MB
+   stored statistics:
+     table: rows=71.76K size=5.66MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=71.76K
+   mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+   tuple-ids=6 row-size=8B cardinality=71.76K
+   in pipelines: 05(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=37.39MB Threads=15
+Per-Host Resource Estimates: Memory=442MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(ws_order_number), sum(ws_ext_ship_cost), sum(ws_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:TOP-N [LIMIT=100]
+|  order by: count(ws_order_number) ASC
+|  mem-estimate=40B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=40B cardinality=1
+|  in pipelines: 13(GETNEXT), 22(OPEN)
+|
+22:AGGREGATE [FINALIZE]
+|  output: count:merge(ws_order_number), sum:merge(ws_ext_ship_cost), sum:merge(ws_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 22(GETNEXT), 12(OPEN)
+|
+21:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 12(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ws1.ws_order_number)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=21.00MB mem-reservation=6.81MB thread-reservation=1 runtime-filters-memory=1.00MB
+12:AGGREGATE
+|  output: count(ws_order_number), sum:merge(ws_ext_ship_cost), sum:merge(ws_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 12(GETNEXT), 11(OPEN)
+|
+11:AGGREGATE
+|  output: sum(ws_ext_ship_cost), sum(ws_net_profit)
+|  group by: ws_order_number
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=40B cardinality=3.25K
+|  in pipelines: 11(GETNEXT), 04(OPEN)
+|
+10:HASH JOIN [LEFT ANTI JOIN, PARTITIONED]
+|  hash predicates: ws1.ws_order_number = wr1.wr_order_number
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,3,1 row-size=96B cardinality=3.25K
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--20:EXCHANGE [HASH(wr1.wr_order_number)]
+|  |  mem-estimate=572.65KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=8B cardinality=71.76K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=2
+|  05:SCAN HDFS [tpcds_parquet.web_returns wr1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.66MB
+|     stored statistics:
+|       table: rows=71.76K size=5.66MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=6 row-size=8B cardinality=71.76K
+|     in pipelines: 05(GETNEXT)
+|
+09:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash predicates: ws2.ws_order_number = ws1.ws_order_number
+|  other join predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
+|  runtime filters: RF000[bloom] <- ws1.ws_order_number
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,3,1 row-size=96B cardinality=3.25K
+|  in pipelines: 04(GETNEXT), 00(OPEN)
+|
+|--19:EXCHANGE [HASH(ws1.ws_order_number)]
+|  |  mem-estimate=376.37KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,2,3,1 row-size=96B cardinality=3.25K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [HASH(ws1.ws_ship_date_sk)] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=3.42MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws1.ws_ship_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws1.ws_ship_date_sk = d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,3,1 row-size=96B cardinality=3.25K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--17:EXCHANGE [HASH(d_date_sk)]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1999-04-02', CAST(d_date AS DATE) >= DATE '1999-02-01'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1999-04-02', CAST(d_date AS DATE) >= DATE '1999-02-01'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1999-04-02', CAST(d_date AS DATE) >= DATE '1999-02-01'
+|  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |     tuple-ids=1 row-size=26B cardinality=7.30K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  16:EXCHANGE [HASH(ws1.ws_ship_date_sk)]
+|  |  mem-estimate=275.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,2,3 row-size=70B cardinality=3.25K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=230.93MB mem-reservation=22.88MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws1.ws_web_site_sk = web_site_sk
+|  |  fk/pk conjuncts: ws1.ws_web_site_sk = web_site_sk
+|  |  runtime filters: RF004[bloom] <- web_site_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,3 row-size=70B cardinality=3.25K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--15:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=20B cardinality=5
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  03:SCAN HDFS [tpcds_parquet.web_site, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=11.91KB
+|  |     predicates: web_company_name = 'pri'
+|  |     stored statistics:
+|  |       table: rows=30 size=11.91KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=30
+|  |     parquet statistics predicates: web_company_name = 'pri'
+|  |     parquet dictionary predicates: web_company_name = 'pri'
+|  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |     tuple-ids=3 row-size=20B cardinality=5
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: ws1.ws_ship_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws1.ws_ship_addr_sk = ca_address_sk
+|  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2 row-size=50B cardinality=19.52K
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--14:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=38.28KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=18B cardinality=980
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_state = 'IL'
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_state = 'IL'
+|  |     parquet dictionary predicates: ca_state = 'IL'
+|  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |     tuple-ids=2 row-size=18B cardinality=980
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.web_sales ws1, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF002[bloom] -> ws1.ws_ship_date_sk, RF004[bloom] -> ws1.ws_web_site_sk, RF006[bloom] -> ws1.ws_ship_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=224.00MB mem-reservation=16.00MB thread-reservation=1
+|     tuple-ids=0 row-size=32B cardinality=719.38K
+|     in pipelines: 00(GETNEXT)
+|
+18:EXCHANGE [HASH(ws2.ws_order_number)]
+|  mem-estimate=4.15MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=12B cardinality=719.38K
+|  in pipelines: 04(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=65.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+04:SCAN HDFS [tpcds_parquet.web_sales ws2, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws2.ws_order_number
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=4 row-size=12B cardinality=719.38K
+   in pipelines: 04(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=43.27MB Threads=14
+Per-Host Resource Estimates: Memory=181MB
+F08:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(ws_order_number), sum(ws_ext_ship_cost), sum(ws_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:TOP-N [LIMIT=100]
+|  order by: count(ws_order_number) ASC
+|  mem-estimate=40B mem-reservation=0B thread-reservation=0
+|  tuple-ids=10 row-size=40B cardinality=1
+|  in pipelines: 13(GETNEXT), 22(OPEN)
+|
+22:AGGREGATE [FINALIZE]
+|  output: count:merge(ws_order_number), sum:merge(ws_ext_ship_cost), sum:merge(ws_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 22(GETNEXT), 12(OPEN)
+|
+21:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 12(GETNEXT)
+|
+F06:PLAN FRAGMENT [HASH(ws1.ws_order_number)] hosts=2 instances=2
+Per-Instance Resources: mem-estimate=20.00MB mem-reservation=1.94MB thread-reservation=1
+12:AGGREGATE
+|  output: count(ws_order_number), sum:merge(ws_ext_ship_cost), sum:merge(ws_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=9 row-size=40B cardinality=1
+|  in pipelines: 12(GETNEXT), 11(OPEN)
+|
+11:AGGREGATE
+|  output: sum(ws_ext_ship_cost), sum(ws_net_profit)
+|  group by: ws_order_number
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=8 row-size=40B cardinality=3.25K
+|  in pipelines: 11(GETNEXT), 04(OPEN)
+|
+10:HASH JOIN [LEFT ANTI JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: ws1.ws_order_number = wr1.wr_order_number
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,3,1 row-size=96B cardinality=3.25K
+|  in pipelines: 04(GETNEXT), 05(OPEN)
+|
+|--F09:PLAN FRAGMENT [HASH(ws1.ws_order_number)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=2.50MB mem-reservation=1.94MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: wr1.wr_order_number
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  20:EXCHANGE [HASH(wr1.wr_order_number)]
+|  |  mem-estimate=572.65KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=8B cardinality=71.76K
+|  |  in pipelines: 05(GETNEXT)
+|  |
+|  F07:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  05:SCAN HDFS [tpcds_parquet.web_returns wr1, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.66MB
+|     stored statistics:
+|       table: rows=71.76K size=5.66MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=6 row-size=8B cardinality=71.76K
+|     in pipelines: 05(GETNEXT)
+|
+09:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash-table-id=01
+|  hash predicates: ws2.ws_order_number = ws1.ws_order_number
+|  other join predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,3,1 row-size=96B cardinality=3.25K
+|  in pipelines: 04(GETNEXT), 00(OPEN)
+|
+|--F10:PLAN FRAGMENT [HASH(ws1.ws_order_number)] hosts=2 instances=2
+|  |  Per-Instance Resources: mem-estimate=3.31MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: ws1.ws_order_number
+|  |  runtime filters: RF000[bloom] <- ws1.ws_order_number
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  19:EXCHANGE [HASH(ws1.ws_order_number)]
+|  |  mem-estimate=376.37KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,2,3,1 row-size=96B cardinality=3.25K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F05:PLAN FRAGMENT [HASH(ws1.ws_ship_date_sk)] hosts=2 instances=2
+|  Per-Instance Resources: mem-estimate=275.07KB mem-reservation=0B thread-reservation=1
+|  08:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash-table-id=02
+|  |  hash predicates: ws1.ws_ship_date_sk = d_date_sk
+|  |  fk/pk conjuncts: ws1.ws_ship_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,3,1 row-size=96B cardinality=3.25K
+|  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |
+|  |--F11:PLAN FRAGMENT [HASH(ws1.ws_ship_date_sk)] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=3.15MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=02 plan-id=03 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  17:EXCHANGE [HASH(d_date_sk)]
+|  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  |  in pipelines: 01(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: CAST(d_date AS DATE) <= DATE '1999-04-02', CAST(d_date AS DATE) >= DATE '1999-02-01'
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: CAST(d_date AS DATE) <= DATE '1999-04-02', CAST(d_date AS DATE) >= DATE '1999-02-01'
+|  |     parquet dictionary predicates: CAST(d_date AS DATE) <= DATE '1999-04-02', CAST(d_date AS DATE) >= DATE '1999-02-01'
+|  |     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|  |     tuple-ids=1 row-size=26B cardinality=7.30K
+|  |     in pipelines: 01(GETNEXT)
+|  |
+|  16:EXCHANGE [HASH(ws1.ws_ship_date_sk)]
+|  |  mem-estimate=275.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=0,2,3 row-size=70B cardinality=3.25K
+|  |  in pipelines: 00(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+|  Per-Instance Resources: mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=1
+|  07:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=03
+|  |  hash predicates: ws1.ws_web_site_sk = web_site_sk
+|  |  fk/pk conjuncts: ws1.ws_web_site_sk = web_site_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,3 row-size=70B cardinality=3.25K
+|  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |
+|  |--F12:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=03 plan-id=04 cohort-id=02
+|  |  |  build expressions: web_site_sk
+|  |  |  runtime filters: RF004[bloom] <- web_site_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  15:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=3 row-size=20B cardinality=5
+|  |  |  in pipelines: 03(GETNEXT)
+|  |  |
+|  |  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  03:SCAN HDFS [tpcds_parquet.web_site, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=11.91KB
+|  |     predicates: web_company_name = 'pri'
+|  |     stored statistics:
+|  |       table: rows=30 size=11.91KB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=30
+|  |     parquet statistics predicates: web_company_name = 'pri'
+|  |     parquet dictionary predicates: web_company_name = 'pri'
+|  |     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|  |     tuple-ids=3 row-size=20B cardinality=5
+|  |     in pipelines: 03(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=04
+|  |  hash predicates: ws1.ws_ship_addr_sk = ca_address_sk
+|  |  fk/pk conjuncts: ws1.ws_ship_addr_sk = ca_address_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2 row-size=50B cardinality=19.52K
+|  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |
+|  |--F13:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  |  Per-Instance Resources: mem-estimate=4.91MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=04 plan-id=05 cohort-id=02
+|  |  |  build expressions: ca_address_sk
+|  |  |  runtime filters: RF006[bloom] <- ca_address_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  14:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=38.28KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=2 row-size=18B cardinality=980
+|  |  |  in pipelines: 02(GETNEXT)
+|  |  |
+|  |  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |     predicates: ca_state = 'IL'
+|  |     stored statistics:
+|  |       table: rows=50.00K size=1.16MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |     parquet statistics predicates: ca_state = 'IL'
+|  |     parquet dictionary predicates: ca_state = 'IL'
+|  |     mem-estimate=16.00MB mem-reservation=256.00KB thread-reservation=0
+|  |     tuple-ids=2 row-size=18B cardinality=980
+|  |     in pipelines: 02(GETNEXT)
+|  |
+|  00:SCAN HDFS [tpcds_parquet.web_sales ws1, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF002[bloom] -> ws1.ws_ship_date_sk, RF004[bloom] -> ws1.ws_web_site_sk, RF006[bloom] -> ws1.ws_ship_addr_sk
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=32.00MB mem-reservation=16.00MB thread-reservation=0
+|     tuple-ids=0 row-size=32B cardinality=719.38K
+|     in pipelines: 00(GETNEXT)
+|
+18:EXCHANGE [HASH(ws2.ws_order_number)]
+|  mem-estimate=4.15MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=12B cardinality=719.38K
+|  in pipelines: 04(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+Per-Instance Resources: mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=1
+04:SCAN HDFS [tpcds_parquet.web_sales ws2, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws2.ws_order_number
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=32.00MB mem-reservation=2.00MB thread-reservation=0
+   tuple-ids=4 row-size=12B cardinality=719.38K
+   in pipelines: 04(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q95.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q95.test
new file mode 100644
index 0000000..f9f8db6
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q95.test
@@ -0,0 +1,528 @@
+# TPCDS-Q95
+with ws_wh as
+(select ws1.ws_order_number,ws1.ws_warehouse_sk wh1,ws2.ws_warehouse_sk wh2
+ from web_sales ws1,web_sales ws2
+ where ws1.ws_order_number = ws2.ws_order_number
+   and ws1.ws_warehouse_sk <> ws2.ws_warehouse_sk)
+ select
+   count(distinct ws_order_number) as "order count"
+  ,sum(ws_ext_ship_cost) as "total shipping cost"
+  ,sum(ws_net_profit) as "total net profit"
+from
+   web_sales ws1
+  ,date_dim
+  ,customer_address
+  ,web_site
+where
+    cast(d_date as timestamp) between cast('1999-02-01' as timestamp) and
+           (cast('1999-02-01' as timestamp) + interval 60 days)
+and ws1.ws_ship_date_sk = d_date_sk
+and ws1.ws_ship_addr_sk = ca_address_sk
+and ca_state = 'IL'
+and ws1.ws_web_site_sk = web_site_sk
+and web_company_name = 'pri'
+and ws1.ws_order_number in (select ws_order_number
+                            from ws_wh)
+and ws1.ws_order_number in (select wr_order_number
+                            from web_returns,ws_wh
+                            where wr_order_number = ws_wh.ws_order_number)
+order by count(distinct ws_order_number)
+limit 100;
+---- PLAN
+Max Per-Host Resource Reservation: Memory=76.19MB Threads=10
+Per-Host Resource Estimates: Memory=610MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=609.75MB mem-reservation=76.19MB thread-reservation=10 runtime-filters-memory=8.00MB
+PLAN-ROOT SINK
+|  output exprs: count(ws_order_number), sum(ws_ext_ship_cost), sum(ws_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+21:TOP-N [LIMIT=100]
+|  order by: count(ws_order_number) ASC
+|  mem-estimate=40B mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=40B cardinality=1
+|  in pipelines: 21(GETNEXT), 20(OPEN)
+|
+20:AGGREGATE [FINALIZE]
+|  output: count(ws_order_number), sum:merge(ws_ext_ship_cost), sum:merge(ws_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=14 row-size=40B cardinality=1
+|  in pipelines: 20(GETNEXT), 19(OPEN)
+|
+19:AGGREGATE
+|  output: sum(ws_ext_ship_cost), sum(ws_net_profit)
+|  group by: ws_order_number
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=40B cardinality=3.25K
+|  in pipelines: 19(GETNEXT), 17(OPEN)
+|
+18:HASH JOIN [RIGHT SEMI JOIN]
+|  hash predicates: tpcds_parquet.web_returns.wr_order_number = ws1.ws_order_number
+|  runtime filters: RF000[bloom] <- ws1.ws_order_number
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,3,1 row-size=92B cardinality=3.25K
+|  in pipelines: 17(GETNEXT), 15(OPEN)
+|
+|--16:HASH JOIN [RIGHT SEMI JOIN]
+|  |  hash predicates: ws1.ws_order_number = ws1.ws_order_number
+|  |  runtime filters: RF006[bloom] <- ws1.ws_order_number
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,3,1 row-size=92B cardinality=3.25K
+|  |  in pipelines: 15(GETNEXT), 00(OPEN)
+|  |
+|  |--14:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws1.ws_ship_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws1.ws_ship_date_sk = d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,2,3,1 row-size=92B cardinality=3.25K
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--01:SCAN HDFS [tpcds_parquet.date_dim]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-04-02 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-01 00:00:00'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet dictionary predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-04-02 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-01 00:00:00'
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  13:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws1.ws_web_site_sk = web_site_sk
+|  |  |  fk/pk conjuncts: ws1.ws_web_site_sk = web_site_sk
+|  |  |  runtime filters: RF012[bloom] <- web_site_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,2,3 row-size=66B cardinality=3.25K
+|  |  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |  |
+|  |  |--03:SCAN HDFS [tpcds_parquet.web_site]
+|  |  |     HDFS partitions=1/1 files=1 size=11.91KB
+|  |  |     predicates: web_company_name = 'pri'
+|  |  |     stored statistics:
+|  |  |       table: rows=30 size=11.91KB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=30
+|  |  |     parquet statistics predicates: web_company_name = 'pri'
+|  |  |     parquet dictionary predicates: web_company_name = 'pri'
+|  |  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  |     tuple-ids=3 row-size=20B cardinality=5
+|  |  |     in pipelines: 03(GETNEXT)
+|  |  |
+|  |  12:HASH JOIN [INNER JOIN]
+|  |  |  hash predicates: ws1.ws_ship_addr_sk = ca_address_sk
+|  |  |  fk/pk conjuncts: ws1.ws_ship_addr_sk = ca_address_sk
+|  |  |  runtime filters: RF014[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,2 row-size=46B cardinality=19.52K
+|  |  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |  |
+|  |  |--02:SCAN HDFS [tpcds_parquet.customer_address]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_state = 'IL'
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_state = 'IL'
+|  |  |     parquet dictionary predicates: ca_state = 'IL'
+|  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=2 row-size=18B cardinality=980
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.web_sales ws1]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF010[bloom] -> ws1.ws_ship_date_sk, RF012[bloom] -> ws1.ws_web_site_sk, RF014[bloom] -> ws1.ws_ship_addr_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=192.00MB mem-reservation=16.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=28B cardinality=719.38K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  15:AGGREGATE [FINALIZE]
+|  |  group by: ws1.ws_order_number
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=8B cardinality=59.77K
+|  |  in pipelines: 15(GETNEXT), 04(OPEN)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: ws1.ws_order_number = ws2.ws_order_number
+|  |  fk/pk conjuncts: none
+|  |  other predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
+|  |  runtime filters: RF008[bloom] <- ws2.ws_order_number
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=24B cardinality=8.66M
+|  |  in pipelines: 04(GETNEXT), 05(OPEN)
+|  |
+|  |--05:SCAN HDFS [tpcds_parquet.web_sales ws2]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF006[bloom] -> ws2.ws_order_number
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=5 row-size=12B cardinality=719.38K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  04:SCAN HDFS [tpcds_parquet.web_sales ws1]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF006[bloom] -> ws1.ws_order_number, RF008[bloom] -> ws1.ws_order_number
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=4 row-size=12B cardinality=719.38K
+|     in pipelines: 04(GETNEXT)
+|
+17:AGGREGATE [FINALIZE]
+|  group by: tpcds_parquet.web_returns.wr_order_number
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=8B cardinality=43.44K
+|  in pipelines: 17(GETNEXT), 08(OPEN)
+|
+11:HASH JOIN [INNER JOIN]
+|  hash predicates: ws1.ws_order_number = wr_order_number
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- wr_order_number
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8 row-size=32B cardinality=10.39M
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+|--07:SCAN HDFS [tpcds_parquet.web_returns]
+|     HDFS partitions=1/1 files=1 size=5.66MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.web_returns.wr_order_number
+|     stored statistics:
+|       table: rows=71.76K size=5.66MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=8 row-size=8B cardinality=71.76K
+|     in pipelines: 07(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN]
+|  hash predicates: ws1.ws_order_number = ws2.ws_order_number
+|  fk/pk conjuncts: none
+|  other predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
+|  runtime filters: RF004[bloom] <- ws2.ws_order_number
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=9,10 row-size=24B cardinality=8.66M
+|  in pipelines: 08(GETNEXT), 09(OPEN)
+|
+|--09:SCAN HDFS [tpcds_parquet.web_sales ws2]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF000[bloom] -> ws2.ws_order_number, RF002[bloom] -> ws2.ws_order_number
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=10 row-size=12B cardinality=719.38K
+|     in pipelines: 09(GETNEXT)
+|
+08:SCAN HDFS [tpcds_parquet.web_sales ws1]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws1.ws_order_number, RF002[bloom] -> ws1.ws_order_number, RF004[bloom] -> ws1.ws_order_number
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=9 row-size=12B cardinality=719.38K
+   in pipelines: 08(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=74.33MB Threads=21
+Per-Host Resource Estimates: Memory=644MB
+F12:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(ws_order_number), sum(ws_ext_ship_cost), sum(ws_net_profit)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+21:TOP-N [LIMIT=100]
+|  order by: count(ws_order_number) ASC
+|  mem-estimate=40B mem-reservation=0B thread-reservation=0
+|  tuple-ids=15 row-size=40B cardinality=1
+|  in pipelines: 21(GETNEXT), 33(OPEN)
+|
+33:AGGREGATE [FINALIZE]
+|  output: count:merge(ws_order_number), sum:merge(ws_ext_ship_cost), sum:merge(ws_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=14 row-size=40B cardinality=1
+|  in pipelines: 33(GETNEXT), 20(OPEN)
+|
+32:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=14 row-size=40B cardinality=1
+|  in pipelines: 20(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(ws1.ws_order_number)] hosts=2 instances=2
+Per-Host Resources: mem-estimate=54.52MB mem-reservation=29.75MB thread-reservation=1 runtime-filters-memory=5.00MB
+20:AGGREGATE
+|  output: count(ws_order_number), sum:merge(ws_ext_ship_cost), sum:merge(ws_net_profit)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=14 row-size=40B cardinality=1
+|  in pipelines: 20(GETNEXT), 19(OPEN)
+|
+19:AGGREGATE
+|  output: sum(ws_ext_ship_cost), sum(ws_net_profit)
+|  group by: ws_order_number
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=13 row-size=40B cardinality=3.25K
+|  in pipelines: 19(GETNEXT), 17(OPEN)
+|
+18:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  hash predicates: tpcds_parquet.web_returns.wr_order_number = ws1.ws_order_number
+|  runtime filters: RF000[bloom] <- ws1.ws_order_number
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,2,3,1 row-size=92B cardinality=3.25K
+|  in pipelines: 17(GETNEXT), 15(OPEN)
+|
+|--16:HASH JOIN [RIGHT SEMI JOIN, PARTITIONED]
+|  |  hash predicates: ws1.ws_order_number = ws1.ws_order_number
+|  |  runtime filters: RF006[bloom] <- ws1.ws_order_number
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=0,2,3,1 row-size=92B cardinality=3.25K
+|  |  in pipelines: 15(GETNEXT), 00(OPEN)
+|  |
+|  |--31:EXCHANGE [HASH(ws1.ws_order_number)]
+|  |  |  mem-estimate=362.01KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0,2,3,1 row-size=92B cardinality=3.25K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F11:PLAN FRAGMENT [HASH(ws1.ws_ship_date_sk)] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=3.40MB mem-reservation=2.94MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  14:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  |  hash predicates: ws1.ws_ship_date_sk = d_date_sk
+|  |  |  fk/pk conjuncts: ws1.ws_ship_date_sk = d_date_sk
+|  |  |  runtime filters: RF010[bloom] <- d_date_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,2,3,1 row-size=92B cardinality=3.25K
+|  |  |  in pipelines: 00(GETNEXT), 01(OPEN)
+|  |  |
+|  |  |--30:EXCHANGE [HASH(d_date_sk)]
+|  |  |  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  |  |  in pipelines: 01(GETNEXT)
+|  |  |  |
+|  |  |  F10:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  |  |  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |  |     predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-04-02 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-01 00:00:00'
+|  |  |     stored statistics:
+|  |  |       table: rows=73.05K size=2.15MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |  |     parquet dictionary predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-04-02 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-01 00:00:00'
+|  |  |     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|  |  |     tuple-ids=1 row-size=26B cardinality=7.30K
+|  |  |     in pipelines: 01(GETNEXT)
+|  |  |
+|  |  29:EXCHANGE [HASH(ws1.ws_ship_date_sk)]
+|  |  |  mem-estimate=260.71KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=0,2,3 row-size=66B cardinality=3.25K
+|  |  |  in pipelines: 00(GETNEXT)
+|  |  |
+|  |  F07:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=198.93MB mem-reservation=22.88MB thread-reservation=2 runtime-filters-memory=3.00MB
+|  |  13:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws1.ws_web_site_sk = web_site_sk
+|  |  |  fk/pk conjuncts: ws1.ws_web_site_sk = web_site_sk
+|  |  |  runtime filters: RF012[bloom] <- web_site_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,2,3 row-size=66B cardinality=3.25K
+|  |  |  in pipelines: 00(GETNEXT), 03(OPEN)
+|  |  |
+|  |  |--28:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=3 row-size=20B cardinality=5
+|  |  |  |  in pipelines: 03(GETNEXT)
+|  |  |  |
+|  |  |  F09:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  |  |  03:SCAN HDFS [tpcds_parquet.web_site, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=11.91KB
+|  |  |     predicates: web_company_name = 'pri'
+|  |  |     stored statistics:
+|  |  |       table: rows=30 size=11.91KB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=30
+|  |  |     parquet statistics predicates: web_company_name = 'pri'
+|  |  |     parquet dictionary predicates: web_company_name = 'pri'
+|  |  |     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|  |  |     tuple-ids=3 row-size=20B cardinality=5
+|  |  |     in pipelines: 03(GETNEXT)
+|  |  |
+|  |  12:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  |  hash predicates: ws1.ws_ship_addr_sk = ca_address_sk
+|  |  |  fk/pk conjuncts: ws1.ws_ship_addr_sk = ca_address_sk
+|  |  |  runtime filters: RF014[bloom] <- ca_address_sk
+|  |  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  |  tuple-ids=0,2 row-size=46B cardinality=19.52K
+|  |  |  in pipelines: 00(GETNEXT), 02(OPEN)
+|  |  |
+|  |  |--27:EXCHANGE [BROADCAST]
+|  |  |  |  mem-estimate=38.28KB mem-reservation=0B thread-reservation=0
+|  |  |  |  tuple-ids=2 row-size=18B cardinality=980
+|  |  |  |  in pipelines: 02(GETNEXT)
+|  |  |  |
+|  |  |  F08:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=2
+|  |  |  02:SCAN HDFS [tpcds_parquet.customer_address, RANDOM]
+|  |  |     HDFS partitions=1/1 files=1 size=1.16MB
+|  |  |     predicates: ca_state = 'IL'
+|  |  |     stored statistics:
+|  |  |       table: rows=50.00K size=1.16MB
+|  |  |       columns: all
+|  |  |     extrapolated-rows=disabled max-scan-range-rows=50.00K
+|  |  |     parquet statistics predicates: ca_state = 'IL'
+|  |  |     parquet dictionary predicates: ca_state = 'IL'
+|  |  |     mem-estimate=32.00MB mem-reservation=256.00KB thread-reservation=1
+|  |  |     tuple-ids=2 row-size=18B cardinality=980
+|  |  |     in pipelines: 02(GETNEXT)
+|  |  |
+|  |  00:SCAN HDFS [tpcds_parquet.web_sales ws1, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF010[bloom] -> ws1.ws_ship_date_sk, RF012[bloom] -> ws1.ws_web_site_sk, RF014[bloom] -> ws1.ws_ship_addr_sk
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=192.00MB mem-reservation=16.00MB thread-reservation=1
+|  |     tuple-ids=0 row-size=28B cardinality=719.38K
+|  |     in pipelines: 00(GETNEXT)
+|  |
+|  15:AGGREGATE [FINALIZE]
+|  |  group by: ws1.ws_order_number
+|  |  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=25 row-size=8B cardinality=59.77K
+|  |  in pipelines: 15(GETNEXT), 04(OPEN)
+|  |
+|  06:HASH JOIN [INNER JOIN, PARTITIONED]
+|  |  hash predicates: ws1.ws_order_number = ws2.ws_order_number
+|  |  fk/pk conjuncts: none
+|  |  other predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
+|  |  runtime filters: RF008[bloom] <- ws2.ws_order_number
+|  |  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=24B cardinality=8.66M
+|  |  in pipelines: 04(GETNEXT), 05(OPEN)
+|  |
+|  |--26:EXCHANGE [HASH(ws2.ws_order_number)]
+|  |  |  mem-estimate=4.15MB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=12B cardinality=719.38K
+|  |  |  in pipelines: 05(GETNEXT)
+|  |  |
+|  |  F05:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  |  Per-Host Resources: mem-estimate=65.00MB mem-reservation=3.00MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  |  05:SCAN HDFS [tpcds_parquet.web_sales ws2, RANDOM]
+|  |     HDFS partitions=1/1 files=2 size=45.09MB
+|  |     runtime filters: RF006[bloom] -> ws2.ws_order_number
+|  |     stored statistics:
+|  |       table: rows=719.38K size=45.09MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|  |     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|  |     tuple-ids=5 row-size=12B cardinality=719.38K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  25:EXCHANGE [HASH(ws1.ws_order_number)]
+|  |  mem-estimate=4.15MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=12B cardinality=719.38K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=66.00MB mem-reservation=4.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  04:SCAN HDFS [tpcds_parquet.web_sales ws1, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF006[bloom] -> ws1.ws_order_number, RF008[bloom] -> ws1.ws_order_number
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=4 row-size=12B cardinality=719.38K
+|     in pipelines: 04(GETNEXT)
+|
+17:AGGREGATE [FINALIZE]
+|  group by: tpcds_parquet.web_returns.wr_order_number
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=26 row-size=8B cardinality=43.44K
+|  in pipelines: 17(GETNEXT), 08(OPEN)
+|
+11:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ws1.ws_order_number = wr_order_number
+|  fk/pk conjuncts: none
+|  runtime filters: RF002[bloom] <- wr_order_number
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=9,10,8 row-size=32B cardinality=10.39M
+|  in pipelines: 08(GETNEXT), 07(OPEN)
+|
+|--24:EXCHANGE [HASH(wr_order_number)]
+|  |  mem-estimate=572.65KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=8 row-size=8B cardinality=71.76K
+|  |  in pipelines: 07(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=17.00MB mem-reservation=1.50MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  07:SCAN HDFS [tpcds_parquet.web_returns, RANDOM]
+|     HDFS partitions=1/1 files=1 size=5.66MB
+|     runtime filters: RF000[bloom] -> tpcds_parquet.web_returns.wr_order_number
+|     stored statistics:
+|       table: rows=71.76K size=5.66MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=71.76K
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=8 row-size=8B cardinality=71.76K
+|     in pipelines: 07(GETNEXT)
+|
+10:HASH JOIN [INNER JOIN, PARTITIONED]
+|  hash predicates: ws1.ws_order_number = ws2.ws_order_number
+|  fk/pk conjuncts: none
+|  other predicates: ws1.ws_warehouse_sk != ws2.ws_warehouse_sk
+|  runtime filters: RF004[bloom] <- ws2.ws_order_number
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=9,10 row-size=24B cardinality=8.66M
+|  in pipelines: 08(GETNEXT), 09(OPEN)
+|
+|--23:EXCHANGE [HASH(ws2.ws_order_number)]
+|  |  mem-estimate=4.15MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=10 row-size=12B cardinality=719.38K
+|  |  in pipelines: 09(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+|  Per-Host Resources: mem-estimate=66.00MB mem-reservation=4.00MB thread-reservation=2 runtime-filters-memory=2.00MB
+|  09:SCAN HDFS [tpcds_parquet.web_sales ws2, RANDOM]
+|     HDFS partitions=1/1 files=2 size=45.09MB
+|     runtime filters: RF000[bloom] -> ws2.ws_order_number, RF002[bloom] -> ws2.ws_order_number
+|     stored statistics:
+|       table: rows=719.38K size=45.09MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=644.77K
+|     mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=10 row-size=12B cardinality=719.38K
+|     in pipelines: 09(GETNEXT)
+|
+22:EXCHANGE [HASH(ws1.ws_order_number)]
+|  mem-estimate=4.15MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=9 row-size=12B cardinality=719.38K
+|  in pipelines: 08(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=2 instances=2
+Per-Host Resources: mem-estimate=67.00MB mem-reservation=5.00MB thread-reservation=2 runtime-filters-memory=3.00MB
+08:SCAN HDFS [tpcds_parquet.web_sales ws1, RANDOM]
+   HDFS partitions=1/1 files=2 size=45.09MB
+   runtime filters: RF000[bloom] -> ws1.ws_order_number, RF002[bloom] -> ws1.ws_order_number, RF004[bloom] -> ws1.ws_order_number
+   stored statistics:
+     table: rows=719.38K size=45.09MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=644.77K
+   mem-estimate=64.00MB mem-reservation=2.00MB thread-reservation=1
+   tuple-ids=9 row-size=12B cardinality=719.38K
+   in pipelines: 08(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q96.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q96.test
new file mode 100644
index 0000000..6eaa2cf
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q96.test
@@ -0,0 +1,376 @@
+# TPCDS-Q96
+SELECT
+  COUNT(*) AS total
+FROM store_sales ss
+JOIN time_dim td
+  ON (ss.ss_sold_time_sk = td.t_time_sk)
+JOIN household_demographics hd
+  ON (ss.ss_hdemo_sk = hd.hd_demo_sk)
+JOIN store s
+  ON (ss.ss_store_sk = s.s_store_sk)
+WHERE
+  td.t_hour = 8
+  AND td.t_minute >= 30
+  AND hd.hd_dep_count = 5
+  AND s.s_store_name = 'ese'
+---- PLAN
+Max Per-Host Resource Reservation: Memory=10.39MB Threads=5
+Per-Host Resource Estimates: Memory=169MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=168.81MB mem-reservation=10.39MB thread-reservation=5 runtime-filters-memory=3.00MB
+PLAN-ROOT SINK
+|  output exprs: count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+07:AGGREGATE [FINALIZE]
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: ss.ss_store_sk = s.s_store_sk
+|  fk/pk conjuncts: ss.ss_store_sk = s.s_store_sk
+|  runtime filters: RF000[bloom] <- s.s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=52B cardinality=2.27K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.store s]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s.s_store_name = 'ese'
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s.s_store_name = 'ese'
+|     parquet dictionary predicates: s.s_store_name = 'ese'
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=20B cardinality=2
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: ss.ss_hdemo_sk = hd.hd_demo_sk
+|  fk/pk conjuncts: ss.ss_hdemo_sk = hd.hd_demo_sk
+|  runtime filters: RF002[bloom] <- hd.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=32B cardinality=6.82K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.household_demographics hd]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: hd.hd_dep_count = CAST(5 AS INT)
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: hd.hd_dep_count = CAST(5 AS INT)
+|     parquet dictionary predicates: hd.hd_dep_count = CAST(5 AS INT)
+|     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=720
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss.ss_sold_time_sk = td.t_time_sk
+|  fk/pk conjuncts: ss.ss_sold_time_sk = td.t_time_sk
+|  runtime filters: RF004[bloom] <- td.t_time_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=69.82K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.time_dim td]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: td.t_hour = CAST(8 AS INT), td.t_minute >= CAST(30 AS INT)
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: td.t_hour = CAST(8 AS INT), td.t_minute >= CAST(30 AS INT)
+|     parquet dictionary predicates: td.t_hour = CAST(8 AS INT), td.t_minute >= CAST(30 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=1.14K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales ss]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss.ss_store_sk, RF002[bloom] -> ss.ss_hdemo_sk, RF004[bloom] -> ss.ss_sold_time_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=10.39MB Threads=9
+Per-Host Resource Estimates: Memory=189MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+12:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 12(GETNEXT), 07(OPEN)
+|
+11:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=66.81MB mem-reservation=9.81MB thread-reservation=2 runtime-filters-memory=3.00MB
+07:AGGREGATE
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss.ss_store_sk = s.s_store_sk
+|  fk/pk conjuncts: ss.ss_store_sk = s.s_store_sk
+|  runtime filters: RF000[bloom] <- s.s_store_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=52B cardinality=2.27K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=20B cardinality=2
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.store s, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s.s_store_name = 'ese'
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s.s_store_name = 'ese'
+|     parquet dictionary predicates: s.s_store_name = 'ese'
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=20B cardinality=2
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss.ss_hdemo_sk = hd.hd_demo_sk
+|  fk/pk conjuncts: ss.ss_hdemo_sk = hd.hd_demo_sk
+|  runtime filters: RF002[bloom] <- hd.hd_demo_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=32B cardinality=6.82K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=720
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.household_demographics hd, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: hd.hd_dep_count = CAST(5 AS INT)
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: hd.hd_dep_count = CAST(5 AS INT)
+|     parquet dictionary predicates: hd.hd_dep_count = CAST(5 AS INT)
+|     mem-estimate=32.00MB mem-reservation=64.00KB thread-reservation=1
+|     tuple-ids=2 row-size=8B cardinality=720
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss.ss_sold_time_sk = td.t_time_sk
+|  fk/pk conjuncts: ss.ss_sold_time_sk = td.t_time_sk
+|  runtime filters: RF004[bloom] <- td.t_time_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=69.82K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=1.14K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.time_dim td, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: td.t_hour = CAST(8 AS INT), td.t_minute >= CAST(30 AS INT)
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: td.t_hour = CAST(8 AS INT), td.t_minute >= CAST(30 AS INT)
+|     parquet dictionary predicates: td.t_hour = CAST(8 AS INT), td.t_minute >= CAST(30 AS INT)
+|     mem-estimate=48.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=12B cardinality=1.14K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales ss, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss.ss_store_sk, RF002[bloom] -> ss.ss_hdemo_sk, RF004[bloom] -> ss.ss_sold_time_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=48.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=20.20MB Threads=9
+Per-Host Resource Estimates: Memory=128MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: count(*)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+12:AGGREGATE [FINALIZE]
+|  output: count:merge(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 12(GETNEXT), 07(OPEN)
+|
+11:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=3.00MB mem-reservation=3.00MB thread-reservation=0 runtime-filters-memory=3.00MB
+Per-Instance Resources: mem-estimate=26.00MB mem-reservation=1.00MB thread-reservation=1
+07:AGGREGATE
+|  output: count(*)
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=4 row-size=8B cardinality=1
+|  in pipelines: 07(GETNEXT), 00(OPEN)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss.ss_store_sk = s.s_store_sk
+|  fk/pk conjuncts: ss.ss_store_sk = s.s_store_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2,3 row-size=52B cardinality=2.27K
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: s.s_store_sk
+|  |  runtime filters: RF000[bloom] <- s.s_store_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=20B cardinality=2
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.store s, RANDOM]
+|     HDFS partitions=1/1 files=1 size=9.93KB
+|     predicates: s.s_store_name = 'ese'
+|     stored statistics:
+|       table: rows=12 size=9.93KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=12
+|     parquet statistics predicates: s.s_store_name = 'ese'
+|     parquet dictionary predicates: s.s_store_name = 'ese'
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=3 row-size=20B cardinality=2
+|     in pipelines: 03(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss.ss_hdemo_sk = hd.hd_demo_sk
+|  fk/pk conjuncts: ss.ss_hdemo_sk = hd.hd_demo_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=32B cardinality=6.82K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: hd.hd_demo_sk
+|  |  runtime filters: RF002[bloom] <- hd.hd_demo_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=8B cardinality=720
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.household_demographics hd, RANDOM]
+|     HDFS partitions=1/1 files=1 size=41.69KB
+|     predicates: hd.hd_dep_count = CAST(5 AS INT)
+|     stored statistics:
+|       table: rows=7.20K size=41.69KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=7.20K
+|     parquet statistics predicates: hd.hd_dep_count = CAST(5 AS INT)
+|     parquet dictionary predicates: hd.hd_dep_count = CAST(5 AS INT)
+|     mem-estimate=16.00MB mem-reservation=64.00KB thread-reservation=0
+|     tuple-ids=2 row-size=8B cardinality=720
+|     in pipelines: 02(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: ss.ss_sold_time_sk = td.t_time_sk
+|  fk/pk conjuncts: ss.ss_sold_time_sk = td.t_time_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=69.82K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.90MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: td.t_time_sk
+|  |  runtime filters: RF004[bloom] <- td.t_time_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  08:EXCHANGE [BROADCAST]
+|  |  mem-estimate=29.34KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=12B cardinality=1.14K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.time_dim td, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.31MB
+|     predicates: td.t_hour = CAST(8 AS INT), td.t_minute >= CAST(30 AS INT)
+|     stored statistics:
+|       table: rows=86.40K size=1.31MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=86.40K
+|     parquet statistics predicates: td.t_hour = CAST(8 AS INT), td.t_minute >= CAST(30 AS INT)
+|     parquet dictionary predicates: td.t_hour = CAST(8 AS INT), td.t_minute >= CAST(30 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=1 row-size=12B cardinality=1.14K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales ss, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss.ss_store_sk, RF002[bloom] -> ss.ss_hdemo_sk, RF004[bloom] -> ss.ss_sold_time_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=0 row-size=12B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q97.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q97.test
new file mode 100644
index 0000000..7408ff8
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q97.test
@@ -0,0 +1,466 @@
+# TPCDS-Q97
+WITH ssci AS
+  (SELECT ss_customer_sk customer_sk ,
+          ss_item_sk item_sk
+   FROM store_sales,
+        date_dim
+   WHERE ss_sold_date_sk = d_date_sk
+     AND d_month_seq BETWEEN 1200 AND 1200 + 11
+   GROUP BY ss_customer_sk ,
+            ss_item_sk),
+     csci as
+  ( SELECT cs_bill_customer_sk customer_sk ,cs_item_sk item_sk
+   FROM catalog_sales,date_dim
+   WHERE cs_sold_date_sk = d_date_sk
+     AND d_month_seq BETWEEN 1200 AND 1200 + 11
+   GROUP BY cs_bill_customer_sk ,cs_item_sk)
+SELECT sum(CASE
+               WHEN ssci.customer_sk IS NOT NULL
+                    AND csci.customer_sk IS NULL THEN 1
+               ELSE 0
+           END) store_only ,
+       sum(CASE
+               WHEN ssci.customer_sk IS NULL
+                    AND csci.customer_sk IS NOT NULL THEN 1
+               ELSE 0
+           END) catalog_only ,
+       sum(CASE
+               WHEN ssci.customer_sk IS NOT NULL
+                    AND csci.customer_sk IS NOT NULL THEN 1
+               ELSE 0
+           END) store_and_catalog
+FROM ssci
+FULL OUTER JOIN csci ON (ssci.customer_sk=csci.customer_sk
+                         AND ssci.item_sk = csci.item_sk)
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=106.94MB Threads=5
+Per-Host Resource Estimates: Memory=252MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=252.13MB mem-reservation=106.94MB thread-reservation=5 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: sum(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NULL THEN 1 ELSE 0 END), sum(CASE WHEN ssci.customer_sk IS NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END), sum(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+09:AGGREGATE [FINALIZE]
+|  output: sum(CAST(CASE WHEN ss_customer_sk IS NOT NULL AND cs_bill_customer_sk IS NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN ss_customer_sk IS NULL AND cs_bill_customer_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN ss_customer_sk IS NOT NULL AND cs_bill_customer_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  limit: 100
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=24B cardinality=1
+|  in pipelines: 09(GETNEXT), 03(OPEN)
+|
+08:HASH JOIN [FULL OUTER JOIN]
+|  hash predicates: ss_customer_sk = cs_bill_customer_sk, ss_item_sk = cs_item_sk
+|  fk/pk conjuncts: ss_customer_sk = cs_bill_customer_sk, ss_item_sk = cs_item_sk
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=2N,6N row-size=24B cardinality=4.32M
+|  in pipelines: 03(GETNEXT), 07(OPEN)
+|
+|--07:AGGREGATE [FINALIZE]
+|  |  group by: cs_bill_customer_sk, cs_item_sk
+|  |  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  |  tuple-ids=6 row-size=12B cardinality=1.44M
+|  |  in pipelines: 07(GETNEXT), 04(OPEN)
+|  |
+|  06:HASH JOIN [INNER JOIN]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=24B cardinality=1.44M
+|  |  in pipelines: 04(GETNEXT), 05(OPEN)
+|  |
+|  |--05:SCAN HDFS [tpcds_parquet.date_dim]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=8B cardinality=7.30K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  04:SCAN HDFS [tpcds_parquet.catalog_sales]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF002[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=4 row-size=16B cardinality=1.44M
+|     in pipelines: 04(GETNEXT)
+|
+03:AGGREGATE [FINALIZE]
+|  group by: ss_customer_sk, ss_item_sk
+|  mem-estimate=36.26MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=2 row-size=12B cardinality=2.88M
+|  in pipelines: 03(GETNEXT), 00(OPEN)
+|
+02:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=122.38MB Threads=10
+Per-Host Resource Estimates: Memory=377MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: sum(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NULL THEN 1 ELSE 0 END), sum(CASE WHEN ssci.customer_sk IS NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END), sum(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NULL THEN 1 ELSE 0 END), sum:merge(CASE WHEN ssci.customer_sk IS NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END), sum:merge(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END)
+|  limit: 100
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=24B cardinality=1
+|  in pipelines: 17(GETNEXT), 09(OPEN)
+|
+16:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=24B cardinality=1
+|  in pipelines: 09(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=69.55MB mem-reservation=59.50MB thread-reservation=1
+09:AGGREGATE
+|  output: sum(CAST(CASE WHEN ss_customer_sk IS NOT NULL AND cs_bill_customer_sk IS NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN ss_customer_sk IS NULL AND cs_bill_customer_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN ss_customer_sk IS NOT NULL AND cs_bill_customer_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=24B cardinality=1
+|  in pipelines: 09(GETNEXT), 12(OPEN)
+|
+08:HASH JOIN [FULL OUTER JOIN, PARTITIONED]
+|  hash predicates: ss_customer_sk = cs_bill_customer_sk, ss_item_sk = cs_item_sk
+|  fk/pk conjuncts: ss_customer_sk = cs_bill_customer_sk, ss_item_sk = cs_item_sk
+|  mem-estimate=8.50MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  tuple-ids=2N,6N row-size=24B cardinality=4.32M
+|  in pipelines: 12(GETNEXT), 15(OPEN)
+|
+|--15:AGGREGATE [FINALIZE]
+|  |  group by: cs_bill_customer_sk, cs_item_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=6 row-size=12B cardinality=1.44M
+|  |  in pipelines: 15(GETNEXT), 04(OPEN)
+|  |
+|  14:EXCHANGE [HASH(cs_bill_customer_sk,cs_item_sk)]
+|  |  mem-estimate=5.55MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=12B cardinality=1.44M
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Resources: mem-estimate=164.00MB mem-reservation=23.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+|  07:AGGREGATE [STREAMING]
+|  |  group by: cs_bill_customer_sk, cs_item_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=6 row-size=12B cardinality=1.44M
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=24B cardinality=1.44M
+|  |  in pipelines: 04(GETNEXT), 05(OPEN)
+|  |
+|  |--13:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 05(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  |  05:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|  |     tuple-ids=5 row-size=8B cardinality=7.30K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  04:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF002[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=144.00MB mem-reservation=4.00MB thread-reservation=1
+|     tuple-ids=4 row-size=16B cardinality=1.44M
+|     in pipelines: 04(GETNEXT)
+|
+12:AGGREGATE [FINALIZE]
+|  group by: ss_customer_sk, ss_item_sk
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=2 row-size=12B cardinality=2.88M
+|  in pipelines: 12(GETNEXT), 00(OPEN)
+|
+11:EXCHANGE [HASH(ss_customer_sk,ss_item_sk)]
+|  mem-estimate=10.05MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2 row-size=12B cardinality=2.88M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=69.00MB mem-reservation=37.94MB thread-reservation=2 runtime-filters-memory=1.00MB
+03:AGGREGATE [STREAMING]
+|  group by: ss_customer_sk, ss_item_sk
+|  mem-estimate=34.00MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=2 row-size=12B cardinality=2.88M
+|  in pipelines: 00(GETNEXT)
+|
+02:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=1 row-size=8B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=130.25MB Threads=12
+Per-Host Resource Estimates: Memory=270MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=10.02MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: sum(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NULL THEN 1 ELSE 0 END), sum(CASE WHEN ssci.customer_sk IS NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END), sum(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NULL THEN 1 ELSE 0 END), sum:merge(CASE WHEN ssci.customer_sk IS NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END), sum:merge(CASE WHEN ssci.customer_sk IS NOT NULL AND csci.customer_sk IS NOT NULL THEN 1 ELSE 0 END)
+|  limit: 100
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=24B cardinality=1
+|  in pipelines: 17(GETNEXT), 09(OPEN)
+|
+16:EXCHANGE [UNPARTITIONED]
+|  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=8 row-size=24B cardinality=1
+|  in pipelines: 09(GETNEXT)
+|
+F02:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=27.09MB mem-reservation=17.00MB thread-reservation=1
+09:AGGREGATE
+|  output: sum(CAST(CASE WHEN ss_customer_sk IS NOT NULL AND cs_bill_customer_sk IS NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN ss_customer_sk IS NULL AND cs_bill_customer_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN ss_customer_sk IS NOT NULL AND cs_bill_customer_sk IS NOT NULL THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  mem-estimate=10.00MB mem-reservation=0B spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=8 row-size=24B cardinality=1
+|  in pipelines: 09(GETNEXT), 12(OPEN)
+|
+08:HASH JOIN [FULL OUTER JOIN, PARTITIONED]
+|  hash-table-id=00
+|  hash predicates: ss_customer_sk = cs_bill_customer_sk, ss_item_sk = cs_item_sk
+|  fk/pk conjuncts: ss_customer_sk = cs_bill_customer_sk, ss_item_sk = cs_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=256.00KB thread-reservation=0
+|  tuple-ids=2N,6N row-size=24B cardinality=4.32M
+|  in pipelines: 12(GETNEXT), 15(OPEN)
+|
+|--F07:PLAN FRAGMENT [HASH(ss_customer_sk,ss_item_sk)] hosts=3 instances=6
+|  |  Per-Instance Resources: mem-estimate=15.55MB mem-reservation=13.25MB thread-reservation=1
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: cs_bill_customer_sk, cs_item_sk
+|  |  mem-estimate=4.75MB mem-reservation=4.75MB spill-buffer=256.00KB thread-reservation=0
+|  |
+|  15:AGGREGATE [FINALIZE]
+|  |  group by: cs_bill_customer_sk, cs_item_sk
+|  |  mem-estimate=10.00MB mem-reservation=8.50MB spill-buffer=512.00KB thread-reservation=0
+|  |  tuple-ids=6 row-size=12B cardinality=1.44M
+|  |  in pipelines: 15(GETNEXT), 04(OPEN)
+|  |
+|  14:EXCHANGE [HASH(cs_bill_customer_sk,cs_item_sk)]
+|  |  mem-estimate=5.55MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=6 row-size=12B cardinality=1.44M
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+|  Per-Instance Resources: mem-estimate=65.00MB mem-reservation=21.00MB thread-reservation=1
+|  07:AGGREGATE [STREAMING]
+|  |  group by: cs_bill_customer_sk, cs_item_sk
+|  |  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  |  tuple-ids=6 row-size=12B cardinality=1.44M
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  06:HASH JOIN [INNER JOIN, BROADCAST]
+|  |  hash-table-id=01
+|  |  hash predicates: cs_sold_date_sk = d_date_sk
+|  |  fk/pk conjuncts: cs_sold_date_sk = d_date_sk
+|  |  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  |  tuple-ids=4,5 row-size=24B cardinality=1.44M
+|  |  in pipelines: 04(GETNEXT), 05(OPEN)
+|  |
+|  |--F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  |  Per-Instance Resources: mem-estimate=4.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  |  JOIN BUILD
+|  |  |  join-table-id=01 plan-id=02 cohort-id=02
+|  |  |  build expressions: d_date_sk
+|  |  |  runtime filters: RF002[bloom] <- d_date_sk
+|  |  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |  |
+|  |  13:EXCHANGE [BROADCAST]
+|  |  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  |  tuple-ids=5 row-size=8B cardinality=7.30K
+|  |  |  in pipelines: 05(GETNEXT)
+|  |  |
+|  |  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  |  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  |  05:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|  |     HDFS partitions=1/1 files=1 size=2.15MB
+|  |     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     stored statistics:
+|  |       table: rows=73.05K size=2.15MB
+|  |       columns: all
+|  |     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|  |     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|  |     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|  |     tuple-ids=5 row-size=8B cardinality=7.30K
+|  |     in pipelines: 05(GETNEXT)
+|  |
+|  04:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+|     HDFS partitions=1/1 files=3 size=96.62MB
+|     runtime filters: RF002[bloom] -> cs_sold_date_sk
+|     stored statistics:
+|       table: rows=1.44M size=96.62MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=650.14K
+|     mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+|     tuple-ids=4 row-size=16B cardinality=1.44M
+|     in pipelines: 04(GETNEXT)
+|
+12:AGGREGATE [FINALIZE]
+|  group by: ss_customer_sk, ss_item_sk
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=2 row-size=12B cardinality=2.88M
+|  in pipelines: 12(GETNEXT), 00(OPEN)
+|
+11:EXCHANGE [HASH(ss_customer_sk,ss_item_sk)]
+|  mem-estimate=10.09MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=2 row-size=12B cardinality=2.88M
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=1.00MB mem-reservation=1.00MB thread-reservation=0 runtime-filters-memory=1.00MB
+Per-Instance Resources: mem-estimate=33.00MB mem-reservation=18.00MB thread-reservation=1
+03:AGGREGATE [STREAMING]
+|  group by: ss_customer_sk, ss_item_sk
+|  mem-estimate=17.00MB mem-reservation=17.00MB spill-buffer=1.00MB thread-reservation=0
+|  tuple-ids=2 row-size=12B cardinality=2.88M
+|  in pipelines: 00(GETNEXT)
+|
+02:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=24B cardinality=2.88M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=8B cardinality=7.30K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=1 row-size=8B cardinality=7.30K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q98.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q98.test
new file mode 100644
index 0000000..4caa0ed
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q98.test
@@ -0,0 +1,384 @@
+# TPCDS-Q98
+select
+  i_item_desc,
+  i_category,
+  i_class,
+  i_current_price,
+  sum(ss_ext_sales_price) as itemrevenue,
+  sum(ss_ext_sales_price)*100/sum(sum(ss_ext_sales_price)) over (partition by i_class) as revenueratio
+from
+  store_sales,
+  item,
+  date_dim
+where
+  ss_item_sk = i_item_sk
+  and i_category in ('Jewelry', 'Sports', 'Books')
+  and ss_sold_date_sk = d_date_sk
+  and cast(d_date as timestamp) between cast('1999-02-22' as timestamp)
+                                and (cast('1999-02-22' as timestamp) + interval 30 days)
+group by
+  i_item_id,
+  i_item_desc,
+  i_category,
+  i_class,
+  i_current_price
+order by
+  i_category,
+  i_class,
+  i_item_id,
+  i_item_desc,
+  revenueratio
+limit 1000
+---- PLAN
+Max Per-Host Resource Reservation: Memory=52.00MB Threads=4
+Per-Host Resource Estimates: Memory=221MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=221.46MB mem-reservation=52.00MB thread-reservation=4 runtime-filters-memory=2.00MB
+PLAN-ROOT SINK
+|  output exprs: i_item_desc, i_category, i_class, i_current_price, sum(ss_ext_sales_price), sum(ss_ext_sales_price) * CAST(100 AS DECIMAL(3,0)) / sum(sum(ss_ext_sales_price))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+08:TOP-N [LIMIT=1000]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ss_ext_sales_price) * 100 / sum(sum(ss_ext_sales_price)) ASC
+|  mem-estimate=209.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=1.00K
+|  in pipelines: 08(GETNEXT), 06(OPEN)
+|
+07:ANALYTIC
+|  functions: sum(sum(ss_ext_sales_price))
+|  partition by: i_class
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10,9 row-size=214B cardinality=864.12K
+|  in pipelines: 06(GETNEXT)
+|
+06:SORT
+|  order by: i_class ASC NULLS LAST
+|  mem-estimate=14.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10 row-size=198B cardinality=864.12K
+|  in pipelines: 06(GETNEXT), 05(OPEN)
+|
+05:AGGREGATE [FINALIZE]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=179.58MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=864.12K
+|  in pipelines: 05(GETNEXT), 00(OPEN)
+|
+04:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=232B cardinality=864.12K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-03-24 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-22 00:00:00'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet dictionary predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-03-24 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-22 00:00:00'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=206B cardinality=864.12K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.item]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Jewelry', 'Sports', 'Books')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Jewelry', 'Sports', 'Books')
+|     parquet dictionary predicates: i_category IN ('Jewelry', 'Sports', 'Books')
+|     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=190B cardinality=5.40K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=93.88MB Threads=8
+Per-Host Resource Estimates: Memory=366MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=708.68KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_desc, i_category, i_class, i_current_price, sum(ss_ext_sales_price), sum(ss_ext_sales_price) * CAST(100 AS DECIMAL(3,0)) / sum(sum(ss_ext_sales_price))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ss_ext_sales_price) * 100 / sum(sum(ss_ext_sales_price)) ASC
+|  limit: 1000
+|  mem-estimate=708.68KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=1.00K
+|  in pipelines: 08(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(i_class)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=107.79MB mem-reservation=50.00MB thread-reservation=1
+08:TOP-N [LIMIT=1000]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ss_ext_sales_price) * 100 / sum(sum(ss_ext_sales_price)) ASC
+|  mem-estimate=209.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=1.00K
+|  in pipelines: 08(GETNEXT), 06(OPEN)
+|
+07:ANALYTIC
+|  functions: sum(sum(ss_ext_sales_price))
+|  partition by: i_class
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10,9 row-size=214B cardinality=864.12K
+|  in pipelines: 06(GETNEXT)
+|
+06:SORT
+|  order by: i_class ASC NULLS LAST
+|  mem-estimate=14.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10 row-size=198B cardinality=864.12K
+|  in pipelines: 06(GETNEXT), 12(OPEN)
+|
+12:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=89.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=864.12K
+|  in pipelines: 12(GETNEXT), 00(OPEN)
+|
+11:EXCHANGE [HASH(i_class)]
+|  mem-estimate=10.59MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=864.12K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=129.05MB mem-reservation=40.88MB thread-reservation=2 runtime-filters-memory=2.00MB
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=89.79MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=864.12K
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=232B cardinality=864.12K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-03-24 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-22 00:00:00'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet dictionary predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-03-24 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-22 00:00:00'
+|     mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  runtime filters: RF002[bloom] <- i_item_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=206B cardinality=864.12K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.17MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=190B cardinality=5.40K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Jewelry', 'Sports', 'Books')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Jewelry', 'Sports', 'Books')
+|     parquet dictionary predicates: i_category IN ('Jewelry', 'Sports', 'Books')
+|     mem-estimate=96.00MB mem-reservation=2.00MB thread-reservation=1
+|     tuple-ids=1 row-size=190B cardinality=5.40K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=32.00MB mem-reservation=1.00MB thread-reservation=1
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=184.75MB Threads=9
+Per-Host Resource Estimates: Memory=294MB
+F04:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=1.32MB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: i_item_desc, i_category, i_class, i_current_price, sum(ss_ext_sales_price), sum(ss_ext_sales_price) * CAST(100 AS DECIMAL(3,0)) / sum(sum(ss_ext_sales_price))
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+13:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ss_ext_sales_price) * 100 / sum(sum(ss_ext_sales_price)) ASC
+|  limit: 1000
+|  mem-estimate=1.32MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=1.00K
+|  in pipelines: 08(GETNEXT)
+|
+F03:PLAN FRAGMENT [HASH(i_class)] hosts=3 instances=6
+Per-Instance Resources: mem-estimate=62.90MB mem-reservation=50.00MB thread-reservation=1
+08:TOP-N [LIMIT=1000]
+|  order by: i_category ASC, i_class ASC, i_item_id ASC, i_item_desc ASC, sum(ss_ext_sales_price) * 100 / sum(sum(ss_ext_sales_price)) ASC
+|  mem-estimate=209.09KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=5 row-size=214B cardinality=1.00K
+|  in pipelines: 08(GETNEXT), 06(OPEN)
+|
+07:ANALYTIC
+|  functions: sum(sum(ss_ext_sales_price))
+|  partition by: i_class
+|  mem-estimate=4.00MB mem-reservation=4.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10,9 row-size=214B cardinality=864.12K
+|  in pipelines: 06(GETNEXT)
+|
+06:SORT
+|  order by: i_class ASC NULLS LAST
+|  mem-estimate=14.00MB mem-reservation=12.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=10 row-size=198B cardinality=864.12K
+|  in pipelines: 06(GETNEXT), 12(OPEN)
+|
+12:AGGREGATE [FINALIZE]
+|  output: sum:merge(ss_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=44.90MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=864.12K
+|  in pipelines: 12(GETNEXT), 00(OPEN)
+|
+11:EXCHANGE [HASH(i_class)]
+|  mem-estimate=11.18MB mem-reservation=0B thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=864.12K
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=6
+Per-Host Shared Resources: mem-estimate=2.00MB mem-reservation=2.00MB thread-reservation=0 runtime-filters-memory=2.00MB
+Per-Instance Resources: mem-estimate=60.90MB mem-reservation=35.00MB thread-reservation=1
+05:AGGREGATE [STREAMING]
+|  output: sum(ss_ext_sales_price)
+|  group by: i_item_id, i_item_desc, i_category, i_class, i_current_price
+|  mem-estimate=44.90MB mem-reservation=34.00MB spill-buffer=2.00MB thread-reservation=0
+|  tuple-ids=3 row-size=198B cardinality=864.12K
+|  in pipelines: 00(GETNEXT)
+|
+04:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: ss_sold_date_sk = d_date_sk
+|  fk/pk conjuncts: ss_sold_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,2 row-size=232B cardinality=864.12K
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F05:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=5.09MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  10:EXCHANGE [BROADCAST]
+|  |  mem-estimate=215.48KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=2 row-size=26B cardinality=7.30K
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-03-24 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-22 00:00:00'
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet dictionary predicates: CAST(d_date AS TIMESTAMP) <= TIMESTAMP '1999-03-24 00:00:00', CAST(d_date AS TIMESTAMP) >= TIMESTAMP '1999-02-22 00:00:00'
+|     mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+|     tuple-ids=2 row-size=26B cardinality=7.30K
+|     in pipelines: 02(GETNEXT)
+|
+03:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: ss_item_sk = i_item_sk
+|  fk/pk conjuncts: ss_item_sk = i_item_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=206B cardinality=864.12K
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F06:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=6.04MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: i_item_sk
+|  |  runtime filters: RF002[bloom] <- i_item_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  09:EXCHANGE [BROADCAST]
+|  |  mem-estimate=1.17MB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=190B cardinality=5.40K
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.item, RANDOM]
+|     HDFS partitions=1/1 files=1 size=1.73MB
+|     predicates: i_category IN ('Jewelry', 'Sports', 'Books')
+|     stored statistics:
+|       table: rows=18.00K size=1.73MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=18.00K
+|     parquet statistics predicates: i_category IN ('Jewelry', 'Sports', 'Books')
+|     parquet dictionary predicates: i_category IN ('Jewelry', 'Sports', 'Books')
+|     mem-estimate=16.00MB mem-reservation=2.00MB thread-reservation=0
+|     tuple-ids=1 row-size=190B cardinality=5.40K
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.store_sales, RANDOM]
+   HDFS partitions=1824/1824 files=1824 size=201.02MB
+   runtime filters: RF000[bloom] -> ss_sold_date_sk, RF002[bloom] -> ss_item_sk
+   stored statistics:
+     table: rows=2.88M size=201.02MB
+     partitions: 1824/1824 rows=2.88M
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=130.09K
+   mem-estimate=16.00MB mem-reservation=1.00MB thread-reservation=0
+   tuple-ids=0 row-size=16B cardinality=2.88M
+   in pipelines: 00(GETNEXT)
+====
diff --git a/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q99.test b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q99.test
new file mode 100644
index 0000000..791128c
--- /dev/null
+++ b/testdata/workloads/functional-planner/queries/PlannerTest/tpcds/tpcds-q99.test
@@ -0,0 +1,506 @@
+# TPCDS-Q99
+SELECT w_substr ,
+       sm_type ,
+       LOWER(cc_name) cc_name_lower ,
+       sum(CASE
+               WHEN (cs_ship_date_sk - cs_sold_date_sk <= 30) THEN 1
+               ELSE 0
+           END) AS "30 days",
+       sum(CASE
+               WHEN (cs_ship_date_sk - cs_sold_date_sk > 30)
+                    AND (cs_ship_date_sk - cs_sold_date_sk <= 60) THEN 1
+               ELSE 0
+           END) AS "31-60 days",
+       sum(CASE
+               WHEN (cs_ship_date_sk - cs_sold_date_sk > 60)
+                    AND (cs_ship_date_sk - cs_sold_date_sk <= 90) THEN 1
+               ELSE 0
+           END) AS "61-90 days",
+       sum(CASE
+               WHEN (cs_ship_date_sk - cs_sold_date_sk > 90)
+                    AND (cs_ship_date_sk - cs_sold_date_sk <= 120) THEN 1
+               ELSE 0
+           END) AS "91-120 days",
+       sum(CASE
+               WHEN (cs_ship_date_sk - cs_sold_date_sk > 120) THEN 1
+               ELSE 0
+           END) AS ">120 days"
+FROM catalog_sales ,
+  (SELECT SUBSTRING(w_warehouse_name,1,20) w_substr, *
+   FROM warehouse) AS sq1 ,
+     ship_mode ,
+     call_center ,
+     date_dim
+WHERE d_month_seq BETWEEN 1200 AND 1200 + 11
+  AND cs_ship_date_sk = d_date_sk
+  AND cs_warehouse_sk = w_warehouse_sk
+  AND cs_ship_mode_sk = sm_ship_mode_sk
+  AND cs_call_center_sk = cc_call_center_sk
+GROUP BY w_substr ,
+         sm_type ,
+         cc_name
+ORDER BY w_substr ,
+         sm_type ,
+        cc_name_lower
+LIMIT 100;
+
+---- PLAN
+Max Per-Host Resource Reservation: Memory=17.69MB Threads=6
+Per-Host Resource Estimates: Memory=380MB
+F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=379.75MB mem-reservation=17.69MB thread-reservation=6 runtime-filters-memory=4.00MB
+PLAN-ROOT SINK
+|  output exprs: w_substr, sm_type, lower(cc_name), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 30) AND (cs_ship_date_sk - cs_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 60) AND (cs_ship_date_sk - cs_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 90) AND (cs_ship_date_sk - cs_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+10:TOP-N [LIMIT=100]
+|  order by: w_substr ASC, sm_type ASC, lower(cc_name) ASC
+|  materialized: lower(cc_name)
+|  mem-estimate=5.87KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=84B cardinality=72
+|  in pipelines: 10(GETNEXT), 09(OPEN)
+|
+09:AGGREGATE [FINALIZE]
+|  output: sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(30 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(30 AS BIGINT)) AND (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(60 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(60 AS BIGINT)) AND (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(90 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(90 AS BIGINT)) AND (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  group by: substring(w_warehouse_name, CAST(1 AS BIGINT), CAST(20 AS BIGINT)), sm_type, cc_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=95B cardinality=72
+|  in pipelines: 09(GETNEXT), 00(OPEN)
+|
+08:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_ship_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_ship_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4,5 row-size=113B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--04:SCAN HDFS [tpcds_parquet.date_dim]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  runtime filters: RF002[bloom] <- cc_call_center_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4 row-size=105B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--03:SCAN HDFS [tpcds_parquet.call_center]
+|     HDFS partitions=1/1 files=1 size=10.28KB
+|     stored statistics:
+|       table: rows=6 size=10.28KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=4 row-size=28B cardinality=6
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_ship_mode_sk = sm_ship_mode_sk
+|  fk/pk conjuncts: cs_ship_mode_sk = sm_ship_mode_sk
+|  runtime filters: RF004[bloom] <- sm_ship_mode_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3 row-size=77B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--02:SCAN HDFS [tpcds_parquet.ship_mode]
+|     HDFS partitions=1/1 files=1 size=2.68KB
+|     stored statistics:
+|       table: rows=20 size=2.68KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=24B cardinality=20
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN]
+|  hash predicates: cs_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  fk/pk conjuncts: cs_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  runtime filters: RF006[bloom] <- tpcds_parquet.warehouse.w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=54B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--01:SCAN HDFS [tpcds_parquet.warehouse]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=34B cardinality=5
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_ship_date_sk, RF002[bloom] -> cs_call_center_sk, RF004[bloom] -> cs_ship_mode_sk, RF006[bloom] -> cs_warehouse_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=240.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+---- DISTRIBUTEDPLAN
+Max Per-Host Resource Reservation: Memory=20.23MB Threads=12
+Per-Host Resource Estimates: Memory=400MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=20.41KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_substr, sm_type, lower(cc_name), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 30) AND (cs_ship_date_sk - cs_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 60) AND (cs_ship_date_sk - cs_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 90) AND (cs_ship_date_sk - cs_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_substr ASC, sm_type ASC, lower(cc_name) ASC
+|  limit: 100
+|  mem-estimate=20.41KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=84B cardinality=72
+|  in pipelines: 10(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(w_substr,sm_type,cc_name)] hosts=3 instances=3
+Per-Host Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: w_substr ASC, sm_type ASC, lower(cc_name) ASC
+|  materialized: lower(cc_name)
+|  mem-estimate=5.87KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=84B cardinality=72
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 30) AND (cs_ship_date_sk - cs_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 60) AND (cs_ship_date_sk - cs_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 90) AND (cs_ship_date_sk - cs_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  group by: w_substr, sm_type, cc_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=95B cardinality=72
+|  in pipelines: 16(GETNEXT), 00(OPEN)
+|
+15:EXCHANGE [HASH(w_substr,sm_type,cc_name)]
+|  mem-estimate=23.19KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=95B cardinality=72
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Resources: mem-estimate=261.86MB mem-reservation=17.75MB thread-reservation=2 runtime-filters-memory=4.00MB
+09:AGGREGATE [STREAMING]
+|  output: sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(30 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(30 AS BIGINT)) AND (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(60 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(60 AS BIGINT)) AND (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(90 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(90 AS BIGINT)) AND (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  group by: substring(w_warehouse_name, CAST(1 AS BIGINT), CAST(20 AS BIGINT)), sm_type, cc_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=95B cardinality=72
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_ship_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_ship_date_sk = d_date_sk
+|  runtime filters: RF000[bloom] <- d_date_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4,5 row-size=113B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=7.30K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=2
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=32.00MB mem-reservation=512.00KB thread-reservation=1
+|     tuple-ids=5 row-size=8B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  runtime filters: RF002[bloom] <- cc_call_center_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4 row-size=105B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=28B cardinality=6
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  03:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.28KB
+|     stored statistics:
+|       table: rows=6 size=10.28KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=4 row-size=28B cardinality=6
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_ship_mode_sk = sm_ship_mode_sk
+|  fk/pk conjuncts: cs_ship_mode_sk = sm_ship_mode_sk
+|  runtime filters: RF004[bloom] <- sm_ship_mode_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3 row-size=77B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=24B cardinality=20
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  02:SCAN HDFS [tpcds_parquet.ship_mode, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.68KB
+|     stored statistics:
+|       table: rows=20 size=2.68KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=3 row-size=24B cardinality=20
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash predicates: cs_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  fk/pk conjuncts: cs_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  runtime filters: RF006[bloom] <- tpcds_parquet.warehouse.w_warehouse_sk
+|  mem-estimate=1.94MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=54B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=34B cardinality=5
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Host Resources: mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=2
+|  01:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=32.00MB mem-reservation=16.00KB thread-reservation=1
+|     tuple-ids=1 row-size=34B cardinality=5
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_ship_date_sk, RF002[bloom] -> cs_call_center_sk, RF004[bloom] -> cs_ship_mode_sk, RF006[bloom] -> cs_warehouse_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=240.00MB mem-reservation=4.00MB thread-reservation=1
+   tuple-ids=0 row-size=20B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+---- PARALLELPLANS
+Max Per-Host Resource Reservation: Memory=31.98MB Threads=11
+Per-Host Resource Estimates: Memory=156MB
+F06:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=20.41KB mem-reservation=0B thread-reservation=1
+PLAN-ROOT SINK
+|  output exprs: w_substr, sm_type, lower(cc_name), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 30) AND (cs_ship_date_sk - cs_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 60) AND (cs_ship_date_sk - cs_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 90) AND (cs_ship_date_sk - cs_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  mem-estimate=0B mem-reservation=0B thread-reservation=0
+|
+17:MERGING-EXCHANGE [UNPARTITIONED]
+|  order by: w_substr ASC, sm_type ASC, lower(cc_name) ASC
+|  limit: 100
+|  mem-estimate=20.41KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=84B cardinality=72
+|  in pipelines: 10(GETNEXT)
+|
+F05:PLAN FRAGMENT [HASH(w_substr,sm_type,cc_name)] hosts=3 instances=3
+Per-Instance Resources: mem-estimate=10.02MB mem-reservation=1.94MB thread-reservation=1
+10:TOP-N [LIMIT=100]
+|  order by: w_substr ASC, sm_type ASC, lower(cc_name) ASC
+|  materialized: lower(cc_name)
+|  mem-estimate=5.87KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=7 row-size=84B cardinality=72
+|  in pipelines: 10(GETNEXT), 16(OPEN)
+|
+16:AGGREGATE [FINALIZE]
+|  output: sum:merge(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk <= 30) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 30) AND (cs_ship_date_sk - cs_sold_date_sk <= 60) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 60) AND (cs_ship_date_sk - cs_sold_date_sk <= 90) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 90) AND (cs_ship_date_sk - cs_sold_date_sk <= 120) THEN 1 ELSE 0 END), sum:merge(CASE WHEN (cs_ship_date_sk - cs_sold_date_sk > 120) THEN 1 ELSE 0 END)
+|  group by: w_substr, sm_type, cc_name
+|  mem-estimate=10.00MB mem-reservation=1.94MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=95B cardinality=72
+|  in pipelines: 16(GETNEXT), 00(OPEN)
+|
+15:EXCHANGE [HASH(w_substr,sm_type,cc_name)]
+|  mem-estimate=23.19KB mem-reservation=0B thread-reservation=0
+|  tuple-ids=6 row-size=95B cardinality=72
+|  in pipelines: 00(GETNEXT)
+|
+F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+Per-Host Shared Resources: mem-estimate=4.00MB mem-reservation=4.00MB thread-reservation=0 runtime-filters-memory=4.00MB
+Per-Instance Resources: mem-estimate=58.00MB mem-reservation=6.00MB thread-reservation=1
+09:AGGREGATE [STREAMING]
+|  output: sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(30 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(30 AS BIGINT)) AND (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(60 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(60 AS BIGINT)) AND (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(90 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(90 AS BIGINT)) AND (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) <= CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT)), sum(CAST(CASE WHEN (CAST(cs_ship_date_sk AS BIGINT) - CAST(cs_sold_date_sk AS BIGINT) > CAST(120 AS BIGINT)) THEN CAST(1 AS TINYINT) ELSE CAST(0 AS TINYINT) END AS BIGINT))
+|  group by: substring(w_warehouse_name, CAST(1 AS BIGINT), CAST(20 AS BIGINT)), sm_type, cc_name
+|  mem-estimate=10.00MB mem-reservation=2.00MB spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=6 row-size=95B cardinality=72
+|  in pipelines: 00(GETNEXT)
+|
+08:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=00
+|  hash predicates: cs_ship_date_sk = d_date_sk
+|  fk/pk conjuncts: cs_ship_date_sk = d_date_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4,5 row-size=113B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 04(OPEN)
+|
+|--F07:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.94MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=00 plan-id=01 cohort-id=01
+|  |  build expressions: d_date_sk
+|  |  runtime filters: RF000[bloom] <- d_date_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  14:EXCHANGE [BROADCAST]
+|  |  mem-estimate=69.07KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=5 row-size=8B cardinality=7.30K
+|  |  in pipelines: 04(GETNEXT)
+|  |
+|  F04:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=1
+|  04:SCAN HDFS [tpcds_parquet.date_dim, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.15MB
+|     predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     stored statistics:
+|       table: rows=73.05K size=2.15MB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=73.05K
+|     parquet statistics predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     parquet dictionary predicates: d_month_seq <= CAST(1211 AS INT), d_month_seq >= CAST(1200 AS INT)
+|     mem-estimate=16.00MB mem-reservation=512.00KB thread-reservation=0
+|     tuple-ids=5 row-size=8B cardinality=7.30K
+|     in pipelines: 04(GETNEXT)
+|
+07:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=01
+|  hash predicates: cs_call_center_sk = cc_call_center_sk
+|  fk/pk conjuncts: cs_call_center_sk = cc_call_center_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3,4 row-size=105B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 03(OPEN)
+|
+|--F08:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=01 plan-id=02 cohort-id=01
+|  |  build expressions: cc_call_center_sk
+|  |  runtime filters: RF002[bloom] <- cc_call_center_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  13:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=4 row-size=28B cardinality=6
+|  |  in pipelines: 03(GETNEXT)
+|  |
+|  F03:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  03:SCAN HDFS [tpcds_parquet.call_center, RANDOM]
+|     HDFS partitions=1/1 files=1 size=10.28KB
+|     stored statistics:
+|       table: rows=6 size=10.28KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=6
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=4 row-size=28B cardinality=6
+|     in pipelines: 03(GETNEXT)
+|
+06:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=02
+|  hash predicates: cs_ship_mode_sk = sm_ship_mode_sk
+|  fk/pk conjuncts: cs_ship_mode_sk = sm_ship_mode_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1,3 row-size=77B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 02(OPEN)
+|
+|--F09:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=02 plan-id=03 cohort-id=01
+|  |  build expressions: sm_ship_mode_sk
+|  |  runtime filters: RF004[bloom] <- sm_ship_mode_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  12:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=3 row-size=24B cardinality=20
+|  |  in pipelines: 02(GETNEXT)
+|  |
+|  F02:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  02:SCAN HDFS [tpcds_parquet.ship_mode, RANDOM]
+|     HDFS partitions=1/1 files=1 size=2.68KB
+|     stored statistics:
+|       table: rows=20 size=2.68KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=20
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=3 row-size=24B cardinality=20
+|     in pipelines: 02(GETNEXT)
+|
+05:HASH JOIN [INNER JOIN, BROADCAST]
+|  hash-table-id=03
+|  hash predicates: cs_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  fk/pk conjuncts: cs_warehouse_sk = tpcds_parquet.warehouse.w_warehouse_sk
+|  mem-estimate=0B mem-reservation=0B spill-buffer=64.00KB thread-reservation=0
+|  tuple-ids=0,1 row-size=54B cardinality=1.44M
+|  in pipelines: 00(GETNEXT), 01(OPEN)
+|
+|--F10:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
+|  |  Per-Instance Resources: mem-estimate=4.89MB mem-reservation=4.88MB thread-reservation=1 runtime-filters-memory=1.00MB
+|  JOIN BUILD
+|  |  join-table-id=03 plan-id=04 cohort-id=01
+|  |  build expressions: tpcds_parquet.warehouse.w_warehouse_sk
+|  |  runtime filters: RF006[bloom] <- tpcds_parquet.warehouse.w_warehouse_sk
+|  |  mem-estimate=3.88MB mem-reservation=3.88MB spill-buffer=64.00KB thread-reservation=0
+|  |
+|  11:EXCHANGE [BROADCAST]
+|  |  mem-estimate=16.00KB mem-reservation=0B thread-reservation=0
+|  |  tuple-ids=1 row-size=34B cardinality=5
+|  |  in pipelines: 01(GETNEXT)
+|  |
+|  F01:PLAN FRAGMENT [RANDOM] hosts=1 instances=1
+|  Per-Instance Resources: mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=1
+|  01:SCAN HDFS [tpcds_parquet.warehouse, RANDOM]
+|     HDFS partitions=1/1 files=1 size=4.38KB
+|     stored statistics:
+|       table: rows=5 size=4.38KB
+|       columns: all
+|     extrapolated-rows=disabled max-scan-range-rows=5
+|     mem-estimate=16.00MB mem-reservation=16.00KB thread-reservation=0
+|     tuple-ids=1 row-size=34B cardinality=5
+|     in pipelines: 01(GETNEXT)
+|
+00:SCAN HDFS [tpcds_parquet.catalog_sales, RANDOM]
+   HDFS partitions=1/1 files=3 size=96.62MB
+   runtime filters: RF000[bloom] -> cs_ship_date_sk, RF002[bloom] -> cs_call_center_sk, RF004[bloom] -> cs_ship_mode_sk, RF006[bloom] -> cs_warehouse_sk
+   stored statistics:
+     table: rows=1.44M size=96.62MB
+     columns: all
+   extrapolated-rows=disabled max-scan-range-rows=650.14K
+   mem-estimate=48.00MB mem-reservation=4.00MB thread-reservation=0
+   tuple-ids=0 row-size=20B cardinality=1.44M
+   in pipelines: 00(GETNEXT)
+====