You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by su...@apache.org on 2024/02/21 21:51:52 UTC

(arrow-datafusion-comet) branch main updated: test: Add golden files for TPCDSPlanStabilitySuite (#73)

This is an automated email from the ASF dual-hosted git repository.

sunchao pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion-comet.git


The following commit(s) were added to refs/heads/main by this push:
     new 33024c6  test: Add golden files for TPCDSPlanStabilitySuite (#73)
33024c6 is described below

commit 33024c68d1ea5ab060ac4feea3efe72277780519
Author: Chao Sun <su...@apple.com>
AuthorDate: Wed Feb 21 13:51:48 2024 -0800

    test: Add golden files for TPCDSPlanStabilitySuite (#73)
---
 .../approved-plans-v1_4/q1/explain.txt             |  274 +++++
 .../approved-plans-v1_4/q1/simplified.txt          |   68 ++
 .../approved-plans-v1_4/q10/explain.txt            |  286 ++++++
 .../approved-plans-v1_4/q10/simplified.txt         |   75 ++
 .../approved-plans-v1_4/q11/explain.txt            |  482 +++++++++
 .../approved-plans-v1_4/q11/simplified.txt         |  123 +++
 .../approved-plans-v1_4/q12/explain.txt            |  150 +++
 .../approved-plans-v1_4/q12/simplified.txt         |   40 +
 .../approved-plans-v1_4/q13/explain.txt            |  232 +++++
 .../approved-plans-v1_4/q13/simplified.txt         |   59 ++
 .../approved-plans-v1_4/q14a/explain.txt           |  800 +++++++++++++++
 .../approved-plans-v1_4/q14a/simplified.txt        |  214 ++++
 .../approved-plans-v1_4/q14b/explain.txt           |  755 ++++++++++++++
 .../approved-plans-v1_4/q14b/simplified.txt        |  202 ++++
 .../approved-plans-v1_4/q15/explain.txt            |  164 +++
 .../approved-plans-v1_4/q15/simplified.txt         |   41 +
 .../approved-plans-v1_4/q16/explain.txt            |  260 +++++
 .../approved-plans-v1_4/q16/simplified.txt         |   68 ++
 .../approved-plans-v1_4/q17/explain.txt            |  298 ++++++
 .../approved-plans-v1_4/q17/simplified.txt         |   76 ++
 .../approved-plans-v1_4/q18/explain.txt            |  281 +++++
 .../approved-plans-v1_4/q18/simplified.txt         |   71 ++
 .../approved-plans-v1_4/q19/explain.txt            |  227 +++++
 .../approved-plans-v1_4/q19/simplified.txt         |   58 ++
 .../approved-plans-v1_4/q2/explain.txt             |  210 ++++
 .../approved-plans-v1_4/q2/simplified.txt          |   54 +
 .../approved-plans-v1_4/q20/explain.txt            |  150 +++
 .../approved-plans-v1_4/q20/simplified.txt         |   40 +
 .../approved-plans-v1_4/q21/explain.txt            |  169 +++
 .../approved-plans-v1_4/q21/simplified.txt         |   42 +
 .../approved-plans-v1_4/q22/explain.txt            |  169 +++
 .../approved-plans-v1_4/q22/simplified.txt         |   42 +
 .../approved-plans-v1_4/q23a/explain.txt           |  570 +++++++++++
 .../approved-plans-v1_4/q23a/simplified.txt        |  155 +++
 .../approved-plans-v1_4/q23b/explain.txt           |  694 +++++++++++++
 .../approved-plans-v1_4/q23b/simplified.txt        |  186 ++++
 .../approved-plans-v1_4/q24a/explain.txt           |  435 ++++++++
 .../approved-plans-v1_4/q24a/simplified.txt        |  116 +++
 .../approved-plans-v1_4/q24b/explain.txt           |  435 ++++++++
 .../approved-plans-v1_4/q24b/simplified.txt        |  116 +++
 .../approved-plans-v1_4/q25/explain.txt            |  298 ++++++
 .../approved-plans-v1_4/q25/simplified.txt         |   76 ++
 .../approved-plans-v1_4/q26/explain.txt            |  208 ++++
 .../approved-plans-v1_4/q26/simplified.txt         |   52 +
 .../approved-plans-v1_4/q27/explain.txt            |  208 ++++
 .../approved-plans-v1_4/q27/simplified.txt         |   52 +
 .../approved-plans-v1_4/q28/explain.txt            |  419 ++++++++
 .../approved-plans-v1_4/q28/simplified.txt         |   99 ++
 .../approved-plans-v1_4/q29/explain.txt            |  326 ++++++
 .../approved-plans-v1_4/q29/simplified.txt         |   83 ++
 .../approved-plans-v1_4/q3/explain.txt             |  125 +++
 .../approved-plans-v1_4/q3/simplified.txt          |   31 +
 .../approved-plans-v1_4/q30/explain.txt            |  324 ++++++
 .../approved-plans-v1_4/q30/simplified.txt         |   81 ++
 .../approved-plans-v1_4/q31/explain.txt            |  616 +++++++++++
 .../approved-plans-v1_4/q31/simplified.txt         |  159 +++
 .../approved-plans-v1_4/q32/explain.txt            |  209 ++++
 .../approved-plans-v1_4/q32/simplified.txt         |   52 +
 .../approved-plans-v1_4/q33/explain.txt            |  405 ++++++++
 .../approved-plans-v1_4/q33/simplified.txt         |  105 ++
 .../approved-plans-v1_4/q34/explain.txt            |  218 ++++
 .../approved-plans-v1_4/q34/simplified.txt         |   56 +
 .../approved-plans-v1_4/q35/explain.txt            |  281 +++++
 .../approved-plans-v1_4/q35/simplified.txt         |   74 ++
 .../approved-plans-v1_4/q36/explain.txt            |  194 ++++
 .../approved-plans-v1_4/q36/simplified.txt         |   51 +
 .../approved-plans-v1_4/q37/explain.txt            |  179 ++++
 .../approved-plans-v1_4/q37/simplified.txt         |   44 +
 .../approved-plans-v1_4/q38/explain.txt            |  321 ++++++
 .../approved-plans-v1_4/q38/simplified.txt         |   81 ++
 .../approved-plans-v1_4/q39a/explain.txt           |  318 ++++++
 .../approved-plans-v1_4/q39a/simplified.txt        |   81 ++
 .../approved-plans-v1_4/q39b/explain.txt           |  318 ++++++
 .../approved-plans-v1_4/q39b/simplified.txt        |   81 ++
 .../approved-plans-v1_4/q4/explain.txt             |  698 +++++++++++++
 .../approved-plans-v1_4/q4/simplified.txt          |  179 ++++
 .../approved-plans-v1_4/q40/explain.txt            |  218 ++++
 .../approved-plans-v1_4/q40/simplified.txt         |   56 +
 .../approved-plans-v1_4/q41/explain.txt            |  115 +++
 .../approved-plans-v1_4/q41/simplified.txt         |   27 +
 .../approved-plans-v1_4/q42/explain.txt            |  125 +++
 .../approved-plans-v1_4/q42/simplified.txt         |   31 +
 .../approved-plans-v1_4/q43/explain.txt            |  125 +++
 .../approved-plans-v1_4/q43/simplified.txt         |   31 +
 .../approved-plans-v1_4/q44/explain.txt            |  218 ++++
 .../approved-plans-v1_4/q44/simplified.txt         |   58 ++
 .../approved-plans-v1_4/q45/explain.txt            |  242 +++++
 .../approved-plans-v1_4/q45/simplified.txt         |   61 ++
 .../approved-plans-v1_4/q46/explain.txt            |  258 +++++
 .../approved-plans-v1_4/q46/simplified.txt         |   65 ++
 .../approved-plans-v1_4/q47/explain.txt            |  279 +++++
 .../approved-plans-v1_4/q47/simplified.txt         |   81 ++
 .../approved-plans-v1_4/q48/explain.txt            |  198 ++++
 .../approved-plans-v1_4/q48/simplified.txt         |   50 +
 .../approved-plans-v1_4/q49/explain.txt            |  471 +++++++++
 .../approved-plans-v1_4/q49/simplified.txt         |  133 +++
 .../approved-plans-v1_4/q5/explain.txt             |  464 +++++++++
 .../approved-plans-v1_4/q5/simplified.txt          |  120 +++
 .../approved-plans-v1_4/q50/explain.txt            |  199 ++++
 .../approved-plans-v1_4/q50/simplified.txt         |   50 +
 .../approved-plans-v1_4/q51/explain.txt            |  245 +++++
 .../approved-plans-v1_4/q51/simplified.txt         |   75 ++
 .../approved-plans-v1_4/q52/explain.txt            |  125 +++
 .../approved-plans-v1_4/q52/simplified.txt         |   31 +
 .../approved-plans-v1_4/q53/explain.txt            |  194 ++++
 .../approved-plans-v1_4/q53/simplified.txt         |   51 +
 .../approved-plans-v1_4/q54/explain.txt            |  471 +++++++++
 .../approved-plans-v1_4/q54/simplified.txt         |  117 +++
 .../approved-plans-v1_4/q55/explain.txt            |  125 +++
 .../approved-plans-v1_4/q55/simplified.txt         |   31 +
 .../approved-plans-v1_4/q56/explain.txt            |  405 ++++++++
 .../approved-plans-v1_4/q56/simplified.txt         |  105 ++
 .../approved-plans-v1_4/q57/explain.txt            |  279 +++++
 .../approved-plans-v1_4/q57/simplified.txt         |   81 ++
 .../approved-plans-v1_4/q58/explain.txt            |  384 +++++++
 .../approved-plans-v1_4/q58/simplified.txt         |   97 ++
 .../approved-plans-v1_4/q59/explain.txt            |  256 +++++
 .../approved-plans-v1_4/q59/simplified.txt         |   66 ++
 .../approved-plans-v1_4/q6/explain.txt             |  297 ++++++
 .../approved-plans-v1_4/q6/simplified.txt          |   74 ++
 .../approved-plans-v1_4/q60/explain.txt            |  405 ++++++++
 .../approved-plans-v1_4/q60/simplified.txt         |  105 ++
 .../approved-plans-v1_4/q61/explain.txt            |  417 ++++++++
 .../approved-plans-v1_4/q61/simplified.txt         |  106 ++
 .../approved-plans-v1_4/q62/explain.txt            |  187 ++++
 .../approved-plans-v1_4/q62/simplified.txt         |   48 +
 .../approved-plans-v1_4/q63/explain.txt            |  194 ++++
 .../approved-plans-v1_4/q63/simplified.txt         |   51 +
 .../approved-plans-v1_4/q64/explain.txt            | 1074 ++++++++++++++++++++
 .../approved-plans-v1_4/q64/simplified.txt         |  285 ++++++
 .../approved-plans-v1_4/q65/explain.txt            |  269 +++++
 .../approved-plans-v1_4/q65/simplified.txt         |   67 ++
 .../approved-plans-v1_4/q66/explain.txt            |  332 ++++++
 .../approved-plans-v1_4/q66/simplified.txt         |   86 ++
 .../approved-plans-v1_4/q67/explain.txt            |  189 ++++
 .../approved-plans-v1_4/q67/simplified.txt         |   50 +
 .../approved-plans-v1_4/q68/explain.txt            |  258 +++++
 .../approved-plans-v1_4/q68/simplified.txt         |   65 ++
 .../approved-plans-v1_4/q69/explain.txt            |  281 +++++
 .../approved-plans-v1_4/q69/simplified.txt         |   74 ++
 .../approved-plans-v1_4/q7/explain.txt             |  208 ++++
 .../approved-plans-v1_4/q7/simplified.txt          |   52 +
 .../approved-plans-v1_4/q70/explain.txt            |  278 +++++
 .../approved-plans-v1_4/q70/simplified.txt         |   74 ++
 .../approved-plans-v1_4/q71/explain.txt            |  254 +++++
 .../approved-plans-v1_4/q71/simplified.txt         |   69 ++
 .../approved-plans-v1_4/q72/explain.txt            |  433 ++++++++
 .../approved-plans-v1_4/q72/simplified.txt         |  114 +++
 .../approved-plans-v1_4/q73/explain.txt            |  218 ++++
 .../approved-plans-v1_4/q73/simplified.txt         |   56 +
 .../approved-plans-v1_4/q74/explain.txt            |  477 +++++++++
 .../approved-plans-v1_4/q74/simplified.txt         |  122 +++
 .../approved-plans-v1_4/q75/explain.txt            |  791 ++++++++++++++
 .../approved-plans-v1_4/q75/simplified.txt         |  237 +++++
 .../approved-plans-v1_4/q76/explain.txt            |  218 ++++
 .../approved-plans-v1_4/q76/simplified.txt         |   58 ++
 .../approved-plans-v1_4/q77/explain.txt            |  547 ++++++++++
 .../approved-plans-v1_4/q77/simplified.txt         |  143 +++
 .../approved-plans-v1_4/q78/explain.txt            |  431 ++++++++
 .../approved-plans-v1_4/q78/simplified.txt         |  115 +++
 .../approved-plans-v1_4/q79/explain.txt            |  208 ++++
 .../approved-plans-v1_4/q79/simplified.txt         |   52 +
 .../approved-plans-v1_4/q8/explain.txt             |  288 ++++++
 .../approved-plans-v1_4/q8/simplified.txt          |   72 ++
 .../approved-plans-v1_4/q80/explain.txt            |  645 ++++++++++++
 .../approved-plans-v1_4/q80/simplified.txt         |  170 ++++
 .../approved-plans-v1_4/q81/explain.txt            |  319 ++++++
 .../approved-plans-v1_4/q81/simplified.txt         |   80 ++
 .../approved-plans-v1_4/q82/explain.txt            |  179 ++++
 .../approved-plans-v1_4/q82/simplified.txt         |   44 +
 .../approved-plans-v1_4/q83/explain.txt            |  371 +++++++
 .../approved-plans-v1_4/q83/simplified.txt         |   95 ++
 .../approved-plans-v1_4/q84/explain.txt            |  210 ++++
 .../approved-plans-v1_4/q84/simplified.txt         |   54 +
 .../approved-plans-v1_4/q85/explain.txt            |  310 ++++++
 .../approved-plans-v1_4/q85/simplified.txt         |   79 ++
 .../approved-plans-v1_4/q86/explain.txt            |  155 +++
 .../approved-plans-v1_4/q86/simplified.txt         |   41 +
 .../approved-plans-v1_4/q87/explain.txt            |  321 ++++++
 .../approved-plans-v1_4/q87/simplified.txt         |   81 ++
 .../approved-plans-v1_4/q88/explain.txt            | 1031 +++++++++++++++++++
 .../approved-plans-v1_4/q88/simplified.txt         |  265 +++++
 .../approved-plans-v1_4/q89/explain.txt            |  189 ++++
 .../approved-plans-v1_4/q89/simplified.txt         |   50 +
 .../approved-plans-v1_4/q9/explain.txt             |  273 +++++
 .../approved-plans-v1_4/q9/simplified.txt          |   71 ++
 .../approved-plans-v1_4/q90/explain.txt            |  292 ++++++
 .../approved-plans-v1_4/q90/simplified.txt         |   74 ++
 .../approved-plans-v1_4/q91/explain.txt            |  281 +++++
 .../approved-plans-v1_4/q91/simplified.txt         |   73 ++
 .../approved-plans-v1_4/q92/explain.txt            |  209 ++++
 .../approved-plans-v1_4/q92/simplified.txt         |   52 +
 .../approved-plans-v1_4/q93/explain.txt            |  138 +++
 .../approved-plans-v1_4/q93/simplified.txt         |   36 +
 .../approved-plans-v1_4/q94/explain.txt            |  260 +++++
 .../approved-plans-v1_4/q94/simplified.txt         |   68 ++
 .../approved-plans-v1_4/q95/explain.txt            |  342 +++++++
 .../approved-plans-v1_4/q95/simplified.txt         |   99 ++
 .../approved-plans-v1_4/q96/explain.txt            |  163 +++
 .../approved-plans-v1_4/q96/simplified.txt         |   41 +
 .../approved-plans-v1_4/q97/explain.txt            |  179 ++++
 .../approved-plans-v1_4/q97/simplified.txt         |   47 +
 .../approved-plans-v1_4/q98/explain.txt            |  160 +++
 .../approved-plans-v1_4/q98/simplified.txt         |   44 +
 .../approved-plans-v1_4/q99/explain.txt            |  187 ++++
 .../approved-plans-v1_4/q99/simplified.txt         |   48 +
 .../approved-plans-v2_7/q10a/explain.txt           |  272 +++++
 .../approved-plans-v2_7/q10a/simplified.txt        |   72 ++
 .../approved-plans-v2_7/q11/explain.txt            |  477 +++++++++
 .../approved-plans-v2_7/q11/simplified.txt         |  122 +++
 .../approved-plans-v2_7/q12/explain.txt            |  150 +++
 .../approved-plans-v2_7/q12/simplified.txt         |   40 +
 .../approved-plans-v2_7/q14/explain.txt            |  755 ++++++++++++++
 .../approved-plans-v2_7/q14/simplified.txt         |  202 ++++
 .../approved-plans-v2_7/q14a/explain.txt           |  964 ++++++++++++++++++
 .../approved-plans-v2_7/q14a/simplified.txt        |  261 +++++
 .../approved-plans-v2_7/q18a/explain.txt           |  909 +++++++++++++++++
 .../approved-plans-v2_7/q18a/simplified.txt        |  233 +++++
 .../approved-plans-v2_7/q20/explain.txt            |  150 +++
 .../approved-plans-v2_7/q20/simplified.txt         |   40 +
 .../approved-plans-v2_7/q22/explain.txt            |  161 +++
 .../approved-plans-v2_7/q22/simplified.txt         |   41 +
 .../approved-plans-v2_7/q22a/explain.txt           |  315 ++++++
 .../approved-plans-v2_7/q22a/simplified.txt        |   80 ++
 .../approved-plans-v2_7/q24/explain.txt            |  445 ++++++++
 .../approved-plans-v2_7/q24/simplified.txt         |  120 +++
 .../approved-plans-v2_7/q27a/explain.txt           |  457 +++++++++
 .../approved-plans-v2_7/q27a/simplified.txt        |  117 +++
 .../approved-plans-v2_7/q34/explain.txt            |  218 ++++
 .../approved-plans-v2_7/q34/simplified.txt         |   56 +
 .../approved-plans-v2_7/q35/explain.txt            |  281 +++++
 .../approved-plans-v2_7/q35/simplified.txt         |   74 ++
 .../approved-plans-v2_7/q35a/explain.txt           |  267 +++++
 .../approved-plans-v2_7/q35a/simplified.txt        |   71 ++
 .../approved-plans-v2_7/q36a/explain.txt           |  279 +++++
 .../approved-plans-v2_7/q36a/simplified.txt        |   76 ++
 .../approved-plans-v2_7/q47/explain.txt            |  279 +++++
 .../approved-plans-v2_7/q47/simplified.txt         |   81 ++
 .../approved-plans-v2_7/q49/explain.txt            |  471 +++++++++
 .../approved-plans-v2_7/q49/simplified.txt         |  133 +++
 .../approved-plans-v2_7/q51a/explain.txt           |  416 ++++++++
 .../approved-plans-v2_7/q51a/simplified.txt        |  124 +++
 .../approved-plans-v2_7/q57/explain.txt            |  279 +++++
 .../approved-plans-v2_7/q57/simplified.txt         |   81 ++
 .../approved-plans-v2_7/q5a/explain.txt            |  549 ++++++++++
 .../approved-plans-v2_7/q5a/simplified.txt         |  145 +++
 .../approved-plans-v2_7/q6/explain.txt             |  297 ++++++
 .../approved-plans-v2_7/q6/simplified.txt          |   74 ++
 .../approved-plans-v2_7/q64/explain.txt            | 1074 ++++++++++++++++++++
 .../approved-plans-v2_7/q64/simplified.txt         |  285 ++++++
 .../approved-plans-v2_7/q67a/explain.txt           |  451 ++++++++
 .../approved-plans-v2_7/q67a/simplified.txt        |  122 +++
 .../approved-plans-v2_7/q70a/explain.txt           |  363 +++++++
 .../approved-plans-v2_7/q70a/simplified.txt        |   99 ++
 .../approved-plans-v2_7/q72/explain.txt            |  433 ++++++++
 .../approved-plans-v2_7/q72/simplified.txt         |  114 +++
 .../approved-plans-v2_7/q74/explain.txt            |  477 +++++++++
 .../approved-plans-v2_7/q74/simplified.txt         |  122 +++
 .../approved-plans-v2_7/q75/explain.txt            |  791 ++++++++++++++
 .../approved-plans-v2_7/q75/simplified.txt         |  237 +++++
 .../approved-plans-v2_7/q77a/explain.txt           |  632 ++++++++++++
 .../approved-plans-v2_7/q77a/simplified.txt        |  168 +++
 .../approved-plans-v2_7/q78/explain.txt            |  431 ++++++++
 .../approved-plans-v2_7/q78/simplified.txt         |  115 +++
 .../approved-plans-v2_7/q80a/explain.txt           |  730 +++++++++++++
 .../approved-plans-v2_7/q80a/simplified.txt        |  195 ++++
 .../approved-plans-v2_7/q86a/explain.txt           |  240 +++++
 .../approved-plans-v2_7/q86a/simplified.txt        |   66 ++
 .../approved-plans-v2_7/q98/explain.txt            |  155 +++
 .../approved-plans-v2_7/q98/simplified.txt         |   43 +
 .../spark/sql/comet/CometPlanStabilitySuite.scala  |    4 +-
 271 files changed, 59036 insertions(+), 2 deletions(-)

diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt
new file mode 100644
index 0000000..b0ea6be
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt
@@ -0,0 +1,274 @@
+== Physical Plan ==
+TakeOrderedAndProject (40)
++- * Project (39)
+   +- * BroadcastHashJoin Inner BuildRight (38)
+      :- * Project (33)
+      :  +- * BroadcastHashJoin Inner BuildRight (32)
+      :     :- * Project (26)
+      :     :  +- * BroadcastHashJoin Inner BuildRight (25)
+      :     :     :- * Filter (10)
+      :     :     :  +- * HashAggregate (9)
+      :     :     :     +- Exchange (8)
+      :     :     :        +- * HashAggregate (7)
+      :     :     :           +- * Project (6)
+      :     :     :              +- * BroadcastHashJoin Inner BuildRight (5)
+      :     :     :                 :- * ColumnarToRow (3)
+      :     :     :                 :  +- CometFilter (2)
+      :     :     :                 :     +- CometScan parquet spark_catalog.default.store_returns (1)
+      :     :     :                 +- ReusedExchange (4)
+      :     :     +- BroadcastExchange (24)
+      :     :        +- * Filter (23)
+      :     :           +- * HashAggregate (22)
+      :     :              +- Exchange (21)
+      :     :                 +- * HashAggregate (20)
+      :     :                    +- * HashAggregate (19)
+      :     :                       +- Exchange (18)
+      :     :                          +- * HashAggregate (17)
+      :     :                             +- * Project (16)
+      :     :                                +- * BroadcastHashJoin Inner BuildRight (15)
+      :     :                                   :- * ColumnarToRow (13)
+      :     :                                   :  +- CometFilter (12)
+      :     :                                   :     +- CometScan parquet spark_catalog.default.store_returns (11)
+      :     :                                   +- ReusedExchange (14)
+      :     +- BroadcastExchange (31)
+      :        +- * ColumnarToRow (30)
+      :           +- CometProject (29)
+      :              +- CometFilter (28)
+      :                 +- CometScan parquet spark_catalog.default.store (27)
+      +- BroadcastExchange (37)
+         +- * ColumnarToRow (36)
+            +- CometFilter (35)
+               +- CometScan parquet spark_catalog.default.customer (34)
+
+
+(unknown) Scan parquet spark_catalog.default.store_returns
+Output [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(sr_returned_date_sk#4), dynamicpruningexpression(sr_returned_date_sk#4 IN dynamicpruning#5)]
+PushedFilters: [IsNotNull(sr_store_sk), IsNotNull(sr_customer_sk)]
+ReadSchema: struct<sr_customer_sk:int,sr_store_sk:int,sr_return_amt:decimal(7,2)>
+
+(2) CometFilter
+Input [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4]
+Condition : (isnotnull(sr_store_sk#2) AND isnotnull(sr_customer_sk#1))
+
+(3) ColumnarToRow [codegen id : 2]
+Input [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4]
+
+(4) ReusedExchange [Reuses operator id: 45]
+Output [1]: [d_date_sk#6]
+
+(5) BroadcastHashJoin [codegen id : 2]
+Left keys [1]: [sr_returned_date_sk#4]
+Right keys [1]: [d_date_sk#6]
+Join type: Inner
+Join condition: None
+
+(6) Project [codegen id : 2]
+Output [3]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3]
+Input [5]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4, d_date_sk#6]
+
+(7) HashAggregate [codegen id : 2]
+Input [3]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3]
+Keys [2]: [sr_customer_sk#1, sr_store_sk#2]
+Functions [1]: [partial_sum(UnscaledValue(sr_return_amt#3))]
+Aggregate Attributes [1]: [sum#7]
+Results [3]: [sr_customer_sk#1, sr_store_sk#2, sum#8]
+
+(8) Exchange
+Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#8]
+Arguments: hashpartitioning(sr_customer_sk#1, sr_store_sk#2, 5), ENSURE_REQUIREMENTS, [plan_id=1]
+
+(9) HashAggregate [codegen id : 9]
+Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#8]
+Keys [2]: [sr_customer_sk#1, sr_store_sk#2]
+Functions [1]: [sum(UnscaledValue(sr_return_amt#3))]
+Aggregate Attributes [1]: [sum(UnscaledValue(sr_return_amt#3))#9]
+Results [3]: [sr_customer_sk#1 AS ctr_customer_sk#10, sr_store_sk#2 AS ctr_store_sk#11, MakeDecimal(sum(UnscaledValue(sr_return_amt#3))#9,17,2) AS ctr_total_return#12]
+
+(10) Filter [codegen id : 9]
+Input [3]: [ctr_customer_sk#10, ctr_store_sk#11, ctr_total_return#12]
+Condition : isnotnull(ctr_total_return#12)
+
+(unknown) Scan parquet spark_catalog.default.store_returns
+Output [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(sr_returned_date_sk#4), dynamicpruningexpression(sr_returned_date_sk#4 IN dynamicpruning#13)]
+PushedFilters: [IsNotNull(sr_store_sk)]
+ReadSchema: struct<sr_customer_sk:int,sr_store_sk:int,sr_return_amt:decimal(7,2)>
+
+(12) CometFilter
+Input [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4]
+Condition : isnotnull(sr_store_sk#2)
+
+(13) ColumnarToRow [codegen id : 4]
+Input [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4]
+
+(14) ReusedExchange [Reuses operator id: 45]
+Output [1]: [d_date_sk#6]
+
+(15) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [sr_returned_date_sk#4]
+Right keys [1]: [d_date_sk#6]
+Join type: Inner
+Join condition: None
+
+(16) Project [codegen id : 4]
+Output [3]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3]
+Input [5]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4, d_date_sk#6]
+
+(17) HashAggregate [codegen id : 4]
+Input [3]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3]
+Keys [2]: [sr_customer_sk#1, sr_store_sk#2]
+Functions [1]: [partial_sum(UnscaledValue(sr_return_amt#3))]
+Aggregate Attributes [1]: [sum#14]
+Results [3]: [sr_customer_sk#1, sr_store_sk#2, sum#15]
+
+(18) Exchange
+Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#15]
+Arguments: hashpartitioning(sr_customer_sk#1, sr_store_sk#2, 5), ENSURE_REQUIREMENTS, [plan_id=2]
+
+(19) HashAggregate [codegen id : 5]
+Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#15]
+Keys [2]: [sr_customer_sk#1, sr_store_sk#2]
+Functions [1]: [sum(UnscaledValue(sr_return_amt#3))]
+Aggregate Attributes [1]: [sum(UnscaledValue(sr_return_amt#3))#9]
+Results [2]: [sr_store_sk#2 AS ctr_store_sk#11, MakeDecimal(sum(UnscaledValue(sr_return_amt#3))#9,17,2) AS ctr_total_return#12]
+
+(20) HashAggregate [codegen id : 5]
+Input [2]: [ctr_store_sk#11, ctr_total_return#12]
+Keys [1]: [ctr_store_sk#11]
+Functions [1]: [partial_avg(ctr_total_return#12)]
+Aggregate Attributes [2]: [sum#16, count#17]
+Results [3]: [ctr_store_sk#11, sum#18, count#19]
+
+(21) Exchange
+Input [3]: [ctr_store_sk#11, sum#18, count#19]
+Arguments: hashpartitioning(ctr_store_sk#11, 5), ENSURE_REQUIREMENTS, [plan_id=3]
+
+(22) HashAggregate [codegen id : 6]
+Input [3]: [ctr_store_sk#11, sum#18, count#19]
+Keys [1]: [ctr_store_sk#11]
+Functions [1]: [avg(ctr_total_return#12)]
+Aggregate Attributes [1]: [avg(ctr_total_return#12)#20]
+Results [2]: [(avg(ctr_total_return#12)#20 * 1.2) AS (avg(ctr_total_return) * 1.2)#21, ctr_store_sk#11 AS ctr_store_sk#11#22]
+
+(23) Filter [codegen id : 6]
+Input [2]: [(avg(ctr_total_return) * 1.2)#21, ctr_store_sk#11#22]
+Condition : isnotnull((avg(ctr_total_return) * 1.2)#21)
+
+(24) BroadcastExchange
+Input [2]: [(avg(ctr_total_return) * 1.2)#21, ctr_store_sk#11#22]
+Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [plan_id=4]
+
+(25) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [ctr_store_sk#11]
+Right keys [1]: [ctr_store_sk#11#22]
+Join type: Inner
+Join condition: (cast(ctr_total_return#12 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#21)
+
+(26) Project [codegen id : 9]
+Output [2]: [ctr_customer_sk#10, ctr_store_sk#11]
+Input [5]: [ctr_customer_sk#10, ctr_store_sk#11, ctr_total_return#12, (avg(ctr_total_return) * 1.2)#21, ctr_store_sk#11#22]
+
+(unknown) Scan parquet spark_catalog.default.store
+Output [2]: [s_store_sk#23, s_state#24]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store]
+PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)]
+ReadSchema: struct<s_store_sk:int,s_state:string>
+
+(28) CometFilter
+Input [2]: [s_store_sk#23, s_state#24]
+Condition : ((isnotnull(s_state#24) AND (s_state#24 = TN)) AND isnotnull(s_store_sk#23))
+
+(29) CometProject
+Input [2]: [s_store_sk#23, s_state#24]
+Arguments: [s_store_sk#23], [s_store_sk#23]
+
+(30) ColumnarToRow [codegen id : 7]
+Input [1]: [s_store_sk#23]
+
+(31) BroadcastExchange
+Input [1]: [s_store_sk#23]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
+
+(32) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [ctr_store_sk#11]
+Right keys [1]: [s_store_sk#23]
+Join type: Inner
+Join condition: None
+
+(33) Project [codegen id : 9]
+Output [1]: [ctr_customer_sk#10]
+Input [3]: [ctr_customer_sk#10, ctr_store_sk#11, s_store_sk#23]
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [2]: [c_customer_sk#25, c_customer_id#26]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk)]
+ReadSchema: struct<c_customer_sk:int,c_customer_id:string>
+
+(35) CometFilter
+Input [2]: [c_customer_sk#25, c_customer_id#26]
+Condition : isnotnull(c_customer_sk#25)
+
+(36) ColumnarToRow [codegen id : 8]
+Input [2]: [c_customer_sk#25, c_customer_id#26]
+
+(37) BroadcastExchange
+Input [2]: [c_customer_sk#25, c_customer_id#26]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=6]
+
+(38) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [ctr_customer_sk#10]
+Right keys [1]: [c_customer_sk#25]
+Join type: Inner
+Join condition: None
+
+(39) Project [codegen id : 9]
+Output [1]: [c_customer_id#26]
+Input [3]: [ctr_customer_sk#10, c_customer_sk#25, c_customer_id#26]
+
+(40) TakeOrderedAndProject
+Input [1]: [c_customer_id#26]
+Arguments: 100, [c_customer_id#26 ASC NULLS FIRST], [c_customer_id#26]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = sr_returned_date_sk#4 IN dynamicpruning#5
+BroadcastExchange (45)
++- * ColumnarToRow (44)
+   +- CometProject (43)
+      +- CometFilter (42)
+         +- CometScan parquet spark_catalog.default.date_dim (41)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#6, d_year#27]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int>
+
+(42) CometFilter
+Input [2]: [d_date_sk#6, d_year#27]
+Condition : ((isnotnull(d_year#27) AND (d_year#27 = 2000)) AND isnotnull(d_date_sk#6))
+
+(43) CometProject
+Input [2]: [d_date_sk#6, d_year#27]
+Arguments: [d_date_sk#6], [d_date_sk#6]
+
+(44) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#6]
+
+(45) BroadcastExchange
+Input [1]: [d_date_sk#6]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
+
+Subquery:2 Hosting operator id = 11 Hosting Expression = sr_returned_date_sk#4 IN dynamicpruning#5
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/simplified.txt
new file mode 100644
index 0000000..6d4c0fc
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/simplified.txt
@@ -0,0 +1,68 @@
+TakeOrderedAndProject [c_customer_id]
+  WholeStageCodegen (9)
+    Project [c_customer_id]
+      BroadcastHashJoin [ctr_customer_sk,c_customer_sk]
+        Project [ctr_customer_sk]
+          BroadcastHashJoin [ctr_store_sk,s_store_sk]
+            Project [ctr_customer_sk,ctr_store_sk]
+              BroadcastHashJoin [ctr_store_sk,ctr_store_sk,ctr_total_return,(avg(ctr_total_return) * 1.2)]
+                Filter [ctr_total_return]
+                  HashAggregate [sr_customer_sk,sr_store_sk,sum] [sum(UnscaledValue(sr_return_amt)),ctr_customer_sk,ctr_store_sk,ctr_total_return,sum]
+                    InputAdapter
+                      Exchange [sr_customer_sk,sr_store_sk] #1
+                        WholeStageCodegen (2)
+                          HashAggregate [sr_customer_sk,sr_store_sk,sr_return_amt] [sum,sum]
+                            Project [sr_customer_sk,sr_store_sk,sr_return_amt]
+                              BroadcastHashJoin [sr_returned_date_sk,d_date_sk]
+                                ColumnarToRow
+                                  InputAdapter
+                                    CometFilter [sr_store_sk,sr_customer_sk]
+                                      CometScan parquet spark_catalog.default.store_returns [sr_customer_sk,sr_store_sk,sr_return_amt,sr_returned_date_sk]
+                                        SubqueryBroadcast [d_date_sk] #1
+                                          BroadcastExchange #2
+                                            WholeStageCodegen (1)
+                                              ColumnarToRow
+                                                InputAdapter
+                                                  CometProject [d_date_sk]
+                                                    CometFilter [d_year,d_date_sk]
+                                                      CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year]
+                                InputAdapter
+                                  ReusedExchange [d_date_sk] #2
+                InputAdapter
+                  BroadcastExchange #3
+                    WholeStageCodegen (6)
+                      Filter [(avg(ctr_total_return) * 1.2)]
+                        HashAggregate [ctr_store_sk,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_store_sk,sum,count]
+                          InputAdapter
+                            Exchange [ctr_store_sk] #4
+                              WholeStageCodegen (5)
+                                HashAggregate [ctr_store_sk,ctr_total_return] [sum,count,sum,count]
+                                  HashAggregate [sr_customer_sk,sr_store_sk,sum] [sum(UnscaledValue(sr_return_amt)),ctr_store_sk,ctr_total_return,sum]
+                                    InputAdapter
+                                      Exchange [sr_customer_sk,sr_store_sk] #5
+                                        WholeStageCodegen (4)
+                                          HashAggregate [sr_customer_sk,sr_store_sk,sr_return_amt] [sum,sum]
+                                            Project [sr_customer_sk,sr_store_sk,sr_return_amt]
+                                              BroadcastHashJoin [sr_returned_date_sk,d_date_sk]
+                                                ColumnarToRow
+                                                  InputAdapter
+                                                    CometFilter [sr_store_sk]
+                                                      CometScan parquet spark_catalog.default.store_returns [sr_customer_sk,sr_store_sk,sr_return_amt,sr_returned_date_sk]
+                                                        ReusedSubquery [d_date_sk] #1
+                                                InputAdapter
+                                                  ReusedExchange [d_date_sk] #2
+            InputAdapter
+              BroadcastExchange #6
+                WholeStageCodegen (7)
+                  ColumnarToRow
+                    InputAdapter
+                      CometProject [s_store_sk]
+                        CometFilter [s_state,s_store_sk]
+                          CometScan parquet spark_catalog.default.store [s_store_sk,s_state]
+        InputAdapter
+          BroadcastExchange #7
+            WholeStageCodegen (8)
+              ColumnarToRow
+                InputAdapter
+                  CometFilter [c_customer_sk]
+                    CometScan parquet spark_catalog.default.customer [c_customer_sk,c_customer_id]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/explain.txt
new file mode 100644
index 0000000..1ea2344
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/explain.txt
@@ -0,0 +1,286 @@
+== Physical Plan ==
+TakeOrderedAndProject (43)
++- * HashAggregate (42)
+   +- Exchange (41)
+      +- * HashAggregate (40)
+         +- * Project (39)
+            +- * BroadcastHashJoin Inner BuildRight (38)
+               :- * Project (33)
+               :  +- * BroadcastHashJoin Inner BuildRight (32)
+               :     :- * Project (26)
+               :     :  +- * Filter (25)
+               :     :     +- * BroadcastHashJoin ExistenceJoin(exists#1) BuildRight (24)
+               :     :        :- * BroadcastHashJoin ExistenceJoin(exists#2) BuildRight (17)
+               :     :        :  :- * BroadcastHashJoin LeftSemi BuildRight (10)
+               :     :        :  :  :- * ColumnarToRow (3)
+               :     :        :  :  :  +- CometFilter (2)
+               :     :        :  :  :     +- CometScan parquet spark_catalog.default.customer (1)
+               :     :        :  :  +- BroadcastExchange (9)
+               :     :        :  :     +- * Project (8)
+               :     :        :  :        +- * BroadcastHashJoin Inner BuildRight (7)
+               :     :        :  :           :- * ColumnarToRow (5)
+               :     :        :  :           :  +- CometScan parquet spark_catalog.default.store_sales (4)
+               :     :        :  :           +- ReusedExchange (6)
+               :     :        :  +- BroadcastExchange (16)
+               :     :        :     +- * Project (15)
+               :     :        :        +- * BroadcastHashJoin Inner BuildRight (14)
+               :     :        :           :- * ColumnarToRow (12)
+               :     :        :           :  +- CometScan parquet spark_catalog.default.web_sales (11)
+               :     :        :           +- ReusedExchange (13)
+               :     :        +- BroadcastExchange (23)
+               :     :           +- * Project (22)
+               :     :              +- * BroadcastHashJoin Inner BuildRight (21)
+               :     :                 :- * ColumnarToRow (19)
+               :     :                 :  +- CometScan parquet spark_catalog.default.catalog_sales (18)
+               :     :                 +- ReusedExchange (20)
+               :     +- BroadcastExchange (31)
+               :        +- * ColumnarToRow (30)
+               :           +- CometProject (29)
+               :              +- CometFilter (28)
+               :                 +- CometScan parquet spark_catalog.default.customer_address (27)
+               +- BroadcastExchange (37)
+                  +- * ColumnarToRow (36)
+                     +- CometFilter (35)
+                        +- CometScan parquet spark_catalog.default.customer_demographics (34)
+
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)]
+ReadSchema: struct<c_customer_sk:int,c_current_cdemo_sk:int,c_current_addr_sk:int>
+
+(2) CometFilter
+Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]
+Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4))
+
+(3) ColumnarToRow [codegen id : 9]
+Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [2]: [ss_customer_sk#6, ss_sold_date_sk#7]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)]
+ReadSchema: struct<ss_customer_sk:int>
+
+(5) ColumnarToRow [codegen id : 2]
+Input [2]: [ss_customer_sk#6, ss_sold_date_sk#7]
+
+(6) ReusedExchange [Reuses operator id: 48]
+Output [1]: [d_date_sk#9]
+
+(7) BroadcastHashJoin [codegen id : 2]
+Left keys [1]: [ss_sold_date_sk#7]
+Right keys [1]: [d_date_sk#9]
+Join type: Inner
+Join condition: None
+
+(8) Project [codegen id : 2]
+Output [1]: [ss_customer_sk#6]
+Input [3]: [ss_customer_sk#6, ss_sold_date_sk#7, d_date_sk#9]
+
+(9) BroadcastExchange
+Input [1]: [ss_customer_sk#6]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
+
+(10) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [c_customer_sk#3]
+Right keys [1]: [ss_customer_sk#6]
+Join type: LeftSemi
+Join condition: None
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [2]: [ws_bill_customer_sk#10, ws_sold_date_sk#11]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#11), dynamicpruningexpression(ws_sold_date_sk#11 IN dynamicpruning#12)]
+ReadSchema: struct<ws_bill_customer_sk:int>
+
+(12) ColumnarToRow [codegen id : 4]
+Input [2]: [ws_bill_customer_sk#10, ws_sold_date_sk#11]
+
+(13) ReusedExchange [Reuses operator id: 48]
+Output [1]: [d_date_sk#13]
+
+(14) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [ws_sold_date_sk#11]
+Right keys [1]: [d_date_sk#13]
+Join type: Inner
+Join condition: None
+
+(15) Project [codegen id : 4]
+Output [1]: [ws_bill_customer_sk#10]
+Input [3]: [ws_bill_customer_sk#10, ws_sold_date_sk#11, d_date_sk#13]
+
+(16) BroadcastExchange
+Input [1]: [ws_bill_customer_sk#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
+
+(17) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [c_customer_sk#3]
+Right keys [1]: [ws_bill_customer_sk#10]
+Join type: ExistenceJoin(exists#2)
+Join condition: None
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [2]: [cs_ship_customer_sk#14, cs_sold_date_sk#15]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#15), dynamicpruningexpression(cs_sold_date_sk#15 IN dynamicpruning#16)]
+ReadSchema: struct<cs_ship_customer_sk:int>
+
+(19) ColumnarToRow [codegen id : 6]
+Input [2]: [cs_ship_customer_sk#14, cs_sold_date_sk#15]
+
+(20) ReusedExchange [Reuses operator id: 48]
+Output [1]: [d_date_sk#17]
+
+(21) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [cs_sold_date_sk#15]
+Right keys [1]: [d_date_sk#17]
+Join type: Inner
+Join condition: None
+
+(22) Project [codegen id : 6]
+Output [1]: [cs_ship_customer_sk#14]
+Input [3]: [cs_ship_customer_sk#14, cs_sold_date_sk#15, d_date_sk#17]
+
+(23) BroadcastExchange
+Input [1]: [cs_ship_customer_sk#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]
+
+(24) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [c_customer_sk#3]
+Right keys [1]: [cs_ship_customer_sk#14]
+Join type: ExistenceJoin(exists#1)
+Join condition: None
+
+(25) Filter [codegen id : 9]
+Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1]
+Condition : (exists#2 OR exists#1)
+
+(26) Project [codegen id : 9]
+Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5]
+Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1]
+
+(unknown) Scan parquet spark_catalog.default.customer_address
+Output [2]: [ca_address_sk#18, ca_county#19]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_address]
+PushedFilters: [In(ca_county, [Dona Ana County,Jefferson County,La Porte County,Rush County,Toole County]), IsNotNull(ca_address_sk)]
+ReadSchema: struct<ca_address_sk:int,ca_county:string>
+
+(28) CometFilter
+Input [2]: [ca_address_sk#18, ca_county#19]
+Condition : (ca_county#19 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#18))
+
+(29) CometProject
+Input [2]: [ca_address_sk#18, ca_county#19]
+Arguments: [ca_address_sk#18], [ca_address_sk#18]
+
+(30) ColumnarToRow [codegen id : 7]
+Input [1]: [ca_address_sk#18]
+
+(31) BroadcastExchange
+Input [1]: [ca_address_sk#18]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]
+
+(32) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [c_current_addr_sk#5]
+Right keys [1]: [ca_address_sk#18]
+Join type: Inner
+Join condition: None
+
+(33) Project [codegen id : 9]
+Output [1]: [c_current_cdemo_sk#4]
+Input [3]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#18]
+
+(unknown) Scan parquet spark_catalog.default.customer_demographics
+Output [9]: [cd_demo_sk#20, cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_demographics]
+PushedFilters: [IsNotNull(cd_demo_sk)]
+ReadSchema: struct<cd_demo_sk:int,cd_gender:string,cd_marital_status:string,cd_education_status:string,cd_purchase_estimate:int,cd_credit_rating:string,cd_dep_count:int,cd_dep_employed_count:int,cd_dep_college_count:int>
+
+(35) CometFilter
+Input [9]: [cd_demo_sk#20, cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
+Condition : isnotnull(cd_demo_sk#20)
+
+(36) ColumnarToRow [codegen id : 8]
+Input [9]: [cd_demo_sk#20, cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
+
+(37) BroadcastExchange
+Input [9]: [cd_demo_sk#20, cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=5]
+
+(38) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [c_current_cdemo_sk#4]
+Right keys [1]: [cd_demo_sk#20]
+Join type: Inner
+Join condition: None
+
+(39) Project [codegen id : 9]
+Output [8]: [cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
+Input [10]: [c_current_cdemo_sk#4, cd_demo_sk#20, cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
+
+(40) HashAggregate [codegen id : 9]
+Input [8]: [cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
+Keys [8]: [cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
+Functions [1]: [partial_count(1)]
+Aggregate Attributes [1]: [count#29]
+Results [9]: [cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, count#30]
+
+(41) Exchange
+Input [9]: [cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, count#30]
+Arguments: hashpartitioning(cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, 5), ENSURE_REQUIREMENTS, [plan_id=6]
+
+(42) HashAggregate [codegen id : 10]
+Input [9]: [cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28, count#30]
+Keys [8]: [cd_gender#21, cd_marital_status#22, cd_education_status#23, cd_purchase_estimate#24, cd_credit_rating#25, cd_dep_count#26, cd_dep_employed_count#27, cd_dep_college_count#28]
+Functions [1]: [count(1)]
+Aggregate Attributes [1]: [count(1)#31]
+Results [14]: [cd_gender#21, cd_marital_status#22, cd_education_status#23, count(1)#31 AS cnt1#32, cd_purchase_estimate#24, count(1)#31 AS cnt2#33, cd_credit_rating#25, count(1)#31 AS cnt3#34, cd_dep_count#26, count(1)#31 AS cnt4#35, cd_dep_employed_count#27, count(1)#31 AS cnt5#36, cd_dep_college_count#28, count(1)#31 AS cnt6#37]
+
+(43) TakeOrderedAndProject
+Input [14]: [cd_gender#21, cd_marital_status#22, cd_education_status#23, cnt1#32, cd_purchase_estimate#24, cnt2#33, cd_credit_rating#25, cnt3#34, cd_dep_count#26, cnt4#35, cd_dep_employed_count#27, cnt5#36, cd_dep_college_count#28, cnt6#37]
+Arguments: 100, [cd_gender#21 ASC NULLS FIRST, cd_marital_status#22 ASC NULLS FIRST, cd_education_status#23 ASC NULLS FIRST, cd_purchase_estimate#24 ASC NULLS FIRST, cd_credit_rating#25 ASC NULLS FIRST, cd_dep_count#26 ASC NULLS FIRST, cd_dep_employed_count#27 ASC NULLS FIRST, cd_dep_college_count#28 ASC NULLS FIRST], [cd_gender#21, cd_marital_status#22, cd_education_status#23, cnt1#32, cd_purchase_estimate#24, cnt2#33, cd_credit_rating#25, cnt3#34, cd_dep_count#26, cnt4#35, cd_dep_emplo [...]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8
+BroadcastExchange (48)
++- * ColumnarToRow (47)
+   +- CometProject (46)
+      +- CometFilter (45)
+         +- CometScan parquet spark_catalog.default.date_dim (44)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [3]: [d_date_sk#9, d_year#38, d_moy#39]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,1), LessThanOrEqual(d_moy,4), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
+
+(45) CometFilter
+Input [3]: [d_date_sk#9, d_year#38, d_moy#39]
+Condition : (((((isnotnull(d_year#38) AND isnotnull(d_moy#39)) AND (d_year#38 = 2002)) AND (d_moy#39 >= 1)) AND (d_moy#39 <= 4)) AND isnotnull(d_date_sk#9))
+
+(46) CometProject
+Input [3]: [d_date_sk#9, d_year#38, d_moy#39]
+Arguments: [d_date_sk#9], [d_date_sk#9]
+
+(47) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#9]
+
+(48) BroadcastExchange
+Input [1]: [d_date_sk#9]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
+
+Subquery:2 Hosting operator id = 11 Hosting Expression = ws_sold_date_sk#11 IN dynamicpruning#8
+
+Subquery:3 Hosting operator id = 18 Hosting Expression = cs_sold_date_sk#15 IN dynamicpruning#8
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/simplified.txt
new file mode 100644
index 0000000..89893c8
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/simplified.txt
@@ -0,0 +1,75 @@
+TakeOrderedAndProject [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,cnt1,cnt2,cnt3,cnt4,cnt5,cnt6]
+  WholeStageCodegen (10)
+    HashAggregate [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,count] [count(1),cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,count]
+      InputAdapter
+        Exchange [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] #1
+          WholeStageCodegen (9)
+            HashAggregate [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] [count,count]
+              Project [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]
+                BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk]
+                  Project [c_current_cdemo_sk]
+                    BroadcastHashJoin [c_current_addr_sk,ca_address_sk]
+                      Project [c_current_cdemo_sk,c_current_addr_sk]
+                        Filter [exists,exists]
+                          BroadcastHashJoin [c_customer_sk,cs_ship_customer_sk]
+                            BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk]
+                              BroadcastHashJoin [c_customer_sk,ss_customer_sk]
+                                ColumnarToRow
+                                  InputAdapter
+                                    CometFilter [c_current_addr_sk,c_current_cdemo_sk]
+                                      CometScan parquet spark_catalog.default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk]
+                                InputAdapter
+                                  BroadcastExchange #2
+                                    WholeStageCodegen (2)
+                                      Project [ss_customer_sk]
+                                        BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometScan parquet spark_catalog.default.store_sales [ss_customer_sk,ss_sold_date_sk]
+                                                SubqueryBroadcast [d_date_sk] #1
+                                                  BroadcastExchange #3
+                                                    WholeStageCodegen (1)
+                                                      ColumnarToRow
+                                                        InputAdapter
+                                                          CometProject [d_date_sk]
+                                                            CometFilter [d_year,d_moy,d_date_sk]
+                                                              CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year,d_moy]
+                                          InputAdapter
+                                            ReusedExchange [d_date_sk] #3
+                              InputAdapter
+                                BroadcastExchange #4
+                                  WholeStageCodegen (4)
+                                    Project [ws_bill_customer_sk]
+                                      BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
+                                        ColumnarToRow
+                                          InputAdapter
+                                            CometScan parquet spark_catalog.default.web_sales [ws_bill_customer_sk,ws_sold_date_sk]
+                                              ReusedSubquery [d_date_sk] #1
+                                        InputAdapter
+                                          ReusedExchange [d_date_sk] #3
+                            InputAdapter
+                              BroadcastExchange #5
+                                WholeStageCodegen (6)
+                                  Project [cs_ship_customer_sk]
+                                    BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                                      ColumnarToRow
+                                        InputAdapter
+                                          CometScan parquet spark_catalog.default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk]
+                                            ReusedSubquery [d_date_sk] #1
+                                      InputAdapter
+                                        ReusedExchange [d_date_sk] #3
+                      InputAdapter
+                        BroadcastExchange #6
+                          WholeStageCodegen (7)
+                            ColumnarToRow
+                              InputAdapter
+                                CometProject [ca_address_sk]
+                                  CometFilter [ca_county,ca_address_sk]
+                                    CometScan parquet spark_catalog.default.customer_address [ca_address_sk,ca_county]
+                  InputAdapter
+                    BroadcastExchange #7
+                      WholeStageCodegen (8)
+                        ColumnarToRow
+                          InputAdapter
+                            CometFilter [cd_demo_sk]
+                              CometScan parquet spark_catalog.default.customer_demographics [cd_demo_sk,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]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt
new file mode 100644
index 0000000..64f486f
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt
@@ -0,0 +1,482 @@
+== Physical Plan ==
+TakeOrderedAndProject (72)
++- * Project (71)
+   +- * BroadcastHashJoin Inner BuildRight (70)
+      :- * Project (53)
+      :  +- * BroadcastHashJoin Inner BuildRight (52)
+      :     :- * Project (34)
+      :     :  +- * BroadcastHashJoin Inner BuildRight (33)
+      :     :     :- * Filter (16)
+      :     :     :  +- * HashAggregate (15)
+      :     :     :     +- Exchange (14)
+      :     :     :        +- * HashAggregate (13)
+      :     :     :           +- * Project (12)
+      :     :     :              +- * BroadcastHashJoin Inner BuildRight (11)
+      :     :     :                 :- * Project (9)
+      :     :     :                 :  +- * BroadcastHashJoin Inner BuildRight (8)
+      :     :     :                 :     :- * ColumnarToRow (3)
+      :     :     :                 :     :  +- CometFilter (2)
+      :     :     :                 :     :     +- CometScan parquet spark_catalog.default.customer (1)
+      :     :     :                 :     +- BroadcastExchange (7)
+      :     :     :                 :        +- * ColumnarToRow (6)
+      :     :     :                 :           +- CometFilter (5)
+      :     :     :                 :              +- CometScan parquet spark_catalog.default.store_sales (4)
+      :     :     :                 +- ReusedExchange (10)
+      :     :     +- BroadcastExchange (32)
+      :     :        +- * HashAggregate (31)
+      :     :           +- Exchange (30)
+      :     :              +- * HashAggregate (29)
+      :     :                 +- * Project (28)
+      :     :                    +- * BroadcastHashJoin Inner BuildRight (27)
+      :     :                       :- * Project (25)
+      :     :                       :  +- * BroadcastHashJoin Inner BuildRight (24)
+      :     :                       :     :- * ColumnarToRow (19)
+      :     :                       :     :  +- CometFilter (18)
+      :     :                       :     :     +- CometScan parquet spark_catalog.default.customer (17)
+      :     :                       :     +- BroadcastExchange (23)
+      :     :                       :        +- * ColumnarToRow (22)
+      :     :                       :           +- CometFilter (21)
+      :     :                       :              +- CometScan parquet spark_catalog.default.store_sales (20)
+      :     :                       +- ReusedExchange (26)
+      :     +- BroadcastExchange (51)
+      :        +- * Filter (50)
+      :           +- * HashAggregate (49)
+      :              +- Exchange (48)
+      :                 +- * HashAggregate (47)
+      :                    +- * Project (46)
+      :                       +- * BroadcastHashJoin Inner BuildRight (45)
+      :                          :- * Project (43)
+      :                          :  +- * BroadcastHashJoin Inner BuildRight (42)
+      :                          :     :- * ColumnarToRow (37)
+      :                          :     :  +- CometFilter (36)
+      :                          :     :     +- CometScan parquet spark_catalog.default.customer (35)
+      :                          :     +- BroadcastExchange (41)
+      :                          :        +- * ColumnarToRow (40)
+      :                          :           +- CometFilter (39)
+      :                          :              +- CometScan parquet spark_catalog.default.web_sales (38)
+      :                          +- ReusedExchange (44)
+      +- BroadcastExchange (69)
+         +- * HashAggregate (68)
+            +- Exchange (67)
+               +- * HashAggregate (66)
+                  +- * Project (65)
+                     +- * BroadcastHashJoin Inner BuildRight (64)
+                        :- * Project (62)
+                        :  +- * BroadcastHashJoin Inner BuildRight (61)
+                        :     :- * ColumnarToRow (56)
+                        :     :  +- CometFilter (55)
+                        :     :     +- CometScan parquet spark_catalog.default.customer (54)
+                        :     +- BroadcastExchange (60)
+                        :        +- * ColumnarToRow (59)
+                        :           +- CometFilter (58)
+                        :              +- CometScan parquet spark_catalog.default.web_sales (57)
+                        +- ReusedExchange (63)
+
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
+ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string,c_preferred_cust_flag:string,c_birth_country:string,c_login:string,c_email_address:string>
+
+(2) CometFilter
+Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
+Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2))
+
+(3) ColumnarToRow [codegen id : 3]
+Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)]
+PushedFilters: [IsNotNull(ss_customer_sk)]
+ReadSchema: struct<ss_customer_sk:int,ss_ext_discount_amt:decimal(7,2),ss_ext_list_price:decimal(7,2)>
+
+(5) CometFilter
+Input [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
+Condition : isnotnull(ss_customer_sk#9)
+
+(6) ColumnarToRow [codegen id : 1]
+Input [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
+
+(7) BroadcastExchange
+Input [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(8) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [c_customer_sk#1]
+Right keys [1]: [ss_customer_sk#9]
+Join type: Inner
+Join condition: None
+
+(9) Project [codegen id : 3]
+Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
+Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12]
+
+(10) ReusedExchange [Reuses operator id: 76]
+Output [2]: [d_date_sk#14, d_year#15]
+
+(11) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [ss_sold_date_sk#12]
+Right keys [1]: [d_date_sk#14]
+Join type: Inner
+Join condition: None
+
+(12) Project [codegen id : 3]
+Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, d_year#15]
+Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12, d_date_sk#14, d_year#15]
+
+(13) HashAggregate [codegen id : 3]
+Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, d_year#15]
+Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
+Functions [1]: [partial_sum(UnscaledValue((ss_ext_list_price#11 - ss_ext_discount_amt#10)))]
+Aggregate Attributes [1]: [sum#16]
+Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#17]
+
+(14) Exchange
+Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#17]
+Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), ENSURE_REQUIREMENTS, [plan_id=2]
+
+(15) HashAggregate [codegen id : 16]
+Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#17]
+Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#15, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
+Functions [1]: [sum(UnscaledValue((ss_ext_list_price#11 - ss_ext_discount_amt#10)))]
+Aggregate Attributes [1]: [sum(UnscaledValue((ss_ext_list_price#11 - ss_ext_discount_amt#10)))#18]
+Results [2]: [c_customer_id#2 AS customer_id#19, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#11 - ss_ext_discount_amt#10)))#18,18,2) AS year_total#20]
+
+(16) Filter [codegen id : 16]
+Input [2]: [customer_id#19, year_total#20]
+Condition : (isnotnull(year_total#20) AND (year_total#20 > 0.00))
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [8]: [c_customer_sk#21, c_customer_id#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
+ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string,c_preferred_cust_flag:string,c_birth_country:string,c_login:string,c_email_address:string>
+
+(18) CometFilter
+Input [8]: [c_customer_sk#21, c_customer_id#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28]
+Condition : (isnotnull(c_customer_sk#21) AND isnotnull(c_customer_id#22))
+
+(19) ColumnarToRow [codegen id : 6]
+Input [8]: [c_customer_sk#21, c_customer_id#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28]
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [4]: [ss_customer_sk#29, ss_ext_discount_amt#30, ss_ext_list_price#31, ss_sold_date_sk#32]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#32), dynamicpruningexpression(ss_sold_date_sk#32 IN dynamicpruning#33)]
+PushedFilters: [IsNotNull(ss_customer_sk)]
+ReadSchema: struct<ss_customer_sk:int,ss_ext_discount_amt:decimal(7,2),ss_ext_list_price:decimal(7,2)>
+
+(21) CometFilter
+Input [4]: [ss_customer_sk#29, ss_ext_discount_amt#30, ss_ext_list_price#31, ss_sold_date_sk#32]
+Condition : isnotnull(ss_customer_sk#29)
+
+(22) ColumnarToRow [codegen id : 4]
+Input [4]: [ss_customer_sk#29, ss_ext_discount_amt#30, ss_ext_list_price#31, ss_sold_date_sk#32]
+
+(23) BroadcastExchange
+Input [4]: [ss_customer_sk#29, ss_ext_discount_amt#30, ss_ext_list_price#31, ss_sold_date_sk#32]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
+
+(24) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [c_customer_sk#21]
+Right keys [1]: [ss_customer_sk#29]
+Join type: Inner
+Join condition: None
+
+(25) Project [codegen id : 6]
+Output [10]: [c_customer_id#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28, ss_ext_discount_amt#30, ss_ext_list_price#31, ss_sold_date_sk#32]
+Input [12]: [c_customer_sk#21, c_customer_id#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28, ss_customer_sk#29, ss_ext_discount_amt#30, ss_ext_list_price#31, ss_sold_date_sk#32]
+
+(26) ReusedExchange [Reuses operator id: 80]
+Output [2]: [d_date_sk#34, d_year#35]
+
+(27) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_sold_date_sk#32]
+Right keys [1]: [d_date_sk#34]
+Join type: Inner
+Join condition: None
+
+(28) Project [codegen id : 6]
+Output [10]: [c_customer_id#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28, ss_ext_discount_amt#30, ss_ext_list_price#31, d_year#35]
+Input [12]: [c_customer_id#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28, ss_ext_discount_amt#30, ss_ext_list_price#31, ss_sold_date_sk#32, d_date_sk#34, d_year#35]
+
+(29) HashAggregate [codegen id : 6]
+Input [10]: [c_customer_id#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28, ss_ext_discount_amt#30, ss_ext_list_price#31, d_year#35]
+Keys [8]: [c_customer_id#22, c_first_name#23, c_last_name#24, d_year#35, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28]
+Functions [1]: [partial_sum(UnscaledValue((ss_ext_list_price#31 - ss_ext_discount_amt#30)))]
+Aggregate Attributes [1]: [sum#36]
+Results [9]: [c_customer_id#22, c_first_name#23, c_last_name#24, d_year#35, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28, sum#37]
+
+(30) Exchange
+Input [9]: [c_customer_id#22, c_first_name#23, c_last_name#24, d_year#35, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28, sum#37]
+Arguments: hashpartitioning(c_customer_id#22, c_first_name#23, c_last_name#24, d_year#35, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28, 5), ENSURE_REQUIREMENTS, [plan_id=4]
+
+(31) HashAggregate [codegen id : 7]
+Input [9]: [c_customer_id#22, c_first_name#23, c_last_name#24, d_year#35, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28, sum#37]
+Keys [8]: [c_customer_id#22, c_first_name#23, c_last_name#24, d_year#35, c_preferred_cust_flag#25, c_birth_country#26, c_login#27, c_email_address#28]
+Functions [1]: [sum(UnscaledValue((ss_ext_list_price#31 - ss_ext_discount_amt#30)))]
+Aggregate Attributes [1]: [sum(UnscaledValue((ss_ext_list_price#31 - ss_ext_discount_amt#30)))#18]
+Results [3]: [c_customer_id#22 AS customer_id#38, c_preferred_cust_flag#25 AS customer_preferred_cust_flag#39, MakeDecimal(sum(UnscaledValue((ss_ext_list_price#31 - ss_ext_discount_amt#30)))#18,18,2) AS year_total#40]
+
+(32) BroadcastExchange
+Input [3]: [customer_id#38, customer_preferred_cust_flag#39, year_total#40]
+Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=5]
+
+(33) BroadcastHashJoin [codegen id : 16]
+Left keys [1]: [customer_id#19]
+Right keys [1]: [customer_id#38]
+Join type: Inner
+Join condition: None
+
+(34) Project [codegen id : 16]
+Output [4]: [customer_id#19, year_total#20, customer_preferred_cust_flag#39, year_total#40]
+Input [5]: [customer_id#19, year_total#20, customer_id#38, customer_preferred_cust_flag#39, year_total#40]
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [8]: [c_customer_sk#41, c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
+ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string,c_preferred_cust_flag:string,c_birth_country:string,c_login:string,c_email_address:string>
+
+(36) CometFilter
+Input [8]: [c_customer_sk#41, c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48]
+Condition : (isnotnull(c_customer_sk#41) AND isnotnull(c_customer_id#42))
+
+(37) ColumnarToRow [codegen id : 10]
+Input [8]: [c_customer_sk#41, c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48]
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [4]: [ws_bill_customer_sk#49, ws_ext_discount_amt#50, ws_ext_list_price#51, ws_sold_date_sk#52]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#52), dynamicpruningexpression(ws_sold_date_sk#52 IN dynamicpruning#53)]
+PushedFilters: [IsNotNull(ws_bill_customer_sk)]
+ReadSchema: struct<ws_bill_customer_sk:int,ws_ext_discount_amt:decimal(7,2),ws_ext_list_price:decimal(7,2)>
+
+(39) CometFilter
+Input [4]: [ws_bill_customer_sk#49, ws_ext_discount_amt#50, ws_ext_list_price#51, ws_sold_date_sk#52]
+Condition : isnotnull(ws_bill_customer_sk#49)
+
+(40) ColumnarToRow [codegen id : 8]
+Input [4]: [ws_bill_customer_sk#49, ws_ext_discount_amt#50, ws_ext_list_price#51, ws_sold_date_sk#52]
+
+(41) BroadcastExchange
+Input [4]: [ws_bill_customer_sk#49, ws_ext_discount_amt#50, ws_ext_list_price#51, ws_sold_date_sk#52]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=6]
+
+(42) BroadcastHashJoin [codegen id : 10]
+Left keys [1]: [c_customer_sk#41]
+Right keys [1]: [ws_bill_customer_sk#49]
+Join type: Inner
+Join condition: None
+
+(43) Project [codegen id : 10]
+Output [10]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, ws_ext_discount_amt#50, ws_ext_list_price#51, ws_sold_date_sk#52]
+Input [12]: [c_customer_sk#41, c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, ws_bill_customer_sk#49, ws_ext_discount_amt#50, ws_ext_list_price#51, ws_sold_date_sk#52]
+
+(44) ReusedExchange [Reuses operator id: 76]
+Output [2]: [d_date_sk#54, d_year#55]
+
+(45) BroadcastHashJoin [codegen id : 10]
+Left keys [1]: [ws_sold_date_sk#52]
+Right keys [1]: [d_date_sk#54]
+Join type: Inner
+Join condition: None
+
+(46) Project [codegen id : 10]
+Output [10]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, ws_ext_discount_amt#50, ws_ext_list_price#51, d_year#55]
+Input [12]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, ws_ext_discount_amt#50, ws_ext_list_price#51, ws_sold_date_sk#52, d_date_sk#54, d_year#55]
+
+(47) HashAggregate [codegen id : 10]
+Input [10]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, ws_ext_discount_amt#50, ws_ext_list_price#51, d_year#55]
+Keys [8]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#55]
+Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#51 - ws_ext_discount_amt#50)))]
+Aggregate Attributes [1]: [sum#56]
+Results [9]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#55, sum#57]
+
+(48) Exchange
+Input [9]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#55, sum#57]
+Arguments: hashpartitioning(c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#55, 5), ENSURE_REQUIREMENTS, [plan_id=7]
+
+(49) HashAggregate [codegen id : 11]
+Input [9]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#55, sum#57]
+Keys [8]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#55]
+Functions [1]: [sum(UnscaledValue((ws_ext_list_price#51 - ws_ext_discount_amt#50)))]
+Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#51 - ws_ext_discount_amt#50)))#58]
+Results [2]: [c_customer_id#42 AS customer_id#59, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#51 - ws_ext_discount_amt#50)))#58,18,2) AS year_total#60]
+
+(50) Filter [codegen id : 11]
+Input [2]: [customer_id#59, year_total#60]
+Condition : (isnotnull(year_total#60) AND (year_total#60 > 0.00))
+
+(51) BroadcastExchange
+Input [2]: [customer_id#59, year_total#60]
+Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=8]
+
+(52) BroadcastHashJoin [codegen id : 16]
+Left keys [1]: [customer_id#19]
+Right keys [1]: [customer_id#59]
+Join type: Inner
+Join condition: None
+
+(53) Project [codegen id : 16]
+Output [5]: [customer_id#19, year_total#20, customer_preferred_cust_flag#39, year_total#40, year_total#60]
+Input [6]: [customer_id#19, year_total#20, customer_preferred_cust_flag#39, year_total#40, customer_id#59, year_total#60]
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [8]: [c_customer_sk#61, c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)]
+ReadSchema: struct<c_customer_sk:int,c_customer_id:string,c_first_name:string,c_last_name:string,c_preferred_cust_flag:string,c_birth_country:string,c_login:string,c_email_address:string>
+
+(55) CometFilter
+Input [8]: [c_customer_sk#61, c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68]
+Condition : (isnotnull(c_customer_sk#61) AND isnotnull(c_customer_id#62))
+
+(56) ColumnarToRow [codegen id : 14]
+Input [8]: [c_customer_sk#61, c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68]
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [4]: [ws_bill_customer_sk#69, ws_ext_discount_amt#70, ws_ext_list_price#71, ws_sold_date_sk#72]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#72), dynamicpruningexpression(ws_sold_date_sk#72 IN dynamicpruning#73)]
+PushedFilters: [IsNotNull(ws_bill_customer_sk)]
+ReadSchema: struct<ws_bill_customer_sk:int,ws_ext_discount_amt:decimal(7,2),ws_ext_list_price:decimal(7,2)>
+
+(58) CometFilter
+Input [4]: [ws_bill_customer_sk#69, ws_ext_discount_amt#70, ws_ext_list_price#71, ws_sold_date_sk#72]
+Condition : isnotnull(ws_bill_customer_sk#69)
+
+(59) ColumnarToRow [codegen id : 12]
+Input [4]: [ws_bill_customer_sk#69, ws_ext_discount_amt#70, ws_ext_list_price#71, ws_sold_date_sk#72]
+
+(60) BroadcastExchange
+Input [4]: [ws_bill_customer_sk#69, ws_ext_discount_amt#70, ws_ext_list_price#71, ws_sold_date_sk#72]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=9]
+
+(61) BroadcastHashJoin [codegen id : 14]
+Left keys [1]: [c_customer_sk#61]
+Right keys [1]: [ws_bill_customer_sk#69]
+Join type: Inner
+Join condition: None
+
+(62) Project [codegen id : 14]
+Output [10]: [c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68, ws_ext_discount_amt#70, ws_ext_list_price#71, ws_sold_date_sk#72]
+Input [12]: [c_customer_sk#61, c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68, ws_bill_customer_sk#69, ws_ext_discount_amt#70, ws_ext_list_price#71, ws_sold_date_sk#72]
+
+(63) ReusedExchange [Reuses operator id: 80]
+Output [2]: [d_date_sk#74, d_year#75]
+
+(64) BroadcastHashJoin [codegen id : 14]
+Left keys [1]: [ws_sold_date_sk#72]
+Right keys [1]: [d_date_sk#74]
+Join type: Inner
+Join condition: None
+
+(65) Project [codegen id : 14]
+Output [10]: [c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68, ws_ext_discount_amt#70, ws_ext_list_price#71, d_year#75]
+Input [12]: [c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68, ws_ext_discount_amt#70, ws_ext_list_price#71, ws_sold_date_sk#72, d_date_sk#74, d_year#75]
+
+(66) HashAggregate [codegen id : 14]
+Input [10]: [c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68, ws_ext_discount_amt#70, ws_ext_list_price#71, d_year#75]
+Keys [8]: [c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68, d_year#75]
+Functions [1]: [partial_sum(UnscaledValue((ws_ext_list_price#71 - ws_ext_discount_amt#70)))]
+Aggregate Attributes [1]: [sum#76]
+Results [9]: [c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68, d_year#75, sum#77]
+
+(67) Exchange
+Input [9]: [c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68, d_year#75, sum#77]
+Arguments: hashpartitioning(c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68, d_year#75, 5), ENSURE_REQUIREMENTS, [plan_id=10]
+
+(68) HashAggregate [codegen id : 15]
+Input [9]: [c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68, d_year#75, sum#77]
+Keys [8]: [c_customer_id#62, c_first_name#63, c_last_name#64, c_preferred_cust_flag#65, c_birth_country#66, c_login#67, c_email_address#68, d_year#75]
+Functions [1]: [sum(UnscaledValue((ws_ext_list_price#71 - ws_ext_discount_amt#70)))]
+Aggregate Attributes [1]: [sum(UnscaledValue((ws_ext_list_price#71 - ws_ext_discount_amt#70)))#58]
+Results [2]: [c_customer_id#62 AS customer_id#78, MakeDecimal(sum(UnscaledValue((ws_ext_list_price#71 - ws_ext_discount_amt#70)))#58,18,2) AS year_total#79]
+
+(69) BroadcastExchange
+Input [2]: [customer_id#78, year_total#79]
+Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [plan_id=11]
+
+(70) BroadcastHashJoin [codegen id : 16]
+Left keys [1]: [customer_id#19]
+Right keys [1]: [customer_id#78]
+Join type: Inner
+Join condition: (CASE WHEN (year_total#60 > 0.00) THEN (year_total#79 / year_total#60) END > CASE WHEN (year_total#20 > 0.00) THEN (year_total#40 / year_total#20) END)
+
+(71) Project [codegen id : 16]
+Output [1]: [customer_preferred_cust_flag#39]
+Input [7]: [customer_id#19, year_total#20, customer_preferred_cust_flag#39, year_total#40, year_total#60, customer_id#78, year_total#79]
+
+(72) TakeOrderedAndProject
+Input [1]: [customer_preferred_cust_flag#39]
+Arguments: 100, [customer_preferred_cust_flag#39 ASC NULLS FIRST], [customer_preferred_cust_flag#39]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13
+BroadcastExchange (76)
++- * ColumnarToRow (75)
+   +- CometFilter (74)
+      +- CometScan parquet spark_catalog.default.date_dim (73)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#14, d_year#15]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int>
+
+(74) CometFilter
+Input [2]: [d_date_sk#14, d_year#15]
+Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2001)) AND isnotnull(d_date_sk#14))
+
+(75) ColumnarToRow [codegen id : 1]
+Input [2]: [d_date_sk#14, d_year#15]
+
+(76) BroadcastExchange
+Input [2]: [d_date_sk#14, d_year#15]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=12]
+
+Subquery:2 Hosting operator id = 20 Hosting Expression = ss_sold_date_sk#32 IN dynamicpruning#33
+BroadcastExchange (80)
++- * ColumnarToRow (79)
+   +- CometFilter (78)
+      +- CometScan parquet spark_catalog.default.date_dim (77)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#34, d_year#35]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int>
+
+(78) CometFilter
+Input [2]: [d_date_sk#34, d_year#35]
+Condition : ((isnotnull(d_year#35) AND (d_year#35 = 2002)) AND isnotnull(d_date_sk#34))
+
+(79) ColumnarToRow [codegen id : 1]
+Input [2]: [d_date_sk#34, d_year#35]
+
+(80) BroadcastExchange
+Input [2]: [d_date_sk#34, d_year#35]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=13]
+
+Subquery:3 Hosting operator id = 38 Hosting Expression = ws_sold_date_sk#52 IN dynamicpruning#13
+
+Subquery:4 Hosting operator id = 57 Hosting Expression = ws_sold_date_sk#72 IN dynamicpruning#33
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt
new file mode 100644
index 0000000..562b5fd
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt
@@ -0,0 +1,123 @@
+TakeOrderedAndProject [customer_preferred_cust_flag]
+  WholeStageCodegen (16)
+    Project [customer_preferred_cust_flag]
+      BroadcastHashJoin [customer_id,customer_id,year_total,year_total,year_total,year_total]
+        Project [customer_id,year_total,customer_preferred_cust_flag,year_total,year_total]
+          BroadcastHashJoin [customer_id,customer_id]
+            Project [customer_id,year_total,customer_preferred_cust_flag,year_total]
+              BroadcastHashJoin [customer_id,customer_id]
+                Filter [year_total]
+                  HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue((ss_ext_list_price - ss_ext_discount_amt))),customer_id,year_total,sum]
+                    InputAdapter
+                      Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #1
+                        WholeStageCodegen (3)
+                          HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum]
+                            Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year]
+                              BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk]
+                                  BroadcastHashJoin [c_customer_sk,ss_customer_sk]
+                                    ColumnarToRow
+                                      InputAdapter
+                                        CometFilter [c_customer_sk,c_customer_id]
+                                          CometScan parquet spark_catalog.default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address]
+                                    InputAdapter
+                                      BroadcastExchange #2
+                                        WholeStageCodegen (1)
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometFilter [ss_customer_sk]
+                                                CometScan parquet spark_catalog.default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk]
+                                                  SubqueryBroadcast [d_date_sk] #1
+                                                    BroadcastExchange #3
+                                                      WholeStageCodegen (1)
+                                                        ColumnarToRow
+                                                          InputAdapter
+                                                            CometFilter [d_year,d_date_sk]
+                                                              CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year]
+                                InputAdapter
+                                  ReusedExchange [d_date_sk,d_year] #3
+                InputAdapter
+                  BroadcastExchange #4
+                    WholeStageCodegen (7)
+                      HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue((ss_ext_list_price - ss_ext_discount_amt))),customer_id,customer_preferred_cust_flag,year_total,sum]
+                        InputAdapter
+                          Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5
+                            WholeStageCodegen (6)
+                              HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum]
+                                Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year]
+                                  BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                    Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk]
+                                      BroadcastHashJoin [c_customer_sk,ss_customer_sk]
+                                        ColumnarToRow
+                                          InputAdapter
+                                            CometFilter [c_customer_sk,c_customer_id]
+                                              CometScan parquet spark_catalog.default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address]
+                                        InputAdapter
+                                          BroadcastExchange #6
+                                            WholeStageCodegen (4)
+                                              ColumnarToRow
+                                                InputAdapter
+                                                  CometFilter [ss_customer_sk]
+                                                    CometScan parquet spark_catalog.default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk]
+                                                      SubqueryBroadcast [d_date_sk] #2
+                                                        BroadcastExchange #7
+                                                          WholeStageCodegen (1)
+                                                            ColumnarToRow
+                                                              InputAdapter
+                                                                CometFilter [d_year,d_date_sk]
+                                                                  CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year]
+                                    InputAdapter
+                                      ReusedExchange [d_date_sk,d_year] #7
+            InputAdapter
+              BroadcastExchange #8
+                WholeStageCodegen (11)
+                  Filter [year_total]
+                    HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum] [sum(UnscaledValue((ws_ext_list_price - ws_ext_discount_amt))),customer_id,year_total,sum]
+                      InputAdapter
+                        Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #9
+                          WholeStageCodegen (10)
+                            HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_discount_amt] [sum,sum]
+                              Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,d_year]
+                                BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
+                                  Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk]
+                                    BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk]
+                                      ColumnarToRow
+                                        InputAdapter
+                                          CometFilter [c_customer_sk,c_customer_id]
+                                            CometScan parquet spark_catalog.default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address]
+                                      InputAdapter
+                                        BroadcastExchange #10
+                                          WholeStageCodegen (8)
+                                            ColumnarToRow
+                                              InputAdapter
+                                                CometFilter [ws_bill_customer_sk]
+                                                  CometScan parquet spark_catalog.default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk]
+                                                    ReusedSubquery [d_date_sk] #1
+                                  InputAdapter
+                                    ReusedExchange [d_date_sk,d_year] #3
+        InputAdapter
+          BroadcastExchange #11
+            WholeStageCodegen (15)
+              HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum] [sum(UnscaledValue((ws_ext_list_price - ws_ext_discount_amt))),customer_id,year_total,sum]
+                InputAdapter
+                  Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #12
+                    WholeStageCodegen (14)
+                      HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_discount_amt] [sum,sum]
+                        Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,d_year]
+                          BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
+                            Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk]
+                              BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk]
+                                ColumnarToRow
+                                  InputAdapter
+                                    CometFilter [c_customer_sk,c_customer_id]
+                                      CometScan parquet spark_catalog.default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address]
+                                InputAdapter
+                                  BroadcastExchange #13
+                                    WholeStageCodegen (12)
+                                      ColumnarToRow
+                                        InputAdapter
+                                          CometFilter [ws_bill_customer_sk]
+                                            CometScan parquet spark_catalog.default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk]
+                                              ReusedSubquery [d_date_sk] #2
+                            InputAdapter
+                              ReusedExchange [d_date_sk,d_year] #7
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/explain.txt
new file mode 100644
index 0000000..23ff8f9
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/explain.txt
@@ -0,0 +1,150 @@
+== Physical Plan ==
+TakeOrderedAndProject (20)
++- * Project (19)
+   +- Window (18)
+      +- * Sort (17)
+         +- Exchange (16)
+            +- * HashAggregate (15)
+               +- Exchange (14)
+                  +- * HashAggregate (13)
+                     +- * Project (12)
+                        +- * BroadcastHashJoin Inner BuildRight (11)
+                           :- * Project (9)
+                           :  +- * BroadcastHashJoin Inner BuildRight (8)
+                           :     :- * ColumnarToRow (3)
+                           :     :  +- CometFilter (2)
+                           :     :     +- CometScan parquet spark_catalog.default.web_sales (1)
+                           :     +- BroadcastExchange (7)
+                           :        +- * ColumnarToRow (6)
+                           :           +- CometFilter (5)
+                           :              +- CometScan parquet spark_catalog.default.item (4)
+                           +- ReusedExchange (10)
+
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)]
+PushedFilters: [IsNotNull(ws_item_sk)]
+ReadSchema: struct<ws_item_sk:int,ws_ext_sales_price:decimal(7,2)>
+
+(2) CometFilter
+Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3]
+Condition : isnotnull(ws_item_sk#1)
+
+(3) ColumnarToRow [codegen id : 3]
+Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [In(i_category, [Books                                             ,Home                                              ,Sports                                            ]), IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_item_id:string,i_item_desc:string,i_current_price:decimal(7,2),i_class:string,i_category:string>
+
+(5) CometFilter
+Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Condition : (i_category#10 IN (Sports                                            ,Books                                             ,Home                                              ) AND isnotnull(i_item_sk#5))
+
+(6) ColumnarToRow [codegen id : 1]
+Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+
+(7) BroadcastExchange
+Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(8) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [ws_item_sk#1]
+Right keys [1]: [i_item_sk#5]
+Join type: Inner
+Join condition: None
+
+(9) Project [codegen id : 3]
+Output [7]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Input [9]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+
+(10) ReusedExchange [Reuses operator id: 25]
+Output [1]: [d_date_sk#11]
+
+(11) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [ws_sold_date_sk#3]
+Right keys [1]: [d_date_sk#11]
+Join type: Inner
+Join condition: None
+
+(12) Project [codegen id : 3]
+Output [6]: [ws_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Input [8]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#11]
+
+(13) HashAggregate [codegen id : 3]
+Input [6]: [ws_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8]
+Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#2))]
+Aggregate Attributes [1]: [sum#12]
+Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#13]
+
+(14) Exchange
+Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#13]
+Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), ENSURE_REQUIREMENTS, [plan_id=2]
+
+(15) HashAggregate [codegen id : 4]
+Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#13]
+Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8]
+Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#2))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#2))#14]
+Results [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#14,17,2) AS itemrevenue#15, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#14,17,2) AS _w0#16, i_item_id#6]
+
+(16) Exchange
+Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, i_item_id#6]
+Arguments: hashpartitioning(i_class#9, 5), ENSURE_REQUIREMENTS, [plan_id=3]
+
+(17) Sort [codegen id : 5]
+Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, i_item_id#6]
+Arguments: [i_class#9 ASC NULLS FIRST], false, 0
+
+(18) Window
+Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, i_item_id#6]
+Arguments: [sum(_w0#16) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#17], [i_class#9]
+
+(19) Project [codegen id : 6]
+Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, ((_w0#16 * 100) / _we0#17) AS revenueratio#18, i_item_id#6]
+Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, i_item_id#6, _we0#17]
+
+(20) TakeOrderedAndProject
+Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, revenueratio#18, i_item_id#6]
+Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#18 ASC NULLS FIRST], [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, revenueratio#18]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4
+BroadcastExchange (25)
++- * ColumnarToRow (24)
+   +- CometProject (23)
+      +- CometFilter (22)
+         +- CometScan parquet spark_catalog.default.date_dim (21)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#11, d_date#19]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_date:date>
+
+(22) CometFilter
+Input [2]: [d_date_sk#11, d_date#19]
+Condition : (((isnotnull(d_date#19) AND (d_date#19 >= 1999-02-22)) AND (d_date#19 <= 1999-03-24)) AND isnotnull(d_date_sk#11))
+
+(23) CometProject
+Input [2]: [d_date_sk#11, d_date#19]
+Arguments: [d_date_sk#11], [d_date_sk#11]
+
+(24) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#11]
+
+(25) BroadcastExchange
+Input [1]: [d_date_sk#11]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/simplified.txt
new file mode 100644
index 0000000..fae1c6d
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/simplified.txt
@@ -0,0 +1,40 @@
+TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_current_price,itemrevenue]
+  WholeStageCodegen (6)
+    Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0,i_item_id]
+      InputAdapter
+        Window [_w0,i_class]
+          WholeStageCodegen (5)
+            Sort [i_class]
+              InputAdapter
+                Exchange [i_class] #1
+                  WholeStageCodegen (4)
+                    HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(ws_ext_sales_price)),itemrevenue,_w0,sum]
+                      InputAdapter
+                        Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #2
+                          WholeStageCodegen (3)
+                            HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ws_ext_sales_price] [sum,sum]
+                              Project [ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category]
+                                BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
+                                  Project [ws_ext_sales_price,ws_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category]
+                                    BroadcastHashJoin [ws_item_sk,i_item_sk]
+                                      ColumnarToRow
+                                        InputAdapter
+                                          CometFilter [ws_item_sk]
+                                            CometScan parquet spark_catalog.default.web_sales [ws_item_sk,ws_ext_sales_price,ws_sold_date_sk]
+                                              SubqueryBroadcast [d_date_sk] #1
+                                                BroadcastExchange #3
+                                                  WholeStageCodegen (1)
+                                                    ColumnarToRow
+                                                      InputAdapter
+                                                        CometProject [d_date_sk]
+                                                          CometFilter [d_date,d_date_sk]
+                                                            CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_date]
+                                      InputAdapter
+                                        BroadcastExchange #4
+                                          WholeStageCodegen (1)
+                                            ColumnarToRow
+                                              InputAdapter
+                                                CometFilter [i_category,i_item_sk]
+                                                  CometScan parquet spark_catalog.default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category]
+                                  InputAdapter
+                                    ReusedExchange [d_date_sk] #3
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/explain.txt
new file mode 100644
index 0000000..7598715
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/explain.txt
@@ -0,0 +1,232 @@
+== Physical Plan ==
+* HashAggregate (34)
++- Exchange (33)
+   +- * HashAggregate (32)
+      +- * Project (31)
+         +- * BroadcastHashJoin Inner BuildRight (30)
+            :- * Project (25)
+            :  +- * BroadcastHashJoin Inner BuildRight (24)
+            :     :- * Project (19)
+            :     :  +- * BroadcastHashJoin Inner BuildRight (18)
+            :     :     :- * Project (16)
+            :     :     :  +- * BroadcastHashJoin Inner BuildRight (15)
+            :     :     :     :- * Project (9)
+            :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (8)
+            :     :     :     :     :- * ColumnarToRow (3)
+            :     :     :     :     :  +- CometFilter (2)
+            :     :     :     :     :     +- CometScan parquet spark_catalog.default.store_sales (1)
+            :     :     :     :     +- BroadcastExchange (7)
+            :     :     :     :        +- * ColumnarToRow (6)
+            :     :     :     :           +- CometFilter (5)
+            :     :     :     :              +- CometScan parquet spark_catalog.default.store (4)
+            :     :     :     +- BroadcastExchange (14)
+            :     :     :        +- * ColumnarToRow (13)
+            :     :     :           +- CometProject (12)
+            :     :     :              +- CometFilter (11)
+            :     :     :                 +- CometScan parquet spark_catalog.default.customer_address (10)
+            :     :     +- ReusedExchange (17)
+            :     +- BroadcastExchange (23)
+            :        +- * ColumnarToRow (22)
+            :           +- CometFilter (21)
+            :              +- CometScan parquet spark_catalog.default.customer_demographics (20)
+            +- BroadcastExchange (29)
+               +- * ColumnarToRow (28)
+                  +- CometFilter (27)
+                     +- CometScan parquet spark_catalog.default.household_demographics (26)
+
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [10]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#10), dynamicpruningexpression(ss_sold_date_sk#10 IN dynamicpruning#11)]
+PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_hdemo_sk), Or(Or(And(GreaterThanOrEqual(ss_net_profit,100.00),LessThanOrEqual(ss_net_profit,200.00)),And(GreaterThanOrEqual(ss_net_profit,150.00),LessThanOrEqual(ss_net_profit,300.00))),And(GreaterThanOrEqual(ss_net_profit,50.00),LessThanOrEqual(ss_net_profit,250.00))), Or(Or(And(GreaterThanOrEqual(ss_sales_price,100.00),LessThanOrEqual(ss_sales_price,150.00)),And(GreaterThanOrEqual(ss_sal [...]
+ReadSchema: struct<ss_cdemo_sk:int,ss_hdemo_sk:int,ss_addr_sk:int,ss_store_sk:int,ss_quantity:int,ss_sales_price:decimal(7,2),ss_ext_sales_price:decimal(7,2),ss_ext_wholesale_cost:decimal(7,2),ss_net_profit:decimal(7,2)>
+
+(2) CometFilter
+Input [10]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10]
+Condition : (((((isnotnull(ss_store_sk#4) AND isnotnull(ss_addr_sk#3)) AND isnotnull(ss_cdemo_sk#1)) AND isnotnull(ss_hdemo_sk#2)) AND ((((ss_net_profit#9 >= 100.00) AND (ss_net_profit#9 <= 200.00)) OR ((ss_net_profit#9 >= 150.00) AND (ss_net_profit#9 <= 300.00))) OR ((ss_net_profit#9 >= 50.00) AND (ss_net_profit#9 <= 250.00)))) AND ((((ss_sales_price#6 >= 100.00) AND (ss_sales_price#6 <= 150.00)) OR ((ss_sales_price#6 >= 50.00) AND (ss_sales_price#6 <= 100.00))) OR ((ss_sales_price#6 >= [...]
+
+(3) ColumnarToRow [codegen id : 6]
+Input [10]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10]
+
+(unknown) Scan parquet spark_catalog.default.store
+Output [1]: [s_store_sk#12]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store]
+PushedFilters: [IsNotNull(s_store_sk)]
+ReadSchema: struct<s_store_sk:int>
+
+(5) CometFilter
+Input [1]: [s_store_sk#12]
+Condition : isnotnull(s_store_sk#12)
+
+(6) ColumnarToRow [codegen id : 1]
+Input [1]: [s_store_sk#12]
+
+(7) BroadcastExchange
+Input [1]: [s_store_sk#12]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(8) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_store_sk#4]
+Right keys [1]: [s_store_sk#12]
+Join type: Inner
+Join condition: None
+
+(9) Project [codegen id : 6]
+Output [9]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10]
+Input [11]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10, s_store_sk#12]
+
+(unknown) Scan parquet spark_catalog.default.customer_address
+Output [3]: [ca_address_sk#13, ca_state#14, ca_country#15]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_address]
+PushedFilters: [IsNotNull(ca_country), EqualTo(ca_country,United States), IsNotNull(ca_address_sk), Or(Or(In(ca_state, [OH,TX]),In(ca_state, [KY,NM,OR])),In(ca_state, [MS,TX,VA]))]
+ReadSchema: struct<ca_address_sk:int,ca_state:string,ca_country:string>
+
+(11) CometFilter
+Input [3]: [ca_address_sk#13, ca_state#14, ca_country#15]
+Condition : (((isnotnull(ca_country#15) AND (ca_country#15 = United States)) AND isnotnull(ca_address_sk#13)) AND ((ca_state#14 IN (TX,OH) OR ca_state#14 IN (OR,NM,KY)) OR ca_state#14 IN (VA,TX,MS)))
+
+(12) CometProject
+Input [3]: [ca_address_sk#13, ca_state#14, ca_country#15]
+Arguments: [ca_address_sk#13, ca_state#14], [ca_address_sk#13, ca_state#14]
+
+(13) ColumnarToRow [codegen id : 2]
+Input [2]: [ca_address_sk#13, ca_state#14]
+
+(14) BroadcastExchange
+Input [2]: [ca_address_sk#13, ca_state#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
+
+(15) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_addr_sk#3]
+Right keys [1]: [ca_address_sk#13]
+Join type: Inner
+Join condition: ((((ca_state#14 IN (TX,OH) AND (ss_net_profit#9 >= 100.00)) AND (ss_net_profit#9 <= 200.00)) OR ((ca_state#14 IN (OR,NM,KY) AND (ss_net_profit#9 >= 150.00)) AND (ss_net_profit#9 <= 300.00))) OR ((ca_state#14 IN (VA,TX,MS) AND (ss_net_profit#9 >= 50.00)) AND (ss_net_profit#9 <= 250.00)))
+
+(16) Project [codegen id : 6]
+Output [7]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_sold_date_sk#10]
+Input [11]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10, ca_address_sk#13, ca_state#14]
+
+(17) ReusedExchange [Reuses operator id: 39]
+Output [1]: [d_date_sk#16]
+
+(18) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_sold_date_sk#10]
+Right keys [1]: [d_date_sk#16]
+Join type: Inner
+Join condition: None
+
+(19) Project [codegen id : 6]
+Output [6]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8]
+Input [8]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_sold_date_sk#10, d_date_sk#16]
+
+(unknown) Scan parquet spark_catalog.default.customer_demographics
+Output [3]: [cd_demo_sk#17, cd_marital_status#18, cd_education_status#19]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_demographics]
+PushedFilters: [IsNotNull(cd_demo_sk), Or(Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Advanced Degree     )),And(EqualTo(cd_marital_status,S),EqualTo(cd_education_status,College             ))),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,2 yr Degree         )))]
+ReadSchema: struct<cd_demo_sk:int,cd_marital_status:string,cd_education_status:string>
+
+(21) CometFilter
+Input [3]: [cd_demo_sk#17, cd_marital_status#18, cd_education_status#19]
+Condition : (isnotnull(cd_demo_sk#17) AND ((((cd_marital_status#18 = M) AND (cd_education_status#19 = Advanced Degree     )) OR ((cd_marital_status#18 = S) AND (cd_education_status#19 = College             ))) OR ((cd_marital_status#18 = W) AND (cd_education_status#19 = 2 yr Degree         ))))
+
+(22) ColumnarToRow [codegen id : 4]
+Input [3]: [cd_demo_sk#17, cd_marital_status#18, cd_education_status#19]
+
+(23) BroadcastExchange
+Input [3]: [cd_demo_sk#17, cd_marital_status#18, cd_education_status#19]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
+
+(24) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_cdemo_sk#1]
+Right keys [1]: [cd_demo_sk#17]
+Join type: Inner
+Join condition: ((((((cd_marital_status#18 = M) AND (cd_education_status#19 = Advanced Degree     )) AND (ss_sales_price#6 >= 100.00)) AND (ss_sales_price#6 <= 150.00)) OR ((((cd_marital_status#18 = S) AND (cd_education_status#19 = College             )) AND (ss_sales_price#6 >= 50.00)) AND (ss_sales_price#6 <= 100.00))) OR ((((cd_marital_status#18 = W) AND (cd_education_status#19 = 2 yr Degree         )) AND (ss_sales_price#6 >= 150.00)) AND (ss_sales_price#6 <= 200.00)))
+
+(25) Project [codegen id : 6]
+Output [7]: [ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, cd_marital_status#18, cd_education_status#19]
+Input [9]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, cd_demo_sk#17, cd_marital_status#18, cd_education_status#19]
+
+(unknown) Scan parquet spark_catalog.default.household_demographics
+Output [2]: [hd_demo_sk#20, hd_dep_count#21]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/household_demographics]
+PushedFilters: [IsNotNull(hd_demo_sk), Or(EqualTo(hd_dep_count,3),EqualTo(hd_dep_count,1))]
+ReadSchema: struct<hd_demo_sk:int,hd_dep_count:int>
+
+(27) CometFilter
+Input [2]: [hd_demo_sk#20, hd_dep_count#21]
+Condition : (isnotnull(hd_demo_sk#20) AND ((hd_dep_count#21 = 3) OR (hd_dep_count#21 = 1)))
+
+(28) ColumnarToRow [codegen id : 5]
+Input [2]: [hd_demo_sk#20, hd_dep_count#21]
+
+(29) BroadcastExchange
+Input [2]: [hd_demo_sk#20, hd_dep_count#21]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
+
+(30) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_hdemo_sk#2]
+Right keys [1]: [hd_demo_sk#20]
+Join type: Inner
+Join condition: (((((((cd_marital_status#18 = M) AND (cd_education_status#19 = Advanced Degree     )) AND (ss_sales_price#6 >= 100.00)) AND (ss_sales_price#6 <= 150.00)) AND (hd_dep_count#21 = 3)) OR (((((cd_marital_status#18 = S) AND (cd_education_status#19 = College             )) AND (ss_sales_price#6 >= 50.00)) AND (ss_sales_price#6 <= 100.00)) AND (hd_dep_count#21 = 1))) OR (((((cd_marital_status#18 = W) AND (cd_education_status#19 = 2 yr Degree         )) AND (ss_sales_price#6 >= 1 [...]
+
+(31) Project [codegen id : 6]
+Output [3]: [ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8]
+Input [9]: [ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, cd_marital_status#18, cd_education_status#19, hd_demo_sk#20, hd_dep_count#21]
+
+(32) HashAggregate [codegen id : 6]
+Input [3]: [ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8]
+Keys: []
+Functions [4]: [partial_avg(ss_quantity#5), partial_avg(UnscaledValue(ss_ext_sales_price#7)), partial_avg(UnscaledValue(ss_ext_wholesale_cost#8)), partial_sum(UnscaledValue(ss_ext_wholesale_cost#8))]
+Aggregate Attributes [7]: [sum#22, count#23, sum#24, count#25, sum#26, count#27, sum#28]
+Results [7]: [sum#29, count#30, sum#31, count#32, sum#33, count#34, sum#35]
+
+(33) Exchange
+Input [7]: [sum#29, count#30, sum#31, count#32, sum#33, count#34, sum#35]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=5]
+
+(34) HashAggregate [codegen id : 7]
+Input [7]: [sum#29, count#30, sum#31, count#32, sum#33, count#34, sum#35]
+Keys: []
+Functions [4]: [avg(ss_quantity#5), avg(UnscaledValue(ss_ext_sales_price#7)), avg(UnscaledValue(ss_ext_wholesale_cost#8)), sum(UnscaledValue(ss_ext_wholesale_cost#8))]
+Aggregate Attributes [4]: [avg(ss_quantity#5)#36, avg(UnscaledValue(ss_ext_sales_price#7))#37, avg(UnscaledValue(ss_ext_wholesale_cost#8))#38, sum(UnscaledValue(ss_ext_wholesale_cost#8))#39]
+Results [4]: [avg(ss_quantity#5)#36 AS avg(ss_quantity)#40, cast((avg(UnscaledValue(ss_ext_sales_price#7))#37 / 100.0) as decimal(11,6)) AS avg(ss_ext_sales_price)#41, cast((avg(UnscaledValue(ss_ext_wholesale_cost#8))#38 / 100.0) as decimal(11,6)) AS avg(ss_ext_wholesale_cost)#42, MakeDecimal(sum(UnscaledValue(ss_ext_wholesale_cost#8))#39,17,2) AS sum(ss_ext_wholesale_cost)#43]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#10 IN dynamicpruning#11
+BroadcastExchange (39)
++- * ColumnarToRow (38)
+   +- CometProject (37)
+      +- CometFilter (36)
+         +- CometScan parquet spark_catalog.default.date_dim (35)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#16, d_year#44]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int>
+
+(36) CometFilter
+Input [2]: [d_date_sk#16, d_year#44]
+Condition : ((isnotnull(d_year#44) AND (d_year#44 = 2001)) AND isnotnull(d_date_sk#16))
+
+(37) CometProject
+Input [2]: [d_date_sk#16, d_year#44]
+Arguments: [d_date_sk#16], [d_date_sk#16]
+
+(38) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#16]
+
+(39) BroadcastExchange
+Input [1]: [d_date_sk#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/simplified.txt
new file mode 100644
index 0000000..5e5fc41
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/simplified.txt
@@ -0,0 +1,59 @@
+WholeStageCodegen (7)
+  HashAggregate [sum,count,sum,count,sum,count,sum] [avg(ss_quantity),avg(UnscaledValue(ss_ext_sales_price)),avg(UnscaledValue(ss_ext_wholesale_cost)),sum(UnscaledValue(ss_ext_wholesale_cost)),avg(ss_quantity),avg(ss_ext_sales_price),avg(ss_ext_wholesale_cost),sum(ss_ext_wholesale_cost),sum,count,sum,count,sum,count,sum]
+    InputAdapter
+      Exchange #1
+        WholeStageCodegen (6)
+          HashAggregate [ss_quantity,ss_ext_sales_price,ss_ext_wholesale_cost] [sum,count,sum,count,sum,count,sum,sum,count,sum,count,sum,count,sum]
+            Project [ss_quantity,ss_ext_sales_price,ss_ext_wholesale_cost]
+              BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk,cd_marital_status,cd_education_status,ss_sales_price,hd_dep_count]
+                Project [ss_hdemo_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost,cd_marital_status,cd_education_status]
+                  BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk,cd_marital_status,cd_education_status,ss_sales_price]
+                    Project [ss_cdemo_sk,ss_hdemo_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost]
+                      BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                        Project [ss_cdemo_sk,ss_hdemo_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost,ss_sold_date_sk]
+                          BroadcastHashJoin [ss_addr_sk,ca_address_sk,ca_state,ss_net_profit]
+                            Project [ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost,ss_net_profit,ss_sold_date_sk]
+                              BroadcastHashJoin [ss_store_sk,s_store_sk]
+                                ColumnarToRow
+                                  InputAdapter
+                                    CometFilter [ss_store_sk,ss_addr_sk,ss_cdemo_sk,ss_hdemo_sk,ss_net_profit,ss_sales_price]
+                                      CometScan parquet spark_catalog.default.store_sales [ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost,ss_net_profit,ss_sold_date_sk]
+                                        SubqueryBroadcast [d_date_sk] #1
+                                          BroadcastExchange #2
+                                            WholeStageCodegen (1)
+                                              ColumnarToRow
+                                                InputAdapter
+                                                  CometProject [d_date_sk]
+                                                    CometFilter [d_year,d_date_sk]
+                                                      CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year]
+                                InputAdapter
+                                  BroadcastExchange #3
+                                    WholeStageCodegen (1)
+                                      ColumnarToRow
+                                        InputAdapter
+                                          CometFilter [s_store_sk]
+                                            CometScan parquet spark_catalog.default.store [s_store_sk]
+                            InputAdapter
+                              BroadcastExchange #4
+                                WholeStageCodegen (2)
+                                  ColumnarToRow
+                                    InputAdapter
+                                      CometProject [ca_address_sk,ca_state]
+                                        CometFilter [ca_country,ca_address_sk,ca_state]
+                                          CometScan parquet spark_catalog.default.customer_address [ca_address_sk,ca_state,ca_country]
+                        InputAdapter
+                          ReusedExchange [d_date_sk] #2
+                    InputAdapter
+                      BroadcastExchange #5
+                        WholeStageCodegen (4)
+                          ColumnarToRow
+                            InputAdapter
+                              CometFilter [cd_demo_sk,cd_marital_status,cd_education_status]
+                                CometScan parquet spark_catalog.default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status]
+                InputAdapter
+                  BroadcastExchange #6
+                    WholeStageCodegen (5)
+                      ColumnarToRow
+                        InputAdapter
+                          CometFilter [hd_demo_sk,hd_dep_count]
+                            CometScan parquet spark_catalog.default.household_demographics [hd_demo_sk,hd_dep_count]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt
new file mode 100644
index 0000000..1323cb8
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt
@@ -0,0 +1,800 @@
+== Physical Plan ==
+TakeOrderedAndProject (105)
++- * HashAggregate (104)
+   +- Exchange (103)
+      +- * HashAggregate (102)
+         +- * Expand (101)
+            +- Union (100)
+               :- * Project (67)
+               :  +- * Filter (66)
+               :     +- * HashAggregate (65)
+               :        +- Exchange (64)
+               :           +- * HashAggregate (63)
+               :              +- * Project (62)
+               :                 +- * BroadcastHashJoin Inner BuildRight (61)
+               :                    :- * Project (59)
+               :                    :  +- * BroadcastHashJoin Inner BuildRight (58)
+               :                    :     :- * BroadcastHashJoin LeftSemi BuildRight (51)
+               :                    :     :  :- * ColumnarToRow (3)
+               :                    :     :  :  +- CometFilter (2)
+               :                    :     :  :     +- CometScan parquet spark_catalog.default.store_sales (1)
+               :                    :     :  +- BroadcastExchange (50)
+               :                    :     :     +- * Project (49)
+               :                    :     :        +- * BroadcastHashJoin Inner BuildRight (48)
+               :                    :     :           :- * ColumnarToRow (6)
+               :                    :     :           :  +- CometFilter (5)
+               :                    :     :           :     +- CometScan parquet spark_catalog.default.item (4)
+               :                    :     :           +- BroadcastExchange (47)
+               :                    :     :              +- * BroadcastHashJoin LeftSemi BuildRight (46)
+               :                    :     :                 :- * HashAggregate (35)
+               :                    :     :                 :  +- Exchange (34)
+               :                    :     :                 :     +- * HashAggregate (33)
+               :                    :     :                 :        +- * Project (32)
+               :                    :     :                 :           +- * BroadcastHashJoin Inner BuildRight (31)
+               :                    :     :                 :              :- * Project (29)
+               :                    :     :                 :              :  +- * BroadcastHashJoin Inner BuildRight (28)
+               :                    :     :                 :              :     :- * ColumnarToRow (9)
+               :                    :     :                 :              :     :  +- CometFilter (8)
+               :                    :     :                 :              :     :     +- CometScan parquet spark_catalog.default.store_sales (7)
+               :                    :     :                 :              :     +- BroadcastExchange (27)
+               :                    :     :                 :              :        +- * BroadcastHashJoin LeftSemi BuildRight (26)
+               :                    :     :                 :              :           :- * ColumnarToRow (12)
+               :                    :     :                 :              :           :  +- CometFilter (11)
+               :                    :     :                 :              :           :     +- CometScan parquet spark_catalog.default.item (10)
+               :                    :     :                 :              :           +- BroadcastExchange (25)
+               :                    :     :                 :              :              +- * Project (24)
+               :                    :     :                 :              :                 +- * BroadcastHashJoin Inner BuildRight (23)
+               :                    :     :                 :              :                    :- * Project (21)
+               :                    :     :                 :              :                    :  +- * BroadcastHashJoin Inner BuildRight (20)
+               :                    :     :                 :              :                    :     :- * ColumnarToRow (15)
+               :                    :     :                 :              :                    :     :  +- CometFilter (14)
+               :                    :     :                 :              :                    :     :     +- CometScan parquet spark_catalog.default.catalog_sales (13)
+               :                    :     :                 :              :                    :     +- BroadcastExchange (19)
+               :                    :     :                 :              :                    :        +- * ColumnarToRow (18)
+               :                    :     :                 :              :                    :           +- CometFilter (17)
+               :                    :     :                 :              :                    :              +- CometScan parquet spark_catalog.default.item (16)
+               :                    :     :                 :              :                    +- ReusedExchange (22)
+               :                    :     :                 :              +- ReusedExchange (30)
+               :                    :     :                 +- BroadcastExchange (45)
+               :                    :     :                    +- * Project (44)
+               :                    :     :                       +- * BroadcastHashJoin Inner BuildRight (43)
+               :                    :     :                          :- * Project (41)
+               :                    :     :                          :  +- * BroadcastHashJoin Inner BuildRight (40)
+               :                    :     :                          :     :- * ColumnarToRow (38)
+               :                    :     :                          :     :  +- CometFilter (37)
+               :                    :     :                          :     :     +- CometScan parquet spark_catalog.default.web_sales (36)
+               :                    :     :                          :     +- ReusedExchange (39)
+               :                    :     :                          +- ReusedExchange (42)
+               :                    :     +- BroadcastExchange (57)
+               :                    :        +- * BroadcastHashJoin LeftSemi BuildRight (56)
+               :                    :           :- * ColumnarToRow (54)
+               :                    :           :  +- CometFilter (53)
+               :                    :           :     +- CometScan parquet spark_catalog.default.item (52)
+               :                    :           +- ReusedExchange (55)
+               :                    +- ReusedExchange (60)
+               :- * Project (83)
+               :  +- * Filter (82)
+               :     +- * HashAggregate (81)
+               :        +- Exchange (80)
+               :           +- * HashAggregate (79)
+               :              +- * Project (78)
+               :                 +- * BroadcastHashJoin Inner BuildRight (77)
+               :                    :- * Project (75)
+               :                    :  +- * BroadcastHashJoin Inner BuildRight (74)
+               :                    :     :- * BroadcastHashJoin LeftSemi BuildRight (72)
+               :                    :     :  :- * ColumnarToRow (70)
+               :                    :     :  :  +- CometFilter (69)
+               :                    :     :  :     +- CometScan parquet spark_catalog.default.catalog_sales (68)
+               :                    :     :  +- ReusedExchange (71)
+               :                    :     +- ReusedExchange (73)
+               :                    +- ReusedExchange (76)
+               +- * Project (99)
+                  +- * Filter (98)
+                     +- * HashAggregate (97)
+                        +- Exchange (96)
+                           +- * HashAggregate (95)
+                              +- * Project (94)
+                                 +- * BroadcastHashJoin Inner BuildRight (93)
+                                    :- * Project (91)
+                                    :  +- * BroadcastHashJoin Inner BuildRight (90)
+                                    :     :- * BroadcastHashJoin LeftSemi BuildRight (88)
+                                    :     :  :- * ColumnarToRow (86)
+                                    :     :  :  +- CometFilter (85)
+                                    :     :  :     +- CometScan parquet spark_catalog.default.web_sales (84)
+                                    :     :  +- ReusedExchange (87)
+                                    :     +- ReusedExchange (89)
+                                    +- ReusedExchange (92)
+
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)]
+PushedFilters: [IsNotNull(ss_item_sk)]
+ReadSchema: struct<ss_item_sk:int,ss_quantity:int,ss_list_price:decimal(7,2)>
+
+(2) CometFilter
+Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4]
+Condition : isnotnull(ss_item_sk#1)
+
+(3) ColumnarToRow [codegen id : 25]
+Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)]
+ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>
+
+(5) CometFilter
+Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9]
+Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9))
+
+(6) ColumnarToRow [codegen id : 11]
+Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9]
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [2]: [ss_item_sk#10, ss_sold_date_sk#11]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#11), dynamicpruningexpression(ss_sold_date_sk#11 IN dynamicpruning#12)]
+PushedFilters: [IsNotNull(ss_item_sk)]
+ReadSchema: struct<ss_item_sk:int>
+
+(8) CometFilter
+Input [2]: [ss_item_sk#10, ss_sold_date_sk#11]
+Condition : isnotnull(ss_item_sk#10)
+
+(9) ColumnarToRow [codegen id : 6]
+Input [2]: [ss_item_sk#10, ss_sold_date_sk#11]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)]
+ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>
+
+(11) CometFilter
+Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16]
+Condition : (((isnotnull(i_item_sk#13) AND isnotnull(i_brand_id#14)) AND isnotnull(i_class_id#15)) AND isnotnull(i_category_id#16))
+
+(12) ColumnarToRow [codegen id : 4]
+Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16]
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [2]: [cs_item_sk#17, cs_sold_date_sk#18]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#19)]
+PushedFilters: [IsNotNull(cs_item_sk)]
+ReadSchema: struct<cs_item_sk:int>
+
+(14) CometFilter
+Input [2]: [cs_item_sk#17, cs_sold_date_sk#18]
+Condition : isnotnull(cs_item_sk#17)
+
+(15) ColumnarToRow [codegen id : 3]
+Input [2]: [cs_item_sk#17, cs_sold_date_sk#18]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [4]: [i_item_sk#20, i_brand_id#21, i_class_id#22, i_category_id#23]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>
+
+(17) CometFilter
+Input [4]: [i_item_sk#20, i_brand_id#21, i_class_id#22, i_category_id#23]
+Condition : isnotnull(i_item_sk#20)
+
+(18) ColumnarToRow [codegen id : 1]
+Input [4]: [i_item_sk#20, i_brand_id#21, i_class_id#22, i_category_id#23]
+
+(19) BroadcastExchange
+Input [4]: [i_item_sk#20, i_brand_id#21, i_class_id#22, i_category_id#23]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(20) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [cs_item_sk#17]
+Right keys [1]: [i_item_sk#20]
+Join type: Inner
+Join condition: None
+
+(21) Project [codegen id : 3]
+Output [4]: [cs_sold_date_sk#18, i_brand_id#21, i_class_id#22, i_category_id#23]
+Input [6]: [cs_item_sk#17, cs_sold_date_sk#18, i_item_sk#20, i_brand_id#21, i_class_id#22, i_category_id#23]
+
+(22) ReusedExchange [Reuses operator id: 134]
+Output [1]: [d_date_sk#24]
+
+(23) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [cs_sold_date_sk#18]
+Right keys [1]: [d_date_sk#24]
+Join type: Inner
+Join condition: None
+
+(24) Project [codegen id : 3]
+Output [3]: [i_brand_id#21, i_class_id#22, i_category_id#23]
+Input [5]: [cs_sold_date_sk#18, i_brand_id#21, i_class_id#22, i_category_id#23, d_date_sk#24]
+
+(25) BroadcastExchange
+Input [3]: [i_brand_id#21, i_class_id#22, i_category_id#23]
+Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [plan_id=2]
+
+(26) BroadcastHashJoin [codegen id : 4]
+Left keys [6]: [coalesce(i_brand_id#14, 0), isnull(i_brand_id#14), coalesce(i_class_id#15, 0), isnull(i_class_id#15), coalesce(i_category_id#16, 0), isnull(i_category_id#16)]
+Right keys [6]: [coalesce(i_brand_id#21, 0), isnull(i_brand_id#21), coalesce(i_class_id#22, 0), isnull(i_class_id#22), coalesce(i_category_id#23, 0), isnull(i_category_id#23)]
+Join type: LeftSemi
+Join condition: None
+
+(27) BroadcastExchange
+Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
+
+(28) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_item_sk#10]
+Right keys [1]: [i_item_sk#13]
+Join type: Inner
+Join condition: None
+
+(29) Project [codegen id : 6]
+Output [4]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16]
+Input [6]: [ss_item_sk#10, ss_sold_date_sk#11, i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16]
+
+(30) ReusedExchange [Reuses operator id: 134]
+Output [1]: [d_date_sk#25]
+
+(31) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_sold_date_sk#11]
+Right keys [1]: [d_date_sk#25]
+Join type: Inner
+Join condition: None
+
+(32) Project [codegen id : 6]
+Output [3]: [i_brand_id#14 AS brand_id#26, i_class_id#15 AS class_id#27, i_category_id#16 AS category_id#28]
+Input [5]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16, d_date_sk#25]
+
+(33) HashAggregate [codegen id : 6]
+Input [3]: [brand_id#26, class_id#27, category_id#28]
+Keys [3]: [brand_id#26, class_id#27, category_id#28]
+Functions: []
+Aggregate Attributes: []
+Results [3]: [brand_id#26, class_id#27, category_id#28]
+
+(34) Exchange
+Input [3]: [brand_id#26, class_id#27, category_id#28]
+Arguments: hashpartitioning(brand_id#26, class_id#27, category_id#28, 5), ENSURE_REQUIREMENTS, [plan_id=4]
+
+(35) HashAggregate [codegen id : 10]
+Input [3]: [brand_id#26, class_id#27, category_id#28]
+Keys [3]: [brand_id#26, class_id#27, category_id#28]
+Functions: []
+Aggregate Attributes: []
+Results [3]: [brand_id#26, class_id#27, category_id#28]
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [2]: [ws_item_sk#29, ws_sold_date_sk#30]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#30), dynamicpruningexpression(ws_sold_date_sk#30 IN dynamicpruning#31)]
+PushedFilters: [IsNotNull(ws_item_sk)]
+ReadSchema: struct<ws_item_sk:int>
+
+(37) CometFilter
+Input [2]: [ws_item_sk#29, ws_sold_date_sk#30]
+Condition : isnotnull(ws_item_sk#29)
+
+(38) ColumnarToRow [codegen id : 9]
+Input [2]: [ws_item_sk#29, ws_sold_date_sk#30]
+
+(39) ReusedExchange [Reuses operator id: 19]
+Output [4]: [i_item_sk#32, i_brand_id#33, i_class_id#34, i_category_id#35]
+
+(40) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [ws_item_sk#29]
+Right keys [1]: [i_item_sk#32]
+Join type: Inner
+Join condition: None
+
+(41) Project [codegen id : 9]
+Output [4]: [ws_sold_date_sk#30, i_brand_id#33, i_class_id#34, i_category_id#35]
+Input [6]: [ws_item_sk#29, ws_sold_date_sk#30, i_item_sk#32, i_brand_id#33, i_class_id#34, i_category_id#35]
+
+(42) ReusedExchange [Reuses operator id: 134]
+Output [1]: [d_date_sk#36]
+
+(43) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [ws_sold_date_sk#30]
+Right keys [1]: [d_date_sk#36]
+Join type: Inner
+Join condition: None
+
+(44) Project [codegen id : 9]
+Output [3]: [i_brand_id#33, i_class_id#34, i_category_id#35]
+Input [5]: [ws_sold_date_sk#30, i_brand_id#33, i_class_id#34, i_category_id#35, d_date_sk#36]
+
+(45) BroadcastExchange
+Input [3]: [i_brand_id#33, i_class_id#34, i_category_id#35]
+Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [plan_id=5]
+
+(46) BroadcastHashJoin [codegen id : 10]
+Left keys [6]: [coalesce(brand_id#26, 0), isnull(brand_id#26), coalesce(class_id#27, 0), isnull(class_id#27), coalesce(category_id#28, 0), isnull(category_id#28)]
+Right keys [6]: [coalesce(i_brand_id#33, 0), isnull(i_brand_id#33), coalesce(i_class_id#34, 0), isnull(i_class_id#34), coalesce(i_category_id#35, 0), isnull(i_category_id#35)]
+Join type: LeftSemi
+Join condition: None
+
+(47) BroadcastExchange
+Input [3]: [brand_id#26, class_id#27, category_id#28]
+Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [plan_id=6]
+
+(48) BroadcastHashJoin [codegen id : 11]
+Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9]
+Right keys [3]: [brand_id#26, class_id#27, category_id#28]
+Join type: Inner
+Join condition: None
+
+(49) Project [codegen id : 11]
+Output [1]: [i_item_sk#6 AS ss_item_sk#37]
+Input [7]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, brand_id#26, class_id#27, category_id#28]
+
+(50) BroadcastExchange
+Input [1]: [ss_item_sk#37]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
+
+(51) BroadcastHashJoin [codegen id : 25]
+Left keys [1]: [ss_item_sk#1]
+Right keys [1]: [ss_item_sk#37]
+Join type: LeftSemi
+Join condition: None
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [4]: [i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>
+
+(53) CometFilter
+Input [4]: [i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]
+Condition : isnotnull(i_item_sk#38)
+
+(54) ColumnarToRow [codegen id : 23]
+Input [4]: [i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]
+
+(55) ReusedExchange [Reuses operator id: 50]
+Output [1]: [ss_item_sk#37]
+
+(56) BroadcastHashJoin [codegen id : 23]
+Left keys [1]: [i_item_sk#38]
+Right keys [1]: [ss_item_sk#37]
+Join type: LeftSemi
+Join condition: None
+
+(57) BroadcastExchange
+Input [4]: [i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=8]
+
+(58) BroadcastHashJoin [codegen id : 25]
+Left keys [1]: [ss_item_sk#1]
+Right keys [1]: [i_item_sk#38]
+Join type: Inner
+Join condition: None
+
+(59) Project [codegen id : 25]
+Output [6]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#39, i_class_id#40, i_category_id#41]
+Input [8]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]
+
+(60) ReusedExchange [Reuses operator id: 129]
+Output [1]: [d_date_sk#42]
+
+(61) BroadcastHashJoin [codegen id : 25]
+Left keys [1]: [ss_sold_date_sk#4]
+Right keys [1]: [d_date_sk#42]
+Join type: Inner
+Join condition: None
+
+(62) Project [codegen id : 25]
+Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#39, i_class_id#40, i_category_id#41]
+Input [7]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#39, i_class_id#40, i_category_id#41, d_date_sk#42]
+
+(63) HashAggregate [codegen id : 25]
+Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#39, i_class_id#40, i_category_id#41]
+Keys [3]: [i_brand_id#39, i_class_id#40, i_category_id#41]
+Functions [2]: [partial_sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3)), partial_count(1)]
+Aggregate Attributes [3]: [sum#43, isEmpty#44, count#45]
+Results [6]: [i_brand_id#39, i_class_id#40, i_category_id#41, sum#46, isEmpty#47, count#48]
+
+(64) Exchange
+Input [6]: [i_brand_id#39, i_class_id#40, i_category_id#41, sum#46, isEmpty#47, count#48]
+Arguments: hashpartitioning(i_brand_id#39, i_class_id#40, i_category_id#41, 5), ENSURE_REQUIREMENTS, [plan_id=9]
+
+(65) HashAggregate [codegen id : 26]
+Input [6]: [i_brand_id#39, i_class_id#40, i_category_id#41, sum#46, isEmpty#47, count#48]
+Keys [3]: [i_brand_id#39, i_class_id#40, i_category_id#41]
+Functions [2]: [sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3)), count(1)]
+Aggregate Attributes [2]: [sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3))#49, count(1)#50]
+Results [5]: [i_brand_id#39, i_class_id#40, i_category_id#41, sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3))#49 AS sales#51, count(1)#50 AS number_sales#52]
+
+(66) Filter [codegen id : 26]
+Input [5]: [i_brand_id#39, i_class_id#40, i_category_id#41, sales#51, number_sales#52]
+Condition : (isnotnull(sales#51) AND (cast(sales#51 as decimal(32,6)) > cast(Subquery scalar-subquery#53, [id=#54] as decimal(32,6))))
+
+(67) Project [codegen id : 26]
+Output [6]: [sales#51, number_sales#52, store AS channel#55, i_brand_id#39 AS i_brand_id#56, i_class_id#40 AS i_class_id#57, i_category_id#41 AS i_category_id#58]
+Input [5]: [i_brand_id#39, i_class_id#40, i_category_id#41, sales#51, number_sales#52]
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [4]: [cs_item_sk#59, cs_quantity#60, cs_list_price#61, cs_sold_date_sk#62]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#62), dynamicpruningexpression(cs_sold_date_sk#62 IN dynamicpruning#63)]
+PushedFilters: [IsNotNull(cs_item_sk)]
+ReadSchema: struct<cs_item_sk:int,cs_quantity:int,cs_list_price:decimal(7,2)>
+
+(69) CometFilter
+Input [4]: [cs_item_sk#59, cs_quantity#60, cs_list_price#61, cs_sold_date_sk#62]
+Condition : isnotnull(cs_item_sk#59)
+
+(70) ColumnarToRow [codegen id : 51]
+Input [4]: [cs_item_sk#59, cs_quantity#60, cs_list_price#61, cs_sold_date_sk#62]
+
+(71) ReusedExchange [Reuses operator id: 50]
+Output [1]: [ss_item_sk#37]
+
+(72) BroadcastHashJoin [codegen id : 51]
+Left keys [1]: [cs_item_sk#59]
+Right keys [1]: [ss_item_sk#37]
+Join type: LeftSemi
+Join condition: None
+
+(73) ReusedExchange [Reuses operator id: 57]
+Output [4]: [i_item_sk#64, i_brand_id#65, i_class_id#66, i_category_id#67]
+
+(74) BroadcastHashJoin [codegen id : 51]
+Left keys [1]: [cs_item_sk#59]
+Right keys [1]: [i_item_sk#64]
+Join type: Inner
+Join condition: None
+
+(75) Project [codegen id : 51]
+Output [6]: [cs_quantity#60, cs_list_price#61, cs_sold_date_sk#62, i_brand_id#65, i_class_id#66, i_category_id#67]
+Input [8]: [cs_item_sk#59, cs_quantity#60, cs_list_price#61, cs_sold_date_sk#62, i_item_sk#64, i_brand_id#65, i_class_id#66, i_category_id#67]
+
+(76) ReusedExchange [Reuses operator id: 129]
+Output [1]: [d_date_sk#68]
+
+(77) BroadcastHashJoin [codegen id : 51]
+Left keys [1]: [cs_sold_date_sk#62]
+Right keys [1]: [d_date_sk#68]
+Join type: Inner
+Join condition: None
+
+(78) Project [codegen id : 51]
+Output [5]: [cs_quantity#60, cs_list_price#61, i_brand_id#65, i_class_id#66, i_category_id#67]
+Input [7]: [cs_quantity#60, cs_list_price#61, cs_sold_date_sk#62, i_brand_id#65, i_class_id#66, i_category_id#67, d_date_sk#68]
+
+(79) HashAggregate [codegen id : 51]
+Input [5]: [cs_quantity#60, cs_list_price#61, i_brand_id#65, i_class_id#66, i_category_id#67]
+Keys [3]: [i_brand_id#65, i_class_id#66, i_category_id#67]
+Functions [2]: [partial_sum((cast(cs_quantity#60 as decimal(10,0)) * cs_list_price#61)), partial_count(1)]
+Aggregate Attributes [3]: [sum#69, isEmpty#70, count#71]
+Results [6]: [i_brand_id#65, i_class_id#66, i_category_id#67, sum#72, isEmpty#73, count#74]
+
+(80) Exchange
+Input [6]: [i_brand_id#65, i_class_id#66, i_category_id#67, sum#72, isEmpty#73, count#74]
+Arguments: hashpartitioning(i_brand_id#65, i_class_id#66, i_category_id#67, 5), ENSURE_REQUIREMENTS, [plan_id=10]
+
+(81) HashAggregate [codegen id : 52]
+Input [6]: [i_brand_id#65, i_class_id#66, i_category_id#67, sum#72, isEmpty#73, count#74]
+Keys [3]: [i_brand_id#65, i_class_id#66, i_category_id#67]
+Functions [2]: [sum((cast(cs_quantity#60 as decimal(10,0)) * cs_list_price#61)), count(1)]
+Aggregate Attributes [2]: [sum((cast(cs_quantity#60 as decimal(10,0)) * cs_list_price#61))#75, count(1)#76]
+Results [5]: [i_brand_id#65, i_class_id#66, i_category_id#67, sum((cast(cs_quantity#60 as decimal(10,0)) * cs_list_price#61))#75 AS sales#77, count(1)#76 AS number_sales#78]
+
+(82) Filter [codegen id : 52]
+Input [5]: [i_brand_id#65, i_class_id#66, i_category_id#67, sales#77, number_sales#78]
+Condition : (isnotnull(sales#77) AND (cast(sales#77 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#53, [id=#54] as decimal(32,6))))
+
+(83) Project [codegen id : 52]
+Output [6]: [sales#77, number_sales#78, catalog AS channel#79, i_brand_id#65, i_class_id#66, i_category_id#67]
+Input [5]: [i_brand_id#65, i_class_id#66, i_category_id#67, sales#77, number_sales#78]
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [4]: [ws_item_sk#80, ws_quantity#81, ws_list_price#82, ws_sold_date_sk#83]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#83), dynamicpruningexpression(ws_sold_date_sk#83 IN dynamicpruning#84)]
+PushedFilters: [IsNotNull(ws_item_sk)]
+ReadSchema: struct<ws_item_sk:int,ws_quantity:int,ws_list_price:decimal(7,2)>
+
+(85) CometFilter
+Input [4]: [ws_item_sk#80, ws_quantity#81, ws_list_price#82, ws_sold_date_sk#83]
+Condition : isnotnull(ws_item_sk#80)
+
+(86) ColumnarToRow [codegen id : 77]
+Input [4]: [ws_item_sk#80, ws_quantity#81, ws_list_price#82, ws_sold_date_sk#83]
+
+(87) ReusedExchange [Reuses operator id: 50]
+Output [1]: [ss_item_sk#37]
+
+(88) BroadcastHashJoin [codegen id : 77]
+Left keys [1]: [ws_item_sk#80]
+Right keys [1]: [ss_item_sk#37]
+Join type: LeftSemi
+Join condition: None
+
+(89) ReusedExchange [Reuses operator id: 57]
+Output [4]: [i_item_sk#85, i_brand_id#86, i_class_id#87, i_category_id#88]
+
+(90) BroadcastHashJoin [codegen id : 77]
+Left keys [1]: [ws_item_sk#80]
+Right keys [1]: [i_item_sk#85]
+Join type: Inner
+Join condition: None
+
+(91) Project [codegen id : 77]
+Output [6]: [ws_quantity#81, ws_list_price#82, ws_sold_date_sk#83, i_brand_id#86, i_class_id#87, i_category_id#88]
+Input [8]: [ws_item_sk#80, ws_quantity#81, ws_list_price#82, ws_sold_date_sk#83, i_item_sk#85, i_brand_id#86, i_class_id#87, i_category_id#88]
+
+(92) ReusedExchange [Reuses operator id: 129]
+Output [1]: [d_date_sk#89]
+
+(93) BroadcastHashJoin [codegen id : 77]
+Left keys [1]: [ws_sold_date_sk#83]
+Right keys [1]: [d_date_sk#89]
+Join type: Inner
+Join condition: None
+
+(94) Project [codegen id : 77]
+Output [5]: [ws_quantity#81, ws_list_price#82, i_brand_id#86, i_class_id#87, i_category_id#88]
+Input [7]: [ws_quantity#81, ws_list_price#82, ws_sold_date_sk#83, i_brand_id#86, i_class_id#87, i_category_id#88, d_date_sk#89]
+
+(95) HashAggregate [codegen id : 77]
+Input [5]: [ws_quantity#81, ws_list_price#82, i_brand_id#86, i_class_id#87, i_category_id#88]
+Keys [3]: [i_brand_id#86, i_class_id#87, i_category_id#88]
+Functions [2]: [partial_sum((cast(ws_quantity#81 as decimal(10,0)) * ws_list_price#82)), partial_count(1)]
+Aggregate Attributes [3]: [sum#90, isEmpty#91, count#92]
+Results [6]: [i_brand_id#86, i_class_id#87, i_category_id#88, sum#93, isEmpty#94, count#95]
+
+(96) Exchange
+Input [6]: [i_brand_id#86, i_class_id#87, i_category_id#88, sum#93, isEmpty#94, count#95]
+Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, 5), ENSURE_REQUIREMENTS, [plan_id=11]
+
+(97) HashAggregate [codegen id : 78]
+Input [6]: [i_brand_id#86, i_class_id#87, i_category_id#88, sum#93, isEmpty#94, count#95]
+Keys [3]: [i_brand_id#86, i_class_id#87, i_category_id#88]
+Functions [2]: [sum((cast(ws_quantity#81 as decimal(10,0)) * ws_list_price#82)), count(1)]
+Aggregate Attributes [2]: [sum((cast(ws_quantity#81 as decimal(10,0)) * ws_list_price#82))#96, count(1)#97]
+Results [5]: [i_brand_id#86, i_class_id#87, i_category_id#88, sum((cast(ws_quantity#81 as decimal(10,0)) * ws_list_price#82))#96 AS sales#98, count(1)#97 AS number_sales#99]
+
+(98) Filter [codegen id : 78]
+Input [5]: [i_brand_id#86, i_class_id#87, i_category_id#88, sales#98, number_sales#99]
+Condition : (isnotnull(sales#98) AND (cast(sales#98 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#53, [id=#54] as decimal(32,6))))
+
+(99) Project [codegen id : 78]
+Output [6]: [sales#98, number_sales#99, web AS channel#100, i_brand_id#86, i_class_id#87, i_category_id#88]
+Input [5]: [i_brand_id#86, i_class_id#87, i_category_id#88, sales#98, number_sales#99]
+
+(100) Union
+
+(101) Expand [codegen id : 79]
+Input [6]: [sales#51, number_sales#52, channel#55, i_brand_id#56, i_class_id#57, i_category_id#58]
+Arguments: [[sales#51, number_sales#52, channel#55, i_brand_id#56, i_class_id#57, i_category_id#58, 0], [sales#51, number_sales#52, channel#55, i_brand_id#56, i_class_id#57, null, 1], [sales#51, number_sales#52, channel#55, i_brand_id#56, null, null, 3], [sales#51, number_sales#52, channel#55, null, null, null, 7], [sales#51, number_sales#52, null, null, null, null, 15]], [sales#51, number_sales#52, channel#101, i_brand_id#102, i_class_id#103, i_category_id#104, spark_grouping_id#105]
+
+(102) HashAggregate [codegen id : 79]
+Input [7]: [sales#51, number_sales#52, channel#101, i_brand_id#102, i_class_id#103, i_category_id#104, spark_grouping_id#105]
+Keys [5]: [channel#101, i_brand_id#102, i_class_id#103, i_category_id#104, spark_grouping_id#105]
+Functions [2]: [partial_sum(sales#51), partial_sum(number_sales#52)]
+Aggregate Attributes [3]: [sum#106, isEmpty#107, sum#108]
+Results [8]: [channel#101, i_brand_id#102, i_class_id#103, i_category_id#104, spark_grouping_id#105, sum#109, isEmpty#110, sum#111]
+
+(103) Exchange
+Input [8]: [channel#101, i_brand_id#102, i_class_id#103, i_category_id#104, spark_grouping_id#105, sum#109, isEmpty#110, sum#111]
+Arguments: hashpartitioning(channel#101, i_brand_id#102, i_class_id#103, i_category_id#104, spark_grouping_id#105, 5), ENSURE_REQUIREMENTS, [plan_id=12]
+
+(104) HashAggregate [codegen id : 80]
+Input [8]: [channel#101, i_brand_id#102, i_class_id#103, i_category_id#104, spark_grouping_id#105, sum#109, isEmpty#110, sum#111]
+Keys [5]: [channel#101, i_brand_id#102, i_class_id#103, i_category_id#104, spark_grouping_id#105]
+Functions [2]: [sum(sales#51), sum(number_sales#52)]
+Aggregate Attributes [2]: [sum(sales#51)#112, sum(number_sales#52)#113]
+Results [6]: [channel#101, i_brand_id#102, i_class_id#103, i_category_id#104, sum(sales#51)#112 AS sum(sales)#114, sum(number_sales#52)#113 AS sum(number_sales)#115]
+
+(105) TakeOrderedAndProject
+Input [6]: [channel#101, i_brand_id#102, i_class_id#103, i_category_id#104, sum(sales)#114, sum(number_sales)#115]
+Arguments: 100, [channel#101 ASC NULLS FIRST, i_brand_id#102 ASC NULLS FIRST, i_class_id#103 ASC NULLS FIRST, i_category_id#104 ASC NULLS FIRST], [channel#101, i_brand_id#102, i_class_id#103, i_category_id#104, sum(sales)#114, sum(number_sales)#115]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 66 Hosting Expression = Subquery scalar-subquery#53, [id=#54]
+* HashAggregate (124)
++- Exchange (123)
+   +- * HashAggregate (122)
+      +- Union (121)
+         :- * Project (110)
+         :  +- * BroadcastHashJoin Inner BuildRight (109)
+         :     :- * ColumnarToRow (107)
+         :     :  +- CometScan parquet spark_catalog.default.store_sales (106)
+         :     +- ReusedExchange (108)
+         :- * Project (115)
+         :  +- * BroadcastHashJoin Inner BuildRight (114)
+         :     :- * ColumnarToRow (112)
+         :     :  +- CometScan parquet spark_catalog.default.catalog_sales (111)
+         :     +- ReusedExchange (113)
+         +- * Project (120)
+            +- * BroadcastHashJoin Inner BuildRight (119)
+               :- * ColumnarToRow (117)
+               :  +- CometScan parquet spark_catalog.default.web_sales (116)
+               +- ReusedExchange (118)
+
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [3]: [ss_quantity#116, ss_list_price#117, ss_sold_date_sk#118]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#118), dynamicpruningexpression(ss_sold_date_sk#118 IN dynamicpruning#119)]
+ReadSchema: struct<ss_quantity:int,ss_list_price:decimal(7,2)>
+
+(107) ColumnarToRow [codegen id : 2]
+Input [3]: [ss_quantity#116, ss_list_price#117, ss_sold_date_sk#118]
+
+(108) ReusedExchange [Reuses operator id: 134]
+Output [1]: [d_date_sk#120]
+
+(109) BroadcastHashJoin [codegen id : 2]
+Left keys [1]: [ss_sold_date_sk#118]
+Right keys [1]: [d_date_sk#120]
+Join type: Inner
+Join condition: None
+
+(110) Project [codegen id : 2]
+Output [2]: [ss_quantity#116 AS quantity#121, ss_list_price#117 AS list_price#122]
+Input [4]: [ss_quantity#116, ss_list_price#117, ss_sold_date_sk#118, d_date_sk#120]
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [3]: [cs_quantity#123, cs_list_price#124, cs_sold_date_sk#125]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#125), dynamicpruningexpression(cs_sold_date_sk#125 IN dynamicpruning#126)]
+ReadSchema: struct<cs_quantity:int,cs_list_price:decimal(7,2)>
+
+(112) ColumnarToRow [codegen id : 4]
+Input [3]: [cs_quantity#123, cs_list_price#124, cs_sold_date_sk#125]
+
+(113) ReusedExchange [Reuses operator id: 134]
+Output [1]: [d_date_sk#127]
+
+(114) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [cs_sold_date_sk#125]
+Right keys [1]: [d_date_sk#127]
+Join type: Inner
+Join condition: None
+
+(115) Project [codegen id : 4]
+Output [2]: [cs_quantity#123 AS quantity#128, cs_list_price#124 AS list_price#129]
+Input [4]: [cs_quantity#123, cs_list_price#124, cs_sold_date_sk#125, d_date_sk#127]
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [3]: [ws_quantity#130, ws_list_price#131, ws_sold_date_sk#132]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#132), dynamicpruningexpression(ws_sold_date_sk#132 IN dynamicpruning#133)]
+ReadSchema: struct<ws_quantity:int,ws_list_price:decimal(7,2)>
+
+(117) ColumnarToRow [codegen id : 6]
+Input [3]: [ws_quantity#130, ws_list_price#131, ws_sold_date_sk#132]
+
+(118) ReusedExchange [Reuses operator id: 134]
+Output [1]: [d_date_sk#134]
+
+(119) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ws_sold_date_sk#132]
+Right keys [1]: [d_date_sk#134]
+Join type: Inner
+Join condition: None
+
+(120) Project [codegen id : 6]
+Output [2]: [ws_quantity#130 AS quantity#135, ws_list_price#131 AS list_price#136]
+Input [4]: [ws_quantity#130, ws_list_price#131, ws_sold_date_sk#132, d_date_sk#134]
+
+(121) Union
+
+(122) HashAggregate [codegen id : 7]
+Input [2]: [quantity#121, list_price#122]
+Keys: []
+Functions [1]: [partial_avg((cast(quantity#121 as decimal(10,0)) * list_price#122))]
+Aggregate Attributes [2]: [sum#137, count#138]
+Results [2]: [sum#139, count#140]
+
+(123) Exchange
+Input [2]: [sum#139, count#140]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=13]
+
+(124) HashAggregate [codegen id : 8]
+Input [2]: [sum#139, count#140]
+Keys: []
+Functions [1]: [avg((cast(quantity#121 as decimal(10,0)) * list_price#122))]
+Aggregate Attributes [1]: [avg((cast(quantity#121 as decimal(10,0)) * list_price#122))#141]
+Results [1]: [avg((cast(quantity#121 as decimal(10,0)) * list_price#122))#141 AS average_sales#142]
+
+Subquery:2 Hosting operator id = 106 Hosting Expression = ss_sold_date_sk#118 IN dynamicpruning#12
+
+Subquery:3 Hosting operator id = 111 Hosting Expression = cs_sold_date_sk#125 IN dynamicpruning#12
+
+Subquery:4 Hosting operator id = 116 Hosting Expression = ws_sold_date_sk#132 IN dynamicpruning#12
+
+Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5
+BroadcastExchange (129)
++- * ColumnarToRow (128)
+   +- CometProject (127)
+      +- CometFilter (126)
+         +- CometScan parquet spark_catalog.default.date_dim (125)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [3]: [d_date_sk#42, d_year#143, d_moy#144]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,11), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
+
+(126) CometFilter
+Input [3]: [d_date_sk#42, d_year#143, d_moy#144]
+Condition : ((((isnotnull(d_year#143) AND isnotnull(d_moy#144)) AND (d_year#143 = 2001)) AND (d_moy#144 = 11)) AND isnotnull(d_date_sk#42))
+
+(127) CometProject
+Input [3]: [d_date_sk#42, d_year#143, d_moy#144]
+Arguments: [d_date_sk#42], [d_date_sk#42]
+
+(128) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#42]
+
+(129) BroadcastExchange
+Input [1]: [d_date_sk#42]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=14]
+
+Subquery:6 Hosting operator id = 7 Hosting Expression = ss_sold_date_sk#11 IN dynamicpruning#12
+BroadcastExchange (134)
++- * ColumnarToRow (133)
+   +- CometProject (132)
+      +- CometFilter (131)
+         +- CometScan parquet spark_catalog.default.date_dim (130)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#25, d_year#145]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int>
+
+(131) CometFilter
+Input [2]: [d_date_sk#25, d_year#145]
+Condition : (((isnotnull(d_year#145) AND (d_year#145 >= 1999)) AND (d_year#145 <= 2001)) AND isnotnull(d_date_sk#25))
+
+(132) CometProject
+Input [2]: [d_date_sk#25, d_year#145]
+Arguments: [d_date_sk#25], [d_date_sk#25]
+
+(133) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#25]
+
+(134) BroadcastExchange
+Input [1]: [d_date_sk#25]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=15]
+
+Subquery:7 Hosting operator id = 13 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#12
+
+Subquery:8 Hosting operator id = 36 Hosting Expression = ws_sold_date_sk#30 IN dynamicpruning#12
+
+Subquery:9 Hosting operator id = 82 Hosting Expression = ReusedSubquery Subquery scalar-subquery#53, [id=#54]
+
+Subquery:10 Hosting operator id = 68 Hosting Expression = cs_sold_date_sk#62 IN dynamicpruning#5
+
+Subquery:11 Hosting operator id = 98 Hosting Expression = ReusedSubquery Subquery scalar-subquery#53, [id=#54]
+
+Subquery:12 Hosting operator id = 84 Hosting Expression = ws_sold_date_sk#83 IN dynamicpruning#5
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt
new file mode 100644
index 0000000..cf688c4
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt
@@ -0,0 +1,214 @@
+TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),sum(number_sales)]
+  WholeStageCodegen (80)
+    HashAggregate [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum(sales),sum(number_sales),sum,isEmpty,sum]
+      InputAdapter
+        Exchange [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id] #1
+          WholeStageCodegen (79)
+            HashAggregate [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum]
+              Expand [sales,number_sales,channel,i_brand_id,i_class_id,i_category_id]
+                InputAdapter
+                  Union
+                    WholeStageCodegen (26)
+                      Project [sales,number_sales,i_brand_id,i_class_id,i_category_id]
+                        Filter [sales]
+                          Subquery #3
+                            WholeStageCodegen (8)
+                              HashAggregate [sum,count] [avg((cast(quantity as decimal(10,0)) * list_price)),average_sales,sum,count]
+                                InputAdapter
+                                  Exchange #13
+                                    WholeStageCodegen (7)
+                                      HashAggregate [quantity,list_price] [sum,count,sum,count]
+                                        InputAdapter
+                                          Union
+                                            WholeStageCodegen (2)
+                                              Project [ss_quantity,ss_list_price]
+                                                BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                                  ColumnarToRow
+                                                    InputAdapter
+                                                      CometScan parquet spark_catalog.default.store_sales [ss_quantity,ss_list_price,ss_sold_date_sk]
+                                                        ReusedSubquery [d_date_sk] #2
+                                                  InputAdapter
+                                                    ReusedExchange [d_date_sk] #7
+                                            WholeStageCodegen (4)
+                                              Project [cs_quantity,cs_list_price]
+                                                BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                                                  ColumnarToRow
+                                                    InputAdapter
+                                                      CometScan parquet spark_catalog.default.catalog_sales [cs_quantity,cs_list_price,cs_sold_date_sk]
+                                                        ReusedSubquery [d_date_sk] #2
+                                                  InputAdapter
+                                                    ReusedExchange [d_date_sk] #7
+                                            WholeStageCodegen (6)
+                                              Project [ws_quantity,ws_list_price]
+                                                BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
+                                                  ColumnarToRow
+                                                    InputAdapter
+                                                      CometScan parquet spark_catalog.default.web_sales [ws_quantity,ws_list_price,ws_sold_date_sk]
+                                                        ReusedSubquery [d_date_sk] #2
+                                                  InputAdapter
+                                                    ReusedExchange [d_date_sk] #7
+                          HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum((cast(ss_quantity as decimal(10,0)) * ss_list_price)),count(1),sales,number_sales,sum,isEmpty,count]
+                            InputAdapter
+                              Exchange [i_brand_id,i_class_id,i_category_id] #2
+                                WholeStageCodegen (25)
+                                  HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count]
+                                    Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id]
+                                      BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                        Project [ss_quantity,ss_list_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id]
+                                          BroadcastHashJoin [ss_item_sk,i_item_sk]
+                                            BroadcastHashJoin [ss_item_sk,ss_item_sk]
+                                              ColumnarToRow
+                                                InputAdapter
+                                                  CometFilter [ss_item_sk]
+                                                    CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk]
+                                                      SubqueryBroadcast [d_date_sk] #1
+                                                        BroadcastExchange #3
+                                                          WholeStageCodegen (1)
+                                                            ColumnarToRow
+                                                              InputAdapter
+                                                                CometProject [d_date_sk]
+                                                                  CometFilter [d_year,d_moy,d_date_sk]
+                                                                    CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year,d_moy]
+                                              InputAdapter
+                                                BroadcastExchange #4
+                                                  WholeStageCodegen (11)
+                                                    Project [i_item_sk]
+                                                      BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id]
+                                                        ColumnarToRow
+                                                          InputAdapter
+                                                            CometFilter [i_brand_id,i_class_id,i_category_id]
+                                                              CometScan parquet spark_catalog.default.item [i_item_sk,i_brand_id,i_class_id,i_category_id]
+                                                        InputAdapter
+                                                          BroadcastExchange #5
+                                                            WholeStageCodegen (10)
+                                                              BroadcastHashJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id]
+                                                                HashAggregate [brand_id,class_id,category_id]
+                                                                  InputAdapter
+                                                                    Exchange [brand_id,class_id,category_id] #6
+                                                                      WholeStageCodegen (6)
+                                                                        HashAggregate [brand_id,class_id,category_id]
+                                                                          Project [i_brand_id,i_class_id,i_category_id]
+                                                                            BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                                                              Project [ss_sold_date_sk,i_brand_id,i_class_id,i_category_id]
+                                                                                BroadcastHashJoin [ss_item_sk,i_item_sk]
+                                                                                  ColumnarToRow
+                                                                                    InputAdapter
+                                                                                      CometFilter [ss_item_sk]
+                                                                                        CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_sold_date_sk]
+                                                                                          SubqueryBroadcast [d_date_sk] #2
+                                                                                            BroadcastExchange #7
+                                                                                              WholeStageCodegen (1)
+                                                                                                ColumnarToRow
+                                                                                                  InputAdapter
+                                                                                                    CometProject [d_date_sk]
+                                                                                                      CometFilter [d_year,d_date_sk]
+                                                                                                        CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year]
+                                                                                  InputAdapter
+                                                                                    BroadcastExchange #8
+                                                                                      WholeStageCodegen (4)
+                                                                                        BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id]
+                                                                                          ColumnarToRow
+                                                                                            InputAdapter
+                                                                                              CometFilter [i_item_sk,i_brand_id,i_class_id,i_category_id]
+                                                                                                CometScan parquet spark_catalog.default.item [i_item_sk,i_brand_id,i_class_id,i_category_id]
+                                                                                          InputAdapter
+                                                                                            BroadcastExchange #9
+                                                                                              WholeStageCodegen (3)
+                                                                                                Project [i_brand_id,i_class_id,i_category_id]
+                                                                                                  BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                                                                                                    Project [cs_sold_date_sk,i_brand_id,i_class_id,i_category_id]
+                                                                                                      BroadcastHashJoin [cs_item_sk,i_item_sk]
+                                                                                                        ColumnarToRow
+                                                                                                          InputAdapter
+                                                                                                            CometFilter [cs_item_sk]
+                                                                                                              CometScan parquet spark_catalog.default.catalog_sales [cs_item_sk,cs_sold_date_sk]
+                                                                                                                ReusedSubquery [d_date_sk] #2
+                                                                                                        InputAdapter
+                                                                                                          BroadcastExchange #10
+                                                                                                            WholeStageCodegen (1)
+                                                                                                              ColumnarToRow
+                                                                                                                InputAdapter
+                                                                                                                  CometFilter [i_item_sk]
+                                                                                                                    CometScan parquet spark_catalog.default.item [i_item_sk,i_brand_id,i_class_id,i_category_id]
+                                                                                                    InputAdapter
+                                                                                                      ReusedExchange [d_date_sk] #7
+                                                                              InputAdapter
+                                                                                ReusedExchange [d_date_sk] #7
+                                                                InputAdapter
+                                                                  BroadcastExchange #11
+                                                                    WholeStageCodegen (9)
+                                                                      Project [i_brand_id,i_class_id,i_category_id]
+                                                                        BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
+                                                                          Project [ws_sold_date_sk,i_brand_id,i_class_id,i_category_id]
+                                                                            BroadcastHashJoin [ws_item_sk,i_item_sk]
+                                                                              ColumnarToRow
+                                                                                InputAdapter
+                                                                                  CometFilter [ws_item_sk]
+                                                                                    CometScan parquet spark_catalog.default.web_sales [ws_item_sk,ws_sold_date_sk]
+                                                                                      ReusedSubquery [d_date_sk] #2
+                                                                              InputAdapter
+                                                                                ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #10
+                                                                          InputAdapter
+                                                                            ReusedExchange [d_date_sk] #7
+                                            InputAdapter
+                                              BroadcastExchange #12
+                                                WholeStageCodegen (23)
+                                                  BroadcastHashJoin [i_item_sk,ss_item_sk]
+                                                    ColumnarToRow
+                                                      InputAdapter
+                                                        CometFilter [i_item_sk]
+                                                          CometScan parquet spark_catalog.default.item [i_item_sk,i_brand_id,i_class_id,i_category_id]
+                                                    InputAdapter
+                                                      ReusedExchange [ss_item_sk] #4
+                                        InputAdapter
+                                          ReusedExchange [d_date_sk] #3
+                    WholeStageCodegen (52)
+                      Project [sales,number_sales,i_brand_id,i_class_id,i_category_id]
+                        Filter [sales]
+                          ReusedSubquery [average_sales] #3
+                          HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum((cast(cs_quantity as decimal(10,0)) * cs_list_price)),count(1),sales,number_sales,sum,isEmpty,count]
+                            InputAdapter
+                              Exchange [i_brand_id,i_class_id,i_category_id] #14
+                                WholeStageCodegen (51)
+                                  HashAggregate [i_brand_id,i_class_id,i_category_id,cs_quantity,cs_list_price] [sum,isEmpty,count,sum,isEmpty,count]
+                                    Project [cs_quantity,cs_list_price,i_brand_id,i_class_id,i_category_id]
+                                      BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                                        Project [cs_quantity,cs_list_price,cs_sold_date_sk,i_brand_id,i_class_id,i_category_id]
+                                          BroadcastHashJoin [cs_item_sk,i_item_sk]
+                                            BroadcastHashJoin [cs_item_sk,ss_item_sk]
+                                              ColumnarToRow
+                                                InputAdapter
+                                                  CometFilter [cs_item_sk]
+                                                    CometScan parquet spark_catalog.default.catalog_sales [cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk]
+                                                      ReusedSubquery [d_date_sk] #1
+                                              InputAdapter
+                                                ReusedExchange [ss_item_sk] #4
+                                            InputAdapter
+                                              ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #12
+                                        InputAdapter
+                                          ReusedExchange [d_date_sk] #3
+                    WholeStageCodegen (78)
+                      Project [sales,number_sales,i_brand_id,i_class_id,i_category_id]
+                        Filter [sales]
+                          ReusedSubquery [average_sales] #3
+                          HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum((cast(ws_quantity as decimal(10,0)) * ws_list_price)),count(1),sales,number_sales,sum,isEmpty,count]
+                            InputAdapter
+                              Exchange [i_brand_id,i_class_id,i_category_id] #15
+                                WholeStageCodegen (77)
+                                  HashAggregate [i_brand_id,i_class_id,i_category_id,ws_quantity,ws_list_price] [sum,isEmpty,count,sum,isEmpty,count]
+                                    Project [ws_quantity,ws_list_price,i_brand_id,i_class_id,i_category_id]
+                                      BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
+                                        Project [ws_quantity,ws_list_price,ws_sold_date_sk,i_brand_id,i_class_id,i_category_id]
+                                          BroadcastHashJoin [ws_item_sk,i_item_sk]
+                                            BroadcastHashJoin [ws_item_sk,ss_item_sk]
+                                              ColumnarToRow
+                                                InputAdapter
+                                                  CometFilter [ws_item_sk]
+                                                    CometScan parquet spark_catalog.default.web_sales [ws_item_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
+                                                      ReusedSubquery [d_date_sk] #1
+                                              InputAdapter
+                                                ReusedExchange [ss_item_sk] #4
+                                            InputAdapter
+                                              ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #12
+                                        InputAdapter
+                                          ReusedExchange [d_date_sk] #3
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt
new file mode 100644
index 0000000..536306d
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt
@@ -0,0 +1,755 @@
+== Physical Plan ==
+TakeOrderedAndProject (84)
++- * BroadcastHashJoin Inner BuildRight (83)
+   :- * Filter (66)
+   :  +- * HashAggregate (65)
+   :     +- Exchange (64)
+   :        +- * HashAggregate (63)
+   :           +- * Project (62)
+   :              +- * BroadcastHashJoin Inner BuildRight (61)
+   :                 :- * Project (59)
+   :                 :  +- * BroadcastHashJoin Inner BuildRight (58)
+   :                 :     :- * BroadcastHashJoin LeftSemi BuildRight (51)
+   :                 :     :  :- * ColumnarToRow (3)
+   :                 :     :  :  +- CometFilter (2)
+   :                 :     :  :     +- CometScan parquet spark_catalog.default.store_sales (1)
+   :                 :     :  +- BroadcastExchange (50)
+   :                 :     :     +- * Project (49)
+   :                 :     :        +- * BroadcastHashJoin Inner BuildRight (48)
+   :                 :     :           :- * ColumnarToRow (6)
+   :                 :     :           :  +- CometFilter (5)
+   :                 :     :           :     +- CometScan parquet spark_catalog.default.item (4)
+   :                 :     :           +- BroadcastExchange (47)
+   :                 :     :              +- * BroadcastHashJoin LeftSemi BuildRight (46)
+   :                 :     :                 :- * HashAggregate (35)
+   :                 :     :                 :  +- Exchange (34)
+   :                 :     :                 :     +- * HashAggregate (33)
+   :                 :     :                 :        +- * Project (32)
+   :                 :     :                 :           +- * BroadcastHashJoin Inner BuildRight (31)
+   :                 :     :                 :              :- * Project (29)
+   :                 :     :                 :              :  +- * BroadcastHashJoin Inner BuildRight (28)
+   :                 :     :                 :              :     :- * ColumnarToRow (9)
+   :                 :     :                 :              :     :  +- CometFilter (8)
+   :                 :     :                 :              :     :     +- CometScan parquet spark_catalog.default.store_sales (7)
+   :                 :     :                 :              :     +- BroadcastExchange (27)
+   :                 :     :                 :              :        +- * BroadcastHashJoin LeftSemi BuildRight (26)
+   :                 :     :                 :              :           :- * ColumnarToRow (12)
+   :                 :     :                 :              :           :  +- CometFilter (11)
+   :                 :     :                 :              :           :     +- CometScan parquet spark_catalog.default.item (10)
+   :                 :     :                 :              :           +- BroadcastExchange (25)
+   :                 :     :                 :              :              +- * Project (24)
+   :                 :     :                 :              :                 +- * BroadcastHashJoin Inner BuildRight (23)
+   :                 :     :                 :              :                    :- * Project (21)
+   :                 :     :                 :              :                    :  +- * BroadcastHashJoin Inner BuildRight (20)
+   :                 :     :                 :              :                    :     :- * ColumnarToRow (15)
+   :                 :     :                 :              :                    :     :  +- CometFilter (14)
+   :                 :     :                 :              :                    :     :     +- CometScan parquet spark_catalog.default.catalog_sales (13)
+   :                 :     :                 :              :                    :     +- BroadcastExchange (19)
+   :                 :     :                 :              :                    :        +- * ColumnarToRow (18)
+   :                 :     :                 :              :                    :           +- CometFilter (17)
+   :                 :     :                 :              :                    :              +- CometScan parquet spark_catalog.default.item (16)
+   :                 :     :                 :              :                    +- ReusedExchange (22)
+   :                 :     :                 :              +- ReusedExchange (30)
+   :                 :     :                 +- BroadcastExchange (45)
+   :                 :     :                    +- * Project (44)
+   :                 :     :                       +- * BroadcastHashJoin Inner BuildRight (43)
+   :                 :     :                          :- * Project (41)
+   :                 :     :                          :  +- * BroadcastHashJoin Inner BuildRight (40)
+   :                 :     :                          :     :- * ColumnarToRow (38)
+   :                 :     :                          :     :  +- CometFilter (37)
+   :                 :     :                          :     :     +- CometScan parquet spark_catalog.default.web_sales (36)
+   :                 :     :                          :     +- ReusedExchange (39)
+   :                 :     :                          +- ReusedExchange (42)
+   :                 :     +- BroadcastExchange (57)
+   :                 :        +- * BroadcastHashJoin LeftSemi BuildRight (56)
+   :                 :           :- * ColumnarToRow (54)
+   :                 :           :  +- CometFilter (53)
+   :                 :           :     +- CometScan parquet spark_catalog.default.item (52)
+   :                 :           +- ReusedExchange (55)
+   :                 +- ReusedExchange (60)
+   +- BroadcastExchange (82)
+      +- * Filter (81)
+         +- * HashAggregate (80)
+            +- Exchange (79)
+               +- * HashAggregate (78)
+                  +- * Project (77)
+                     +- * BroadcastHashJoin Inner BuildRight (76)
+                        :- * Project (74)
+                        :  +- * BroadcastHashJoin Inner BuildRight (73)
+                        :     :- * BroadcastHashJoin LeftSemi BuildRight (71)
+                        :     :  :- * ColumnarToRow (69)
+                        :     :  :  +- CometFilter (68)
+                        :     :  :     +- CometScan parquet spark_catalog.default.store_sales (67)
+                        :     :  +- ReusedExchange (70)
+                        :     +- ReusedExchange (72)
+                        +- ReusedExchange (75)
+
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)]
+PushedFilters: [IsNotNull(ss_item_sk)]
+ReadSchema: struct<ss_item_sk:int,ss_quantity:int,ss_list_price:decimal(7,2)>
+
+(2) CometFilter
+Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4]
+Condition : isnotnull(ss_item_sk#1)
+
+(3) ColumnarToRow [codegen id : 25]
+Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)]
+ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>
+
+(5) CometFilter
+Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9]
+Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9))
+
+(6) ColumnarToRow [codegen id : 11]
+Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9]
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [2]: [ss_item_sk#10, ss_sold_date_sk#11]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#11), dynamicpruningexpression(ss_sold_date_sk#11 IN dynamicpruning#12)]
+PushedFilters: [IsNotNull(ss_item_sk)]
+ReadSchema: struct<ss_item_sk:int>
+
+(8) CometFilter
+Input [2]: [ss_item_sk#10, ss_sold_date_sk#11]
+Condition : isnotnull(ss_item_sk#10)
+
+(9) ColumnarToRow [codegen id : 6]
+Input [2]: [ss_item_sk#10, ss_sold_date_sk#11]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)]
+ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>
+
+(11) CometFilter
+Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16]
+Condition : (((isnotnull(i_item_sk#13) AND isnotnull(i_brand_id#14)) AND isnotnull(i_class_id#15)) AND isnotnull(i_category_id#16))
+
+(12) ColumnarToRow [codegen id : 4]
+Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16]
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [2]: [cs_item_sk#17, cs_sold_date_sk#18]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#19)]
+PushedFilters: [IsNotNull(cs_item_sk)]
+ReadSchema: struct<cs_item_sk:int>
+
+(14) CometFilter
+Input [2]: [cs_item_sk#17, cs_sold_date_sk#18]
+Condition : isnotnull(cs_item_sk#17)
+
+(15) ColumnarToRow [codegen id : 3]
+Input [2]: [cs_item_sk#17, cs_sold_date_sk#18]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [4]: [i_item_sk#20, i_brand_id#21, i_class_id#22, i_category_id#23]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>
+
+(17) CometFilter
+Input [4]: [i_item_sk#20, i_brand_id#21, i_class_id#22, i_category_id#23]
+Condition : isnotnull(i_item_sk#20)
+
+(18) ColumnarToRow [codegen id : 1]
+Input [4]: [i_item_sk#20, i_brand_id#21, i_class_id#22, i_category_id#23]
+
+(19) BroadcastExchange
+Input [4]: [i_item_sk#20, i_brand_id#21, i_class_id#22, i_category_id#23]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(20) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [cs_item_sk#17]
+Right keys [1]: [i_item_sk#20]
+Join type: Inner
+Join condition: None
+
+(21) Project [codegen id : 3]
+Output [4]: [cs_sold_date_sk#18, i_brand_id#21, i_class_id#22, i_category_id#23]
+Input [6]: [cs_item_sk#17, cs_sold_date_sk#18, i_item_sk#20, i_brand_id#21, i_class_id#22, i_category_id#23]
+
+(22) ReusedExchange [Reuses operator id: 117]
+Output [1]: [d_date_sk#24]
+
+(23) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [cs_sold_date_sk#18]
+Right keys [1]: [d_date_sk#24]
+Join type: Inner
+Join condition: None
+
+(24) Project [codegen id : 3]
+Output [3]: [i_brand_id#21, i_class_id#22, i_category_id#23]
+Input [5]: [cs_sold_date_sk#18, i_brand_id#21, i_class_id#22, i_category_id#23, d_date_sk#24]
+
+(25) BroadcastExchange
+Input [3]: [i_brand_id#21, i_class_id#22, i_category_id#23]
+Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [plan_id=2]
+
+(26) BroadcastHashJoin [codegen id : 4]
+Left keys [6]: [coalesce(i_brand_id#14, 0), isnull(i_brand_id#14), coalesce(i_class_id#15, 0), isnull(i_class_id#15), coalesce(i_category_id#16, 0), isnull(i_category_id#16)]
+Right keys [6]: [coalesce(i_brand_id#21, 0), isnull(i_brand_id#21), coalesce(i_class_id#22, 0), isnull(i_class_id#22), coalesce(i_category_id#23, 0), isnull(i_category_id#23)]
+Join type: LeftSemi
+Join condition: None
+
+(27) BroadcastExchange
+Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
+
+(28) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_item_sk#10]
+Right keys [1]: [i_item_sk#13]
+Join type: Inner
+Join condition: None
+
+(29) Project [codegen id : 6]
+Output [4]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16]
+Input [6]: [ss_item_sk#10, ss_sold_date_sk#11, i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16]
+
+(30) ReusedExchange [Reuses operator id: 117]
+Output [1]: [d_date_sk#25]
+
+(31) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_sold_date_sk#11]
+Right keys [1]: [d_date_sk#25]
+Join type: Inner
+Join condition: None
+
+(32) Project [codegen id : 6]
+Output [3]: [i_brand_id#14 AS brand_id#26, i_class_id#15 AS class_id#27, i_category_id#16 AS category_id#28]
+Input [5]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16, d_date_sk#25]
+
+(33) HashAggregate [codegen id : 6]
+Input [3]: [brand_id#26, class_id#27, category_id#28]
+Keys [3]: [brand_id#26, class_id#27, category_id#28]
+Functions: []
+Aggregate Attributes: []
+Results [3]: [brand_id#26, class_id#27, category_id#28]
+
+(34) Exchange
+Input [3]: [brand_id#26, class_id#27, category_id#28]
+Arguments: hashpartitioning(brand_id#26, class_id#27, category_id#28, 5), ENSURE_REQUIREMENTS, [plan_id=4]
+
+(35) HashAggregate [codegen id : 10]
+Input [3]: [brand_id#26, class_id#27, category_id#28]
+Keys [3]: [brand_id#26, class_id#27, category_id#28]
+Functions: []
+Aggregate Attributes: []
+Results [3]: [brand_id#26, class_id#27, category_id#28]
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [2]: [ws_item_sk#29, ws_sold_date_sk#30]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#30), dynamicpruningexpression(ws_sold_date_sk#30 IN dynamicpruning#31)]
+PushedFilters: [IsNotNull(ws_item_sk)]
+ReadSchema: struct<ws_item_sk:int>
+
+(37) CometFilter
+Input [2]: [ws_item_sk#29, ws_sold_date_sk#30]
+Condition : isnotnull(ws_item_sk#29)
+
+(38) ColumnarToRow [codegen id : 9]
+Input [2]: [ws_item_sk#29, ws_sold_date_sk#30]
+
+(39) ReusedExchange [Reuses operator id: 19]
+Output [4]: [i_item_sk#32, i_brand_id#33, i_class_id#34, i_category_id#35]
+
+(40) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [ws_item_sk#29]
+Right keys [1]: [i_item_sk#32]
+Join type: Inner
+Join condition: None
+
+(41) Project [codegen id : 9]
+Output [4]: [ws_sold_date_sk#30, i_brand_id#33, i_class_id#34, i_category_id#35]
+Input [6]: [ws_item_sk#29, ws_sold_date_sk#30, i_item_sk#32, i_brand_id#33, i_class_id#34, i_category_id#35]
+
+(42) ReusedExchange [Reuses operator id: 117]
+Output [1]: [d_date_sk#36]
+
+(43) BroadcastHashJoin [codegen id : 9]
+Left keys [1]: [ws_sold_date_sk#30]
+Right keys [1]: [d_date_sk#36]
+Join type: Inner
+Join condition: None
+
+(44) Project [codegen id : 9]
+Output [3]: [i_brand_id#33, i_class_id#34, i_category_id#35]
+Input [5]: [ws_sold_date_sk#30, i_brand_id#33, i_class_id#34, i_category_id#35, d_date_sk#36]
+
+(45) BroadcastExchange
+Input [3]: [i_brand_id#33, i_class_id#34, i_category_id#35]
+Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [plan_id=5]
+
+(46) BroadcastHashJoin [codegen id : 10]
+Left keys [6]: [coalesce(brand_id#26, 0), isnull(brand_id#26), coalesce(class_id#27, 0), isnull(class_id#27), coalesce(category_id#28, 0), isnull(category_id#28)]
+Right keys [6]: [coalesce(i_brand_id#33, 0), isnull(i_brand_id#33), coalesce(i_class_id#34, 0), isnull(i_class_id#34), coalesce(i_category_id#35, 0), isnull(i_category_id#35)]
+Join type: LeftSemi
+Join condition: None
+
+(47) BroadcastExchange
+Input [3]: [brand_id#26, class_id#27, category_id#28]
+Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [plan_id=6]
+
+(48) BroadcastHashJoin [codegen id : 11]
+Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9]
+Right keys [3]: [brand_id#26, class_id#27, category_id#28]
+Join type: Inner
+Join condition: None
+
+(49) Project [codegen id : 11]
+Output [1]: [i_item_sk#6 AS ss_item_sk#37]
+Input [7]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, brand_id#26, class_id#27, category_id#28]
+
+(50) BroadcastExchange
+Input [1]: [ss_item_sk#37]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
+
+(51) BroadcastHashJoin [codegen id : 25]
+Left keys [1]: [ss_item_sk#1]
+Right keys [1]: [ss_item_sk#37]
+Join type: LeftSemi
+Join condition: None
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [4]: [i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)]
+ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_class_id:int,i_category_id:int>
+
+(53) CometFilter
+Input [4]: [i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]
+Condition : (((isnotnull(i_item_sk#38) AND isnotnull(i_brand_id#39)) AND isnotnull(i_class_id#40)) AND isnotnull(i_category_id#41))
+
+(54) ColumnarToRow [codegen id : 23]
+Input [4]: [i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]
+
+(55) ReusedExchange [Reuses operator id: 50]
+Output [1]: [ss_item_sk#37]
+
+(56) BroadcastHashJoin [codegen id : 23]
+Left keys [1]: [i_item_sk#38]
+Right keys [1]: [ss_item_sk#37]
+Join type: LeftSemi
+Join condition: None
+
+(57) BroadcastExchange
+Input [4]: [i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=8]
+
+(58) BroadcastHashJoin [codegen id : 25]
+Left keys [1]: [ss_item_sk#1]
+Right keys [1]: [i_item_sk#38]
+Join type: Inner
+Join condition: None
+
+(59) Project [codegen id : 25]
+Output [6]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#39, i_class_id#40, i_category_id#41]
+Input [8]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_item_sk#38, i_brand_id#39, i_class_id#40, i_category_id#41]
+
+(60) ReusedExchange [Reuses operator id: 108]
+Output [1]: [d_date_sk#42]
+
+(61) BroadcastHashJoin [codegen id : 25]
+Left keys [1]: [ss_sold_date_sk#4]
+Right keys [1]: [d_date_sk#42]
+Join type: Inner
+Join condition: None
+
+(62) Project [codegen id : 25]
+Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#39, i_class_id#40, i_category_id#41]
+Input [7]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#39, i_class_id#40, i_category_id#41, d_date_sk#42]
+
+(63) HashAggregate [codegen id : 25]
+Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#39, i_class_id#40, i_category_id#41]
+Keys [3]: [i_brand_id#39, i_class_id#40, i_category_id#41]
+Functions [2]: [partial_sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3)), partial_count(1)]
+Aggregate Attributes [3]: [sum#43, isEmpty#44, count#45]
+Results [6]: [i_brand_id#39, i_class_id#40, i_category_id#41, sum#46, isEmpty#47, count#48]
+
+(64) Exchange
+Input [6]: [i_brand_id#39, i_class_id#40, i_category_id#41, sum#46, isEmpty#47, count#48]
+Arguments: hashpartitioning(i_brand_id#39, i_class_id#40, i_category_id#41, 5), ENSURE_REQUIREMENTS, [plan_id=9]
+
+(65) HashAggregate [codegen id : 52]
+Input [6]: [i_brand_id#39, i_class_id#40, i_category_id#41, sum#46, isEmpty#47, count#48]
+Keys [3]: [i_brand_id#39, i_class_id#40, i_category_id#41]
+Functions [2]: [sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3)), count(1)]
+Aggregate Attributes [2]: [sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3))#49, count(1)#50]
+Results [6]: [store AS channel#51, i_brand_id#39, i_class_id#40, i_category_id#41, sum((cast(ss_quantity#2 as decimal(10,0)) * ss_list_price#3))#49 AS sales#52, count(1)#50 AS number_sales#53]
+
+(66) Filter [codegen id : 52]
+Input [6]: [channel#51, i_brand_id#39, i_class_id#40, i_category_id#41, sales#52, number_sales#53]
+Condition : (isnotnull(sales#52) AND (cast(sales#52 as decimal(32,6)) > cast(Subquery scalar-subquery#54, [id=#55] as decimal(32,6))))
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [4]: [ss_item_sk#56, ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#59), dynamicpruningexpression(ss_sold_date_sk#59 IN dynamicpruning#60)]
+PushedFilters: [IsNotNull(ss_item_sk)]
+ReadSchema: struct<ss_item_sk:int,ss_quantity:int,ss_list_price:decimal(7,2)>
+
+(68) CometFilter
+Input [4]: [ss_item_sk#56, ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59]
+Condition : isnotnull(ss_item_sk#56)
+
+(69) ColumnarToRow [codegen id : 50]
+Input [4]: [ss_item_sk#56, ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59]
+
+(70) ReusedExchange [Reuses operator id: 50]
+Output [1]: [ss_item_sk#37]
+
+(71) BroadcastHashJoin [codegen id : 50]
+Left keys [1]: [ss_item_sk#56]
+Right keys [1]: [ss_item_sk#37]
+Join type: LeftSemi
+Join condition: None
+
+(72) ReusedExchange [Reuses operator id: 57]
+Output [4]: [i_item_sk#61, i_brand_id#62, i_class_id#63, i_category_id#64]
+
+(73) BroadcastHashJoin [codegen id : 50]
+Left keys [1]: [ss_item_sk#56]
+Right keys [1]: [i_item_sk#61]
+Join type: Inner
+Join condition: None
+
+(74) Project [codegen id : 50]
+Output [6]: [ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59, i_brand_id#62, i_class_id#63, i_category_id#64]
+Input [8]: [ss_item_sk#56, ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59, i_item_sk#61, i_brand_id#62, i_class_id#63, i_category_id#64]
+
+(75) ReusedExchange [Reuses operator id: 122]
+Output [1]: [d_date_sk#65]
+
+(76) BroadcastHashJoin [codegen id : 50]
+Left keys [1]: [ss_sold_date_sk#59]
+Right keys [1]: [d_date_sk#65]
+Join type: Inner
+Join condition: None
+
+(77) Project [codegen id : 50]
+Output [5]: [ss_quantity#57, ss_list_price#58, i_brand_id#62, i_class_id#63, i_category_id#64]
+Input [7]: [ss_quantity#57, ss_list_price#58, ss_sold_date_sk#59, i_brand_id#62, i_class_id#63, i_category_id#64, d_date_sk#65]
+
+(78) HashAggregate [codegen id : 50]
+Input [5]: [ss_quantity#57, ss_list_price#58, i_brand_id#62, i_class_id#63, i_category_id#64]
+Keys [3]: [i_brand_id#62, i_class_id#63, i_category_id#64]
+Functions [2]: [partial_sum((cast(ss_quantity#57 as decimal(10,0)) * ss_list_price#58)), partial_count(1)]
+Aggregate Attributes [3]: [sum#66, isEmpty#67, count#68]
+Results [6]: [i_brand_id#62, i_class_id#63, i_category_id#64, sum#69, isEmpty#70, count#71]
+
+(79) Exchange
+Input [6]: [i_brand_id#62, i_class_id#63, i_category_id#64, sum#69, isEmpty#70, count#71]
+Arguments: hashpartitioning(i_brand_id#62, i_class_id#63, i_category_id#64, 5), ENSURE_REQUIREMENTS, [plan_id=10]
+
+(80) HashAggregate [codegen id : 51]
+Input [6]: [i_brand_id#62, i_class_id#63, i_category_id#64, sum#69, isEmpty#70, count#71]
+Keys [3]: [i_brand_id#62, i_class_id#63, i_category_id#64]
+Functions [2]: [sum((cast(ss_quantity#57 as decimal(10,0)) * ss_list_price#58)), count(1)]
+Aggregate Attributes [2]: [sum((cast(ss_quantity#57 as decimal(10,0)) * ss_list_price#58))#72, count(1)#73]
+Results [6]: [store AS channel#74, i_brand_id#62, i_class_id#63, i_category_id#64, sum((cast(ss_quantity#57 as decimal(10,0)) * ss_list_price#58))#72 AS sales#75, count(1)#73 AS number_sales#76]
+
+(81) Filter [codegen id : 51]
+Input [6]: [channel#74, i_brand_id#62, i_class_id#63, i_category_id#64, sales#75, number_sales#76]
+Condition : (isnotnull(sales#75) AND (cast(sales#75 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#54, [id=#55] as decimal(32,6))))
+
+(82) BroadcastExchange
+Input [6]: [channel#74, i_brand_id#62, i_class_id#63, i_category_id#64, sales#75, number_sales#76]
+Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true]),false), [plan_id=11]
+
+(83) BroadcastHashJoin [codegen id : 52]
+Left keys [3]: [i_brand_id#39, i_class_id#40, i_category_id#41]
+Right keys [3]: [i_brand_id#62, i_class_id#63, i_category_id#64]
+Join type: Inner
+Join condition: None
+
+(84) TakeOrderedAndProject
+Input [12]: [channel#51, i_brand_id#39, i_class_id#40, i_category_id#41, sales#52, number_sales#53, channel#74, i_brand_id#62, i_class_id#63, i_category_id#64, sales#75, number_sales#76]
+Arguments: 100, [i_brand_id#39 ASC NULLS FIRST, i_class_id#40 ASC NULLS FIRST, i_category_id#41 ASC NULLS FIRST], [channel#51, i_brand_id#39, i_class_id#40, i_category_id#41, sales#52, number_sales#53, channel#74, i_brand_id#62, i_class_id#63, i_category_id#64, sales#75, number_sales#76]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 66 Hosting Expression = Subquery scalar-subquery#54, [id=#55]
+* HashAggregate (103)
++- Exchange (102)
+   +- * HashAggregate (101)
+      +- Union (100)
+         :- * Project (89)
+         :  +- * BroadcastHashJoin Inner BuildRight (88)
+         :     :- * ColumnarToRow (86)
+         :     :  +- CometScan parquet spark_catalog.default.store_sales (85)
+         :     +- ReusedExchange (87)
+         :- * Project (94)
+         :  +- * BroadcastHashJoin Inner BuildRight (93)
+         :     :- * ColumnarToRow (91)
+         :     :  +- CometScan parquet spark_catalog.default.catalog_sales (90)
+         :     +- ReusedExchange (92)
+         +- * Project (99)
+            +- * BroadcastHashJoin Inner BuildRight (98)
+               :- * ColumnarToRow (96)
+               :  +- CometScan parquet spark_catalog.default.web_sales (95)
+               +- ReusedExchange (97)
+
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [3]: [ss_quantity#77, ss_list_price#78, ss_sold_date_sk#79]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#79), dynamicpruningexpression(ss_sold_date_sk#79 IN dynamicpruning#80)]
+ReadSchema: struct<ss_quantity:int,ss_list_price:decimal(7,2)>
+
+(86) ColumnarToRow [codegen id : 2]
+Input [3]: [ss_quantity#77, ss_list_price#78, ss_sold_date_sk#79]
+
+(87) ReusedExchange [Reuses operator id: 117]
+Output [1]: [d_date_sk#81]
+
+(88) BroadcastHashJoin [codegen id : 2]
+Left keys [1]: [ss_sold_date_sk#79]
+Right keys [1]: [d_date_sk#81]
+Join type: Inner
+Join condition: None
+
+(89) Project [codegen id : 2]
+Output [2]: [ss_quantity#77 AS quantity#82, ss_list_price#78 AS list_price#83]
+Input [4]: [ss_quantity#77, ss_list_price#78, ss_sold_date_sk#79, d_date_sk#81]
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [3]: [cs_quantity#84, cs_list_price#85, cs_sold_date_sk#86]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#86), dynamicpruningexpression(cs_sold_date_sk#86 IN dynamicpruning#87)]
+ReadSchema: struct<cs_quantity:int,cs_list_price:decimal(7,2)>
+
+(91) ColumnarToRow [codegen id : 4]
+Input [3]: [cs_quantity#84, cs_list_price#85, cs_sold_date_sk#86]
+
+(92) ReusedExchange [Reuses operator id: 117]
+Output [1]: [d_date_sk#88]
+
+(93) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [cs_sold_date_sk#86]
+Right keys [1]: [d_date_sk#88]
+Join type: Inner
+Join condition: None
+
+(94) Project [codegen id : 4]
+Output [2]: [cs_quantity#84 AS quantity#89, cs_list_price#85 AS list_price#90]
+Input [4]: [cs_quantity#84, cs_list_price#85, cs_sold_date_sk#86, d_date_sk#88]
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [3]: [ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#93), dynamicpruningexpression(ws_sold_date_sk#93 IN dynamicpruning#94)]
+ReadSchema: struct<ws_quantity:int,ws_list_price:decimal(7,2)>
+
+(96) ColumnarToRow [codegen id : 6]
+Input [3]: [ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93]
+
+(97) ReusedExchange [Reuses operator id: 117]
+Output [1]: [d_date_sk#95]
+
+(98) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ws_sold_date_sk#93]
+Right keys [1]: [d_date_sk#95]
+Join type: Inner
+Join condition: None
+
+(99) Project [codegen id : 6]
+Output [2]: [ws_quantity#91 AS quantity#96, ws_list_price#92 AS list_price#97]
+Input [4]: [ws_quantity#91, ws_list_price#92, ws_sold_date_sk#93, d_date_sk#95]
+
+(100) Union
+
+(101) HashAggregate [codegen id : 7]
+Input [2]: [quantity#82, list_price#83]
+Keys: []
+Functions [1]: [partial_avg((cast(quantity#82 as decimal(10,0)) * list_price#83))]
+Aggregate Attributes [2]: [sum#98, count#99]
+Results [2]: [sum#100, count#101]
+
+(102) Exchange
+Input [2]: [sum#100, count#101]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=12]
+
+(103) HashAggregate [codegen id : 8]
+Input [2]: [sum#100, count#101]
+Keys: []
+Functions [1]: [avg((cast(quantity#82 as decimal(10,0)) * list_price#83))]
+Aggregate Attributes [1]: [avg((cast(quantity#82 as decimal(10,0)) * list_price#83))#102]
+Results [1]: [avg((cast(quantity#82 as decimal(10,0)) * list_price#83))#102 AS average_sales#103]
+
+Subquery:2 Hosting operator id = 85 Hosting Expression = ss_sold_date_sk#79 IN dynamicpruning#12
+
+Subquery:3 Hosting operator id = 90 Hosting Expression = cs_sold_date_sk#86 IN dynamicpruning#12
+
+Subquery:4 Hosting operator id = 95 Hosting Expression = ws_sold_date_sk#93 IN dynamicpruning#12
+
+Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5
+BroadcastExchange (108)
++- * ColumnarToRow (107)
+   +- CometProject (106)
+      +- CometFilter (105)
+         +- CometScan parquet spark_catalog.default.date_dim (104)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#42, d_week_seq#104]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_week_seq:int>
+
+(105) CometFilter
+Input [2]: [d_date_sk#42, d_week_seq#104]
+Condition : ((isnotnull(d_week_seq#104) AND (d_week_seq#104 = Subquery scalar-subquery#105, [id=#106])) AND isnotnull(d_date_sk#42))
+
+(106) CometProject
+Input [2]: [d_date_sk#42, d_week_seq#104]
+Arguments: [d_date_sk#42], [d_date_sk#42]
+
+(107) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#42]
+
+(108) BroadcastExchange
+Input [1]: [d_date_sk#42]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=13]
+
+Subquery:6 Hosting operator id = 105 Hosting Expression = Subquery scalar-subquery#105, [id=#106]
+* ColumnarToRow (112)
++- CometProject (111)
+   +- CometFilter (110)
+      +- CometScan parquet spark_catalog.default.date_dim (109)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [4]: [d_week_seq#107, d_year#108, d_moy#109, d_dom#110]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,2000), EqualTo(d_moy,12), EqualTo(d_dom,11)]
+ReadSchema: struct<d_week_seq:int,d_year:int,d_moy:int,d_dom:int>
+
+(110) CometFilter
+Input [4]: [d_week_seq#107, d_year#108, d_moy#109, d_dom#110]
+Condition : (((((isnotnull(d_year#108) AND isnotnull(d_moy#109)) AND isnotnull(d_dom#110)) AND (d_year#108 = 2000)) AND (d_moy#109 = 12)) AND (d_dom#110 = 11))
+
+(111) CometProject
+Input [4]: [d_week_seq#107, d_year#108, d_moy#109, d_dom#110]
+Arguments: [d_week_seq#107], [d_week_seq#107]
+
+(112) ColumnarToRow [codegen id : 1]
+Input [1]: [d_week_seq#107]
+
+Subquery:7 Hosting operator id = 7 Hosting Expression = ss_sold_date_sk#11 IN dynamicpruning#12
+BroadcastExchange (117)
++- * ColumnarToRow (116)
+   +- CometProject (115)
+      +- CometFilter (114)
+         +- CometScan parquet spark_catalog.default.date_dim (113)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#25, d_year#111]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int>
+
+(114) CometFilter
+Input [2]: [d_date_sk#25, d_year#111]
+Condition : (((isnotnull(d_year#111) AND (d_year#111 >= 1999)) AND (d_year#111 <= 2001)) AND isnotnull(d_date_sk#25))
+
+(115) CometProject
+Input [2]: [d_date_sk#25, d_year#111]
+Arguments: [d_date_sk#25], [d_date_sk#25]
+
+(116) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#25]
+
+(117) BroadcastExchange
+Input [1]: [d_date_sk#25]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=14]
+
+Subquery:8 Hosting operator id = 13 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#12
+
+Subquery:9 Hosting operator id = 36 Hosting Expression = ws_sold_date_sk#30 IN dynamicpruning#12
+
+Subquery:10 Hosting operator id = 81 Hosting Expression = ReusedSubquery Subquery scalar-subquery#54, [id=#55]
+
+Subquery:11 Hosting operator id = 67 Hosting Expression = ss_sold_date_sk#59 IN dynamicpruning#60
+BroadcastExchange (122)
++- * ColumnarToRow (121)
+   +- CometProject (120)
+      +- CometFilter (119)
+         +- CometScan parquet spark_catalog.default.date_dim (118)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#65, d_week_seq#112]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_week_seq:int>
+
+(119) CometFilter
+Input [2]: [d_date_sk#65, d_week_seq#112]
+Condition : ((isnotnull(d_week_seq#112) AND (d_week_seq#112 = Subquery scalar-subquery#113, [id=#114])) AND isnotnull(d_date_sk#65))
+
+(120) CometProject
+Input [2]: [d_date_sk#65, d_week_seq#112]
+Arguments: [d_date_sk#65], [d_date_sk#65]
+
+(121) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#65]
+
+(122) BroadcastExchange
+Input [1]: [d_date_sk#65]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=15]
+
+Subquery:12 Hosting operator id = 119 Hosting Expression = Subquery scalar-subquery#113, [id=#114]
+* ColumnarToRow (126)
++- CometProject (125)
+   +- CometFilter (124)
+      +- CometScan parquet spark_catalog.default.date_dim (123)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [4]: [d_week_seq#115, d_year#116, d_moy#117, d_dom#118]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1999), EqualTo(d_moy,12), EqualTo(d_dom,11)]
+ReadSchema: struct<d_week_seq:int,d_year:int,d_moy:int,d_dom:int>
+
+(124) CometFilter
+Input [4]: [d_week_seq#115, d_year#116, d_moy#117, d_dom#118]
+Condition : (((((isnotnull(d_year#116) AND isnotnull(d_moy#117)) AND isnotnull(d_dom#118)) AND (d_year#116 = 1999)) AND (d_moy#117 = 12)) AND (d_dom#118 = 11))
+
+(125) CometProject
+Input [4]: [d_week_seq#115, d_year#116, d_moy#117, d_dom#118]
+Arguments: [d_week_seq#115], [d_week_seq#115]
+
+(126) ColumnarToRow [codegen id : 1]
+Input [1]: [d_week_seq#115]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt
new file mode 100644
index 0000000..09d8d9d
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt
@@ -0,0 +1,202 @@
+TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_sales,channel,i_brand_id,i_class_id,i_category_id,sales,number_sales]
+  WholeStageCodegen (52)
+    BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id]
+      Filter [sales]
+        Subquery #4
+          WholeStageCodegen (8)
+            HashAggregate [sum,count] [avg((cast(quantity as decimal(10,0)) * list_price)),average_sales,sum,count]
+              InputAdapter
+                Exchange #12
+                  WholeStageCodegen (7)
+                    HashAggregate [quantity,list_price] [sum,count,sum,count]
+                      InputAdapter
+                        Union
+                          WholeStageCodegen (2)
+                            Project [ss_quantity,ss_list_price]
+                              BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                ColumnarToRow
+                                  InputAdapter
+                                    CometScan parquet spark_catalog.default.store_sales [ss_quantity,ss_list_price,ss_sold_date_sk]
+                                      ReusedSubquery [d_date_sk] #3
+                                InputAdapter
+                                  ReusedExchange [d_date_sk] #6
+                          WholeStageCodegen (4)
+                            Project [cs_quantity,cs_list_price]
+                              BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                                ColumnarToRow
+                                  InputAdapter
+                                    CometScan parquet spark_catalog.default.catalog_sales [cs_quantity,cs_list_price,cs_sold_date_sk]
+                                      ReusedSubquery [d_date_sk] #3
+                                InputAdapter
+                                  ReusedExchange [d_date_sk] #6
+                          WholeStageCodegen (6)
+                            Project [ws_quantity,ws_list_price]
+                              BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
+                                ColumnarToRow
+                                  InputAdapter
+                                    CometScan parquet spark_catalog.default.web_sales [ws_quantity,ws_list_price,ws_sold_date_sk]
+                                      ReusedSubquery [d_date_sk] #3
+                                InputAdapter
+                                  ReusedExchange [d_date_sk] #6
+        HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum((cast(ss_quantity as decimal(10,0)) * ss_list_price)),count(1),channel,sales,number_sales,sum,isEmpty,count]
+          InputAdapter
+            Exchange [i_brand_id,i_class_id,i_category_id] #1
+              WholeStageCodegen (25)
+                HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count]
+                  Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id]
+                    BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                      Project [ss_quantity,ss_list_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id]
+                        BroadcastHashJoin [ss_item_sk,i_item_sk]
+                          BroadcastHashJoin [ss_item_sk,ss_item_sk]
+                            ColumnarToRow
+                              InputAdapter
+                                CometFilter [ss_item_sk]
+                                  CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk]
+                                    SubqueryBroadcast [d_date_sk] #1
+                                      BroadcastExchange #2
+                                        WholeStageCodegen (1)
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometProject [d_date_sk]
+                                                CometFilter [d_week_seq,d_date_sk]
+                                                  Subquery #2
+                                                    WholeStageCodegen (1)
+                                                      ColumnarToRow
+                                                        InputAdapter
+                                                          CometProject [d_week_seq]
+                                                            CometFilter [d_year,d_moy,d_dom]
+                                                              CometScan parquet spark_catalog.default.date_dim [d_week_seq,d_year,d_moy,d_dom]
+                                                  CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_week_seq]
+                            InputAdapter
+                              BroadcastExchange #3
+                                WholeStageCodegen (11)
+                                  Project [i_item_sk]
+                                    BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id]
+                                      ColumnarToRow
+                                        InputAdapter
+                                          CometFilter [i_brand_id,i_class_id,i_category_id]
+                                            CometScan parquet spark_catalog.default.item [i_item_sk,i_brand_id,i_class_id,i_category_id]
+                                      InputAdapter
+                                        BroadcastExchange #4
+                                          WholeStageCodegen (10)
+                                            BroadcastHashJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id]
+                                              HashAggregate [brand_id,class_id,category_id]
+                                                InputAdapter
+                                                  Exchange [brand_id,class_id,category_id] #5
+                                                    WholeStageCodegen (6)
+                                                      HashAggregate [brand_id,class_id,category_id]
+                                                        Project [i_brand_id,i_class_id,i_category_id]
+                                                          BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                                            Project [ss_sold_date_sk,i_brand_id,i_class_id,i_category_id]
+                                                              BroadcastHashJoin [ss_item_sk,i_item_sk]
+                                                                ColumnarToRow
+                                                                  InputAdapter
+                                                                    CometFilter [ss_item_sk]
+                                                                      CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_sold_date_sk]
+                                                                        SubqueryBroadcast [d_date_sk] #3
+                                                                          BroadcastExchange #6
+                                                                            WholeStageCodegen (1)
+                                                                              ColumnarToRow
+                                                                                InputAdapter
+                                                                                  CometProject [d_date_sk]
+                                                                                    CometFilter [d_year,d_date_sk]
+                                                                                      CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year]
+                                                                InputAdapter
+                                                                  BroadcastExchange #7
+                                                                    WholeStageCodegen (4)
+                                                                      BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id]
+                                                                        ColumnarToRow
+                                                                          InputAdapter
+                                                                            CometFilter [i_item_sk,i_brand_id,i_class_id,i_category_id]
+                                                                              CometScan parquet spark_catalog.default.item [i_item_sk,i_brand_id,i_class_id,i_category_id]
+                                                                        InputAdapter
+                                                                          BroadcastExchange #8
+                                                                            WholeStageCodegen (3)
+                                                                              Project [i_brand_id,i_class_id,i_category_id]
+                                                                                BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                                                                                  Project [cs_sold_date_sk,i_brand_id,i_class_id,i_category_id]
+                                                                                    BroadcastHashJoin [cs_item_sk,i_item_sk]
+                                                                                      ColumnarToRow
+                                                                                        InputAdapter
+                                                                                          CometFilter [cs_item_sk]
+                                                                                            CometScan parquet spark_catalog.default.catalog_sales [cs_item_sk,cs_sold_date_sk]
+                                                                                              ReusedSubquery [d_date_sk] #3
+                                                                                      InputAdapter
+                                                                                        BroadcastExchange #9
+                                                                                          WholeStageCodegen (1)
+                                                                                            ColumnarToRow
+                                                                                              InputAdapter
+                                                                                                CometFilter [i_item_sk]
+                                                                                                  CometScan parquet spark_catalog.default.item [i_item_sk,i_brand_id,i_class_id,i_category_id]
+                                                                                  InputAdapter
+                                                                                    ReusedExchange [d_date_sk] #6
+                                                            InputAdapter
+                                                              ReusedExchange [d_date_sk] #6
+                                              InputAdapter
+                                                BroadcastExchange #10
+                                                  WholeStageCodegen (9)
+                                                    Project [i_brand_id,i_class_id,i_category_id]
+                                                      BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
+                                                        Project [ws_sold_date_sk,i_brand_id,i_class_id,i_category_id]
+                                                          BroadcastHashJoin [ws_item_sk,i_item_sk]
+                                                            ColumnarToRow
+                                                              InputAdapter
+                                                                CometFilter [ws_item_sk]
+                                                                  CometScan parquet spark_catalog.default.web_sales [ws_item_sk,ws_sold_date_sk]
+                                                                    ReusedSubquery [d_date_sk] #3
+                                                            InputAdapter
+                                                              ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #9
+                                                        InputAdapter
+                                                          ReusedExchange [d_date_sk] #6
+                          InputAdapter
+                            BroadcastExchange #11
+                              WholeStageCodegen (23)
+                                BroadcastHashJoin [i_item_sk,ss_item_sk]
+                                  ColumnarToRow
+                                    InputAdapter
+                                      CometFilter [i_item_sk,i_brand_id,i_class_id,i_category_id]
+                                        CometScan parquet spark_catalog.default.item [i_item_sk,i_brand_id,i_class_id,i_category_id]
+                                  InputAdapter
+                                    ReusedExchange [ss_item_sk] #3
+                      InputAdapter
+                        ReusedExchange [d_date_sk] #2
+      InputAdapter
+        BroadcastExchange #13
+          WholeStageCodegen (51)
+            Filter [sales]
+              ReusedSubquery [average_sales] #4
+              HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum((cast(ss_quantity as decimal(10,0)) * ss_list_price)),count(1),channel,sales,number_sales,sum,isEmpty,count]
+                InputAdapter
+                  Exchange [i_brand_id,i_class_id,i_category_id] #14
+                    WholeStageCodegen (50)
+                      HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count]
+                        Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id]
+                          BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                            Project [ss_quantity,ss_list_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id]
+                              BroadcastHashJoin [ss_item_sk,i_item_sk]
+                                BroadcastHashJoin [ss_item_sk,ss_item_sk]
+                                  ColumnarToRow
+                                    InputAdapter
+                                      CometFilter [ss_item_sk]
+                                        CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk]
+                                          SubqueryBroadcast [d_date_sk] #5
+                                            BroadcastExchange #15
+                                              WholeStageCodegen (1)
+                                                ColumnarToRow
+                                                  InputAdapter
+                                                    CometProject [d_date_sk]
+                                                      CometFilter [d_week_seq,d_date_sk]
+                                                        Subquery #6
+                                                          WholeStageCodegen (1)
+                                                            ColumnarToRow
+                                                              InputAdapter
+                                                                CometProject [d_week_seq]
+                                                                  CometFilter [d_year,d_moy,d_dom]
+                                                                    CometScan parquet spark_catalog.default.date_dim [d_week_seq,d_year,d_moy,d_dom]
+                                                        CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_week_seq]
+                                  InputAdapter
+                                    ReusedExchange [ss_item_sk] #3
+                                InputAdapter
+                                  ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #11
+                            InputAdapter
+                              ReusedExchange [d_date_sk] #15
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/explain.txt
new file mode 100644
index 0000000..811a9ee
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/explain.txt
@@ -0,0 +1,164 @@
+== Physical Plan ==
+TakeOrderedAndProject (22)
++- * HashAggregate (21)
+   +- Exchange (20)
+      +- * HashAggregate (19)
+         +- * Project (18)
+            +- * BroadcastHashJoin Inner BuildRight (17)
+               :- * Project (15)
+               :  +- * BroadcastHashJoin Inner BuildRight (14)
+               :     :- * Project (9)
+               :     :  +- * BroadcastHashJoin Inner BuildRight (8)
+               :     :     :- * ColumnarToRow (3)
+               :     :     :  +- CometFilter (2)
+               :     :     :     +- CometScan parquet spark_catalog.default.catalog_sales (1)
+               :     :     +- BroadcastExchange (7)
+               :     :        +- * ColumnarToRow (6)
+               :     :           +- CometFilter (5)
+               :     :              +- CometScan parquet spark_catalog.default.customer (4)
+               :     +- BroadcastExchange (13)
+               :        +- * ColumnarToRow (12)
+               :           +- CometFilter (11)
+               :              +- CometScan parquet spark_catalog.default.customer_address (10)
+               +- ReusedExchange (16)
+
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [3]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#3), dynamicpruningexpression(cs_sold_date_sk#3 IN dynamicpruning#4)]
+PushedFilters: [IsNotNull(cs_bill_customer_sk)]
+ReadSchema: struct<cs_bill_customer_sk:int,cs_sales_price:decimal(7,2)>
+
+(2) CometFilter
+Input [3]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3]
+Condition : isnotnull(cs_bill_customer_sk#1)
+
+(3) ColumnarToRow [codegen id : 4]
+Input [3]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3]
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [2]: [c_customer_sk#5, c_current_addr_sk#6]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)]
+ReadSchema: struct<c_customer_sk:int,c_current_addr_sk:int>
+
+(5) CometFilter
+Input [2]: [c_customer_sk#5, c_current_addr_sk#6]
+Condition : (isnotnull(c_customer_sk#5) AND isnotnull(c_current_addr_sk#6))
+
+(6) ColumnarToRow [codegen id : 1]
+Input [2]: [c_customer_sk#5, c_current_addr_sk#6]
+
+(7) BroadcastExchange
+Input [2]: [c_customer_sk#5, c_current_addr_sk#6]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(8) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [cs_bill_customer_sk#1]
+Right keys [1]: [c_customer_sk#5]
+Join type: Inner
+Join condition: None
+
+(9) Project [codegen id : 4]
+Output [3]: [cs_sales_price#2, cs_sold_date_sk#3, c_current_addr_sk#6]
+Input [5]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3, c_customer_sk#5, c_current_addr_sk#6]
+
+(unknown) Scan parquet spark_catalog.default.customer_address
+Output [3]: [ca_address_sk#7, ca_state#8, ca_zip#9]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_address]
+PushedFilters: [IsNotNull(ca_address_sk)]
+ReadSchema: struct<ca_address_sk:int,ca_state:string,ca_zip:string>
+
+(11) CometFilter
+Input [3]: [ca_address_sk#7, ca_state#8, ca_zip#9]
+Condition : isnotnull(ca_address_sk#7)
+
+(12) ColumnarToRow [codegen id : 2]
+Input [3]: [ca_address_sk#7, ca_state#8, ca_zip#9]
+
+(13) BroadcastExchange
+Input [3]: [ca_address_sk#7, ca_state#8, ca_zip#9]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]
+
+(14) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [c_current_addr_sk#6]
+Right keys [1]: [ca_address_sk#7]
+Join type: Inner
+Join condition: ((substr(ca_zip#9, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR ca_state#8 IN (CA,WA,GA)) OR (cs_sales_price#2 > 500.00))
+
+(15) Project [codegen id : 4]
+Output [3]: [cs_sales_price#2, cs_sold_date_sk#3, ca_zip#9]
+Input [6]: [cs_sales_price#2, cs_sold_date_sk#3, c_current_addr_sk#6, ca_address_sk#7, ca_state#8, ca_zip#9]
+
+(16) ReusedExchange [Reuses operator id: 27]
+Output [1]: [d_date_sk#10]
+
+(17) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [cs_sold_date_sk#3]
+Right keys [1]: [d_date_sk#10]
+Join type: Inner
+Join condition: None
+
+(18) Project [codegen id : 4]
+Output [2]: [cs_sales_price#2, ca_zip#9]
+Input [4]: [cs_sales_price#2, cs_sold_date_sk#3, ca_zip#9, d_date_sk#10]
+
+(19) HashAggregate [codegen id : 4]
+Input [2]: [cs_sales_price#2, ca_zip#9]
+Keys [1]: [ca_zip#9]
+Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#2))]
+Aggregate Attributes [1]: [sum#11]
+Results [2]: [ca_zip#9, sum#12]
+
+(20) Exchange
+Input [2]: [ca_zip#9, sum#12]
+Arguments: hashpartitioning(ca_zip#9, 5), ENSURE_REQUIREMENTS, [plan_id=3]
+
+(21) HashAggregate [codegen id : 5]
+Input [2]: [ca_zip#9, sum#12]
+Keys [1]: [ca_zip#9]
+Functions [1]: [sum(UnscaledValue(cs_sales_price#2))]
+Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#2))#13]
+Results [2]: [ca_zip#9, MakeDecimal(sum(UnscaledValue(cs_sales_price#2))#13,17,2) AS sum(cs_sales_price)#14]
+
+(22) TakeOrderedAndProject
+Input [2]: [ca_zip#9, sum(cs_sales_price)#14]
+Arguments: 100, [ca_zip#9 ASC NULLS FIRST], [ca_zip#9, sum(cs_sales_price)#14]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#3 IN dynamicpruning#4
+BroadcastExchange (27)
++- * ColumnarToRow (26)
+   +- CometProject (25)
+      +- CometFilter (24)
+         +- CometScan parquet spark_catalog.default.date_dim (23)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [3]: [d_date_sk#10, d_year#15, d_qoy#16]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int,d_qoy:int>
+
+(24) CometFilter
+Input [3]: [d_date_sk#10, d_year#15, d_qoy#16]
+Condition : ((((isnotnull(d_qoy#16) AND isnotnull(d_year#15)) AND (d_qoy#16 = 2)) AND (d_year#15 = 2001)) AND isnotnull(d_date_sk#10))
+
+(25) CometProject
+Input [3]: [d_date_sk#10, d_year#15, d_qoy#16]
+Arguments: [d_date_sk#10], [d_date_sk#10]
+
+(26) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#10]
+
+(27) BroadcastExchange
+Input [1]: [d_date_sk#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/simplified.txt
new file mode 100644
index 0000000..5c750b2
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/simplified.txt
@@ -0,0 +1,41 @@
+TakeOrderedAndProject [ca_zip,sum(cs_sales_price)]
+  WholeStageCodegen (5)
+    HashAggregate [ca_zip,sum] [sum(UnscaledValue(cs_sales_price)),sum(cs_sales_price),sum]
+      InputAdapter
+        Exchange [ca_zip] #1
+          WholeStageCodegen (4)
+            HashAggregate [ca_zip,cs_sales_price] [sum,sum]
+              Project [cs_sales_price,ca_zip]
+                BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                  Project [cs_sales_price,cs_sold_date_sk,ca_zip]
+                    BroadcastHashJoin [c_current_addr_sk,ca_address_sk,ca_zip,ca_state,cs_sales_price]
+                      Project [cs_sales_price,cs_sold_date_sk,c_current_addr_sk]
+                        BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk]
+                          ColumnarToRow
+                            InputAdapter
+                              CometFilter [cs_bill_customer_sk]
+                                CometScan parquet spark_catalog.default.catalog_sales [cs_bill_customer_sk,cs_sales_price,cs_sold_date_sk]
+                                  SubqueryBroadcast [d_date_sk] #1
+                                    BroadcastExchange #2
+                                      WholeStageCodegen (1)
+                                        ColumnarToRow
+                                          InputAdapter
+                                            CometProject [d_date_sk]
+                                              CometFilter [d_qoy,d_year,d_date_sk]
+                                                CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year,d_qoy]
+                          InputAdapter
+                            BroadcastExchange #3
+                              WholeStageCodegen (1)
+                                ColumnarToRow
+                                  InputAdapter
+                                    CometFilter [c_customer_sk,c_current_addr_sk]
+                                      CometScan parquet spark_catalog.default.customer [c_customer_sk,c_current_addr_sk]
+                      InputAdapter
+                        BroadcastExchange #4
+                          WholeStageCodegen (2)
+                            ColumnarToRow
+                              InputAdapter
+                                CometFilter [ca_address_sk]
+                                  CometScan parquet spark_catalog.default.customer_address [ca_address_sk,ca_state,ca_zip]
+                  InputAdapter
+                    ReusedExchange [d_date_sk] #2
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/explain.txt
new file mode 100644
index 0000000..1762c8c
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/explain.txt
@@ -0,0 +1,260 @@
+== Physical Plan ==
+* HashAggregate (45)
++- Exchange (44)
+   +- * HashAggregate (43)
+      +- * HashAggregate (42)
+         +- * HashAggregate (41)
+            +- * Project (40)
+               +- * BroadcastHashJoin Inner BuildRight (39)
+                  :- * Project (33)
+                  :  +- * BroadcastHashJoin Inner BuildRight (32)
+                  :     :- * Project (26)
+                  :     :  +- * BroadcastHashJoin Inner BuildRight (25)
+                  :     :     :- * SortMergeJoin LeftAnti (19)
+                  :     :     :  :- * Project (13)
+                  :     :     :  :  +- * SortMergeJoin LeftSemi (12)
+                  :     :     :  :     :- * ColumnarToRow (6)
+                  :     :     :  :     :  +- CometSort (5)
+                  :     :     :  :     :     +- CometExchange (4)
+                  :     :     :  :     :        +- CometProject (3)
+                  :     :     :  :     :           +- CometFilter (2)
+                  :     :     :  :     :              +- CometScan parquet spark_catalog.default.catalog_sales (1)
+                  :     :     :  :     +- * ColumnarToRow (11)
+                  :     :     :  :        +- CometSort (10)
+                  :     :     :  :           +- CometExchange (9)
+                  :     :     :  :              +- CometProject (8)
+                  :     :     :  :                 +- CometScan parquet spark_catalog.default.catalog_sales (7)
+                  :     :     :  +- * ColumnarToRow (18)
+                  :     :     :     +- CometSort (17)
+                  :     :     :        +- CometExchange (16)
+                  :     :     :           +- CometProject (15)
+                  :     :     :              +- CometScan parquet spark_catalog.default.catalog_returns (14)
+                  :     :     +- BroadcastExchange (24)
+                  :     :        +- * ColumnarToRow (23)
+                  :     :           +- CometProject (22)
+                  :     :              +- CometFilter (21)
+                  :     :                 +- CometScan parquet spark_catalog.default.date_dim (20)
+                  :     +- BroadcastExchange (31)
+                  :        +- * ColumnarToRow (30)
+                  :           +- CometProject (29)
+                  :              +- CometFilter (28)
+                  :                 +- CometScan parquet spark_catalog.default.customer_address (27)
+                  +- BroadcastExchange (38)
+                     +- * ColumnarToRow (37)
+                        +- CometProject (36)
+                           +- CometFilter (35)
+                              +- CometScan parquet spark_catalog.default.call_center (34)
+
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [8]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cs_sold_date_sk#8]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/catalog_sales]
+PushedFilters: [IsNotNull(cs_ship_date_sk), IsNotNull(cs_ship_addr_sk), IsNotNull(cs_call_center_sk)]
+ReadSchema: struct<cs_ship_date_sk:int,cs_ship_addr_sk:int,cs_call_center_sk:int,cs_warehouse_sk:int,cs_order_number:int,cs_ext_ship_cost:decimal(7,2),cs_net_profit:decimal(7,2)>
+
+(2) CometFilter
+Input [8]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cs_sold_date_sk#8]
+Condition : ((isnotnull(cs_ship_date_sk#1) AND isnotnull(cs_ship_addr_sk#2)) AND isnotnull(cs_call_center_sk#3))
+
+(3) CometProject
+Input [8]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cs_sold_date_sk#8]
+Arguments: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7], [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
+
+(4) CometExchange
+Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
+Arguments: hashpartitioning(cs_order_number#5, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]
+
+(5) CometSort
+Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
+Arguments: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7], [cs_order_number#5 ASC NULLS FIRST]
+
+(6) ColumnarToRow [codegen id : 1]
+Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [3]: [cs_warehouse_sk#9, cs_order_number#10, cs_sold_date_sk#11]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/catalog_sales]
+ReadSchema: struct<cs_warehouse_sk:int,cs_order_number:int>
+
+(8) CometProject
+Input [3]: [cs_warehouse_sk#9, cs_order_number#10, cs_sold_date_sk#11]
+Arguments: [cs_warehouse_sk#9, cs_order_number#10], [cs_warehouse_sk#9, cs_order_number#10]
+
+(9) CometExchange
+Input [2]: [cs_warehouse_sk#9, cs_order_number#10]
+Arguments: hashpartitioning(cs_order_number#10, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=2]
+
+(10) CometSort
+Input [2]: [cs_warehouse_sk#9, cs_order_number#10]
+Arguments: [cs_warehouse_sk#9, cs_order_number#10], [cs_order_number#10 ASC NULLS FIRST]
+
+(11) ColumnarToRow [codegen id : 2]
+Input [2]: [cs_warehouse_sk#9, cs_order_number#10]
+
+(12) SortMergeJoin [codegen id : 3]
+Left keys [1]: [cs_order_number#5]
+Right keys [1]: [cs_order_number#10]
+Join type: LeftSemi
+Join condition: NOT (cs_warehouse_sk#4 = cs_warehouse_sk#9)
+
+(13) Project [codegen id : 3]
+Output [6]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
+Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
+
+(unknown) Scan parquet spark_catalog.default.catalog_returns
+Output [2]: [cr_order_number#12, cr_returned_date_sk#13]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/catalog_returns]
+ReadSchema: struct<cr_order_number:int>
+
+(15) CometProject
+Input [2]: [cr_order_number#12, cr_returned_date_sk#13]
+Arguments: [cr_order_number#12], [cr_order_number#12]
+
+(16) CometExchange
+Input [1]: [cr_order_number#12]
+Arguments: hashpartitioning(cr_order_number#12, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=3]
+
+(17) CometSort
+Input [1]: [cr_order_number#12]
+Arguments: [cr_order_number#12], [cr_order_number#12 ASC NULLS FIRST]
+
+(18) ColumnarToRow [codegen id : 4]
+Input [1]: [cr_order_number#12]
+
+(19) SortMergeJoin [codegen id : 8]
+Left keys [1]: [cs_order_number#5]
+Right keys [1]: [cr_order_number#12]
+Join type: LeftAnti
+Join condition: None
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#14, d_date#15]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2002-02-01), LessThanOrEqual(d_date,2002-04-02), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_date:date>
+
+(21) CometFilter
+Input [2]: [d_date_sk#14, d_date#15]
+Condition : (((isnotnull(d_date#15) AND (d_date#15 >= 2002-02-01)) AND (d_date#15 <= 2002-04-02)) AND isnotnull(d_date_sk#14))
+
+(22) CometProject
+Input [2]: [d_date_sk#14, d_date#15]
+Arguments: [d_date_sk#14], [d_date_sk#14]
+
+(23) ColumnarToRow [codegen id : 5]
+Input [1]: [d_date_sk#14]
+
+(24) BroadcastExchange
+Input [1]: [d_date_sk#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]
+
+(25) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [cs_ship_date_sk#1]
+Right keys [1]: [d_date_sk#14]
+Join type: Inner
+Join condition: None
+
+(26) Project [codegen id : 8]
+Output [5]: [cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
+Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#14]
+
+(unknown) Scan parquet spark_catalog.default.customer_address
+Output [2]: [ca_address_sk#16, ca_state#17]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_address]
+PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)]
+ReadSchema: struct<ca_address_sk:int,ca_state:string>
+
+(28) CometFilter
+Input [2]: [ca_address_sk#16, ca_state#17]
+Condition : ((isnotnull(ca_state#17) AND (ca_state#17 = GA)) AND isnotnull(ca_address_sk#16))
+
+(29) CometProject
+Input [2]: [ca_address_sk#16, ca_state#17]
+Arguments: [ca_address_sk#16], [ca_address_sk#16]
+
+(30) ColumnarToRow [codegen id : 6]
+Input [1]: [ca_address_sk#16]
+
+(31) BroadcastExchange
+Input [1]: [ca_address_sk#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
+
+(32) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [cs_ship_addr_sk#2]
+Right keys [1]: [ca_address_sk#16]
+Join type: Inner
+Join condition: None
+
+(33) Project [codegen id : 8]
+Output [4]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
+Input [6]: [cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, ca_address_sk#16]
+
+(unknown) Scan parquet spark_catalog.default.call_center
+Output [2]: [cc_call_center_sk#18, cc_county#19]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/call_center]
+PushedFilters: [IsNotNull(cc_county), EqualTo(cc_county,Williamson County), IsNotNull(cc_call_center_sk)]
+ReadSchema: struct<cc_call_center_sk:int,cc_county:string>
+
+(35) CometFilter
+Input [2]: [cc_call_center_sk#18, cc_county#19]
+Condition : ((isnotnull(cc_county#19) AND (cc_county#19 = Williamson County)) AND isnotnull(cc_call_center_sk#18))
+
+(36) CometProject
+Input [2]: [cc_call_center_sk#18, cc_county#19]
+Arguments: [cc_call_center_sk#18], [cc_call_center_sk#18]
+
+(37) ColumnarToRow [codegen id : 7]
+Input [1]: [cc_call_center_sk#18]
+
+(38) BroadcastExchange
+Input [1]: [cc_call_center_sk#18]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
+
+(39) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [cs_call_center_sk#3]
+Right keys [1]: [cc_call_center_sk#18]
+Join type: Inner
+Join condition: None
+
+(40) Project [codegen id : 8]
+Output [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
+Input [5]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#18]
+
+(41) HashAggregate [codegen id : 8]
+Input [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7]
+Keys [1]: [cs_order_number#5]
+Functions [2]: [partial_sum(UnscaledValue(cs_ext_ship_cost#6)), partial_sum(UnscaledValue(cs_net_profit#7))]
+Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_ship_cost#6))#20, sum(UnscaledValue(cs_net_profit#7))#21]
+Results [3]: [cs_order_number#5, sum#22, sum#23]
+
+(42) HashAggregate [codegen id : 8]
+Input [3]: [cs_order_number#5, sum#22, sum#23]
+Keys [1]: [cs_order_number#5]
+Functions [2]: [merge_sum(UnscaledValue(cs_ext_ship_cost#6)), merge_sum(UnscaledValue(cs_net_profit#7))]
+Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_ship_cost#6))#20, sum(UnscaledValue(cs_net_profit#7))#21]
+Results [3]: [cs_order_number#5, sum#22, sum#23]
+
+(43) HashAggregate [codegen id : 8]
+Input [3]: [cs_order_number#5, sum#22, sum#23]
+Keys: []
+Functions [3]: [merge_sum(UnscaledValue(cs_ext_ship_cost#6)), merge_sum(UnscaledValue(cs_net_profit#7)), partial_count(distinct cs_order_number#5)]
+Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_ship_cost#6))#20, sum(UnscaledValue(cs_net_profit#7))#21, count(cs_order_number#5)#24]
+Results [3]: [sum#22, sum#23, count#25]
+
+(44) Exchange
+Input [3]: [sum#22, sum#23, count#25]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=7]
+
+(45) HashAggregate [codegen id : 9]
+Input [3]: [sum#22, sum#23, count#25]
+Keys: []
+Functions [3]: [sum(UnscaledValue(cs_ext_ship_cost#6)), sum(UnscaledValue(cs_net_profit#7)), count(distinct cs_order_number#5)]
+Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_ship_cost#6))#20, sum(UnscaledValue(cs_net_profit#7))#21, count(cs_order_number#5)#24]
+Results [3]: [count(cs_order_number#5)#24 AS order count #26, MakeDecimal(sum(UnscaledValue(cs_ext_ship_cost#6))#20,17,2) AS total shipping cost #27, MakeDecimal(sum(UnscaledValue(cs_net_profit#7))#21,17,2) AS total net profit #28]
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/simplified.txt
new file mode 100644
index 0000000..2137263
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/simplified.txt
@@ -0,0 +1,68 @@
+WholeStageCodegen (9)
+  HashAggregate [sum,sum,count] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),count(cs_order_number),order count ,total shipping cost ,total net profit ,sum,sum,count]
+    InputAdapter
+      Exchange #1
+        WholeStageCodegen (8)
+          HashAggregate [cs_order_number] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),count(cs_order_number),sum,sum,count,sum,sum,count]
+            HashAggregate [cs_order_number] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum]
+              HashAggregate [cs_order_number,cs_ext_ship_cost,cs_net_profit] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum]
+                Project [cs_order_number,cs_ext_ship_cost,cs_net_profit]
+                  BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk]
+                    Project [cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit]
+                      BroadcastHashJoin [cs_ship_addr_sk,ca_address_sk]
+                        Project [cs_ship_addr_sk,cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit]
+                          BroadcastHashJoin [cs_ship_date_sk,d_date_sk]
+                            SortMergeJoin [cs_order_number,cr_order_number]
+                              InputAdapter
+                                WholeStageCodegen (3)
+                                  Project [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit]
+                                    SortMergeJoin [cs_order_number,cs_order_number,cs_warehouse_sk,cs_warehouse_sk]
+                                      InputAdapter
+                                        WholeStageCodegen (1)
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometSort [cs_order_number]
+                                                CometExchange [cs_order_number] #2
+                                                  CometProject [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk,cs_warehouse_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit]
+                                                    CometFilter [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk]
+                                                      CometScan parquet spark_catalog.default.catalog_sales [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk,cs_warehouse_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit,cs_sold_date_sk]
+                                      InputAdapter
+                                        WholeStageCodegen (2)
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometSort [cs_order_number]
+                                                CometExchange [cs_order_number] #3
+                                                  CometProject [cs_warehouse_sk,cs_order_number]
+                                                    CometScan parquet spark_catalog.default.catalog_sales [cs_warehouse_sk,cs_order_number,cs_sold_date_sk]
+                              InputAdapter
+                                WholeStageCodegen (4)
+                                  ColumnarToRow
+                                    InputAdapter
+                                      CometSort [cr_order_number]
+                                        CometExchange [cr_order_number] #4
+                                          CometProject [cr_order_number]
+                                            CometScan parquet spark_catalog.default.catalog_returns [cr_order_number,cr_returned_date_sk]
+                            InputAdapter
+                              BroadcastExchange #5
+                                WholeStageCodegen (5)
+                                  ColumnarToRow
+                                    InputAdapter
+                                      CometProject [d_date_sk]
+                                        CometFilter [d_date,d_date_sk]
+                                          CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_date]
+                        InputAdapter
+                          BroadcastExchange #6
+                            WholeStageCodegen (6)
+                              ColumnarToRow
+                                InputAdapter
+                                  CometProject [ca_address_sk]
+                                    CometFilter [ca_state,ca_address_sk]
+                                      CometScan parquet spark_catalog.default.customer_address [ca_address_sk,ca_state]
+                    InputAdapter
+                      BroadcastExchange #7
+                        WholeStageCodegen (7)
+                          ColumnarToRow
+                            InputAdapter
+                              CometProject [cc_call_center_sk]
+                                CometFilter [cc_county,cc_call_center_sk]
+                                  CometScan parquet spark_catalog.default.call_center [cc_call_center_sk,cc_county]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/explain.txt
new file mode 100644
index 0000000..5e9b6d1
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/explain.txt
@@ -0,0 +1,298 @@
+== Physical Plan ==
+TakeOrderedAndProject (40)
++- * HashAggregate (39)
+   +- Exchange (38)
+      +- * HashAggregate (37)
+         +- * Project (36)
+            +- * BroadcastHashJoin Inner BuildRight (35)
+               :- * Project (30)
+               :  +- * BroadcastHashJoin Inner BuildRight (29)
+               :     :- * Project (24)
+               :     :  +- * BroadcastHashJoin Inner BuildRight (23)
+               :     :     :- * Project (21)
+               :     :     :  +- * BroadcastHashJoin Inner BuildRight (20)
+               :     :     :     :- * Project (18)
+               :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (17)
+               :     :     :     :     :- * Project (15)
+               :     :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (14)
+               :     :     :     :     :     :- * Project (9)
+               :     :     :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (8)
+               :     :     :     :     :     :     :- * ColumnarToRow (3)
+               :     :     :     :     :     :     :  +- CometFilter (2)
+               :     :     :     :     :     :     :     +- CometScan parquet spark_catalog.default.store_sales (1)
+               :     :     :     :     :     :     +- BroadcastExchange (7)
+               :     :     :     :     :     :        +- * ColumnarToRow (6)
+               :     :     :     :     :     :           +- CometFilter (5)
+               :     :     :     :     :     :              +- CometScan parquet spark_catalog.default.store_returns (4)
+               :     :     :     :     :     +- BroadcastExchange (13)
+               :     :     :     :     :        +- * ColumnarToRow (12)
+               :     :     :     :     :           +- CometFilter (11)
+               :     :     :     :     :              +- CometScan parquet spark_catalog.default.catalog_sales (10)
+               :     :     :     :     +- ReusedExchange (16)
+               :     :     :     +- ReusedExchange (19)
+               :     :     +- ReusedExchange (22)
+               :     +- BroadcastExchange (28)
+               :        +- * ColumnarToRow (27)
+               :           +- CometFilter (26)
+               :              +- CometScan parquet spark_catalog.default.store (25)
+               +- BroadcastExchange (34)
+                  +- * ColumnarToRow (33)
+                     +- CometFilter (32)
+                        +- CometScan parquet spark_catalog.default.item (31)
+
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)]
+PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk)]
+ReadSchema: struct<ss_item_sk:int,ss_customer_sk:int,ss_store_sk:int,ss_ticket_number:int,ss_quantity:int>
+
+(2) CometFilter
+Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6]
+Condition : (((isnotnull(ss_customer_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_ticket_number#4)) AND isnotnull(ss_store_sk#3))
+
+(3) ColumnarToRow [codegen id : 8]
+Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6]
+
+(unknown) Scan parquet spark_catalog.default.store_returns
+Output [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(sr_returned_date_sk#12), dynamicpruningexpression(sr_returned_date_sk#12 IN dynamicpruning#13)]
+PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)]
+ReadSchema: struct<sr_item_sk:int,sr_customer_sk:int,sr_ticket_number:int,sr_return_quantity:int>
+
+(5) CometFilter
+Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12]
+Condition : ((isnotnull(sr_customer_sk#9) AND isnotnull(sr_item_sk#8)) AND isnotnull(sr_ticket_number#10))
+
+(6) ColumnarToRow [codegen id : 1]
+Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12]
+
+(7) BroadcastExchange
+Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12]
+Arguments: HashedRelationBroadcastMode(List(input[1, int, false], input[0, int, false], input[2, int, false]),false), [plan_id=1]
+
+(8) BroadcastHashJoin [codegen id : 8]
+Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4]
+Right keys [3]: [sr_customer_sk#9, sr_item_sk#8, sr_ticket_number#10]
+Join type: Inner
+Join condition: None
+
+(9) Project [codegen id : 8]
+Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_return_quantity#11, sr_returned_date_sk#12]
+Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12]
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [4]: [cs_bill_customer_sk#14, cs_item_sk#15, cs_quantity#16, cs_sold_date_sk#17]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#17), dynamicpruningexpression(cs_sold_date_sk#17 IN dynamicpruning#18)]
+PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)]
+ReadSchema: struct<cs_bill_customer_sk:int,cs_item_sk:int,cs_quantity:int>
+
+(11) CometFilter
+Input [4]: [cs_bill_customer_sk#14, cs_item_sk#15, cs_quantity#16, cs_sold_date_sk#17]
+Condition : (isnotnull(cs_bill_customer_sk#14) AND isnotnull(cs_item_sk#15))
+
+(12) ColumnarToRow [codegen id : 2]
+Input [4]: [cs_bill_customer_sk#14, cs_item_sk#15, cs_quantity#16, cs_sold_date_sk#17]
+
+(13) BroadcastExchange
+Input [4]: [cs_bill_customer_sk#14, cs_item_sk#15, cs_quantity#16, cs_sold_date_sk#17]
+Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[1, int, false] as bigint) & 4294967295))),false), [plan_id=2]
+
+(14) BroadcastHashJoin [codegen id : 8]
+Left keys [2]: [sr_customer_sk#9, sr_item_sk#8]
+Right keys [2]: [cs_bill_customer_sk#14, cs_item_sk#15]
+Join type: Inner
+Join condition: None
+
+(15) Project [codegen id : 8]
+Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#16, cs_sold_date_sk#17]
+Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_return_quantity#11, sr_returned_date_sk#12, cs_bill_customer_sk#14, cs_item_sk#15, cs_quantity#16, cs_sold_date_sk#17]
+
+(16) ReusedExchange [Reuses operator id: 45]
+Output [1]: [d_date_sk#19]
+
+(17) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [ss_sold_date_sk#6]
+Right keys [1]: [d_date_sk#19]
+Join type: Inner
+Join condition: None
+
+(18) Project [codegen id : 8]
+Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#16, cs_sold_date_sk#17]
+Input [9]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#16, cs_sold_date_sk#17, d_date_sk#19]
+
+(19) ReusedExchange [Reuses operator id: 50]
+Output [1]: [d_date_sk#20]
+
+(20) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [sr_returned_date_sk#12]
+Right keys [1]: [d_date_sk#20]
+Join type: Inner
+Join condition: None
+
+(21) Project [codegen id : 8]
+Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#16, cs_sold_date_sk#17]
+Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#16, cs_sold_date_sk#17, d_date_sk#20]
+
+(22) ReusedExchange [Reuses operator id: 50]
+Output [1]: [d_date_sk#21]
+
+(23) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [cs_sold_date_sk#17]
+Right keys [1]: [d_date_sk#21]
+Join type: Inner
+Join condition: None
+
+(24) Project [codegen id : 8]
+Output [5]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#16]
+Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#16, cs_sold_date_sk#17, d_date_sk#21]
+
+(unknown) Scan parquet spark_catalog.default.store
+Output [2]: [s_store_sk#22, s_state#23]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store]
+PushedFilters: [IsNotNull(s_store_sk)]
+ReadSchema: struct<s_store_sk:int,s_state:string>
+
+(26) CometFilter
+Input [2]: [s_store_sk#22, s_state#23]
+Condition : isnotnull(s_store_sk#22)
+
+(27) ColumnarToRow [codegen id : 6]
+Input [2]: [s_store_sk#22, s_state#23]
+
+(28) BroadcastExchange
+Input [2]: [s_store_sk#22, s_state#23]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
+
+(29) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [ss_store_sk#3]
+Right keys [1]: [s_store_sk#22]
+Join type: Inner
+Join condition: None
+
+(30) Project [codegen id : 8]
+Output [5]: [ss_item_sk#1, ss_quantity#5, sr_return_quantity#11, cs_quantity#16, s_state#23]
+Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#16, s_store_sk#22, s_state#23]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [3]: [i_item_sk#24, i_item_id#25, i_item_desc#26]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_item_id:string,i_item_desc:string>
+
+(32) CometFilter
+Input [3]: [i_item_sk#24, i_item_id#25, i_item_desc#26]
+Condition : isnotnull(i_item_sk#24)
+
+(33) ColumnarToRow [codegen id : 7]
+Input [3]: [i_item_sk#24, i_item_id#25, i_item_desc#26]
+
+(34) BroadcastExchange
+Input [3]: [i_item_sk#24, i_item_id#25, i_item_desc#26]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
+
+(35) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [ss_item_sk#1]
+Right keys [1]: [i_item_sk#24]
+Join type: Inner
+Join condition: None
+
+(36) Project [codegen id : 8]
+Output [6]: [ss_quantity#5, sr_return_quantity#11, cs_quantity#16, s_state#23, i_item_id#25, i_item_desc#26]
+Input [8]: [ss_item_sk#1, ss_quantity#5, sr_return_quantity#11, cs_quantity#16, s_state#23, i_item_sk#24, i_item_id#25, i_item_desc#26]
+
+(37) HashAggregate [codegen id : 8]
+Input [6]: [ss_quantity#5, sr_return_quantity#11, cs_quantity#16, s_state#23, i_item_id#25, i_item_desc#26]
+Keys [3]: [i_item_id#25, i_item_desc#26, s_state#23]
+Functions [9]: [partial_count(ss_quantity#5), partial_avg(ss_quantity#5), partial_stddev_samp(cast(ss_quantity#5 as double)), partial_count(sr_return_quantity#11), partial_avg(sr_return_quantity#11), partial_stddev_samp(cast(sr_return_quantity#11 as double)), partial_count(cs_quantity#16), partial_avg(cs_quantity#16), partial_stddev_samp(cast(cs_quantity#16 as double))]
+Aggregate Attributes [18]: [count#27, sum#28, count#29, n#30, avg#31, m2#32, count#33, sum#34, count#35, n#36, avg#37, m2#38, count#39, sum#40, count#41, n#42, avg#43, m2#44]
+Results [21]: [i_item_id#25, i_item_desc#26, s_state#23, count#45, sum#46, count#47, n#48, avg#49, m2#50, count#51, sum#52, count#53, n#54, avg#55, m2#56, count#57, sum#58, count#59, n#60, avg#61, m2#62]
+
+(38) Exchange
+Input [21]: [i_item_id#25, i_item_desc#26, s_state#23, count#45, sum#46, count#47, n#48, avg#49, m2#50, count#51, sum#52, count#53, n#54, avg#55, m2#56, count#57, sum#58, count#59, n#60, avg#61, m2#62]
+Arguments: hashpartitioning(i_item_id#25, i_item_desc#26, s_state#23, 5), ENSURE_REQUIREMENTS, [plan_id=5]
+
+(39) HashAggregate [codegen id : 9]
+Input [21]: [i_item_id#25, i_item_desc#26, s_state#23, count#45, sum#46, count#47, n#48, avg#49, m2#50, count#51, sum#52, count#53, n#54, avg#55, m2#56, count#57, sum#58, count#59, n#60, avg#61, m2#62]
+Keys [3]: [i_item_id#25, i_item_desc#26, s_state#23]
+Functions [9]: [count(ss_quantity#5), avg(ss_quantity#5), stddev_samp(cast(ss_quantity#5 as double)), count(sr_return_quantity#11), avg(sr_return_quantity#11), stddev_samp(cast(sr_return_quantity#11 as double)), count(cs_quantity#16), avg(cs_quantity#16), stddev_samp(cast(cs_quantity#16 as double))]
+Aggregate Attributes [9]: [count(ss_quantity#5)#63, avg(ss_quantity#5)#64, stddev_samp(cast(ss_quantity#5 as double))#65, count(sr_return_quantity#11)#66, avg(sr_return_quantity#11)#67, stddev_samp(cast(sr_return_quantity#11 as double))#68, count(cs_quantity#16)#69, avg(cs_quantity#16)#70, stddev_samp(cast(cs_quantity#16 as double))#71]
+Results [15]: [i_item_id#25, i_item_desc#26, s_state#23, count(ss_quantity#5)#63 AS store_sales_quantitycount#72, avg(ss_quantity#5)#64 AS store_sales_quantityave#73, stddev_samp(cast(ss_quantity#5 as double))#65 AS store_sales_quantitystdev#74, (stddev_samp(cast(ss_quantity#5 as double))#65 / avg(ss_quantity#5)#64) AS store_sales_quantitycov#75, count(sr_return_quantity#11)#66 AS as_store_returns_quantitycount#76, avg(sr_return_quantity#11)#67 AS as_store_returns_quantityave#77, stddev_ [...]
+
+(40) TakeOrderedAndProject
+Input [15]: [i_item_id#25, i_item_desc#26, s_state#23, store_sales_quantitycount#72, store_sales_quantityave#73, store_sales_quantitystdev#74, store_sales_quantitycov#75, as_store_returns_quantitycount#76, as_store_returns_quantityave#77, as_store_returns_quantitystdev#78, store_returns_quantitycov#79, catalog_sales_quantitycount#80, catalog_sales_quantityave#81, catalog_sales_quantitystdev#82, catalog_sales_quantitycov#83]
+Arguments: 100, [i_item_id#25 ASC NULLS FIRST, i_item_desc#26 ASC NULLS FIRST, s_state#23 ASC NULLS FIRST], [i_item_id#25, i_item_desc#26, s_state#23, store_sales_quantitycount#72, store_sales_quantityave#73, store_sales_quantitystdev#74, store_sales_quantitycov#75, as_store_returns_quantitycount#76, as_store_returns_quantityave#77, as_store_returns_quantitystdev#78, store_returns_quantitycov#79, catalog_sales_quantitycount#80, catalog_sales_quantityave#81, catalog_sales_quantitystdev#82 [...]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7
+BroadcastExchange (45)
++- * ColumnarToRow (44)
+   +- CometProject (43)
+      +- CometFilter (42)
+         +- CometScan parquet spark_catalog.default.date_dim (41)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#19, d_quarter_name#84]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_quarter_name), EqualTo(d_quarter_name,2001Q1), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_quarter_name:string>
+
+(42) CometFilter
+Input [2]: [d_date_sk#19, d_quarter_name#84]
+Condition : ((isnotnull(d_quarter_name#84) AND (d_quarter_name#84 = 2001Q1)) AND isnotnull(d_date_sk#19))
+
+(43) CometProject
+Input [2]: [d_date_sk#19, d_quarter_name#84]
+Arguments: [d_date_sk#19], [d_date_sk#19]
+
+(44) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#19]
+
+(45) BroadcastExchange
+Input [1]: [d_date_sk#19]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
+
+Subquery:2 Hosting operator id = 4 Hosting Expression = sr_returned_date_sk#12 IN dynamicpruning#13
+BroadcastExchange (50)
++- * ColumnarToRow (49)
+   +- CometProject (48)
+      +- CometFilter (47)
+         +- CometScan parquet spark_catalog.default.date_dim (46)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#20, d_quarter_name#85]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [In(d_quarter_name, [2001Q1,2001Q2,2001Q3]), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_quarter_name:string>
+
+(47) CometFilter
+Input [2]: [d_date_sk#20, d_quarter_name#85]
+Condition : (d_quarter_name#85 IN (2001Q1,2001Q2,2001Q3) AND isnotnull(d_date_sk#20))
+
+(48) CometProject
+Input [2]: [d_date_sk#20, d_quarter_name#85]
+Arguments: [d_date_sk#20], [d_date_sk#20]
+
+(49) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#20]
+
+(50) BroadcastExchange
+Input [1]: [d_date_sk#20]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
+
+Subquery:3 Hosting operator id = 10 Hosting Expression = cs_sold_date_sk#17 IN dynamicpruning#13
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/simplified.txt
new file mode 100644
index 0000000..9f4d67d
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/simplified.txt
@@ -0,0 +1,76 @@
+TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,store_sales_quantityave,store_sales_quantitystdev,store_sales_quantitycov,as_store_returns_quantitycount,as_store_returns_quantityave,as_store_returns_quantitystdev,store_returns_quantitycov,catalog_sales_quantitycount,catalog_sales_quantityave,catalog_sales_quantitystdev,catalog_sales_quantitycov]
+  WholeStageCodegen (9)
+    HashAggregate [i_item_id,i_item_desc,s_state,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2] [count(ss_quantity),avg(ss_quantity),stddev_samp(cast(ss_quantity as double)),count(sr_return_quantity),avg(sr_return_quantity),stddev_samp(cast(sr_return_quantity as double)),count(cs_quantity),avg(cs_quantity),stddev_samp(cast(cs_quantity as double)),store_sales_quantitycount,store_sales_quantityave,store_sales_quantitystdev,store_sales_quantitycov,as_store_retur [...]
+      InputAdapter
+        Exchange [i_item_id,i_item_desc,s_state] #1
+          WholeStageCodegen (8)
+            HashAggregate [i_item_id,i_item_desc,s_state,ss_quantity,sr_return_quantity,cs_quantity] [count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2]
+              Project [ss_quantity,sr_return_quantity,cs_quantity,s_state,i_item_id,i_item_desc]
+                BroadcastHashJoin [ss_item_sk,i_item_sk]
+                  Project [ss_item_sk,ss_quantity,sr_return_quantity,cs_quantity,s_state]
+                    BroadcastHashJoin [ss_store_sk,s_store_sk]
+                      Project [ss_item_sk,ss_store_sk,ss_quantity,sr_return_quantity,cs_quantity]
+                        BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                          Project [ss_item_sk,ss_store_sk,ss_quantity,sr_return_quantity,cs_quantity,cs_sold_date_sk]
+                            BroadcastHashJoin [sr_returned_date_sk,d_date_sk]
+                              Project [ss_item_sk,ss_store_sk,ss_quantity,sr_return_quantity,sr_returned_date_sk,cs_quantity,cs_sold_date_sk]
+                                BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                  Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sold_date_sk,sr_return_quantity,sr_returned_date_sk,cs_quantity,cs_sold_date_sk]
+                                    BroadcastHashJoin [sr_customer_sk,sr_item_sk,cs_bill_customer_sk,cs_item_sk]
+                                      Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sold_date_sk,sr_item_sk,sr_customer_sk,sr_return_quantity,sr_returned_date_sk]
+                                        BroadcastHashJoin [ss_customer_sk,ss_item_sk,ss_ticket_number,sr_customer_sk,sr_item_sk,sr_ticket_number]
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometFilter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_store_sk]
+                                                CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity,ss_sold_date_sk]
+                                                  SubqueryBroadcast [d_date_sk] #1
+                                                    BroadcastExchange #2
+                                                      WholeStageCodegen (1)
+                                                        ColumnarToRow
+                                                          InputAdapter
+                                                            CometProject [d_date_sk]
+                                                              CometFilter [d_quarter_name,d_date_sk]
+                                                                CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_quarter_name]
+                                          InputAdapter
+                                            BroadcastExchange #3
+                                              WholeStageCodegen (1)
+                                                ColumnarToRow
+                                                  InputAdapter
+                                                    CometFilter [sr_customer_sk,sr_item_sk,sr_ticket_number]
+                                                      CometScan parquet spark_catalog.default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity,sr_returned_date_sk]
+                                                        SubqueryBroadcast [d_date_sk] #2
+                                                          BroadcastExchange #4
+                                                            WholeStageCodegen (1)
+                                                              ColumnarToRow
+                                                                InputAdapter
+                                                                  CometProject [d_date_sk]
+                                                                    CometFilter [d_quarter_name,d_date_sk]
+                                                                      CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_quarter_name]
+                                      InputAdapter
+                                        BroadcastExchange #5
+                                          WholeStageCodegen (2)
+                                            ColumnarToRow
+                                              InputAdapter
+                                                CometFilter [cs_bill_customer_sk,cs_item_sk]
+                                                  CometScan parquet spark_catalog.default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_sold_date_sk]
+                                                    ReusedSubquery [d_date_sk] #2
+                                  InputAdapter
+                                    ReusedExchange [d_date_sk] #2
+                              InputAdapter
+                                ReusedExchange [d_date_sk] #4
+                          InputAdapter
+                            ReusedExchange [d_date_sk] #4
+                      InputAdapter
+                        BroadcastExchange #6
+                          WholeStageCodegen (6)
+                            ColumnarToRow
+                              InputAdapter
+                                CometFilter [s_store_sk]
+                                  CometScan parquet spark_catalog.default.store [s_store_sk,s_state]
+                  InputAdapter
+                    BroadcastExchange #7
+                      WholeStageCodegen (7)
+                        ColumnarToRow
+                          InputAdapter
+                            CometFilter [i_item_sk]
+                              CometScan parquet spark_catalog.default.item [i_item_sk,i_item_id,i_item_desc]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/explain.txt
new file mode 100644
index 0000000..613377a
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/explain.txt
@@ -0,0 +1,281 @@
+== Physical Plan ==
+TakeOrderedAndProject (43)
++- * HashAggregate (42)
+   +- Exchange (41)
+      +- * HashAggregate (40)
+         +- * Expand (39)
+            +- * Project (38)
+               +- * BroadcastHashJoin Inner BuildRight (37)
+                  :- * Project (32)
+                  :  +- * BroadcastHashJoin Inner BuildRight (31)
+                  :     :- * Project (29)
+                  :     :  +- * BroadcastHashJoin Inner BuildRight (28)
+                  :     :     :- * Project (23)
+                  :     :     :  +- * BroadcastHashJoin Inner BuildRight (22)
+                  :     :     :     :- * Project (17)
+                  :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (16)
+                  :     :     :     :     :- * Project (10)
+                  :     :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (9)
+                  :     :     :     :     :     :- * ColumnarToRow (3)
+                  :     :     :     :     :     :  +- CometFilter (2)
+                  :     :     :     :     :     :     +- CometScan parquet spark_catalog.default.catalog_sales (1)
+                  :     :     :     :     :     +- BroadcastExchange (8)
+                  :     :     :     :     :        +- * ColumnarToRow (7)
+                  :     :     :     :     :           +- CometProject (6)
+                  :     :     :     :     :              +- CometFilter (5)
+                  :     :     :     :     :                 +- CometScan parquet spark_catalog.default.customer_demographics (4)
+                  :     :     :     :     +- BroadcastExchange (15)
+                  :     :     :     :        +- * ColumnarToRow (14)
+                  :     :     :     :           +- CometProject (13)
+                  :     :     :     :              +- CometFilter (12)
+                  :     :     :     :                 +- CometScan parquet spark_catalog.default.customer (11)
+                  :     :     :     +- BroadcastExchange (21)
+                  :     :     :        +- * ColumnarToRow (20)
+                  :     :     :           +- CometFilter (19)
+                  :     :     :              +- CometScan parquet spark_catalog.default.customer_demographics (18)
+                  :     :     +- BroadcastExchange (27)
+                  :     :        +- * ColumnarToRow (26)
+                  :     :           +- CometFilter (25)
+                  :     :              +- CometScan parquet spark_catalog.default.customer_address (24)
+                  :     +- ReusedExchange (30)
+                  +- BroadcastExchange (36)
+                     +- * ColumnarToRow (35)
+                        +- CometFilter (34)
+                           +- CometScan parquet spark_catalog.default.item (33)
+
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#9), dynamicpruningexpression(cs_sold_date_sk#9 IN dynamicpruning#10)]
+PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)]
+ReadSchema: struct<cs_bill_customer_sk:int,cs_bill_cdemo_sk:int,cs_item_sk:int,cs_quantity:int,cs_list_price:decimal(7,2),cs_sales_price:decimal(7,2),cs_coupon_amt:decimal(7,2),cs_net_profit:decimal(7,2)>
+
+(2) CometFilter
+Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9]
+Condition : ((isnotnull(cs_bill_cdemo_sk#2) AND isnotnull(cs_bill_customer_sk#1)) AND isnotnull(cs_item_sk#3))
+
+(3) ColumnarToRow [codegen id : 7]
+Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9]
+
+(unknown) Scan parquet spark_catalog.default.customer_demographics
+Output [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_demographics]
+PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_education_status,Unknown             ), IsNotNull(cd_demo_sk)]
+ReadSchema: struct<cd_demo_sk:int,cd_gender:string,cd_education_status:string,cd_dep_count:int>
+
+(5) CometFilter
+Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14]
+Condition : ((((isnotnull(cd_gender#12) AND isnotnull(cd_education_status#13)) AND (cd_gender#12 = F)) AND (cd_education_status#13 = Unknown             )) AND isnotnull(cd_demo_sk#11))
+
+(6) CometProject
+Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14]
+Arguments: [cd_demo_sk#11, cd_dep_count#14], [cd_demo_sk#11, cd_dep_count#14]
+
+(7) ColumnarToRow [codegen id : 1]
+Input [2]: [cd_demo_sk#11, cd_dep_count#14]
+
+(8) BroadcastExchange
+Input [2]: [cd_demo_sk#11, cd_dep_count#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
+
+(9) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [cs_bill_cdemo_sk#2]
+Right keys [1]: [cd_demo_sk#11]
+Join type: Inner
+Join condition: None
+
+(10) Project [codegen id : 7]
+Output [9]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14]
+Input [11]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_demo_sk#11, cd_dep_count#14]
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [5]: [c_customer_sk#15, c_current_cdemo_sk#16, c_current_addr_sk#17, c_birth_month#18, c_birth_year#19]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [In(c_birth_month, [1,12,2,6,8,9]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)]
+ReadSchema: struct<c_customer_sk:int,c_current_cdemo_sk:int,c_current_addr_sk:int,c_birth_month:int,c_birth_year:int>
+
+(12) CometFilter
+Input [5]: [c_customer_sk#15, c_current_cdemo_sk#16, c_current_addr_sk#17, c_birth_month#18, c_birth_year#19]
+Condition : (((c_birth_month#18 IN (1,6,8,9,12,2) AND isnotnull(c_customer_sk#15)) AND isnotnull(c_current_cdemo_sk#16)) AND isnotnull(c_current_addr_sk#17))
+
+(13) CometProject
+Input [5]: [c_customer_sk#15, c_current_cdemo_sk#16, c_current_addr_sk#17, c_birth_month#18, c_birth_year#19]
+Arguments: [c_customer_sk#15, c_current_cdemo_sk#16, c_current_addr_sk#17, c_birth_year#19], [c_customer_sk#15, c_current_cdemo_sk#16, c_current_addr_sk#17, c_birth_year#19]
+
+(14) ColumnarToRow [codegen id : 2]
+Input [4]: [c_customer_sk#15, c_current_cdemo_sk#16, c_current_addr_sk#17, c_birth_year#19]
+
+(15) BroadcastExchange
+Input [4]: [c_customer_sk#15, c_current_cdemo_sk#16, c_current_addr_sk#17, c_birth_year#19]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
+
+(16) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [cs_bill_customer_sk#1]
+Right keys [1]: [c_customer_sk#15]
+Join type: Inner
+Join condition: None
+
+(17) Project [codegen id : 7]
+Output [11]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_cdemo_sk#16, c_current_addr_sk#17, c_birth_year#19]
+Input [13]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_customer_sk#15, c_current_cdemo_sk#16, c_current_addr_sk#17, c_birth_year#19]
+
+(unknown) Scan parquet spark_catalog.default.customer_demographics
+Output [1]: [cd_demo_sk#20]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_demographics]
+PushedFilters: [IsNotNull(cd_demo_sk)]
+ReadSchema: struct<cd_demo_sk:int>
+
+(19) CometFilter
+Input [1]: [cd_demo_sk#20]
+Condition : isnotnull(cd_demo_sk#20)
+
+(20) ColumnarToRow [codegen id : 3]
+Input [1]: [cd_demo_sk#20]
+
+(21) BroadcastExchange
+Input [1]: [cd_demo_sk#20]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
+
+(22) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [c_current_cdemo_sk#16]
+Right keys [1]: [cd_demo_sk#20]
+Join type: Inner
+Join condition: None
+
+(23) Project [codegen id : 7]
+Output [10]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_addr_sk#17, c_birth_year#19]
+Input [12]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_cdemo_sk#16, c_current_addr_sk#17, c_birth_year#19, cd_demo_sk#20]
+
+(unknown) Scan parquet spark_catalog.default.customer_address
+Output [4]: [ca_address_sk#21, ca_county#22, ca_state#23, ca_country#24]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_address]
+PushedFilters: [In(ca_state, [IN,MS,ND,NM,OK,VA]), IsNotNull(ca_address_sk)]
+ReadSchema: struct<ca_address_sk:int,ca_county:string,ca_state:string,ca_country:string>
+
+(25) CometFilter
+Input [4]: [ca_address_sk#21, ca_county#22, ca_state#23, ca_country#24]
+Condition : (ca_state#23 IN (MS,IN,ND,OK,NM,VA) AND isnotnull(ca_address_sk#21))
+
+(26) ColumnarToRow [codegen id : 4]
+Input [4]: [ca_address_sk#21, ca_county#22, ca_state#23, ca_country#24]
+
+(27) BroadcastExchange
+Input [4]: [ca_address_sk#21, ca_county#22, ca_state#23, ca_country#24]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
+
+(28) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [c_current_addr_sk#17]
+Right keys [1]: [ca_address_sk#21]
+Join type: Inner
+Join condition: None
+
+(29) Project [codegen id : 7]
+Output [12]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_birth_year#19, ca_county#22, ca_state#23, ca_country#24]
+Input [14]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_addr_sk#17, c_birth_year#19, ca_address_sk#21, ca_county#22, ca_state#23, ca_country#24]
+
+(30) ReusedExchange [Reuses operator id: 48]
+Output [1]: [d_date_sk#25]
+
+(31) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [cs_sold_date_sk#9]
+Right keys [1]: [d_date_sk#25]
+Join type: Inner
+Join condition: None
+
+(32) Project [codegen id : 7]
+Output [11]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#19, ca_county#22, ca_state#23, ca_country#24]
+Input [13]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_birth_year#19, ca_county#22, ca_state#23, ca_country#24, d_date_sk#25]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [2]: [i_item_sk#26, i_item_id#27]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_item_id:string>
+
+(34) CometFilter
+Input [2]: [i_item_sk#26, i_item_id#27]
+Condition : isnotnull(i_item_sk#26)
+
+(35) ColumnarToRow [codegen id : 6]
+Input [2]: [i_item_sk#26, i_item_id#27]
+
+(36) BroadcastExchange
+Input [2]: [i_item_sk#26, i_item_id#27]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=5]
+
+(37) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [cs_item_sk#3]
+Right keys [1]: [i_item_sk#26]
+Join type: Inner
+Join condition: None
+
+(38) Project [codegen id : 7]
+Output [11]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#19, i_item_id#27, ca_country#24, ca_state#23, ca_county#22]
+Input [13]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#19, ca_county#22, ca_state#23, ca_country#24, i_item_sk#26, i_item_id#27]
+
+(39) Expand [codegen id : 7]
+Input [11]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#19, i_item_id#27, ca_country#24, ca_state#23, ca_county#22]
+Arguments: [[cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#19, i_item_id#27, ca_country#24, ca_state#23, ca_county#22, 0], [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#19, i_item_id#27, ca_country#24, ca_state#23, null, 1], [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#19, i_item_id#2 [...]
+
+(40) HashAggregate [codegen id : 7]
+Input [12]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#19, i_item_id#28, ca_country#29, ca_state#30, ca_county#31, spark_grouping_id#32]
+Keys [5]: [i_item_id#28, ca_country#29, ca_state#30, ca_county#31, spark_grouping_id#32]
+Functions [7]: [partial_avg(cast(cs_quantity#4 as decimal(12,2))), partial_avg(cast(cs_list_price#5 as decimal(12,2))), partial_avg(cast(cs_coupon_amt#7 as decimal(12,2))), partial_avg(cast(cs_sales_price#6 as decimal(12,2))), partial_avg(cast(cs_net_profit#8 as decimal(12,2))), partial_avg(cast(c_birth_year#19 as decimal(12,2))), partial_avg(cast(cd_dep_count#14 as decimal(12,2)))]
+Aggregate Attributes [14]: [sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41, count#42, sum#43, count#44, sum#45, count#46]
+Results [19]: [i_item_id#28, ca_country#29, ca_state#30, ca_county#31, spark_grouping_id#32, sum#47, count#48, sum#49, count#50, sum#51, count#52, sum#53, count#54, sum#55, count#56, sum#57, count#58, sum#59, count#60]
+
+(41) Exchange
+Input [19]: [i_item_id#28, ca_country#29, ca_state#30, ca_county#31, spark_grouping_id#32, sum#47, count#48, sum#49, count#50, sum#51, count#52, sum#53, count#54, sum#55, count#56, sum#57, count#58, sum#59, count#60]
+Arguments: hashpartitioning(i_item_id#28, ca_country#29, ca_state#30, ca_county#31, spark_grouping_id#32, 5), ENSURE_REQUIREMENTS, [plan_id=6]
+
+(42) HashAggregate [codegen id : 8]
+Input [19]: [i_item_id#28, ca_country#29, ca_state#30, ca_county#31, spark_grouping_id#32, sum#47, count#48, sum#49, count#50, sum#51, count#52, sum#53, count#54, sum#55, count#56, sum#57, count#58, sum#59, count#60]
+Keys [5]: [i_item_id#28, ca_country#29, ca_state#30, ca_county#31, spark_grouping_id#32]
+Functions [7]: [avg(cast(cs_quantity#4 as decimal(12,2))), avg(cast(cs_list_price#5 as decimal(12,2))), avg(cast(cs_coupon_amt#7 as decimal(12,2))), avg(cast(cs_sales_price#6 as decimal(12,2))), avg(cast(cs_net_profit#8 as decimal(12,2))), avg(cast(c_birth_year#19 as decimal(12,2))), avg(cast(cd_dep_count#14 as decimal(12,2)))]
+Aggregate Attributes [7]: [avg(cast(cs_quantity#4 as decimal(12,2)))#61, avg(cast(cs_list_price#5 as decimal(12,2)))#62, avg(cast(cs_coupon_amt#7 as decimal(12,2)))#63, avg(cast(cs_sales_price#6 as decimal(12,2)))#64, avg(cast(cs_net_profit#8 as decimal(12,2)))#65, avg(cast(c_birth_year#19 as decimal(12,2)))#66, avg(cast(cd_dep_count#14 as decimal(12,2)))#67]
+Results [11]: [i_item_id#28, ca_country#29, ca_state#30, ca_county#31, avg(cast(cs_quantity#4 as decimal(12,2)))#61 AS agg1#68, avg(cast(cs_list_price#5 as decimal(12,2)))#62 AS agg2#69, avg(cast(cs_coupon_amt#7 as decimal(12,2)))#63 AS agg3#70, avg(cast(cs_sales_price#6 as decimal(12,2)))#64 AS agg4#71, avg(cast(cs_net_profit#8 as decimal(12,2)))#65 AS agg5#72, avg(cast(c_birth_year#19 as decimal(12,2)))#66 AS agg6#73, avg(cast(cd_dep_count#14 as decimal(12,2)))#67 AS agg7#74]
+
+(43) TakeOrderedAndProject
+Input [11]: [i_item_id#28, ca_country#29, ca_state#30, ca_county#31, agg1#68, agg2#69, agg3#70, agg4#71, agg5#72, agg6#73, agg7#74]
+Arguments: 100, [ca_country#29 ASC NULLS FIRST, ca_state#30 ASC NULLS FIRST, ca_county#31 ASC NULLS FIRST, i_item_id#28 ASC NULLS FIRST], [i_item_id#28, ca_country#29, ca_state#30, ca_county#31, agg1#68, agg2#69, agg3#70, agg4#71, agg5#72, agg6#73, agg7#74]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#9 IN dynamicpruning#10
+BroadcastExchange (48)
++- * ColumnarToRow (47)
+   +- CometProject (46)
+      +- CometFilter (45)
+         +- CometScan parquet spark_catalog.default.date_dim (44)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#25, d_year#75]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1998), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int>
+
+(45) CometFilter
+Input [2]: [d_date_sk#25, d_year#75]
+Condition : ((isnotnull(d_year#75) AND (d_year#75 = 1998)) AND isnotnull(d_date_sk#25))
+
+(46) CometProject
+Input [2]: [d_date_sk#25, d_year#75]
+Arguments: [d_date_sk#25], [d_date_sk#25]
+
+(47) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#25]
+
+(48) BroadcastExchange
+Input [1]: [d_date_sk#25]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/simplified.txt
new file mode 100644
index 0000000..47911b9
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/simplified.txt
@@ -0,0 +1,71 @@
+TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7]
+  WholeStageCodegen (8)
+    HashAggregate [i_item_id,ca_country,ca_state,ca_county,spark_grouping_id,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [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(cd_dep_count as decimal(12,2))),agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,cou [...]
+      InputAdapter
+        Exchange [i_item_id,ca_country,ca_state,ca_county,spark_grouping_id] #1
+          WholeStageCodegen (7)
+            HashAggregate [i_item_id,ca_country,ca_state,ca_county,spark_grouping_id,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count]
+              Expand [cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year,i_item_id,ca_country,ca_state,ca_county]
+                Project [cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year,i_item_id,ca_country,ca_state,ca_county]
+                  BroadcastHashJoin [cs_item_sk,i_item_sk]
+                    Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year,ca_county,ca_state,ca_country]
+                      BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                        Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_birth_year,ca_county,ca_state,ca_country]
+                          BroadcastHashJoin [c_current_addr_sk,ca_address_sk]
+                            Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_addr_sk,c_birth_year]
+                              BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk]
+                                Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_cdemo_sk,c_current_addr_sk,c_birth_year]
+                                  BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk]
+                                    Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count]
+                                      BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk]
+                                        ColumnarToRow
+                                          InputAdapter
+                                            CometFilter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_item_sk]
+                                              CometScan parquet spark_catalog.default.catalog_sales [cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk]
+                                                SubqueryBroadcast [d_date_sk] #1
+                                                  BroadcastExchange #2
+                                                    WholeStageCodegen (1)
+                                                      ColumnarToRow
+                                                        InputAdapter
+                                                          CometProject [d_date_sk]
+                                                            CometFilter [d_year,d_date_sk]
+                                                              CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year]
+                                        InputAdapter
+                                          BroadcastExchange #3
+                                            WholeStageCodegen (1)
+                                              ColumnarToRow
+                                                InputAdapter
+                                                  CometProject [cd_demo_sk,cd_dep_count]
+                                                    CometFilter [cd_gender,cd_education_status,cd_demo_sk]
+                                                      CometScan parquet spark_catalog.default.customer_demographics [cd_demo_sk,cd_gender,cd_education_status,cd_dep_count]
+                                    InputAdapter
+                                      BroadcastExchange #4
+                                        WholeStageCodegen (2)
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometProject [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year]
+                                                CometFilter [c_birth_month,c_customer_sk,c_current_cdemo_sk,c_current_addr_sk]
+                                                  CometScan parquet spark_catalog.default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_month,c_birth_year]
+                                InputAdapter
+                                  BroadcastExchange #5
+                                    WholeStageCodegen (3)
+                                      ColumnarToRow
+                                        InputAdapter
+                                          CometFilter [cd_demo_sk]
+                                            CometScan parquet spark_catalog.default.customer_demographics [cd_demo_sk]
+                            InputAdapter
+                              BroadcastExchange #6
+                                WholeStageCodegen (4)
+                                  ColumnarToRow
+                                    InputAdapter
+                                      CometFilter [ca_state,ca_address_sk]
+                                        CometScan parquet spark_catalog.default.customer_address [ca_address_sk,ca_county,ca_state,ca_country]
+                        InputAdapter
+                          ReusedExchange [d_date_sk] #2
+                    InputAdapter
+                      BroadcastExchange #7
+                        WholeStageCodegen (6)
+                          ColumnarToRow
+                            InputAdapter
+                              CometFilter [i_item_sk]
+                                CometScan parquet spark_catalog.default.item [i_item_sk,i_item_id]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/explain.txt
new file mode 100644
index 0000000..1150b3d
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/explain.txt
@@ -0,0 +1,227 @@
+== Physical Plan ==
+TakeOrderedAndProject (39)
++- * HashAggregate (38)
+   +- Exchange (37)
+      +- * HashAggregate (36)
+         +- * Project (35)
+            +- * BroadcastHashJoin Inner BuildRight (34)
+               :- * Project (29)
+               :  +- * BroadcastHashJoin Inner BuildRight (28)
+               :     :- * Project (23)
+               :     :  +- * BroadcastHashJoin Inner BuildRight (22)
+               :     :     :- * Project (17)
+               :     :     :  +- * BroadcastHashJoin Inner BuildRight (16)
+               :     :     :     :- * Project (10)
+               :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (9)
+               :     :     :     :     :- * ColumnarToRow (4)
+               :     :     :     :     :  +- CometProject (3)
+               :     :     :     :     :     +- CometFilter (2)
+               :     :     :     :     :        +- CometScan parquet spark_catalog.default.date_dim (1)
+               :     :     :     :     +- BroadcastExchange (8)
+               :     :     :     :        +- * ColumnarToRow (7)
+               :     :     :     :           +- CometFilter (6)
+               :     :     :     :              +- CometScan parquet spark_catalog.default.store_sales (5)
+               :     :     :     +- BroadcastExchange (15)
+               :     :     :        +- * ColumnarToRow (14)
+               :     :     :           +- CometProject (13)
+               :     :     :              +- CometFilter (12)
+               :     :     :                 +- CometScan parquet spark_catalog.default.item (11)
+               :     :     +- BroadcastExchange (21)
+               :     :        +- * ColumnarToRow (20)
+               :     :           +- CometFilter (19)
+               :     :              +- CometScan parquet spark_catalog.default.customer (18)
+               :     +- BroadcastExchange (27)
+               :        +- * ColumnarToRow (26)
+               :           +- CometFilter (25)
+               :              +- CometScan parquet spark_catalog.default.customer_address (24)
+               +- BroadcastExchange (33)
+                  +- * ColumnarToRow (32)
+                     +- CometFilter (31)
+                        +- CometScan parquet spark_catalog.default.store (30)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [3]: [d_date_sk#1, d_year#2, d_moy#3]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,1998), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
+
+(2) CometFilter
+Input [3]: [d_date_sk#1, d_year#2, d_moy#3]
+Condition : ((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 1998)) AND isnotnull(d_date_sk#1))
+
+(3) CometProject
+Input [3]: [d_date_sk#1, d_year#2, d_moy#3]
+Arguments: [d_date_sk#1], [d_date_sk#1]
+
+(4) ColumnarToRow [codegen id : 6]
+Input [1]: [d_date_sk#1]
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(true)]
+PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)]
+ReadSchema: struct<ss_item_sk:int,ss_customer_sk:int,ss_store_sk:int,ss_ext_sales_price:decimal(7,2)>
+
+(6) CometFilter
+Input [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8]
+Condition : ((isnotnull(ss_item_sk#4) AND isnotnull(ss_customer_sk#5)) AND isnotnull(ss_store_sk#6))
+
+(7) ColumnarToRow [codegen id : 1]
+Input [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8]
+
+(8) BroadcastExchange
+Input [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8]
+Arguments: HashedRelationBroadcastMode(List(cast(input[4, int, true] as bigint)),false), [plan_id=1]
+
+(9) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [d_date_sk#1]
+Right keys [1]: [ss_sold_date_sk#8]
+Join type: Inner
+Join condition: None
+
+(10) Project [codegen id : 6]
+Output [4]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7]
+Input [6]: [d_date_sk#1, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [6]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, i_manager_id#14]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,8), IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_brand:string,i_manufact_id:int,i_manufact:string,i_manager_id:int>
+
+(12) CometFilter
+Input [6]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, i_manager_id#14]
+Condition : ((isnotnull(i_manager_id#14) AND (i_manager_id#14 = 8)) AND isnotnull(i_item_sk#9))
+
+(13) CometProject
+Input [6]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, i_manager_id#14]
+Arguments: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13], [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]
+
+(14) ColumnarToRow [codegen id : 2]
+Input [5]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]
+
+(15) BroadcastExchange
+Input [5]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
+
+(16) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_item_sk#4]
+Right keys [1]: [i_item_sk#9]
+Join type: Inner
+Join condition: None
+
+(17) Project [codegen id : 6]
+Output [7]: [ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]
+Input [9]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [2]: [c_customer_sk#15, c_current_addr_sk#16]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)]
+ReadSchema: struct<c_customer_sk:int,c_current_addr_sk:int>
+
+(19) CometFilter
+Input [2]: [c_customer_sk#15, c_current_addr_sk#16]
+Condition : (isnotnull(c_customer_sk#15) AND isnotnull(c_current_addr_sk#16))
+
+(20) ColumnarToRow [codegen id : 3]
+Input [2]: [c_customer_sk#15, c_current_addr_sk#16]
+
+(21) BroadcastExchange
+Input [2]: [c_customer_sk#15, c_current_addr_sk#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
+
+(22) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_customer_sk#5]
+Right keys [1]: [c_customer_sk#15]
+Join type: Inner
+Join condition: None
+
+(23) Project [codegen id : 6]
+Output [7]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, c_current_addr_sk#16]
+Input [9]: [ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, c_customer_sk#15, c_current_addr_sk#16]
+
+(unknown) Scan parquet spark_catalog.default.customer_address
+Output [2]: [ca_address_sk#17, ca_zip#18]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_address]
+PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_zip)]
+ReadSchema: struct<ca_address_sk:int,ca_zip:string>
+
+(25) CometFilter
+Input [2]: [ca_address_sk#17, ca_zip#18]
+Condition : (isnotnull(ca_address_sk#17) AND isnotnull(ca_zip#18))
+
+(26) ColumnarToRow [codegen id : 4]
+Input [2]: [ca_address_sk#17, ca_zip#18]
+
+(27) BroadcastExchange
+Input [2]: [ca_address_sk#17, ca_zip#18]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
+
+(28) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [c_current_addr_sk#16]
+Right keys [1]: [ca_address_sk#17]
+Join type: Inner
+Join condition: None
+
+(29) Project [codegen id : 6]
+Output [7]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, ca_zip#18]
+Input [9]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, c_current_addr_sk#16, ca_address_sk#17, ca_zip#18]
+
+(unknown) Scan parquet spark_catalog.default.store
+Output [2]: [s_store_sk#19, s_zip#20]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store]
+PushedFilters: [IsNotNull(s_zip), IsNotNull(s_store_sk)]
+ReadSchema: struct<s_store_sk:int,s_zip:string>
+
+(31) CometFilter
+Input [2]: [s_store_sk#19, s_zip#20]
+Condition : (isnotnull(s_zip#20) AND isnotnull(s_store_sk#19))
+
+(32) ColumnarToRow [codegen id : 5]
+Input [2]: [s_store_sk#19, s_zip#20]
+
+(33) BroadcastExchange
+Input [2]: [s_store_sk#19, s_zip#20]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=5]
+
+(34) BroadcastHashJoin [codegen id : 6]
+Left keys [1]: [ss_store_sk#6]
+Right keys [1]: [s_store_sk#19]
+Join type: Inner
+Join condition: NOT (substr(ca_zip#18, 1, 5) = substr(s_zip#20, 1, 5))
+
+(35) Project [codegen id : 6]
+Output [5]: [ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]
+Input [9]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, ca_zip#18, s_store_sk#19, s_zip#20]
+
+(36) HashAggregate [codegen id : 6]
+Input [5]: [ss_ext_sales_price#7, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]
+Keys [4]: [i_brand#11, i_brand_id#10, i_manufact_id#12, i_manufact#13]
+Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#7))]
+Aggregate Attributes [1]: [sum#21]
+Results [5]: [i_brand#11, i_brand_id#10, i_manufact_id#12, i_manufact#13, sum#22]
+
+(37) Exchange
+Input [5]: [i_brand#11, i_brand_id#10, i_manufact_id#12, i_manufact#13, sum#22]
+Arguments: hashpartitioning(i_brand#11, i_brand_id#10, i_manufact_id#12, i_manufact#13, 5), ENSURE_REQUIREMENTS, [plan_id=6]
+
+(38) HashAggregate [codegen id : 7]
+Input [5]: [i_brand#11, i_brand_id#10, i_manufact_id#12, i_manufact#13, sum#22]
+Keys [4]: [i_brand#11, i_brand_id#10, i_manufact_id#12, i_manufact#13]
+Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#7))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#7))#23]
+Results [5]: [i_brand_id#10 AS brand_id#24, i_brand#11 AS brand#25, i_manufact_id#12, i_manufact#13, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#23,17,2) AS ext_price#26]
+
+(39) TakeOrderedAndProject
+Input [5]: [brand_id#24, brand#25, i_manufact_id#12, i_manufact#13, ext_price#26]
+Arguments: 100, [ext_price#26 DESC NULLS LAST, brand#25 ASC NULLS FIRST, brand_id#24 ASC NULLS FIRST, i_manufact_id#12 ASC NULLS FIRST, i_manufact#13 ASC NULLS FIRST], [brand_id#24, brand#25, i_manufact_id#12, i_manufact#13, ext_price#26]
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/simplified.txt
new file mode 100644
index 0000000..c2f5d1a
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/simplified.txt
@@ -0,0 +1,58 @@
+TakeOrderedAndProject [ext_price,brand,brand_id,i_manufact_id,i_manufact]
+  WholeStageCodegen (7)
+    HashAggregate [i_brand,i_brand_id,i_manufact_id,i_manufact,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum]
+      InputAdapter
+        Exchange [i_brand,i_brand_id,i_manufact_id,i_manufact] #1
+          WholeStageCodegen (6)
+            HashAggregate [i_brand,i_brand_id,i_manufact_id,i_manufact,ss_ext_sales_price] [sum,sum]
+              Project [ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact]
+                BroadcastHashJoin [ss_store_sk,s_store_sk,ca_zip,s_zip]
+                  Project [ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact,ca_zip]
+                    BroadcastHashJoin [c_current_addr_sk,ca_address_sk]
+                      Project [ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact,c_current_addr_sk]
+                        BroadcastHashJoin [ss_customer_sk,c_customer_sk]
+                          Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact]
+                            BroadcastHashJoin [ss_item_sk,i_item_sk]
+                              Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price]
+                                BroadcastHashJoin [d_date_sk,ss_sold_date_sk]
+                                  ColumnarToRow
+                                    InputAdapter
+                                      CometProject [d_date_sk]
+                                        CometFilter [d_moy,d_year,d_date_sk]
+                                          CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year,d_moy]
+                                  InputAdapter
+                                    BroadcastExchange #2
+                                      WholeStageCodegen (1)
+                                        ColumnarToRow
+                                          InputAdapter
+                                            CometFilter [ss_item_sk,ss_customer_sk,ss_store_sk]
+                                              CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price,ss_sold_date_sk]
+                              InputAdapter
+                                BroadcastExchange #3
+                                  WholeStageCodegen (2)
+                                    ColumnarToRow
+                                      InputAdapter
+                                        CometProject [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact]
+                                          CometFilter [i_manager_id,i_item_sk]
+                                            CometScan parquet spark_catalog.default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact,i_manager_id]
+                          InputAdapter
+                            BroadcastExchange #4
+                              WholeStageCodegen (3)
+                                ColumnarToRow
+                                  InputAdapter
+                                    CometFilter [c_customer_sk,c_current_addr_sk]
+                                      CometScan parquet spark_catalog.default.customer [c_customer_sk,c_current_addr_sk]
+                      InputAdapter
+                        BroadcastExchange #5
+                          WholeStageCodegen (4)
+                            ColumnarToRow
+                              InputAdapter
+                                CometFilter [ca_address_sk,ca_zip]
+                                  CometScan parquet spark_catalog.default.customer_address [ca_address_sk,ca_zip]
+                  InputAdapter
+                    BroadcastExchange #6
+                      WholeStageCodegen (5)
+                        ColumnarToRow
+                          InputAdapter
+                            CometFilter [s_zip,s_store_sk]
+                              CometScan parquet spark_catalog.default.store [s_store_sk,s_zip]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt
new file mode 100644
index 0000000..2fea53f
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt
@@ -0,0 +1,210 @@
+== Physical Plan ==
+* Sort (36)
++- Exchange (35)
+   +- * Project (34)
+      +- * BroadcastHashJoin Inner BuildRight (33)
+         :- * Project (22)
+         :  +- * BroadcastHashJoin Inner BuildRight (21)
+         :     :- * HashAggregate (15)
+         :     :  +- Exchange (14)
+         :     :     +- * HashAggregate (13)
+         :     :        +- * Project (12)
+         :     :           +- * BroadcastHashJoin Inner BuildRight (11)
+         :     :              :- * ColumnarToRow (6)
+         :     :              :  +- CometUnion (5)
+         :     :              :     :- CometProject (2)
+         :     :              :     :  +- CometScan parquet spark_catalog.default.web_sales (1)
+         :     :              :     +- CometProject (4)
+         :     :              :        +- CometScan parquet spark_catalog.default.catalog_sales (3)
+         :     :              +- BroadcastExchange (10)
+         :     :                 +- * ColumnarToRow (9)
+         :     :                    +- CometFilter (8)
+         :     :                       +- CometScan parquet spark_catalog.default.date_dim (7)
+         :     +- BroadcastExchange (20)
+         :        +- * ColumnarToRow (19)
+         :           +- CometProject (18)
+         :              +- CometFilter (17)
+         :                 +- CometScan parquet spark_catalog.default.date_dim (16)
+         +- BroadcastExchange (32)
+            +- * Project (31)
+               +- * BroadcastHashJoin Inner BuildRight (30)
+                  :- * HashAggregate (24)
+                  :  +- ReusedExchange (23)
+                  +- BroadcastExchange (29)
+                     +- * ColumnarToRow (28)
+                        +- CometProject (27)
+                           +- CometFilter (26)
+                              +- CometScan parquet spark_catalog.default.date_dim (25)
+
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [2]: [ws_ext_sales_price#1, ws_sold_date_sk#2]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#2)]
+ReadSchema: struct<ws_ext_sales_price:decimal(7,2)>
+
+(2) CometProject
+Input [2]: [ws_ext_sales_price#1, ws_sold_date_sk#2]
+Arguments: [sold_date_sk#3, sales_price#4], [ws_sold_date_sk#2 AS sold_date_sk#3, ws_ext_sales_price#1 AS sales_price#4]
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [2]: [cs_ext_sales_price#5, cs_sold_date_sk#6]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#6)]
+ReadSchema: struct<cs_ext_sales_price:decimal(7,2)>
+
+(4) CometProject
+Input [2]: [cs_ext_sales_price#5, cs_sold_date_sk#6]
+Arguments: [sold_date_sk#7, sales_price#8], [cs_sold_date_sk#6 AS sold_date_sk#7, cs_ext_sales_price#5 AS sales_price#8]
+
+(5) CometUnion
+Child 0 Input [2]: [sold_date_sk#3, sales_price#4]
+Child 1 Input [2]: [sold_date_sk#7, sales_price#8]
+
+(6) ColumnarToRow [codegen id : 2]
+Input [2]: [sold_date_sk#3, sales_price#4]
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)]
+ReadSchema: struct<d_date_sk:int,d_week_seq:int,d_day_name:string>
+
+(8) CometFilter
+Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11]
+Condition : (isnotnull(d_date_sk#9) AND isnotnull(d_week_seq#10))
+
+(9) ColumnarToRow [codegen id : 1]
+Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11]
+
+(10) BroadcastExchange
+Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(11) BroadcastHashJoin [codegen id : 2]
+Left keys [1]: [sold_date_sk#3]
+Right keys [1]: [d_date_sk#9]
+Join type: Inner
+Join condition: None
+
+(12) Project [codegen id : 2]
+Output [3]: [sales_price#4, d_week_seq#10, d_day_name#11]
+Input [5]: [sold_date_sk#3, sales_price#4, d_date_sk#9, d_week_seq#10, d_day_name#11]
+
+(13) HashAggregate [codegen id : 2]
+Input [3]: [sales_price#4, d_week_seq#10, d_day_name#11]
+Keys [1]: [d_week_seq#10]
+Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday   ) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday   ) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday  ) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 END)), partial_sum(UnscaledValue( [...]
+Aggregate Attributes [7]: [sum#12, sum#13, sum#14, sum#15, sum#16, sum#17, sum#18]
+Results [8]: [d_week_seq#10, sum#19, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25]
+
+(14) Exchange
+Input [8]: [d_week_seq#10, sum#19, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25]
+Arguments: hashpartitioning(d_week_seq#10, 5), ENSURE_REQUIREMENTS, [plan_id=2]
+
+(15) HashAggregate [codegen id : 8]
+Input [8]: [d_week_seq#10, sum#19, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25]
+Keys [1]: [d_week_seq#10]
+Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday   ) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday   ) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday  ) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday   ) THEN sales [...]
+Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday   ) THEN sales_price#4 END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday   ) THEN sales_price#4 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday  ) THEN sales_price#4 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name# [...]
+Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday   ) THEN sales_price#4 END))#26,17,2) AS sun_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday   ) THEN sales_price#4 END))#27,17,2) AS mon_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday  ) THEN sales_price#4 END))#28,17,2) AS tue_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END))#29,17,2) AS w [...]
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_week_seq#40, d_year#41]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_week_seq)]
+ReadSchema: struct<d_week_seq:int,d_year:int>
+
+(17) CometFilter
+Input [2]: [d_week_seq#40, d_year#41]
+Condition : ((isnotnull(d_year#41) AND (d_year#41 = 2001)) AND isnotnull(d_week_seq#40))
+
+(18) CometProject
+Input [2]: [d_week_seq#40, d_year#41]
+Arguments: [d_week_seq#40], [d_week_seq#40]
+
+(19) ColumnarToRow [codegen id : 3]
+Input [1]: [d_week_seq#40]
+
+(20) BroadcastExchange
+Input [1]: [d_week_seq#40]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]
+
+(21) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [d_week_seq#10]
+Right keys [1]: [d_week_seq#40]
+Join type: Inner
+Join condition: None
+
+(22) Project [codegen id : 8]
+Output [8]: [d_week_seq#10 AS d_week_seq1#42, sun_sales#33 AS sun_sales1#43, mon_sales#34 AS mon_sales1#44, tue_sales#35 AS tue_sales1#45, wed_sales#36 AS wed_sales1#46, thu_sales#37 AS thu_sales1#47, fri_sales#38 AS fri_sales1#48, sat_sales#39 AS sat_sales1#49]
+Input [9]: [d_week_seq#10, sun_sales#33, mon_sales#34, tue_sales#35, wed_sales#36, thu_sales#37, fri_sales#38, sat_sales#39, d_week_seq#40]
+
+(23) ReusedExchange [Reuses operator id: 14]
+Output [8]: [d_week_seq#10, sum#50, sum#51, sum#52, sum#53, sum#54, sum#55, sum#56]
+
+(24) HashAggregate [codegen id : 7]
+Input [8]: [d_week_seq#10, sum#50, sum#51, sum#52, sum#53, sum#54, sum#55, sum#56]
+Keys [1]: [d_week_seq#10]
+Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday   ) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday   ) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday  ) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday   ) THEN sales [...]
+Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday   ) THEN sales_price#4 END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday   ) THEN sales_price#4 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday  ) THEN sales_price#4 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name# [...]
+Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday   ) THEN sales_price#4 END))#26,17,2) AS sun_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday   ) THEN sales_price#4 END))#27,17,2) AS mon_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday  ) THEN sales_price#4 END))#28,17,2) AS tue_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 END))#29,17,2) AS w [...]
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_week_seq#57, d_year#58]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_week_seq)]
+ReadSchema: struct<d_week_seq:int,d_year:int>
+
+(26) CometFilter
+Input [2]: [d_week_seq#57, d_year#58]
+Condition : ((isnotnull(d_year#58) AND (d_year#58 = 2002)) AND isnotnull(d_week_seq#57))
+
+(27) CometProject
+Input [2]: [d_week_seq#57, d_year#58]
+Arguments: [d_week_seq#57], [d_week_seq#57]
+
+(28) ColumnarToRow [codegen id : 6]
+Input [1]: [d_week_seq#57]
+
+(29) BroadcastExchange
+Input [1]: [d_week_seq#57]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]
+
+(30) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [d_week_seq#10]
+Right keys [1]: [d_week_seq#57]
+Join type: Inner
+Join condition: None
+
+(31) Project [codegen id : 7]
+Output [8]: [d_week_seq#10 AS d_week_seq2#59, sun_sales#33 AS sun_sales2#60, mon_sales#34 AS mon_sales2#61, tue_sales#35 AS tue_sales2#62, wed_sales#36 AS wed_sales2#63, thu_sales#37 AS thu_sales2#64, fri_sales#38 AS fri_sales2#65, sat_sales#39 AS sat_sales2#66]
+Input [9]: [d_week_seq#10, sun_sales#33, mon_sales#34, tue_sales#35, wed_sales#36, thu_sales#37, fri_sales#38, sat_sales#39, d_week_seq#57]
+
+(32) BroadcastExchange
+Input [8]: [d_week_seq2#59, sun_sales2#60, mon_sales2#61, tue_sales2#62, wed_sales2#63, thu_sales2#64, fri_sales2#65, sat_sales2#66]
+Arguments: HashedRelationBroadcastMode(List(cast((input[0, int, true] - 53) as bigint)),false), [plan_id=5]
+
+(33) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [d_week_seq1#42]
+Right keys [1]: [(d_week_seq2#59 - 53)]
+Join type: Inner
+Join condition: None
+
+(34) Project [codegen id : 8]
+Output [8]: [d_week_seq1#42, round((sun_sales1#43 / sun_sales2#60), 2) AS round((sun_sales1 / sun_sales2), 2)#67, round((mon_sales1#44 / mon_sales2#61), 2) AS round((mon_sales1 / mon_sales2), 2)#68, round((tue_sales1#45 / tue_sales2#62), 2) AS round((tue_sales1 / tue_sales2), 2)#69, round((wed_sales1#46 / wed_sales2#63), 2) AS round((wed_sales1 / wed_sales2), 2)#70, round((thu_sales1#47 / thu_sales2#64), 2) AS round((thu_sales1 / thu_sales2), 2)#71, round((fri_sales1#48 / fri_sales2#65), [...]
+Input [16]: [d_week_seq1#42, sun_sales1#43, mon_sales1#44, tue_sales1#45, wed_sales1#46, thu_sales1#47, fri_sales1#48, sat_sales1#49, d_week_seq2#59, sun_sales2#60, mon_sales2#61, tue_sales2#62, wed_sales2#63, thu_sales2#64, fri_sales2#65, sat_sales2#66]
+
+(35) Exchange
+Input [8]: [d_week_seq1#42, round((sun_sales1 / sun_sales2), 2)#67, round((mon_sales1 / mon_sales2), 2)#68, round((tue_sales1 / tue_sales2), 2)#69, round((wed_sales1 / wed_sales2), 2)#70, round((thu_sales1 / thu_sales2), 2)#71, round((fri_sales1 / fri_sales2), 2)#72, round((sat_sales1 / sat_sales2), 2)#73]
+Arguments: rangepartitioning(d_week_seq1#42 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [plan_id=6]
+
+(36) Sort [codegen id : 9]
+Input [8]: [d_week_seq1#42, round((sun_sales1 / sun_sales2), 2)#67, round((mon_sales1 / mon_sales2), 2)#68, round((tue_sales1 / tue_sales2), 2)#69, round((wed_sales1 / wed_sales2), 2)#70, round((thu_sales1 / thu_sales2), 2)#71, round((fri_sales1 / fri_sales2), 2)#72, round((sat_sales1 / sat_sales2), 2)#73]
+Arguments: [d_week_seq1#42 ASC NULLS FIRST], true, 0
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt
new file mode 100644
index 0000000..8856ce8
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt
@@ -0,0 +1,54 @@
+WholeStageCodegen (9)
+  Sort [d_week_seq1]
+    InputAdapter
+      Exchange [d_week_seq1] #1
+        WholeStageCodegen (8)
+          Project [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]
+            BroadcastHashJoin [d_week_seq1,d_week_seq2]
+              Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales]
+                BroadcastHashJoin [d_week_seq,d_week_seq]
+                  HashAggregate [d_week_seq,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday   ) THEN sales_price END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday   ) THEN sales_price END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday  ) THEN sales_price END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN sales_price END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN sales_price END)),sum(UnscaledValue(CASE WHEN (d_day_nam [...]
+                    InputAdapter
+                      Exchange [d_week_seq] #2
+                        WholeStageCodegen (2)
+                          HashAggregate [d_week_seq,d_day_name,sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum]
+                            Project [sales_price,d_week_seq,d_day_name]
+                              BroadcastHashJoin [sold_date_sk,d_date_sk]
+                                ColumnarToRow
+                                  InputAdapter
+                                    CometUnion
+                                      CometProject [ws_sold_date_sk,ws_ext_sales_price] [sold_date_sk,sales_price]
+                                        CometScan parquet spark_catalog.default.web_sales [ws_ext_sales_price,ws_sold_date_sk]
+                                      CometProject [cs_sold_date_sk,cs_ext_sales_price] [sold_date_sk,sales_price]
+                                        CometScan parquet spark_catalog.default.catalog_sales [cs_ext_sales_price,cs_sold_date_sk]
+                                InputAdapter
+                                  BroadcastExchange #3
+                                    WholeStageCodegen (1)
+                                      ColumnarToRow
+                                        InputAdapter
+                                          CometFilter [d_date_sk,d_week_seq]
+                                            CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_week_seq,d_day_name]
+                  InputAdapter
+                    BroadcastExchange #4
+                      WholeStageCodegen (3)
+                        ColumnarToRow
+                          InputAdapter
+                            CometProject [d_week_seq]
+                              CometFilter [d_year,d_week_seq]
+                                CometScan parquet spark_catalog.default.date_dim [d_week_seq,d_year]
+              InputAdapter
+                BroadcastExchange #5
+                  WholeStageCodegen (7)
+                    Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales]
+                      BroadcastHashJoin [d_week_seq,d_week_seq]
+                        HashAggregate [d_week_seq,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday   ) THEN sales_price END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday   ) THEN sales_price END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday  ) THEN sales_price END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN sales_price END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN sales_price END)),sum(UnscaledValue(CASE WHEN (d_d [...]
+                          InputAdapter
+                            ReusedExchange [d_week_seq,sum,sum,sum,sum,sum,sum,sum] #2
+                        InputAdapter
+                          BroadcastExchange #6
+                            WholeStageCodegen (6)
+                              ColumnarToRow
+                                InputAdapter
+                                  CometProject [d_week_seq]
+                                    CometFilter [d_year,d_week_seq]
+                                      CometScan parquet spark_catalog.default.date_dim [d_week_seq,d_year]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/explain.txt
new file mode 100644
index 0000000..eedf666
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/explain.txt
@@ -0,0 +1,150 @@
+== Physical Plan ==
+TakeOrderedAndProject (20)
++- * Project (19)
+   +- Window (18)
+      +- * Sort (17)
+         +- Exchange (16)
+            +- * HashAggregate (15)
+               +- Exchange (14)
+                  +- * HashAggregate (13)
+                     +- * Project (12)
+                        +- * BroadcastHashJoin Inner BuildRight (11)
+                           :- * Project (9)
+                           :  +- * BroadcastHashJoin Inner BuildRight (8)
+                           :     :- * ColumnarToRow (3)
+                           :     :  +- CometFilter (2)
+                           :     :     +- CometScan parquet spark_catalog.default.catalog_sales (1)
+                           :     +- BroadcastExchange (7)
+                           :        +- * ColumnarToRow (6)
+                           :           +- CometFilter (5)
+                           :              +- CometScan parquet spark_catalog.default.item (4)
+                           +- ReusedExchange (10)
+
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#3), dynamicpruningexpression(cs_sold_date_sk#3 IN dynamicpruning#4)]
+PushedFilters: [IsNotNull(cs_item_sk)]
+ReadSchema: struct<cs_item_sk:int,cs_ext_sales_price:decimal(7,2)>
+
+(2) CometFilter
+Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3]
+Condition : isnotnull(cs_item_sk#1)
+
+(3) ColumnarToRow [codegen id : 3]
+Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [In(i_category, [Books                                             ,Home                                              ,Sports                                            ]), IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_item_id:string,i_item_desc:string,i_current_price:decimal(7,2),i_class:string,i_category:string>
+
+(5) CometFilter
+Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Condition : (i_category#10 IN (Sports                                            ,Books                                             ,Home                                              ) AND isnotnull(i_item_sk#5))
+
+(6) ColumnarToRow [codegen id : 1]
+Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+
+(7) BroadcastExchange
+Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(8) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [cs_item_sk#1]
+Right keys [1]: [i_item_sk#5]
+Join type: Inner
+Join condition: None
+
+(9) Project [codegen id : 3]
+Output [7]: [cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Input [9]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+
+(10) ReusedExchange [Reuses operator id: 25]
+Output [1]: [d_date_sk#11]
+
+(11) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [cs_sold_date_sk#3]
+Right keys [1]: [d_date_sk#11]
+Join type: Inner
+Join condition: None
+
+(12) Project [codegen id : 3]
+Output [6]: [cs_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Input [8]: [cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#11]
+
+(13) HashAggregate [codegen id : 3]
+Input [6]: [cs_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
+Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8]
+Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#2))]
+Aggregate Attributes [1]: [sum#12]
+Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#13]
+
+(14) Exchange
+Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#13]
+Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), ENSURE_REQUIREMENTS, [plan_id=2]
+
+(15) HashAggregate [codegen id : 4]
+Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#13]
+Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8]
+Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#2))]
+Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#2))#14]
+Results [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#14,17,2) AS itemrevenue#15, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#14,17,2) AS _w0#16, i_item_id#6]
+
+(16) Exchange
+Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, i_item_id#6]
+Arguments: hashpartitioning(i_class#9, 5), ENSURE_REQUIREMENTS, [plan_id=3]
+
+(17) Sort [codegen id : 5]
+Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, i_item_id#6]
+Arguments: [i_class#9 ASC NULLS FIRST], false, 0
+
+(18) Window
+Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, i_item_id#6]
+Arguments: [sum(_w0#16) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#17], [i_class#9]
+
+(19) Project [codegen id : 6]
+Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, ((_w0#16 * 100) / _we0#17) AS revenueratio#18, i_item_id#6]
+Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, i_item_id#6, _we0#17]
+
+(20) TakeOrderedAndProject
+Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, revenueratio#18, i_item_id#6]
+Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#18 ASC NULLS FIRST], [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, revenueratio#18]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#3 IN dynamicpruning#4
+BroadcastExchange (25)
++- * ColumnarToRow (24)
+   +- CometProject (23)
+      +- CometFilter (22)
+         +- CometScan parquet spark_catalog.default.date_dim (21)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#11, d_date#19]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_date:date>
+
+(22) CometFilter
+Input [2]: [d_date_sk#11, d_date#19]
+Condition : (((isnotnull(d_date#19) AND (d_date#19 >= 1999-02-22)) AND (d_date#19 <= 1999-03-24)) AND isnotnull(d_date_sk#11))
+
+(23) CometProject
+Input [2]: [d_date_sk#11, d_date#19]
+Arguments: [d_date_sk#11], [d_date_sk#11]
+
+(24) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#11]
+
+(25) BroadcastExchange
+Input [1]: [d_date_sk#11]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/simplified.txt
new file mode 100644
index 0000000..52c42bd
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/simplified.txt
@@ -0,0 +1,40 @@
+TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_current_price,itemrevenue]
+  WholeStageCodegen (6)
+    Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0,i_item_id]
+      InputAdapter
+        Window [_w0,i_class]
+          WholeStageCodegen (5)
+            Sort [i_class]
+              InputAdapter
+                Exchange [i_class] #1
+                  WholeStageCodegen (4)
+                    HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(cs_ext_sales_price)),itemrevenue,_w0,sum]
+                      InputAdapter
+                        Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #2
+                          WholeStageCodegen (3)
+                            HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,cs_ext_sales_price] [sum,sum]
+                              Project [cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category]
+                                BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                                  Project [cs_ext_sales_price,cs_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category]
+                                    BroadcastHashJoin [cs_item_sk,i_item_sk]
+                                      ColumnarToRow
+                                        InputAdapter
+                                          CometFilter [cs_item_sk]
+                                            CometScan parquet spark_catalog.default.catalog_sales [cs_item_sk,cs_ext_sales_price,cs_sold_date_sk]
+                                              SubqueryBroadcast [d_date_sk] #1
+                                                BroadcastExchange #3
+                                                  WholeStageCodegen (1)
+                                                    ColumnarToRow
+                                                      InputAdapter
+                                                        CometProject [d_date_sk]
+                                                          CometFilter [d_date,d_date_sk]
+                                                            CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_date]
+                                      InputAdapter
+                                        BroadcastExchange #4
+                                          WholeStageCodegen (1)
+                                            ColumnarToRow
+                                              InputAdapter
+                                                CometFilter [i_category,i_item_sk]
+                                                  CometScan parquet spark_catalog.default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category]
+                                  InputAdapter
+                                    ReusedExchange [d_date_sk] #3
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/explain.txt
new file mode 100644
index 0000000..b5625d8
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/explain.txt
@@ -0,0 +1,169 @@
+== Physical Plan ==
+TakeOrderedAndProject (24)
++- * Filter (23)
+   +- * HashAggregate (22)
+      +- Exchange (21)
+         +- * HashAggregate (20)
+            +- * Project (19)
+               +- * BroadcastHashJoin Inner BuildRight (18)
+                  :- * Project (16)
+                  :  +- * BroadcastHashJoin Inner BuildRight (15)
+                  :     :- * Project (9)
+                  :     :  +- * BroadcastHashJoin Inner BuildRight (8)
+                  :     :     :- * ColumnarToRow (3)
+                  :     :     :  +- CometFilter (2)
+                  :     :     :     +- CometScan parquet spark_catalog.default.inventory (1)
+                  :     :     +- BroadcastExchange (7)
+                  :     :        +- * ColumnarToRow (6)
+                  :     :           +- CometFilter (5)
+                  :     :              +- CometScan parquet spark_catalog.default.warehouse (4)
+                  :     +- BroadcastExchange (14)
+                  :        +- * ColumnarToRow (13)
+                  :           +- CometProject (12)
+                  :              +- CometFilter (11)
+                  :                 +- CometScan parquet spark_catalog.default.item (10)
+                  +- ReusedExchange (17)
+
+
+(unknown) Scan parquet spark_catalog.default.inventory
+Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)]
+PushedFilters: [IsNotNull(inv_warehouse_sk), IsNotNull(inv_item_sk)]
+ReadSchema: struct<inv_item_sk:int,inv_warehouse_sk:int,inv_quantity_on_hand:int>
+
+(2) CometFilter
+Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4]
+Condition : (isnotnull(inv_warehouse_sk#2) AND isnotnull(inv_item_sk#1))
+
+(3) ColumnarToRow [codegen id : 4]
+Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4]
+
+(unknown) Scan parquet spark_catalog.default.warehouse
+Output [2]: [w_warehouse_sk#6, w_warehouse_name#7]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/warehouse]
+PushedFilters: [IsNotNull(w_warehouse_sk)]
+ReadSchema: struct<w_warehouse_sk:int,w_warehouse_name:string>
+
+(5) CometFilter
+Input [2]: [w_warehouse_sk#6, w_warehouse_name#7]
+Condition : isnotnull(w_warehouse_sk#6)
+
+(6) ColumnarToRow [codegen id : 1]
+Input [2]: [w_warehouse_sk#6, w_warehouse_name#7]
+
+(7) BroadcastExchange
+Input [2]: [w_warehouse_sk#6, w_warehouse_name#7]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(8) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [inv_warehouse_sk#2]
+Right keys [1]: [w_warehouse_sk#6]
+Join type: Inner
+Join condition: None
+
+(9) Project [codegen id : 4]
+Output [4]: [inv_item_sk#1, inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_name#7]
+Input [6]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_sk#6, w_warehouse_name#7]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [3]: [i_item_sk#8, i_item_id#9, i_current_price#10]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_item_id:string,i_current_price:decimal(7,2)>
+
+(11) CometFilter
+Input [3]: [i_item_sk#8, i_item_id#9, i_current_price#10]
+Condition : (((isnotnull(i_current_price#10) AND (i_current_price#10 >= 0.99)) AND (i_current_price#10 <= 1.49)) AND isnotnull(i_item_sk#8))
+
+(12) CometProject
+Input [3]: [i_item_sk#8, i_item_id#9, i_current_price#10]
+Arguments: [i_item_sk#8, i_item_id#9], [i_item_sk#8, i_item_id#9]
+
+(13) ColumnarToRow [codegen id : 2]
+Input [2]: [i_item_sk#8, i_item_id#9]
+
+(14) BroadcastExchange
+Input [2]: [i_item_sk#8, i_item_id#9]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
+
+(15) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [inv_item_sk#1]
+Right keys [1]: [i_item_sk#8]
+Join type: Inner
+Join condition: None
+
+(16) Project [codegen id : 4]
+Output [4]: [inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_name#7, i_item_id#9]
+Input [6]: [inv_item_sk#1, inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_name#7, i_item_sk#8, i_item_id#9]
+
+(17) ReusedExchange [Reuses operator id: 28]
+Output [2]: [d_date_sk#11, d_date#12]
+
+(18) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [inv_date_sk#4]
+Right keys [1]: [d_date_sk#11]
+Join type: Inner
+Join condition: None
+
+(19) Project [codegen id : 4]
+Output [4]: [inv_quantity_on_hand#3, w_warehouse_name#7, i_item_id#9, d_date#12]
+Input [6]: [inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_name#7, i_item_id#9, d_date_sk#11, d_date#12]
+
+(20) HashAggregate [codegen id : 4]
+Input [4]: [inv_quantity_on_hand#3, w_warehouse_name#7, i_item_id#9, d_date#12]
+Keys [2]: [w_warehouse_name#7, i_item_id#9]
+Functions [2]: [partial_sum(CASE WHEN (d_date#12 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END), partial_sum(CASE WHEN (d_date#12 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)]
+Aggregate Attributes [2]: [sum#13, sum#14]
+Results [4]: [w_warehouse_name#7, i_item_id#9, sum#15, sum#16]
+
+(21) Exchange
+Input [4]: [w_warehouse_name#7, i_item_id#9, sum#15, sum#16]
+Arguments: hashpartitioning(w_warehouse_name#7, i_item_id#9, 5), ENSURE_REQUIREMENTS, [plan_id=3]
+
+(22) HashAggregate [codegen id : 5]
+Input [4]: [w_warehouse_name#7, i_item_id#9, sum#15, sum#16]
+Keys [2]: [w_warehouse_name#7, i_item_id#9]
+Functions [2]: [sum(CASE WHEN (d_date#12 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END), sum(CASE WHEN (d_date#12 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)]
+Aggregate Attributes [2]: [sum(CASE WHEN (d_date#12 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#17, sum(CASE WHEN (d_date#12 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#18]
+Results [4]: [w_warehouse_name#7, i_item_id#9, sum(CASE WHEN (d_date#12 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#17 AS inv_before#19, sum(CASE WHEN (d_date#12 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#18 AS inv_after#20]
+
+(23) Filter [codegen id : 5]
+Input [4]: [w_warehouse_name#7, i_item_id#9, inv_before#19, inv_after#20]
+Condition : (CASE WHEN (inv_before#19 > 0) THEN ((cast(inv_after#20 as double) / cast(inv_before#19 as double)) >= 0.666667) END AND CASE WHEN (inv_before#19 > 0) THEN ((cast(inv_after#20 as double) / cast(inv_before#19 as double)) <= 1.5) END)
+
+(24) TakeOrderedAndProject
+Input [4]: [w_warehouse_name#7, i_item_id#9, inv_before#19, inv_after#20]
+Arguments: 100, [w_warehouse_name#7 ASC NULLS FIRST, i_item_id#9 ASC NULLS FIRST], [w_warehouse_name#7, i_item_id#9, inv_before#19, inv_after#20]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5
+BroadcastExchange (28)
++- * ColumnarToRow (27)
+   +- CometFilter (26)
+      +- CometScan parquet spark_catalog.default.date_dim (25)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#11, d_date#12]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-02-10), LessThanOrEqual(d_date,2000-04-10), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_date:date>
+
+(26) CometFilter
+Input [2]: [d_date_sk#11, d_date#12]
+Condition : (((isnotnull(d_date#12) AND (d_date#12 >= 2000-02-10)) AND (d_date#12 <= 2000-04-10)) AND isnotnull(d_date_sk#11))
+
+(27) ColumnarToRow [codegen id : 1]
+Input [2]: [d_date_sk#11, d_date#12]
+
+(28) BroadcastExchange
+Input [2]: [d_date_sk#11, d_date#12]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/simplified.txt
new file mode 100644
index 0000000..e20755e
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/simplified.txt
@@ -0,0 +1,42 @@
+TakeOrderedAndProject [w_warehouse_name,i_item_id,inv_before,inv_after]
+  WholeStageCodegen (5)
+    Filter [inv_before,inv_after]
+      HashAggregate [w_warehouse_name,i_item_id,sum,sum] [sum(CASE WHEN (d_date < 2000-03-11) THEN inv_quantity_on_hand ELSE 0 END),sum(CASE WHEN (d_date >= 2000-03-11) THEN inv_quantity_on_hand ELSE 0 END),inv_before,inv_after,sum,sum]
+        InputAdapter
+          Exchange [w_warehouse_name,i_item_id] #1
+            WholeStageCodegen (4)
+              HashAggregate [w_warehouse_name,i_item_id,d_date,inv_quantity_on_hand] [sum,sum,sum,sum]
+                Project [inv_quantity_on_hand,w_warehouse_name,i_item_id,d_date]
+                  BroadcastHashJoin [inv_date_sk,d_date_sk]
+                    Project [inv_quantity_on_hand,inv_date_sk,w_warehouse_name,i_item_id]
+                      BroadcastHashJoin [inv_item_sk,i_item_sk]
+                        Project [inv_item_sk,inv_quantity_on_hand,inv_date_sk,w_warehouse_name]
+                          BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk]
+                            ColumnarToRow
+                              InputAdapter
+                                CometFilter [inv_warehouse_sk,inv_item_sk]
+                                  CometScan parquet spark_catalog.default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk]
+                                    SubqueryBroadcast [d_date_sk] #1
+                                      BroadcastExchange #2
+                                        WholeStageCodegen (1)
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometFilter [d_date,d_date_sk]
+                                                CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_date]
+                            InputAdapter
+                              BroadcastExchange #3
+                                WholeStageCodegen (1)
+                                  ColumnarToRow
+                                    InputAdapter
+                                      CometFilter [w_warehouse_sk]
+                                        CometScan parquet spark_catalog.default.warehouse [w_warehouse_sk,w_warehouse_name]
+                        InputAdapter
+                          BroadcastExchange #4
+                            WholeStageCodegen (2)
+                              ColumnarToRow
+                                InputAdapter
+                                  CometProject [i_item_sk,i_item_id]
+                                    CometFilter [i_current_price,i_item_sk]
+                                      CometScan parquet spark_catalog.default.item [i_item_sk,i_item_id,i_current_price]
+                    InputAdapter
+                      ReusedExchange [d_date_sk,d_date] #2
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/explain.txt
new file mode 100644
index 0000000..7dfa2dc
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/explain.txt
@@ -0,0 +1,169 @@
+== Physical Plan ==
+TakeOrderedAndProject (23)
++- * HashAggregate (22)
+   +- Exchange (21)
+      +- * HashAggregate (20)
+         +- * Expand (19)
+            +- * Project (18)
+               +- * BroadcastHashJoin Inner BuildRight (17)
+                  :- * Project (12)
+                  :  +- * BroadcastHashJoin Inner BuildRight (11)
+                  :     :- * Project (6)
+                  :     :  +- * BroadcastHashJoin Inner BuildRight (5)
+                  :     :     :- * ColumnarToRow (3)
+                  :     :     :  +- CometFilter (2)
+                  :     :     :     +- CometScan parquet spark_catalog.default.inventory (1)
+                  :     :     +- ReusedExchange (4)
+                  :     +- BroadcastExchange (10)
+                  :        +- * ColumnarToRow (9)
+                  :           +- CometFilter (8)
+                  :              +- CometScan parquet spark_catalog.default.item (7)
+                  +- BroadcastExchange (16)
+                     +- * ColumnarToRow (15)
+                        +- CometFilter (14)
+                           +- CometScan parquet spark_catalog.default.warehouse (13)
+
+
+(unknown) Scan parquet spark_catalog.default.inventory
+Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)]
+PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)]
+ReadSchema: struct<inv_item_sk:int,inv_warehouse_sk:int,inv_quantity_on_hand:int>
+
+(2) CometFilter
+Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4]
+Condition : (isnotnull(inv_item_sk#1) AND isnotnull(inv_warehouse_sk#2))
+
+(3) ColumnarToRow [codegen id : 4]
+Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4]
+
+(4) ReusedExchange [Reuses operator id: 28]
+Output [1]: [d_date_sk#6]
+
+(5) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [inv_date_sk#4]
+Right keys [1]: [d_date_sk#6]
+Join type: Inner
+Join condition: None
+
+(6) Project [codegen id : 4]
+Output [3]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3]
+Input [5]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, d_date_sk#6]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [5]: [i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_brand:string,i_class:string,i_category:string,i_product_name:string>
+
+(8) CometFilter
+Input [5]: [i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
+Condition : isnotnull(i_item_sk#7)
+
+(9) ColumnarToRow [codegen id : 2]
+Input [5]: [i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
+
+(10) BroadcastExchange
+Input [5]: [i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(11) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [inv_item_sk#1]
+Right keys [1]: [i_item_sk#7]
+Join type: Inner
+Join condition: None
+
+(12) Project [codegen id : 4]
+Output [6]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_brand#8, i_class#9, i_category#10, i_product_name#11]
+Input [8]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, i_item_sk#7, i_brand#8, i_class#9, i_category#10, i_product_name#11]
+
+(unknown) Scan parquet spark_catalog.default.warehouse
+Output [1]: [w_warehouse_sk#12]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/warehouse]
+PushedFilters: [IsNotNull(w_warehouse_sk)]
+ReadSchema: struct<w_warehouse_sk:int>
+
+(14) CometFilter
+Input [1]: [w_warehouse_sk#12]
+Condition : isnotnull(w_warehouse_sk#12)
+
+(15) ColumnarToRow [codegen id : 3]
+Input [1]: [w_warehouse_sk#12]
+
+(16) BroadcastExchange
+Input [1]: [w_warehouse_sk#12]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]
+
+(17) BroadcastHashJoin [codegen id : 4]
+Left keys [1]: [inv_warehouse_sk#2]
+Right keys [1]: [w_warehouse_sk#12]
+Join type: Inner
+Join condition: None
+
+(18) Project [codegen id : 4]
+Output [5]: [inv_quantity_on_hand#3, i_product_name#11, i_brand#8, i_class#9, i_category#10]
+Input [7]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_brand#8, i_class#9, i_category#10, i_product_name#11, w_warehouse_sk#12]
+
+(19) Expand [codegen id : 4]
+Input [5]: [inv_quantity_on_hand#3, i_product_name#11, i_brand#8, i_class#9, i_category#10]
+Arguments: [[inv_quantity_on_hand#3, i_product_name#11, i_brand#8, i_class#9, i_category#10, 0], [inv_quantity_on_hand#3, i_product_name#11, i_brand#8, i_class#9, null, 1], [inv_quantity_on_hand#3, i_product_name#11, i_brand#8, null, null, 3], [inv_quantity_on_hand#3, i_product_name#11, null, null, null, 7], [inv_quantity_on_hand#3, null, null, null, null, 15]], [inv_quantity_on_hand#3, i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17]
+
+(20) HashAggregate [codegen id : 4]
+Input [6]: [inv_quantity_on_hand#3, i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17]
+Keys [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17]
+Functions [1]: [partial_avg(inv_quantity_on_hand#3)]
+Aggregate Attributes [2]: [sum#18, count#19]
+Results [7]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]
+
+(21) Exchange
+Input [7]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]
+Arguments: hashpartitioning(i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, 5), ENSURE_REQUIREMENTS, [plan_id=3]
+
+(22) HashAggregate [codegen id : 5]
+Input [7]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17, sum#20, count#21]
+Keys [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, spark_grouping_id#17]
+Functions [1]: [avg(inv_quantity_on_hand#3)]
+Aggregate Attributes [1]: [avg(inv_quantity_on_hand#3)#22]
+Results [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, avg(inv_quantity_on_hand#3)#22 AS qoh#23]
+
+(23) TakeOrderedAndProject
+Input [5]: [i_product_name#13, i_brand#14, i_class#15, i_category#16, qoh#23]
+Arguments: 100, [qoh#23 ASC NULLS FIRST, i_product_name#13 ASC NULLS FIRST, i_brand#14 ASC NULLS FIRST, i_class#15 ASC NULLS FIRST, i_category#16 ASC NULLS FIRST], [i_product_name#13, i_brand#14, i_class#15, i_category#16, qoh#23]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5
+BroadcastExchange (28)
++- * ColumnarToRow (27)
+   +- CometProject (26)
+      +- CometFilter (25)
+         +- CometScan parquet spark_catalog.default.date_dim (24)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#6, d_month_seq#24]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_month_seq:int>
+
+(25) CometFilter
+Input [2]: [d_date_sk#6, d_month_seq#24]
+Condition : (((isnotnull(d_month_seq#24) AND (d_month_seq#24 >= 1200)) AND (d_month_seq#24 <= 1211)) AND isnotnull(d_date_sk#6))
+
+(26) CometProject
+Input [2]: [d_date_sk#6, d_month_seq#24]
+Arguments: [d_date_sk#6], [d_date_sk#6]
+
+(27) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#6]
+
+(28) BroadcastExchange
+Input [1]: [d_date_sk#6]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/simplified.txt
new file mode 100644
index 0000000..92714bb
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/simplified.txt
@@ -0,0 +1,42 @@
+TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category]
+  WholeStageCodegen (5)
+    HashAggregate [i_product_name,i_brand,i_class,i_category,spark_grouping_id,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count]
+      InputAdapter
+        Exchange [i_product_name,i_brand,i_class,i_category,spark_grouping_id] #1
+          WholeStageCodegen (4)
+            HashAggregate [i_product_name,i_brand,i_class,i_category,spark_grouping_id,inv_quantity_on_hand] [sum,count,sum,count]
+              Expand [inv_quantity_on_hand,i_product_name,i_brand,i_class,i_category]
+                Project [inv_quantity_on_hand,i_product_name,i_brand,i_class,i_category]
+                  BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk]
+                    Project [inv_warehouse_sk,inv_quantity_on_hand,i_brand,i_class,i_category,i_product_name]
+                      BroadcastHashJoin [inv_item_sk,i_item_sk]
+                        Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand]
+                          BroadcastHashJoin [inv_date_sk,d_date_sk]
+                            ColumnarToRow
+                              InputAdapter
+                                CometFilter [inv_item_sk,inv_warehouse_sk]
+                                  CometScan parquet spark_catalog.default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk]
+                                    SubqueryBroadcast [d_date_sk] #1
+                                      BroadcastExchange #2
+                                        WholeStageCodegen (1)
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometProject [d_date_sk]
+                                                CometFilter [d_month_seq,d_date_sk]
+                                                  CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_month_seq]
+                            InputAdapter
+                              ReusedExchange [d_date_sk] #2
+                        InputAdapter
+                          BroadcastExchange #3
+                            WholeStageCodegen (2)
+                              ColumnarToRow
+                                InputAdapter
+                                  CometFilter [i_item_sk]
+                                    CometScan parquet spark_catalog.default.item [i_item_sk,i_brand,i_class,i_category,i_product_name]
+                    InputAdapter
+                      BroadcastExchange #4
+                        WholeStageCodegen (3)
+                          ColumnarToRow
+                            InputAdapter
+                              CometFilter [w_warehouse_sk]
+                                CometScan parquet spark_catalog.default.warehouse [w_warehouse_sk]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt
new file mode 100644
index 0000000..5ec1794
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt
@@ -0,0 +1,570 @@
+== Physical Plan ==
+* HashAggregate (66)
++- Exchange (65)
+   +- * HashAggregate (64)
+      +- Union (63)
+         :- * Project (45)
+         :  +- * BroadcastHashJoin Inner BuildRight (44)
+         :     :- * Project (42)
+         :     :  +- * SortMergeJoin LeftSemi (41)
+         :     :     :- * Sort (24)
+         :     :     :  +- Exchange (23)
+         :     :     :     +- * Project (22)
+         :     :     :        +- * BroadcastHashJoin LeftSemi BuildRight (21)
+         :     :     :           :- * ColumnarToRow (2)
+         :     :     :           :  +- CometScan parquet spark_catalog.default.catalog_sales (1)
+         :     :     :           +- BroadcastExchange (20)
+         :     :     :              +- * Project (19)
+         :     :     :                 +- * Filter (18)
+         :     :     :                    +- * HashAggregate (17)
+         :     :     :                       +- Exchange (16)
+         :     :     :                          +- * HashAggregate (15)
+         :     :     :                             +- * Project (14)
+         :     :     :                                +- * BroadcastHashJoin Inner BuildRight (13)
+         :     :     :                                   :- * Project (8)
+         :     :     :                                   :  +- * BroadcastHashJoin Inner BuildRight (7)
+         :     :     :                                   :     :- * ColumnarToRow (5)
+         :     :     :                                   :     :  +- CometFilter (4)
+         :     :     :                                   :     :     +- CometScan parquet spark_catalog.default.store_sales (3)
+         :     :     :                                   :     +- ReusedExchange (6)
+         :     :     :                                   +- BroadcastExchange (12)
+         :     :     :                                      +- * ColumnarToRow (11)
+         :     :     :                                         +- CometFilter (10)
+         :     :     :                                            +- CometScan parquet spark_catalog.default.item (9)
+         :     :     +- * Sort (40)
+         :     :        +- * Project (39)
+         :     :           +- * Filter (38)
+         :     :              +- * HashAggregate (37)
+         :     :                 +- Exchange (36)
+         :     :                    +- * HashAggregate (35)
+         :     :                       +- * Project (34)
+         :     :                          +- * BroadcastHashJoin Inner BuildRight (33)
+         :     :                             :- * ColumnarToRow (28)
+         :     :                             :  +- CometProject (27)
+         :     :                             :     +- CometFilter (26)
+         :     :                             :        +- CometScan parquet spark_catalog.default.store_sales (25)
+         :     :                             +- BroadcastExchange (32)
+         :     :                                +- * ColumnarToRow (31)
+         :     :                                   +- CometFilter (30)
+         :     :                                      +- CometScan parquet spark_catalog.default.customer (29)
+         :     +- ReusedExchange (43)
+         +- * Project (62)
+            +- * BroadcastHashJoin Inner BuildRight (61)
+               :- * Project (59)
+               :  +- * SortMergeJoin LeftSemi (58)
+               :     :- * Sort (52)
+               :     :  +- Exchange (51)
+               :     :     +- * Project (50)
+               :     :        +- * BroadcastHashJoin LeftSemi BuildRight (49)
+               :     :           :- * ColumnarToRow (47)
+               :     :           :  +- CometScan parquet spark_catalog.default.web_sales (46)
+               :     :           +- ReusedExchange (48)
+               :     +- * Sort (57)
+               :        +- * Project (56)
+               :           +- * Filter (55)
+               :              +- * HashAggregate (54)
+               :                 +- ReusedExchange (53)
+               +- ReusedExchange (60)
+
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)]
+ReadSchema: struct<cs_bill_customer_sk:int,cs_item_sk:int,cs_quantity:int,cs_list_price:decimal(7,2)>
+
+(2) ColumnarToRow [codegen id : 5]
+Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [2]: [ss_item_sk#7, ss_sold_date_sk#8]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)]
+PushedFilters: [IsNotNull(ss_item_sk)]
+ReadSchema: struct<ss_item_sk:int>
+
+(4) CometFilter
+Input [2]: [ss_item_sk#7, ss_sold_date_sk#8]
+Condition : isnotnull(ss_item_sk#7)
+
+(5) ColumnarToRow [codegen id : 3]
+Input [2]: [ss_item_sk#7, ss_sold_date_sk#8]
+
+(6) ReusedExchange [Reuses operator id: 76]
+Output [2]: [d_date_sk#10, d_date#11]
+
+(7) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [ss_sold_date_sk#8]
+Right keys [1]: [d_date_sk#10]
+Join type: Inner
+Join condition: None
+
+(8) Project [codegen id : 3]
+Output [2]: [ss_item_sk#7, d_date#11]
+Input [4]: [ss_item_sk#7, ss_sold_date_sk#8, d_date_sk#10, d_date#11]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [2]: [i_item_sk#12, i_item_desc#13]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_item_desc:string>
+
+(10) CometFilter
+Input [2]: [i_item_sk#12, i_item_desc#13]
+Condition : isnotnull(i_item_sk#12)
+
+(11) ColumnarToRow [codegen id : 2]
+Input [2]: [i_item_sk#12, i_item_desc#13]
+
+(12) BroadcastExchange
+Input [2]: [i_item_sk#12, i_item_desc#13]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(13) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [ss_item_sk#7]
+Right keys [1]: [i_item_sk#12]
+Join type: Inner
+Join condition: None
+
+(14) Project [codegen id : 3]
+Output [3]: [d_date#11, i_item_sk#12, substr(i_item_desc#13, 1, 30) AS _groupingexpression#14]
+Input [4]: [ss_item_sk#7, d_date#11, i_item_sk#12, i_item_desc#13]
+
+(15) HashAggregate [codegen id : 3]
+Input [3]: [d_date#11, i_item_sk#12, _groupingexpression#14]
+Keys [3]: [_groupingexpression#14, i_item_sk#12, d_date#11]
+Functions [1]: [partial_count(1)]
+Aggregate Attributes [1]: [count#15]
+Results [4]: [_groupingexpression#14, i_item_sk#12, d_date#11, count#16]
+
+(16) Exchange
+Input [4]: [_groupingexpression#14, i_item_sk#12, d_date#11, count#16]
+Arguments: hashpartitioning(_groupingexpression#14, i_item_sk#12, d_date#11, 5), ENSURE_REQUIREMENTS, [plan_id=2]
+
+(17) HashAggregate [codegen id : 4]
+Input [4]: [_groupingexpression#14, i_item_sk#12, d_date#11, count#16]
+Keys [3]: [_groupingexpression#14, i_item_sk#12, d_date#11]
+Functions [1]: [count(1)]
+Aggregate Attributes [1]: [count(1)#17]
+Results [2]: [i_item_sk#12 AS item_sk#18, count(1)#17 AS cnt#19]
+
+(18) Filter [codegen id : 4]
+Input [2]: [item_sk#18, cnt#19]
+Condition : (cnt#19 > 4)
+
+(19) Project [codegen id : 4]
+Output [1]: [item_sk#18]
+Input [2]: [item_sk#18, cnt#19]
+
+(20) BroadcastExchange
+Input [1]: [item_sk#18]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]
+
+(21) BroadcastHashJoin [codegen id : 5]
+Left keys [1]: [cs_item_sk#2]
+Right keys [1]: [item_sk#18]
+Join type: LeftSemi
+Join condition: None
+
+(22) Project [codegen id : 5]
+Output [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+
+(23) Exchange
+Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+Arguments: hashpartitioning(cs_bill_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=4]
+
+(24) Sort [codegen id : 6]
+Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+Arguments: [cs_bill_customer_sk#1 ASC NULLS FIRST], false, 0
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, ss_sold_date_sk#23]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store_sales]
+PushedFilters: [IsNotNull(ss_customer_sk)]
+ReadSchema: struct<ss_customer_sk:int,ss_quantity:int,ss_sales_price:decimal(7,2)>
+
+(26) CometFilter
+Input [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, ss_sold_date_sk#23]
+Condition : isnotnull(ss_customer_sk#20)
+
+(27) CometProject
+Input [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, ss_sold_date_sk#23]
+Arguments: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22], [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22]
+
+(28) ColumnarToRow [codegen id : 8]
+Input [3]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22]
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [1]: [c_customer_sk#24]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk)]
+ReadSchema: struct<c_customer_sk:int>
+
+(30) CometFilter
+Input [1]: [c_customer_sk#24]
+Condition : isnotnull(c_customer_sk#24)
+
+(31) ColumnarToRow [codegen id : 7]
+Input [1]: [c_customer_sk#24]
+
+(32) BroadcastExchange
+Input [1]: [c_customer_sk#24]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=5]
+
+(33) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [ss_customer_sk#20]
+Right keys [1]: [c_customer_sk#24]
+Join type: Inner
+Join condition: None
+
+(34) Project [codegen id : 8]
+Output [3]: [ss_quantity#21, ss_sales_price#22, c_customer_sk#24]
+Input [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, c_customer_sk#24]
+
+(35) HashAggregate [codegen id : 8]
+Input [3]: [ss_quantity#21, ss_sales_price#22, c_customer_sk#24]
+Keys [1]: [c_customer_sk#24]
+Functions [1]: [partial_sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))]
+Aggregate Attributes [2]: [sum#25, isEmpty#26]
+Results [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+
+(36) Exchange
+Input [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+Arguments: hashpartitioning(c_customer_sk#24, 5), ENSURE_REQUIREMENTS, [plan_id=6]
+
+(37) HashAggregate [codegen id : 9]
+Input [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+Keys [1]: [c_customer_sk#24]
+Functions [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))]
+Aggregate Attributes [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29]
+Results [2]: [c_customer_sk#24, sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29 AS ssales#30]
+
+(38) Filter [codegen id : 9]
+Input [2]: [c_customer_sk#24, ssales#30]
+Condition : (isnotnull(ssales#30) AND (cast(ssales#30 as decimal(38,8)) > (0.500000 * Subquery scalar-subquery#31, [id=#32])))
+
+(39) Project [codegen id : 9]
+Output [1]: [c_customer_sk#24]
+Input [2]: [c_customer_sk#24, ssales#30]
+
+(40) Sort [codegen id : 9]
+Input [1]: [c_customer_sk#24]
+Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0
+
+(41) SortMergeJoin [codegen id : 11]
+Left keys [1]: [cs_bill_customer_sk#1]
+Right keys [1]: [c_customer_sk#24]
+Join type: LeftSemi
+Join condition: None
+
+(42) Project [codegen id : 11]
+Output [3]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+
+(43) ReusedExchange [Reuses operator id: 71]
+Output [1]: [d_date_sk#33]
+
+(44) BroadcastHashJoin [codegen id : 11]
+Left keys [1]: [cs_sold_date_sk#5]
+Right keys [1]: [d_date_sk#33]
+Join type: Inner
+Join condition: None
+
+(45) Project [codegen id : 11]
+Output [1]: [(cast(cs_quantity#3 as decimal(10,0)) * cs_list_price#4) AS sales#34]
+Input [4]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, d_date_sk#33]
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [5]: [ws_item_sk#35, ws_bill_customer_sk#36, ws_quantity#37, ws_list_price#38, ws_sold_date_sk#39]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#39), dynamicpruningexpression(ws_sold_date_sk#39 IN dynamicpruning#40)]
+ReadSchema: struct<ws_item_sk:int,ws_bill_customer_sk:int,ws_quantity:int,ws_list_price:decimal(7,2)>
+
+(47) ColumnarToRow [codegen id : 16]
+Input [5]: [ws_item_sk#35, ws_bill_customer_sk#36, ws_quantity#37, ws_list_price#38, ws_sold_date_sk#39]
+
+(48) ReusedExchange [Reuses operator id: 20]
+Output [1]: [item_sk#18]
+
+(49) BroadcastHashJoin [codegen id : 16]
+Left keys [1]: [ws_item_sk#35]
+Right keys [1]: [item_sk#18]
+Join type: LeftSemi
+Join condition: None
+
+(50) Project [codegen id : 16]
+Output [4]: [ws_bill_customer_sk#36, ws_quantity#37, ws_list_price#38, ws_sold_date_sk#39]
+Input [5]: [ws_item_sk#35, ws_bill_customer_sk#36, ws_quantity#37, ws_list_price#38, ws_sold_date_sk#39]
+
+(51) Exchange
+Input [4]: [ws_bill_customer_sk#36, ws_quantity#37, ws_list_price#38, ws_sold_date_sk#39]
+Arguments: hashpartitioning(ws_bill_customer_sk#36, 5), ENSURE_REQUIREMENTS, [plan_id=7]
+
+(52) Sort [codegen id : 17]
+Input [4]: [ws_bill_customer_sk#36, ws_quantity#37, ws_list_price#38, ws_sold_date_sk#39]
+Arguments: [ws_bill_customer_sk#36 ASC NULLS FIRST], false, 0
+
+(53) ReusedExchange [Reuses operator id: 36]
+Output [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+
+(54) HashAggregate [codegen id : 20]
+Input [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+Keys [1]: [c_customer_sk#24]
+Functions [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))]
+Aggregate Attributes [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29]
+Results [2]: [c_customer_sk#24, sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29 AS ssales#30]
+
+(55) Filter [codegen id : 20]
+Input [2]: [c_customer_sk#24, ssales#30]
+Condition : (isnotnull(ssales#30) AND (cast(ssales#30 as decimal(38,8)) > (0.500000 * ReusedSubquery Subquery scalar-subquery#31, [id=#32])))
+
+(56) Project [codegen id : 20]
+Output [1]: [c_customer_sk#24]
+Input [2]: [c_customer_sk#24, ssales#30]
+
+(57) Sort [codegen id : 20]
+Input [1]: [c_customer_sk#24]
+Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0
+
+(58) SortMergeJoin [codegen id : 22]
+Left keys [1]: [ws_bill_customer_sk#36]
+Right keys [1]: [c_customer_sk#24]
+Join type: LeftSemi
+Join condition: None
+
+(59) Project [codegen id : 22]
+Output [3]: [ws_quantity#37, ws_list_price#38, ws_sold_date_sk#39]
+Input [4]: [ws_bill_customer_sk#36, ws_quantity#37, ws_list_price#38, ws_sold_date_sk#39]
+
+(60) ReusedExchange [Reuses operator id: 71]
+Output [1]: [d_date_sk#41]
+
+(61) BroadcastHashJoin [codegen id : 22]
+Left keys [1]: [ws_sold_date_sk#39]
+Right keys [1]: [d_date_sk#41]
+Join type: Inner
+Join condition: None
+
+(62) Project [codegen id : 22]
+Output [1]: [(cast(ws_quantity#37 as decimal(10,0)) * ws_list_price#38) AS sales#42]
+Input [4]: [ws_quantity#37, ws_list_price#38, ws_sold_date_sk#39, d_date_sk#41]
+
+(63) Union
+
+(64) HashAggregate [codegen id : 23]
+Input [1]: [sales#34]
+Keys: []
+Functions [1]: [partial_sum(sales#34)]
+Aggregate Attributes [2]: [sum#43, isEmpty#44]
+Results [2]: [sum#45, isEmpty#46]
+
+(65) Exchange
+Input [2]: [sum#45, isEmpty#46]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=8]
+
+(66) HashAggregate [codegen id : 24]
+Input [2]: [sum#45, isEmpty#46]
+Keys: []
+Functions [1]: [sum(sales#34)]
+Aggregate Attributes [1]: [sum(sales#34)#47]
+Results [1]: [sum(sales#34)#47 AS sum(sales)#48]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6
+BroadcastExchange (71)
++- * ColumnarToRow (70)
+   +- CometProject (69)
+      +- CometFilter (68)
+         +- CometScan parquet spark_catalog.default.date_dim (67)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [3]: [d_date_sk#33, d_year#49, d_moy#50]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,2), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
+
+(68) CometFilter
+Input [3]: [d_date_sk#33, d_year#49, d_moy#50]
+Condition : ((((isnotnull(d_year#49) AND isnotnull(d_moy#50)) AND (d_year#49 = 2000)) AND (d_moy#50 = 2)) AND isnotnull(d_date_sk#33))
+
+(69) CometProject
+Input [3]: [d_date_sk#33, d_year#49, d_moy#50]
+Arguments: [d_date_sk#33], [d_date_sk#33]
+
+(70) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#33]
+
+(71) BroadcastExchange
+Input [1]: [d_date_sk#33]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=9]
+
+Subquery:2 Hosting operator id = 3 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9
+BroadcastExchange (76)
++- * ColumnarToRow (75)
+   +- CometProject (74)
+      +- CometFilter (73)
+         +- CometScan parquet spark_catalog.default.date_dim (72)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [3]: [d_date_sk#10, d_date#11, d_year#51]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_date:date,d_year:int>
+
+(73) CometFilter
+Input [3]: [d_date_sk#10, d_date#11, d_year#51]
+Condition : (d_year#51 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#10))
+
+(74) CometProject
+Input [3]: [d_date_sk#10, d_date#11, d_year#51]
+Arguments: [d_date_sk#10, d_date#11], [d_date_sk#10, d_date#11]
+
+(75) ColumnarToRow [codegen id : 1]
+Input [2]: [d_date_sk#10, d_date#11]
+
+(76) BroadcastExchange
+Input [2]: [d_date_sk#10, d_date#11]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=10]
+
+Subquery:3 Hosting operator id = 38 Hosting Expression = Subquery scalar-subquery#31, [id=#32]
+* HashAggregate (91)
++- Exchange (90)
+   +- * HashAggregate (89)
+      +- * HashAggregate (88)
+         +- Exchange (87)
+            +- * HashAggregate (86)
+               +- * Project (85)
+                  +- * BroadcastHashJoin Inner BuildRight (84)
+                     :- * Project (82)
+                     :  +- * BroadcastHashJoin Inner BuildRight (81)
+                     :     :- * ColumnarToRow (79)
+                     :     :  +- CometFilter (78)
+                     :     :     +- CometScan parquet spark_catalog.default.store_sales (77)
+                     :     +- ReusedExchange (80)
+                     +- ReusedExchange (83)
+
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [4]: [ss_customer_sk#52, ss_quantity#53, ss_sales_price#54, ss_sold_date_sk#55]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#55), dynamicpruningexpression(ss_sold_date_sk#55 IN dynamicpruning#56)]
+PushedFilters: [IsNotNull(ss_customer_sk)]
+ReadSchema: struct<ss_customer_sk:int,ss_quantity:int,ss_sales_price:decimal(7,2)>
+
+(78) CometFilter
+Input [4]: [ss_customer_sk#52, ss_quantity#53, ss_sales_price#54, ss_sold_date_sk#55]
+Condition : isnotnull(ss_customer_sk#52)
+
+(79) ColumnarToRow [codegen id : 3]
+Input [4]: [ss_customer_sk#52, ss_quantity#53, ss_sales_price#54, ss_sold_date_sk#55]
+
+(80) ReusedExchange [Reuses operator id: 32]
+Output [1]: [c_customer_sk#57]
+
+(81) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [ss_customer_sk#52]
+Right keys [1]: [c_customer_sk#57]
+Join type: Inner
+Join condition: None
+
+(82) Project [codegen id : 3]
+Output [4]: [ss_quantity#53, ss_sales_price#54, ss_sold_date_sk#55, c_customer_sk#57]
+Input [5]: [ss_customer_sk#52, ss_quantity#53, ss_sales_price#54, ss_sold_date_sk#55, c_customer_sk#57]
+
+(83) ReusedExchange [Reuses operator id: 96]
+Output [1]: [d_date_sk#58]
+
+(84) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [ss_sold_date_sk#55]
+Right keys [1]: [d_date_sk#58]
+Join type: Inner
+Join condition: None
+
+(85) Project [codegen id : 3]
+Output [3]: [ss_quantity#53, ss_sales_price#54, c_customer_sk#57]
+Input [5]: [ss_quantity#53, ss_sales_price#54, ss_sold_date_sk#55, c_customer_sk#57, d_date_sk#58]
+
+(86) HashAggregate [codegen id : 3]
+Input [3]: [ss_quantity#53, ss_sales_price#54, c_customer_sk#57]
+Keys [1]: [c_customer_sk#57]
+Functions [1]: [partial_sum((cast(ss_quantity#53 as decimal(10,0)) * ss_sales_price#54))]
+Aggregate Attributes [2]: [sum#59, isEmpty#60]
+Results [3]: [c_customer_sk#57, sum#61, isEmpty#62]
+
+(87) Exchange
+Input [3]: [c_customer_sk#57, sum#61, isEmpty#62]
+Arguments: hashpartitioning(c_customer_sk#57, 5), ENSURE_REQUIREMENTS, [plan_id=11]
+
+(88) HashAggregate [codegen id : 4]
+Input [3]: [c_customer_sk#57, sum#61, isEmpty#62]
+Keys [1]: [c_customer_sk#57]
+Functions [1]: [sum((cast(ss_quantity#53 as decimal(10,0)) * ss_sales_price#54))]
+Aggregate Attributes [1]: [sum((cast(ss_quantity#53 as decimal(10,0)) * ss_sales_price#54))#63]
+Results [1]: [sum((cast(ss_quantity#53 as decimal(10,0)) * ss_sales_price#54))#63 AS csales#64]
+
+(89) HashAggregate [codegen id : 4]
+Input [1]: [csales#64]
+Keys: []
+Functions [1]: [partial_max(csales#64)]
+Aggregate Attributes [1]: [max#65]
+Results [1]: [max#66]
+
+(90) Exchange
+Input [1]: [max#66]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=12]
+
+(91) HashAggregate [codegen id : 5]
+Input [1]: [max#66]
+Keys: []
+Functions [1]: [max(csales#64)]
+Aggregate Attributes [1]: [max(csales#64)#67]
+Results [1]: [max(csales#64)#67 AS tpcds_cmax#68]
+
+Subquery:4 Hosting operator id = 77 Hosting Expression = ss_sold_date_sk#55 IN dynamicpruning#56
+BroadcastExchange (96)
++- * ColumnarToRow (95)
+   +- CometProject (94)
+      +- CometFilter (93)
+         +- CometScan parquet spark_catalog.default.date_dim (92)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#58, d_year#69]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int>
+
+(93) CometFilter
+Input [2]: [d_date_sk#58, d_year#69]
+Condition : (d_year#69 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#58))
+
+(94) CometProject
+Input [2]: [d_date_sk#58, d_year#69]
+Arguments: [d_date_sk#58], [d_date_sk#58]
+
+(95) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#58]
+
+(96) BroadcastExchange
+Input [1]: [d_date_sk#58]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=13]
+
+Subquery:5 Hosting operator id = 46 Hosting Expression = ws_sold_date_sk#39 IN dynamicpruning#6
+
+Subquery:6 Hosting operator id = 55 Hosting Expression = ReusedSubquery Subquery scalar-subquery#31, [id=#32]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt
new file mode 100644
index 0000000..0ec56d0
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt
@@ -0,0 +1,155 @@
+WholeStageCodegen (24)
+  HashAggregate [sum,isEmpty] [sum(sales),sum(sales),sum,isEmpty]
+    InputAdapter
+      Exchange #1
+        WholeStageCodegen (23)
+          HashAggregate [sales] [sum,isEmpty,sum,isEmpty]
+            InputAdapter
+              Union
+                WholeStageCodegen (11)
+                  Project [cs_quantity,cs_list_price]
+                    BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                      Project [cs_quantity,cs_list_price,cs_sold_date_sk]
+                        SortMergeJoin [cs_bill_customer_sk,c_customer_sk]
+                          InputAdapter
+                            WholeStageCodegen (6)
+                              Sort [cs_bill_customer_sk]
+                                InputAdapter
+                                  Exchange [cs_bill_customer_sk] #2
+                                    WholeStageCodegen (5)
+                                      Project [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sold_date_sk]
+                                        BroadcastHashJoin [cs_item_sk,item_sk]
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometScan parquet spark_catalog.default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk]
+                                                SubqueryBroadcast [d_date_sk] #1
+                                                  BroadcastExchange #3
+                                                    WholeStageCodegen (1)
+                                                      ColumnarToRow
+                                                        InputAdapter
+                                                          CometProject [d_date_sk]
+                                                            CometFilter [d_year,d_moy,d_date_sk]
+                                                              CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year,d_moy]
+                                          InputAdapter
+                                            BroadcastExchange #4
+                                              WholeStageCodegen (4)
+                                                Project [item_sk]
+                                                  Filter [cnt]
+                                                    HashAggregate [_groupingexpression,i_item_sk,d_date,count] [count(1),item_sk,cnt,count]
+                                                      InputAdapter
+                                                        Exchange [_groupingexpression,i_item_sk,d_date] #5
+                                                          WholeStageCodegen (3)
+                                                            HashAggregate [_groupingexpression,i_item_sk,d_date] [count,count]
+                                                              Project [d_date,i_item_sk,i_item_desc]
+                                                                BroadcastHashJoin [ss_item_sk,i_item_sk]
+                                                                  Project [ss_item_sk,d_date]
+                                                                    BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                                                      ColumnarToRow
+                                                                        InputAdapter
+                                                                          CometFilter [ss_item_sk]
+                                                                            CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_sold_date_sk]
+                                                                              SubqueryBroadcast [d_date_sk] #2
+                                                                                BroadcastExchange #6
+                                                                                  WholeStageCodegen (1)
+                                                                                    ColumnarToRow
+                                                                                      InputAdapter
+                                                                                        CometProject [d_date_sk,d_date]
+                                                                                          CometFilter [d_year,d_date_sk]
+                                                                                            CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_date,d_year]
+                                                                      InputAdapter
+                                                                        ReusedExchange [d_date_sk,d_date] #6
+                                                                  InputAdapter
+                                                                    BroadcastExchange #7
+                                                                      WholeStageCodegen (2)
+                                                                        ColumnarToRow
+                                                                          InputAdapter
+                                                                            CometFilter [i_item_sk]
+                                                                              CometScan parquet spark_catalog.default.item [i_item_sk,i_item_desc]
+                          InputAdapter
+                            WholeStageCodegen (9)
+                              Sort [c_customer_sk]
+                                Project [c_customer_sk]
+                                  Filter [ssales]
+                                    Subquery #3
+                                      WholeStageCodegen (5)
+                                        HashAggregate [max] [max(csales),tpcds_cmax,max]
+                                          InputAdapter
+                                            Exchange #10
+                                              WholeStageCodegen (4)
+                                                HashAggregate [csales] [max,max]
+                                                  HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),csales,sum,isEmpty]
+                                                    InputAdapter
+                                                      Exchange [c_customer_sk] #11
+                                                        WholeStageCodegen (3)
+                                                          HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty]
+                                                            Project [ss_quantity,ss_sales_price,c_customer_sk]
+                                                              BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                                                Project [ss_quantity,ss_sales_price,ss_sold_date_sk,c_customer_sk]
+                                                                  BroadcastHashJoin [ss_customer_sk,c_customer_sk]
+                                                                    ColumnarToRow
+                                                                      InputAdapter
+                                                                        CometFilter [ss_customer_sk]
+                                                                          CometScan parquet spark_catalog.default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
+                                                                            SubqueryBroadcast [d_date_sk] #4
+                                                                              BroadcastExchange #12
+                                                                                WholeStageCodegen (1)
+                                                                                  ColumnarToRow
+                                                                                    InputAdapter
+                                                                                      CometProject [d_date_sk]
+                                                                                        CometFilter [d_year,d_date_sk]
+                                                                                          CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year]
+                                                                    InputAdapter
+                                                                      ReusedExchange [c_customer_sk] #9
+                                                                InputAdapter
+                                                                  ReusedExchange [d_date_sk] #12
+                                    HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),ssales,sum,isEmpty]
+                                      InputAdapter
+                                        Exchange [c_customer_sk] #8
+                                          WholeStageCodegen (8)
+                                            HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty]
+                                              Project [ss_quantity,ss_sales_price,c_customer_sk]
+                                                BroadcastHashJoin [ss_customer_sk,c_customer_sk]
+                                                  ColumnarToRow
+                                                    InputAdapter
+                                                      CometProject [ss_customer_sk,ss_quantity,ss_sales_price]
+                                                        CometFilter [ss_customer_sk]
+                                                          CometScan parquet spark_catalog.default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
+                                                  InputAdapter
+                                                    BroadcastExchange #9
+                                                      WholeStageCodegen (7)
+                                                        ColumnarToRow
+                                                          InputAdapter
+                                                            CometFilter [c_customer_sk]
+                                                              CometScan parquet spark_catalog.default.customer [c_customer_sk]
+                      InputAdapter
+                        ReusedExchange [d_date_sk] #3
+                WholeStageCodegen (22)
+                  Project [ws_quantity,ws_list_price]
+                    BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
+                      Project [ws_quantity,ws_list_price,ws_sold_date_sk]
+                        SortMergeJoin [ws_bill_customer_sk,c_customer_sk]
+                          InputAdapter
+                            WholeStageCodegen (17)
+                              Sort [ws_bill_customer_sk]
+                                InputAdapter
+                                  Exchange [ws_bill_customer_sk] #13
+                                    WholeStageCodegen (16)
+                                      Project [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
+                                        BroadcastHashJoin [ws_item_sk,item_sk]
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometScan parquet spark_catalog.default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
+                                                ReusedSubquery [d_date_sk] #1
+                                          InputAdapter
+                                            ReusedExchange [item_sk] #4
+                          InputAdapter
+                            WholeStageCodegen (20)
+                              Sort [c_customer_sk]
+                                Project [c_customer_sk]
+                                  Filter [ssales]
+                                    ReusedSubquery [tpcds_cmax] #3
+                                    HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),ssales,sum,isEmpty]
+                                      InputAdapter
+                                        ReusedExchange [c_customer_sk,sum,isEmpty] #8
+                      InputAdapter
+                        ReusedExchange [d_date_sk] #3
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt
new file mode 100644
index 0000000..86227b8
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt
@@ -0,0 +1,694 @@
+== Physical Plan ==
+TakeOrderedAndProject (87)
++- Union (86)
+   :- * HashAggregate (62)
+   :  +- Exchange (61)
+   :     +- * HashAggregate (60)
+   :        +- * Project (59)
+   :           +- * BroadcastHashJoin Inner BuildRight (58)
+   :              :- * Project (56)
+   :              :  +- * BroadcastHashJoin Inner BuildRight (55)
+   :              :     :- * SortMergeJoin LeftSemi (42)
+   :              :     :  :- * Sort (25)
+   :              :     :  :  +- Exchange (24)
+   :              :     :  :     +- * Project (23)
+   :              :     :  :        +- * BroadcastHashJoin LeftSemi BuildRight (22)
+   :              :     :  :           :- * ColumnarToRow (3)
+   :              :     :  :           :  +- CometFilter (2)
+   :              :     :  :           :     +- CometScan parquet spark_catalog.default.catalog_sales (1)
+   :              :     :  :           +- BroadcastExchange (21)
+   :              :     :  :              +- * Project (20)
+   :              :     :  :                 +- * Filter (19)
+   :              :     :  :                    +- * HashAggregate (18)
+   :              :     :  :                       +- Exchange (17)
+   :              :     :  :                          +- * HashAggregate (16)
+   :              :     :  :                             +- * Project (15)
+   :              :     :  :                                +- * BroadcastHashJoin Inner BuildRight (14)
+   :              :     :  :                                   :- * Project (9)
+   :              :     :  :                                   :  +- * BroadcastHashJoin Inner BuildRight (8)
+   :              :     :  :                                   :     :- * ColumnarToRow (6)
+   :              :     :  :                                   :     :  +- CometFilter (5)
+   :              :     :  :                                   :     :     +- CometScan parquet spark_catalog.default.store_sales (4)
+   :              :     :  :                                   :     +- ReusedExchange (7)
+   :              :     :  :                                   +- BroadcastExchange (13)
+   :              :     :  :                                      +- * ColumnarToRow (12)
+   :              :     :  :                                         +- CometFilter (11)
+   :              :     :  :                                            +- CometScan parquet spark_catalog.default.item (10)
+   :              :     :  +- * Sort (41)
+   :              :     :     +- * Project (40)
+   :              :     :        +- * Filter (39)
+   :              :     :           +- * HashAggregate (38)
+   :              :     :              +- Exchange (37)
+   :              :     :                 +- * HashAggregate (36)
+   :              :     :                    +- * Project (35)
+   :              :     :                       +- * BroadcastHashJoin Inner BuildRight (34)
+   :              :     :                          :- * ColumnarToRow (29)
+   :              :     :                          :  +- CometProject (28)
+   :              :     :                          :     +- CometFilter (27)
+   :              :     :                          :        +- CometScan parquet spark_catalog.default.store_sales (26)
+   :              :     :                          +- BroadcastExchange (33)
+   :              :     :                             +- * ColumnarToRow (32)
+   :              :     :                                +- CometFilter (31)
+   :              :     :                                   +- CometScan parquet spark_catalog.default.customer (30)
+   :              :     +- BroadcastExchange (54)
+   :              :        +- * SortMergeJoin LeftSemi (53)
+   :              :           :- * ColumnarToRow (47)
+   :              :           :  +- CometSort (46)
+   :              :           :     +- CometExchange (45)
+   :              :           :        +- CometFilter (44)
+   :              :           :           +- CometScan parquet spark_catalog.default.customer (43)
+   :              :           +- * Sort (52)
+   :              :              +- * Project (51)
+   :              :                 +- * Filter (50)
+   :              :                    +- * HashAggregate (49)
+   :              :                       +- ReusedExchange (48)
+   :              +- ReusedExchange (57)
+   +- * HashAggregate (85)
+      +- Exchange (84)
+         +- * HashAggregate (83)
+            +- * Project (82)
+               +- * BroadcastHashJoin Inner BuildRight (81)
+                  :- * Project (79)
+                  :  +- * BroadcastHashJoin Inner BuildRight (78)
+                  :     :- * SortMergeJoin LeftSemi (76)
+                  :     :  :- * Sort (70)
+                  :     :  :  +- Exchange (69)
+                  :     :  :     +- * Project (68)
+                  :     :  :        +- * BroadcastHashJoin LeftSemi BuildRight (67)
+                  :     :  :           :- * ColumnarToRow (65)
+                  :     :  :           :  +- CometFilter (64)
+                  :     :  :           :     +- CometScan parquet spark_catalog.default.web_sales (63)
+                  :     :  :           +- ReusedExchange (66)
+                  :     :  +- * Sort (75)
+                  :     :     +- * Project (74)
+                  :     :        +- * Filter (73)
+                  :     :           +- * HashAggregate (72)
+                  :     :              +- ReusedExchange (71)
+                  :     +- ReusedExchange (77)
+                  +- ReusedExchange (80)
+
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)]
+PushedFilters: [IsNotNull(cs_bill_customer_sk)]
+ReadSchema: struct<cs_bill_customer_sk:int,cs_item_sk:int,cs_quantity:int,cs_list_price:decimal(7,2)>
+
+(2) CometFilter
+Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+Condition : isnotnull(cs_bill_customer_sk#1)
+
+(3) ColumnarToRow [codegen id : 5]
+Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [2]: [ss_item_sk#7, ss_sold_date_sk#8]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)]
+PushedFilters: [IsNotNull(ss_item_sk)]
+ReadSchema: struct<ss_item_sk:int>
+
+(5) CometFilter
+Input [2]: [ss_item_sk#7, ss_sold_date_sk#8]
+Condition : isnotnull(ss_item_sk#7)
+
+(6) ColumnarToRow [codegen id : 3]
+Input [2]: [ss_item_sk#7, ss_sold_date_sk#8]
+
+(7) ReusedExchange [Reuses operator id: 97]
+Output [2]: [d_date_sk#10, d_date#11]
+
+(8) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [ss_sold_date_sk#8]
+Right keys [1]: [d_date_sk#10]
+Join type: Inner
+Join condition: None
+
+(9) Project [codegen id : 3]
+Output [2]: [ss_item_sk#7, d_date#11]
+Input [4]: [ss_item_sk#7, ss_sold_date_sk#8, d_date_sk#10, d_date#11]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [2]: [i_item_sk#12, i_item_desc#13]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_item_desc:string>
+
+(11) CometFilter
+Input [2]: [i_item_sk#12, i_item_desc#13]
+Condition : isnotnull(i_item_sk#12)
+
+(12) ColumnarToRow [codegen id : 2]
+Input [2]: [i_item_sk#12, i_item_desc#13]
+
+(13) BroadcastExchange
+Input [2]: [i_item_sk#12, i_item_desc#13]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
+
+(14) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [ss_item_sk#7]
+Right keys [1]: [i_item_sk#12]
+Join type: Inner
+Join condition: None
+
+(15) Project [codegen id : 3]
+Output [3]: [d_date#11, i_item_sk#12, substr(i_item_desc#13, 1, 30) AS _groupingexpression#14]
+Input [4]: [ss_item_sk#7, d_date#11, i_item_sk#12, i_item_desc#13]
+
+(16) HashAggregate [codegen id : 3]
+Input [3]: [d_date#11, i_item_sk#12, _groupingexpression#14]
+Keys [3]: [_groupingexpression#14, i_item_sk#12, d_date#11]
+Functions [1]: [partial_count(1)]
+Aggregate Attributes [1]: [count#15]
+Results [4]: [_groupingexpression#14, i_item_sk#12, d_date#11, count#16]
+
+(17) Exchange
+Input [4]: [_groupingexpression#14, i_item_sk#12, d_date#11, count#16]
+Arguments: hashpartitioning(_groupingexpression#14, i_item_sk#12, d_date#11, 5), ENSURE_REQUIREMENTS, [plan_id=2]
+
+(18) HashAggregate [codegen id : 4]
+Input [4]: [_groupingexpression#14, i_item_sk#12, d_date#11, count#16]
+Keys [3]: [_groupingexpression#14, i_item_sk#12, d_date#11]
+Functions [1]: [count(1)]
+Aggregate Attributes [1]: [count(1)#17]
+Results [2]: [i_item_sk#12 AS item_sk#18, count(1)#17 AS cnt#19]
+
+(19) Filter [codegen id : 4]
+Input [2]: [item_sk#18, cnt#19]
+Condition : (cnt#19 > 4)
+
+(20) Project [codegen id : 4]
+Output [1]: [item_sk#18]
+Input [2]: [item_sk#18, cnt#19]
+
+(21) BroadcastExchange
+Input [1]: [item_sk#18]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]
+
+(22) BroadcastHashJoin [codegen id : 5]
+Left keys [1]: [cs_item_sk#2]
+Right keys [1]: [item_sk#18]
+Join type: LeftSemi
+Join condition: None
+
+(23) Project [codegen id : 5]
+Output [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+
+(24) Exchange
+Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+Arguments: hashpartitioning(cs_bill_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=4]
+
+(25) Sort [codegen id : 6]
+Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5]
+Arguments: [cs_bill_customer_sk#1 ASC NULLS FIRST], false, 0
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, ss_sold_date_sk#23]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store_sales]
+PushedFilters: [IsNotNull(ss_customer_sk)]
+ReadSchema: struct<ss_customer_sk:int,ss_quantity:int,ss_sales_price:decimal(7,2)>
+
+(27) CometFilter
+Input [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, ss_sold_date_sk#23]
+Condition : isnotnull(ss_customer_sk#20)
+
+(28) CometProject
+Input [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, ss_sold_date_sk#23]
+Arguments: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22], [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22]
+
+(29) ColumnarToRow [codegen id : 8]
+Input [3]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22]
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [1]: [c_customer_sk#24]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk)]
+ReadSchema: struct<c_customer_sk:int>
+
+(31) CometFilter
+Input [1]: [c_customer_sk#24]
+Condition : isnotnull(c_customer_sk#24)
+
+(32) ColumnarToRow [codegen id : 7]
+Input [1]: [c_customer_sk#24]
+
+(33) BroadcastExchange
+Input [1]: [c_customer_sk#24]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=5]
+
+(34) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [ss_customer_sk#20]
+Right keys [1]: [c_customer_sk#24]
+Join type: Inner
+Join condition: None
+
+(35) Project [codegen id : 8]
+Output [3]: [ss_quantity#21, ss_sales_price#22, c_customer_sk#24]
+Input [4]: [ss_customer_sk#20, ss_quantity#21, ss_sales_price#22, c_customer_sk#24]
+
+(36) HashAggregate [codegen id : 8]
+Input [3]: [ss_quantity#21, ss_sales_price#22, c_customer_sk#24]
+Keys [1]: [c_customer_sk#24]
+Functions [1]: [partial_sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))]
+Aggregate Attributes [2]: [sum#25, isEmpty#26]
+Results [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+
+(37) Exchange
+Input [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+Arguments: hashpartitioning(c_customer_sk#24, 5), ENSURE_REQUIREMENTS, [plan_id=6]
+
+(38) HashAggregate [codegen id : 9]
+Input [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+Keys [1]: [c_customer_sk#24]
+Functions [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))]
+Aggregate Attributes [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29]
+Results [2]: [c_customer_sk#24, sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29 AS ssales#30]
+
+(39) Filter [codegen id : 9]
+Input [2]: [c_customer_sk#24, ssales#30]
+Condition : (isnotnull(ssales#30) AND (cast(ssales#30 as decimal(38,8)) > (0.500000 * Subquery scalar-subquery#31, [id=#32])))
+
+(40) Project [codegen id : 9]
+Output [1]: [c_customer_sk#24]
+Input [2]: [c_customer_sk#24, ssales#30]
+
+(41) Sort [codegen id : 9]
+Input [1]: [c_customer_sk#24]
+Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0
+
+(42) SortMergeJoin [codegen id : 16]
+Left keys [1]: [cs_bill_customer_sk#1]
+Right keys [1]: [c_customer_sk#24]
+Join type: LeftSemi
+Join condition: None
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [3]: [c_customer_sk#33, c_first_name#34, c_last_name#35]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk)]
+ReadSchema: struct<c_customer_sk:int,c_first_name:string,c_last_name:string>
+
+(44) CometFilter
+Input [3]: [c_customer_sk#33, c_first_name#34, c_last_name#35]
+Condition : isnotnull(c_customer_sk#33)
+
+(45) CometExchange
+Input [3]: [c_customer_sk#33, c_first_name#34, c_last_name#35]
+Arguments: hashpartitioning(c_customer_sk#33, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=7]
+
+(46) CometSort
+Input [3]: [c_customer_sk#33, c_first_name#34, c_last_name#35]
+Arguments: [c_customer_sk#33, c_first_name#34, c_last_name#35], [c_customer_sk#33 ASC NULLS FIRST]
+
+(47) ColumnarToRow [codegen id : 10]
+Input [3]: [c_customer_sk#33, c_first_name#34, c_last_name#35]
+
+(48) ReusedExchange [Reuses operator id: 37]
+Output [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+
+(49) HashAggregate [codegen id : 13]
+Input [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+Keys [1]: [c_customer_sk#24]
+Functions [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))]
+Aggregate Attributes [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29]
+Results [2]: [c_customer_sk#24, sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29 AS ssales#30]
+
+(50) Filter [codegen id : 13]
+Input [2]: [c_customer_sk#24, ssales#30]
+Condition : (isnotnull(ssales#30) AND (cast(ssales#30 as decimal(38,8)) > (0.500000 * ReusedSubquery Subquery scalar-subquery#31, [id=#32])))
+
+(51) Project [codegen id : 13]
+Output [1]: [c_customer_sk#24]
+Input [2]: [c_customer_sk#24, ssales#30]
+
+(52) Sort [codegen id : 13]
+Input [1]: [c_customer_sk#24]
+Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0
+
+(53) SortMergeJoin [codegen id : 14]
+Left keys [1]: [c_customer_sk#33]
+Right keys [1]: [c_customer_sk#24]
+Join type: LeftSemi
+Join condition: None
+
+(54) BroadcastExchange
+Input [3]: [c_customer_sk#33, c_first_name#34, c_last_name#35]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=8]
+
+(55) BroadcastHashJoin [codegen id : 16]
+Left keys [1]: [cs_bill_customer_sk#1]
+Right keys [1]: [c_customer_sk#33]
+Join type: Inner
+Join condition: None
+
+(56) Project [codegen id : 16]
+Output [5]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, c_first_name#34, c_last_name#35]
+Input [7]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, c_customer_sk#33, c_first_name#34, c_last_name#35]
+
+(57) ReusedExchange [Reuses operator id: 92]
+Output [1]: [d_date_sk#36]
+
+(58) BroadcastHashJoin [codegen id : 16]
+Left keys [1]: [cs_sold_date_sk#5]
+Right keys [1]: [d_date_sk#36]
+Join type: Inner
+Join condition: None
+
+(59) Project [codegen id : 16]
+Output [4]: [cs_quantity#3, cs_list_price#4, c_first_name#34, c_last_name#35]
+Input [6]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, c_first_name#34, c_last_name#35, d_date_sk#36]
+
+(60) HashAggregate [codegen id : 16]
+Input [4]: [cs_quantity#3, cs_list_price#4, c_first_name#34, c_last_name#35]
+Keys [2]: [c_last_name#35, c_first_name#34]
+Functions [1]: [partial_sum((cast(cs_quantity#3 as decimal(10,0)) * cs_list_price#4))]
+Aggregate Attributes [2]: [sum#37, isEmpty#38]
+Results [4]: [c_last_name#35, c_first_name#34, sum#39, isEmpty#40]
+
+(61) Exchange
+Input [4]: [c_last_name#35, c_first_name#34, sum#39, isEmpty#40]
+Arguments: hashpartitioning(c_last_name#35, c_first_name#34, 5), ENSURE_REQUIREMENTS, [plan_id=9]
+
+(62) HashAggregate [codegen id : 17]
+Input [4]: [c_last_name#35, c_first_name#34, sum#39, isEmpty#40]
+Keys [2]: [c_last_name#35, c_first_name#34]
+Functions [1]: [sum((cast(cs_quantity#3 as decimal(10,0)) * cs_list_price#4))]
+Aggregate Attributes [1]: [sum((cast(cs_quantity#3 as decimal(10,0)) * cs_list_price#4))#41]
+Results [3]: [c_last_name#35, c_first_name#34, sum((cast(cs_quantity#3 as decimal(10,0)) * cs_list_price#4))#41 AS sales#42]
+
+(unknown) Scan parquet spark_catalog.default.web_sales
+Output [5]: [ws_item_sk#43, ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ws_sold_date_sk#47), dynamicpruningexpression(ws_sold_date_sk#47 IN dynamicpruning#48)]
+PushedFilters: [IsNotNull(ws_bill_customer_sk)]
+ReadSchema: struct<ws_item_sk:int,ws_bill_customer_sk:int,ws_quantity:int,ws_list_price:decimal(7,2)>
+
+(64) CometFilter
+Input [5]: [ws_item_sk#43, ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]
+Condition : isnotnull(ws_bill_customer_sk#44)
+
+(65) ColumnarToRow [codegen id : 22]
+Input [5]: [ws_item_sk#43, ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]
+
+(66) ReusedExchange [Reuses operator id: 21]
+Output [1]: [item_sk#18]
+
+(67) BroadcastHashJoin [codegen id : 22]
+Left keys [1]: [ws_item_sk#43]
+Right keys [1]: [item_sk#18]
+Join type: LeftSemi
+Join condition: None
+
+(68) Project [codegen id : 22]
+Output [4]: [ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]
+Input [5]: [ws_item_sk#43, ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]
+
+(69) Exchange
+Input [4]: [ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]
+Arguments: hashpartitioning(ws_bill_customer_sk#44, 5), ENSURE_REQUIREMENTS, [plan_id=10]
+
+(70) Sort [codegen id : 23]
+Input [4]: [ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47]
+Arguments: [ws_bill_customer_sk#44 ASC NULLS FIRST], false, 0
+
+(71) ReusedExchange [Reuses operator id: 37]
+Output [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+
+(72) HashAggregate [codegen id : 26]
+Input [3]: [c_customer_sk#24, sum#27, isEmpty#28]
+Keys [1]: [c_customer_sk#24]
+Functions [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))]
+Aggregate Attributes [1]: [sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29]
+Results [2]: [c_customer_sk#24, sum((cast(ss_quantity#21 as decimal(10,0)) * ss_sales_price#22))#29 AS ssales#30]
+
+(73) Filter [codegen id : 26]
+Input [2]: [c_customer_sk#24, ssales#30]
+Condition : (isnotnull(ssales#30) AND (cast(ssales#30 as decimal(38,8)) > (0.500000 * ReusedSubquery Subquery scalar-subquery#31, [id=#32])))
+
+(74) Project [codegen id : 26]
+Output [1]: [c_customer_sk#24]
+Input [2]: [c_customer_sk#24, ssales#30]
+
+(75) Sort [codegen id : 26]
+Input [1]: [c_customer_sk#24]
+Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0
+
+(76) SortMergeJoin [codegen id : 33]
+Left keys [1]: [ws_bill_customer_sk#44]
+Right keys [1]: [c_customer_sk#24]
+Join type: LeftSemi
+Join condition: None
+
+(77) ReusedExchange [Reuses operator id: 54]
+Output [3]: [c_customer_sk#49, c_first_name#50, c_last_name#51]
+
+(78) BroadcastHashJoin [codegen id : 33]
+Left keys [1]: [ws_bill_customer_sk#44]
+Right keys [1]: [c_customer_sk#49]
+Join type: Inner
+Join condition: None
+
+(79) Project [codegen id : 33]
+Output [5]: [ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47, c_first_name#50, c_last_name#51]
+Input [7]: [ws_bill_customer_sk#44, ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47, c_customer_sk#49, c_first_name#50, c_last_name#51]
+
+(80) ReusedExchange [Reuses operator id: 92]
+Output [1]: [d_date_sk#52]
+
+(81) BroadcastHashJoin [codegen id : 33]
+Left keys [1]: [ws_sold_date_sk#47]
+Right keys [1]: [d_date_sk#52]
+Join type: Inner
+Join condition: None
+
+(82) Project [codegen id : 33]
+Output [4]: [ws_quantity#45, ws_list_price#46, c_first_name#50, c_last_name#51]
+Input [6]: [ws_quantity#45, ws_list_price#46, ws_sold_date_sk#47, c_first_name#50, c_last_name#51, d_date_sk#52]
+
+(83) HashAggregate [codegen id : 33]
+Input [4]: [ws_quantity#45, ws_list_price#46, c_first_name#50, c_last_name#51]
+Keys [2]: [c_last_name#51, c_first_name#50]
+Functions [1]: [partial_sum((cast(ws_quantity#45 as decimal(10,0)) * ws_list_price#46))]
+Aggregate Attributes [2]: [sum#53, isEmpty#54]
+Results [4]: [c_last_name#51, c_first_name#50, sum#55, isEmpty#56]
+
+(84) Exchange
+Input [4]: [c_last_name#51, c_first_name#50, sum#55, isEmpty#56]
+Arguments: hashpartitioning(c_last_name#51, c_first_name#50, 5), ENSURE_REQUIREMENTS, [plan_id=11]
+
+(85) HashAggregate [codegen id : 34]
+Input [4]: [c_last_name#51, c_first_name#50, sum#55, isEmpty#56]
+Keys [2]: [c_last_name#51, c_first_name#50]
+Functions [1]: [sum((cast(ws_quantity#45 as decimal(10,0)) * ws_list_price#46))]
+Aggregate Attributes [1]: [sum((cast(ws_quantity#45 as decimal(10,0)) * ws_list_price#46))#57]
+Results [3]: [c_last_name#51, c_first_name#50, sum((cast(ws_quantity#45 as decimal(10,0)) * ws_list_price#46))#57 AS sales#58]
+
+(86) Union
+
+(87) TakeOrderedAndProject
+Input [3]: [c_last_name#35, c_first_name#34, sales#42]
+Arguments: 100, [c_last_name#35 ASC NULLS FIRST, c_first_name#34 ASC NULLS FIRST, sales#42 ASC NULLS FIRST], [c_last_name#35, c_first_name#34, sales#42]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6
+BroadcastExchange (92)
++- * ColumnarToRow (91)
+   +- CometProject (90)
+      +- CometFilter (89)
+         +- CometScan parquet spark_catalog.default.date_dim (88)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [3]: [d_date_sk#36, d_year#59, d_moy#60]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,2), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
+
+(89) CometFilter
+Input [3]: [d_date_sk#36, d_year#59, d_moy#60]
+Condition : ((((isnotnull(d_year#59) AND isnotnull(d_moy#60)) AND (d_year#59 = 2000)) AND (d_moy#60 = 2)) AND isnotnull(d_date_sk#36))
+
+(90) CometProject
+Input [3]: [d_date_sk#36, d_year#59, d_moy#60]
+Arguments: [d_date_sk#36], [d_date_sk#36]
+
+(91) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#36]
+
+(92) BroadcastExchange
+Input [1]: [d_date_sk#36]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=12]
+
+Subquery:2 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9
+BroadcastExchange (97)
++- * ColumnarToRow (96)
+   +- CometProject (95)
+      +- CometFilter (94)
+         +- CometScan parquet spark_catalog.default.date_dim (93)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [3]: [d_date_sk#10, d_date#11, d_year#61]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_date:date,d_year:int>
+
+(94) CometFilter
+Input [3]: [d_date_sk#10, d_date#11, d_year#61]
+Condition : (d_year#61 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#10))
+
+(95) CometProject
+Input [3]: [d_date_sk#10, d_date#11, d_year#61]
+Arguments: [d_date_sk#10, d_date#11], [d_date_sk#10, d_date#11]
+
+(96) ColumnarToRow [codegen id : 1]
+Input [2]: [d_date_sk#10, d_date#11]
+
+(97) BroadcastExchange
+Input [2]: [d_date_sk#10, d_date#11]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=13]
+
+Subquery:3 Hosting operator id = 39 Hosting Expression = Subquery scalar-subquery#31, [id=#32]
+* HashAggregate (112)
++- Exchange (111)
+   +- * HashAggregate (110)
+      +- * HashAggregate (109)
+         +- Exchange (108)
+            +- * HashAggregate (107)
+               +- * Project (106)
+                  +- * BroadcastHashJoin Inner BuildRight (105)
+                     :- * Project (103)
+                     :  +- * BroadcastHashJoin Inner BuildRight (102)
+                     :     :- * ColumnarToRow (100)
+                     :     :  +- CometFilter (99)
+                     :     :     +- CometScan parquet spark_catalog.default.store_sales (98)
+                     :     +- ReusedExchange (101)
+                     +- ReusedExchange (104)
+
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [4]: [ss_customer_sk#62, ss_quantity#63, ss_sales_price#64, ss_sold_date_sk#65]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#65), dynamicpruningexpression(ss_sold_date_sk#65 IN dynamicpruning#66)]
+PushedFilters: [IsNotNull(ss_customer_sk)]
+ReadSchema: struct<ss_customer_sk:int,ss_quantity:int,ss_sales_price:decimal(7,2)>
+
+(99) CometFilter
+Input [4]: [ss_customer_sk#62, ss_quantity#63, ss_sales_price#64, ss_sold_date_sk#65]
+Condition : isnotnull(ss_customer_sk#62)
+
+(100) ColumnarToRow [codegen id : 3]
+Input [4]: [ss_customer_sk#62, ss_quantity#63, ss_sales_price#64, ss_sold_date_sk#65]
+
+(101) ReusedExchange [Reuses operator id: 33]
+Output [1]: [c_customer_sk#67]
+
+(102) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [ss_customer_sk#62]
+Right keys [1]: [c_customer_sk#67]
+Join type: Inner
+Join condition: None
+
+(103) Project [codegen id : 3]
+Output [4]: [ss_quantity#63, ss_sales_price#64, ss_sold_date_sk#65, c_customer_sk#67]
+Input [5]: [ss_customer_sk#62, ss_quantity#63, ss_sales_price#64, ss_sold_date_sk#65, c_customer_sk#67]
+
+(104) ReusedExchange [Reuses operator id: 117]
+Output [1]: [d_date_sk#68]
+
+(105) BroadcastHashJoin [codegen id : 3]
+Left keys [1]: [ss_sold_date_sk#65]
+Right keys [1]: [d_date_sk#68]
+Join type: Inner
+Join condition: None
+
+(106) Project [codegen id : 3]
+Output [3]: [ss_quantity#63, ss_sales_price#64, c_customer_sk#67]
+Input [5]: [ss_quantity#63, ss_sales_price#64, ss_sold_date_sk#65, c_customer_sk#67, d_date_sk#68]
+
+(107) HashAggregate [codegen id : 3]
+Input [3]: [ss_quantity#63, ss_sales_price#64, c_customer_sk#67]
+Keys [1]: [c_customer_sk#67]
+Functions [1]: [partial_sum((cast(ss_quantity#63 as decimal(10,0)) * ss_sales_price#64))]
+Aggregate Attributes [2]: [sum#69, isEmpty#70]
+Results [3]: [c_customer_sk#67, sum#71, isEmpty#72]
+
+(108) Exchange
+Input [3]: [c_customer_sk#67, sum#71, isEmpty#72]
+Arguments: hashpartitioning(c_customer_sk#67, 5), ENSURE_REQUIREMENTS, [plan_id=14]
+
+(109) HashAggregate [codegen id : 4]
+Input [3]: [c_customer_sk#67, sum#71, isEmpty#72]
+Keys [1]: [c_customer_sk#67]
+Functions [1]: [sum((cast(ss_quantity#63 as decimal(10,0)) * ss_sales_price#64))]
+Aggregate Attributes [1]: [sum((cast(ss_quantity#63 as decimal(10,0)) * ss_sales_price#64))#73]
+Results [1]: [sum((cast(ss_quantity#63 as decimal(10,0)) * ss_sales_price#64))#73 AS csales#74]
+
+(110) HashAggregate [codegen id : 4]
+Input [1]: [csales#74]
+Keys: []
+Functions [1]: [partial_max(csales#74)]
+Aggregate Attributes [1]: [max#75]
+Results [1]: [max#76]
+
+(111) Exchange
+Input [1]: [max#76]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=15]
+
+(112) HashAggregate [codegen id : 5]
+Input [1]: [max#76]
+Keys: []
+Functions [1]: [max(csales#74)]
+Aggregate Attributes [1]: [max(csales#74)#77]
+Results [1]: [max(csales#74)#77 AS tpcds_cmax#78]
+
+Subquery:4 Hosting operator id = 98 Hosting Expression = ss_sold_date_sk#65 IN dynamicpruning#66
+BroadcastExchange (117)
++- * ColumnarToRow (116)
+   +- CometProject (115)
+      +- CometFilter (114)
+         +- CometScan parquet spark_catalog.default.date_dim (113)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#68, d_year#79]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int>
+
+(114) CometFilter
+Input [2]: [d_date_sk#68, d_year#79]
+Condition : (d_year#79 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#68))
+
+(115) CometProject
+Input [2]: [d_date_sk#68, d_year#79]
+Arguments: [d_date_sk#68], [d_date_sk#68]
+
+(116) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#68]
+
+(117) BroadcastExchange
+Input [1]: [d_date_sk#68]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=16]
+
+Subquery:5 Hosting operator id = 50 Hosting Expression = ReusedSubquery Subquery scalar-subquery#31, [id=#32]
+
+Subquery:6 Hosting operator id = 63 Hosting Expression = ws_sold_date_sk#47 IN dynamicpruning#6
+
+Subquery:7 Hosting operator id = 73 Hosting Expression = ReusedSubquery Subquery scalar-subquery#31, [id=#32]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt
new file mode 100644
index 0000000..9cbb568
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt
@@ -0,0 +1,186 @@
+TakeOrderedAndProject [c_last_name,c_first_name,sales]
+  Union
+    WholeStageCodegen (17)
+      HashAggregate [c_last_name,c_first_name,sum,isEmpty] [sum((cast(cs_quantity as decimal(10,0)) * cs_list_price)),sales,sum,isEmpty]
+        InputAdapter
+          Exchange [c_last_name,c_first_name] #1
+            WholeStageCodegen (16)
+              HashAggregate [c_last_name,c_first_name,cs_quantity,cs_list_price] [sum,isEmpty,sum,isEmpty]
+                Project [cs_quantity,cs_list_price,c_first_name,c_last_name]
+                  BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                    Project [cs_quantity,cs_list_price,cs_sold_date_sk,c_first_name,c_last_name]
+                      BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk]
+                        SortMergeJoin [cs_bill_customer_sk,c_customer_sk]
+                          InputAdapter
+                            WholeStageCodegen (6)
+                              Sort [cs_bill_customer_sk]
+                                InputAdapter
+                                  Exchange [cs_bill_customer_sk] #2
+                                    WholeStageCodegen (5)
+                                      Project [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sold_date_sk]
+                                        BroadcastHashJoin [cs_item_sk,item_sk]
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometFilter [cs_bill_customer_sk]
+                                                CometScan parquet spark_catalog.default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk]
+                                                  SubqueryBroadcast [d_date_sk] #1
+                                                    BroadcastExchange #3
+                                                      WholeStageCodegen (1)
+                                                        ColumnarToRow
+                                                          InputAdapter
+                                                            CometProject [d_date_sk]
+                                                              CometFilter [d_year,d_moy,d_date_sk]
+                                                                CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year,d_moy]
+                                          InputAdapter
+                                            BroadcastExchange #4
+                                              WholeStageCodegen (4)
+                                                Project [item_sk]
+                                                  Filter [cnt]
+                                                    HashAggregate [_groupingexpression,i_item_sk,d_date,count] [count(1),item_sk,cnt,count]
+                                                      InputAdapter
+                                                        Exchange [_groupingexpression,i_item_sk,d_date] #5
+                                                          WholeStageCodegen (3)
+                                                            HashAggregate [_groupingexpression,i_item_sk,d_date] [count,count]
+                                                              Project [d_date,i_item_sk,i_item_desc]
+                                                                BroadcastHashJoin [ss_item_sk,i_item_sk]
+                                                                  Project [ss_item_sk,d_date]
+                                                                    BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                                                      ColumnarToRow
+                                                                        InputAdapter
+                                                                          CometFilter [ss_item_sk]
+                                                                            CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_sold_date_sk]
+                                                                              SubqueryBroadcast [d_date_sk] #2
+                                                                                BroadcastExchange #6
+                                                                                  WholeStageCodegen (1)
+                                                                                    ColumnarToRow
+                                                                                      InputAdapter
+                                                                                        CometProject [d_date_sk,d_date]
+                                                                                          CometFilter [d_year,d_date_sk]
+                                                                                            CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_date,d_year]
+                                                                      InputAdapter
+                                                                        ReusedExchange [d_date_sk,d_date] #6
+                                                                  InputAdapter
+                                                                    BroadcastExchange #7
+                                                                      WholeStageCodegen (2)
+                                                                        ColumnarToRow
+                                                                          InputAdapter
+                                                                            CometFilter [i_item_sk]
+                                                                              CometScan parquet spark_catalog.default.item [i_item_sk,i_item_desc]
+                          InputAdapter
+                            WholeStageCodegen (9)
+                              Sort [c_customer_sk]
+                                Project [c_customer_sk]
+                                  Filter [ssales]
+                                    Subquery #3
+                                      WholeStageCodegen (5)
+                                        HashAggregate [max] [max(csales),tpcds_cmax,max]
+                                          InputAdapter
+                                            Exchange #10
+                                              WholeStageCodegen (4)
+                                                HashAggregate [csales] [max,max]
+                                                  HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),csales,sum,isEmpty]
+                                                    InputAdapter
+                                                      Exchange [c_customer_sk] #11
+                                                        WholeStageCodegen (3)
+                                                          HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty]
+                                                            Project [ss_quantity,ss_sales_price,c_customer_sk]
+                                                              BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                                                Project [ss_quantity,ss_sales_price,ss_sold_date_sk,c_customer_sk]
+                                                                  BroadcastHashJoin [ss_customer_sk,c_customer_sk]
+                                                                    ColumnarToRow
+                                                                      InputAdapter
+                                                                        CometFilter [ss_customer_sk]
+                                                                          CometScan parquet spark_catalog.default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
+                                                                            SubqueryBroadcast [d_date_sk] #4
+                                                                              BroadcastExchange #12
+                                                                                WholeStageCodegen (1)
+                                                                                  ColumnarToRow
+                                                                                    InputAdapter
+                                                                                      CometProject [d_date_sk]
+                                                                                        CometFilter [d_year,d_date_sk]
+                                                                                          CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year]
+                                                                    InputAdapter
+                                                                      ReusedExchange [c_customer_sk] #9
+                                                                InputAdapter
+                                                                  ReusedExchange [d_date_sk] #12
+                                    HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),ssales,sum,isEmpty]
+                                      InputAdapter
+                                        Exchange [c_customer_sk] #8
+                                          WholeStageCodegen (8)
+                                            HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty]
+                                              Project [ss_quantity,ss_sales_price,c_customer_sk]
+                                                BroadcastHashJoin [ss_customer_sk,c_customer_sk]
+                                                  ColumnarToRow
+                                                    InputAdapter
+                                                      CometProject [ss_customer_sk,ss_quantity,ss_sales_price]
+                                                        CometFilter [ss_customer_sk]
+                                                          CometScan parquet spark_catalog.default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk]
+                                                  InputAdapter
+                                                    BroadcastExchange #9
+                                                      WholeStageCodegen (7)
+                                                        ColumnarToRow
+                                                          InputAdapter
+                                                            CometFilter [c_customer_sk]
+                                                              CometScan parquet spark_catalog.default.customer [c_customer_sk]
+                        InputAdapter
+                          BroadcastExchange #13
+                            WholeStageCodegen (14)
+                              SortMergeJoin [c_customer_sk,c_customer_sk]
+                                InputAdapter
+                                  WholeStageCodegen (10)
+                                    ColumnarToRow
+                                      InputAdapter
+                                        CometSort [c_customer_sk]
+                                          CometExchange [c_customer_sk] #14
+                                            CometFilter [c_customer_sk]
+                                              CometScan parquet spark_catalog.default.customer [c_customer_sk,c_first_name,c_last_name]
+                                InputAdapter
+                                  WholeStageCodegen (13)
+                                    Sort [c_customer_sk]
+                                      Project [c_customer_sk]
+                                        Filter [ssales]
+                                          ReusedSubquery [tpcds_cmax] #3
+                                          HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),ssales,sum,isEmpty]
+                                            InputAdapter
+                                              ReusedExchange [c_customer_sk,sum,isEmpty] #8
+                    InputAdapter
+                      ReusedExchange [d_date_sk] #3
+    WholeStageCodegen (34)
+      HashAggregate [c_last_name,c_first_name,sum,isEmpty] [sum((cast(ws_quantity as decimal(10,0)) * ws_list_price)),sales,sum,isEmpty]
+        InputAdapter
+          Exchange [c_last_name,c_first_name] #15
+            WholeStageCodegen (33)
+              HashAggregate [c_last_name,c_first_name,ws_quantity,ws_list_price] [sum,isEmpty,sum,isEmpty]
+                Project [ws_quantity,ws_list_price,c_first_name,c_last_name]
+                  BroadcastHashJoin [ws_sold_date_sk,d_date_sk]
+                    Project [ws_quantity,ws_list_price,ws_sold_date_sk,c_first_name,c_last_name]
+                      BroadcastHashJoin [ws_bill_customer_sk,c_customer_sk]
+                        SortMergeJoin [ws_bill_customer_sk,c_customer_sk]
+                          InputAdapter
+                            WholeStageCodegen (23)
+                              Sort [ws_bill_customer_sk]
+                                InputAdapter
+                                  Exchange [ws_bill_customer_sk] #16
+                                    WholeStageCodegen (22)
+                                      Project [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
+                                        BroadcastHashJoin [ws_item_sk,item_sk]
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometFilter [ws_bill_customer_sk]
+                                                CometScan parquet spark_catalog.default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk]
+                                                  ReusedSubquery [d_date_sk] #1
+                                          InputAdapter
+                                            ReusedExchange [item_sk] #4
+                          InputAdapter
+                            WholeStageCodegen (26)
+                              Sort [c_customer_sk]
+                                Project [c_customer_sk]
+                                  Filter [ssales]
+                                    ReusedSubquery [tpcds_cmax] #3
+                                    HashAggregate [c_customer_sk,sum,isEmpty] [sum((cast(ss_quantity as decimal(10,0)) * ss_sales_price)),ssales,sum,isEmpty]
+                                      InputAdapter
+                                        ReusedExchange [c_customer_sk,sum,isEmpty] #8
+                        InputAdapter
+                          ReusedExchange [c_customer_sk,c_first_name,c_last_name] #13
+                    InputAdapter
+                      ReusedExchange [d_date_sk] #3
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/explain.txt
new file mode 100644
index 0000000..b3a9f22
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/explain.txt
@@ -0,0 +1,435 @@
+== Physical Plan ==
+* Filter (46)
++- * HashAggregate (45)
+   +- Exchange (44)
+      +- * HashAggregate (43)
+         +- * HashAggregate (42)
+            +- Exchange (41)
+               +- * HashAggregate (40)
+                  +- * Project (39)
+                     +- * BroadcastHashJoin Inner BuildRight (38)
+                        :- * Project (33)
+                        :  +- * BroadcastHashJoin Inner BuildRight (32)
+                        :     :- * Project (27)
+                        :     :  +- * BroadcastHashJoin Inner BuildRight (26)
+                        :     :     :- * Project (21)
+                        :     :     :  +- * BroadcastHashJoin Inner BuildRight (20)
+                        :     :     :     :- * Project (14)
+                        :     :     :     :  +- * SortMergeJoin Inner (13)
+                        :     :     :     :     :- * ColumnarToRow (6)
+                        :     :     :     :     :  +- CometSort (5)
+                        :     :     :     :     :     +- CometExchange (4)
+                        :     :     :     :     :        +- CometProject (3)
+                        :     :     :     :     :           +- CometFilter (2)
+                        :     :     :     :     :              +- CometScan parquet spark_catalog.default.store_sales (1)
+                        :     :     :     :     +- * ColumnarToRow (12)
+                        :     :     :     :        +- CometSort (11)
+                        :     :     :     :           +- CometExchange (10)
+                        :     :     :     :              +- CometProject (9)
+                        :     :     :     :                 +- CometFilter (8)
+                        :     :     :     :                    +- CometScan parquet spark_catalog.default.store_returns (7)
+                        :     :     :     +- BroadcastExchange (19)
+                        :     :     :        +- * ColumnarToRow (18)
+                        :     :     :           +- CometProject (17)
+                        :     :     :              +- CometFilter (16)
+                        :     :     :                 +- CometScan parquet spark_catalog.default.store (15)
+                        :     :     +- BroadcastExchange (25)
+                        :     :        +- * ColumnarToRow (24)
+                        :     :           +- CometFilter (23)
+                        :     :              +- CometScan parquet spark_catalog.default.item (22)
+                        :     +- BroadcastExchange (31)
+                        :        +- * ColumnarToRow (30)
+                        :           +- CometFilter (29)
+                        :              +- CometScan parquet spark_catalog.default.customer (28)
+                        +- BroadcastExchange (37)
+                           +- * ColumnarToRow (36)
+                              +- CometFilter (35)
+                                 +- CometScan parquet spark_catalog.default.customer_address (34)
+
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store_sales]
+PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)]
+ReadSchema: struct<ss_item_sk:int,ss_customer_sk:int,ss_store_sk:int,ss_ticket_number:int,ss_net_paid:decimal(7,2)>
+
+(2) CometFilter
+Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6]
+Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2))
+
+(3) CometProject
+Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6]
+Arguments: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5], [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+
+(4) CometExchange
+Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]
+
+(5) CometSort
+Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+Arguments: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5], [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST]
+
+(6) ColumnarToRow [codegen id : 1]
+Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+
+(unknown) Scan parquet spark_catalog.default.store_returns
+Output [3]: [sr_item_sk#7, sr_ticket_number#8, sr_returned_date_sk#9]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store_returns]
+PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)]
+ReadSchema: struct<sr_item_sk:int,sr_ticket_number:int>
+
+(8) CometFilter
+Input [3]: [sr_item_sk#7, sr_ticket_number#8, sr_returned_date_sk#9]
+Condition : (isnotnull(sr_ticket_number#8) AND isnotnull(sr_item_sk#7))
+
+(9) CometProject
+Input [3]: [sr_item_sk#7, sr_ticket_number#8, sr_returned_date_sk#9]
+Arguments: [sr_item_sk#7, sr_ticket_number#8], [sr_item_sk#7, sr_ticket_number#8]
+
+(10) CometExchange
+Input [2]: [sr_item_sk#7, sr_ticket_number#8]
+Arguments: hashpartitioning(sr_ticket_number#8, sr_item_sk#7, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=2]
+
+(11) CometSort
+Input [2]: [sr_item_sk#7, sr_ticket_number#8]
+Arguments: [sr_item_sk#7, sr_ticket_number#8], [sr_ticket_number#8 ASC NULLS FIRST, sr_item_sk#7 ASC NULLS FIRST]
+
+(12) ColumnarToRow [codegen id : 2]
+Input [2]: [sr_item_sk#7, sr_ticket_number#8]
+
+(13) SortMergeJoin [codegen id : 7]
+Left keys [2]: [ss_ticket_number#4, ss_item_sk#1]
+Right keys [2]: [sr_ticket_number#8, sr_item_sk#7]
+Join type: Inner
+Join condition: None
+
+(14) Project [codegen id : 7]
+Output [4]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5]
+Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, sr_item_sk#7, sr_ticket_number#8]
+
+(unknown) Scan parquet spark_catalog.default.store
+Output [5]: [s_store_sk#10, s_store_name#11, s_market_id#12, s_state#13, s_zip#14]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store]
+PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)]
+ReadSchema: struct<s_store_sk:int,s_store_name:string,s_market_id:int,s_state:string,s_zip:string>
+
+(16) CometFilter
+Input [5]: [s_store_sk#10, s_store_name#11, s_market_id#12, s_state#13, s_zip#14]
+Condition : (((isnotnull(s_market_id#12) AND (s_market_id#12 = 8)) AND isnotnull(s_store_sk#10)) AND isnotnull(s_zip#14))
+
+(17) CometProject
+Input [5]: [s_store_sk#10, s_store_name#11, s_market_id#12, s_state#13, s_zip#14]
+Arguments: [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14], [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+
+(18) ColumnarToRow [codegen id : 3]
+Input [4]: [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+
+(19) BroadcastExchange
+Input [4]: [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]
+
+(20) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_store_sk#3]
+Right keys [1]: [s_store_sk#10]
+Join type: Inner
+Join condition: None
+
+(21) Project [codegen id : 7]
+Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14]
+Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5, s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_color), EqualTo(i_color,pale                ), IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_current_price:decimal(7,2),i_size:string,i_color:string,i_units:string,i_manager_id:int>
+
+(23) CometFilter
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Condition : ((isnotnull(i_color#18) AND (i_color#18 = pale                )) AND isnotnull(i_item_sk#15))
+
+(24) ColumnarToRow [codegen id : 4]
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+
+(25) BroadcastExchange
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
+
+(26) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_item_sk#1]
+Right keys [1]: [i_item_sk#15]
+Join type: Inner
+Join condition: None
+
+(27) Project [codegen id : 7]
+Output [10]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_birth_country)]
+ReadSchema: struct<c_customer_sk:int,c_first_name:string,c_last_name:string,c_birth_country:string>
+
+(29) CometFilter
+Input [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+Condition : (isnotnull(c_customer_sk#21) AND isnotnull(c_birth_country#24))
+
+(30) ColumnarToRow [codegen id : 5]
+Input [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+
+(31) BroadcastExchange
+Input [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=5]
+
+(32) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_customer_sk#2]
+Right keys [1]: [c_customer_sk#21]
+Join type: Inner
+Join condition: None
+
+(33) Project [codegen id : 7]
+Output [12]: [ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, c_birth_country#24]
+Input [14]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+
+(unknown) Scan parquet spark_catalog.default.customer_address
+Output [3]: [ca_state#25, ca_zip#26, ca_country#27]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_address]
+PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)]
+ReadSchema: struct<ca_state:string,ca_zip:string,ca_country:string>
+
+(35) CometFilter
+Input [3]: [ca_state#25, ca_zip#26, ca_country#27]
+Condition : (isnotnull(ca_country#27) AND isnotnull(ca_zip#26))
+
+(36) ColumnarToRow [codegen id : 6]
+Input [3]: [ca_state#25, ca_zip#26, ca_country#27]
+
+(37) BroadcastExchange
+Input [3]: [ca_state#25, ca_zip#26, ca_country#27]
+Arguments: HashedRelationBroadcastMode(List(upper(input[2, string, false]), input[1, string, false]),false), [plan_id=6]
+
+(38) BroadcastHashJoin [codegen id : 7]
+Left keys [2]: [c_birth_country#24, s_zip#14]
+Right keys [2]: [upper(ca_country#27), ca_zip#26]
+Join type: Inner
+Join condition: None
+
+(39) Project [codegen id : 7]
+Output [11]: [ss_net_paid#5, s_store_name#11, s_state#13, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, ca_state#25]
+Input [15]: [ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, c_birth_country#24, ca_state#25, ca_zip#26, ca_country#27]
+
+(40) HashAggregate [codegen id : 7]
+Input [11]: [ss_net_paid#5, s_store_name#11, s_state#13, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, ca_state#25]
+Keys [10]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17]
+Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))]
+Aggregate Attributes [1]: [sum#28]
+Results [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#29]
+
+(41) Exchange
+Input [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#29]
+Arguments: hashpartitioning(c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, 5), ENSURE_REQUIREMENTS, [plan_id=7]
+
+(42) HashAggregate [codegen id : 8]
+Input [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#29]
+Keys [10]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17]
+Functions [1]: [sum(UnscaledValue(ss_net_paid#5))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#30]
+Results [4]: [c_last_name#23, c_first_name#22, s_store_name#11, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#30,17,2) AS netpaid#31]
+
+(43) HashAggregate [codegen id : 8]
+Input [4]: [c_last_name#23, c_first_name#22, s_store_name#11, netpaid#31]
+Keys [3]: [c_last_name#23, c_first_name#22, s_store_name#11]
+Functions [1]: [partial_sum(netpaid#31)]
+Aggregate Attributes [2]: [sum#32, isEmpty#33]
+Results [5]: [c_last_name#23, c_first_name#22, s_store_name#11, sum#34, isEmpty#35]
+
+(44) Exchange
+Input [5]: [c_last_name#23, c_first_name#22, s_store_name#11, sum#34, isEmpty#35]
+Arguments: hashpartitioning(c_last_name#23, c_first_name#22, s_store_name#11, 5), ENSURE_REQUIREMENTS, [plan_id=8]
+
+(45) HashAggregate [codegen id : 9]
+Input [5]: [c_last_name#23, c_first_name#22, s_store_name#11, sum#34, isEmpty#35]
+Keys [3]: [c_last_name#23, c_first_name#22, s_store_name#11]
+Functions [1]: [sum(netpaid#31)]
+Aggregate Attributes [1]: [sum(netpaid#31)#36]
+Results [4]: [c_last_name#23, c_first_name#22, s_store_name#11, sum(netpaid#31)#36 AS paid#37]
+
+(46) Filter [codegen id : 9]
+Input [4]: [c_last_name#23, c_first_name#22, s_store_name#11, paid#37]
+Condition : (isnotnull(paid#37) AND (cast(paid#37 as decimal(33,8)) > cast(Subquery scalar-subquery#38, [id=#39] as decimal(33,8))))
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 46 Hosting Expression = Subquery scalar-subquery#38, [id=#39]
+* HashAggregate (75)
++- Exchange (74)
+   +- * HashAggregate (73)
+      +- * HashAggregate (72)
+         +- Exchange (71)
+            +- * HashAggregate (70)
+               +- * Project (69)
+                  +- * BroadcastHashJoin Inner BuildRight (68)
+                     :- * Project (66)
+                     :  +- * BroadcastHashJoin Inner BuildRight (65)
+                     :     :- * Project (63)
+                     :     :  +- * BroadcastHashJoin Inner BuildRight (62)
+                     :     :     :- * Project (57)
+                     :     :     :  +- * BroadcastHashJoin Inner BuildRight (56)
+                     :     :     :     :- * Project (54)
+                     :     :     :     :  +- * SortMergeJoin Inner (53)
+                     :     :     :     :     :- * ColumnarToRow (49)
+                     :     :     :     :     :  +- CometSort (48)
+                     :     :     :     :     :     +- ReusedExchange (47)
+                     :     :     :     :     +- * ColumnarToRow (52)
+                     :     :     :     :        +- CometSort (51)
+                     :     :     :     :           +- ReusedExchange (50)
+                     :     :     :     +- ReusedExchange (55)
+                     :     :     +- BroadcastExchange (61)
+                     :     :        +- * ColumnarToRow (60)
+                     :     :           +- CometFilter (59)
+                     :     :              +- CometScan parquet spark_catalog.default.item (58)
+                     :     +- ReusedExchange (64)
+                     +- ReusedExchange (67)
+
+
+(47) ReusedExchange [Reuses operator id: 4]
+Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+
+(48) CometSort
+Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+Arguments: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5], [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST]
+
+(49) ColumnarToRow [codegen id : 1]
+Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+
+(50) ReusedExchange [Reuses operator id: 10]
+Output [2]: [sr_item_sk#7, sr_ticket_number#8]
+
+(51) CometSort
+Input [2]: [sr_item_sk#7, sr_ticket_number#8]
+Arguments: [sr_item_sk#7, sr_ticket_number#8], [sr_ticket_number#8 ASC NULLS FIRST, sr_item_sk#7 ASC NULLS FIRST]
+
+(52) ColumnarToRow [codegen id : 2]
+Input [2]: [sr_item_sk#7, sr_ticket_number#8]
+
+(53) SortMergeJoin [codegen id : 7]
+Left keys [2]: [ss_ticket_number#4, ss_item_sk#1]
+Right keys [2]: [sr_ticket_number#8, sr_item_sk#7]
+Join type: Inner
+Join condition: None
+
+(54) Project [codegen id : 7]
+Output [4]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5]
+Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, sr_item_sk#7, sr_ticket_number#8]
+
+(55) ReusedExchange [Reuses operator id: 19]
+Output [4]: [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+
+(56) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_store_sk#3]
+Right keys [1]: [s_store_sk#10]
+Join type: Inner
+Join condition: None
+
+(57) Project [codegen id : 7]
+Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14]
+Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5, s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_current_price:decimal(7,2),i_size:string,i_color:string,i_units:string,i_manager_id:int>
+
+(59) CometFilter
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Condition : isnotnull(i_item_sk#15)
+
+(60) ColumnarToRow [codegen id : 4]
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+
+(61) BroadcastExchange
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=9]
+
+(62) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_item_sk#1]
+Right keys [1]: [i_item_sk#15]
+Join type: Inner
+Join condition: None
+
+(63) Project [codegen id : 7]
+Output [10]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+
+(64) ReusedExchange [Reuses operator id: 31]
+Output [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+
+(65) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_customer_sk#2]
+Right keys [1]: [c_customer_sk#21]
+Join type: Inner
+Join condition: None
+
+(66) Project [codegen id : 7]
+Output [12]: [ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, c_birth_country#24]
+Input [14]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+
+(67) ReusedExchange [Reuses operator id: 37]
+Output [3]: [ca_state#25, ca_zip#26, ca_country#27]
+
+(68) BroadcastHashJoin [codegen id : 7]
+Left keys [2]: [c_birth_country#24, s_zip#14]
+Right keys [2]: [upper(ca_country#27), ca_zip#26]
+Join type: Inner
+Join condition: None
+
+(69) Project [codegen id : 7]
+Output [11]: [ss_net_paid#5, s_store_name#11, s_state#13, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, ca_state#25]
+Input [15]: [ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, c_birth_country#24, ca_state#25, ca_zip#26, ca_country#27]
+
+(70) HashAggregate [codegen id : 7]
+Input [11]: [ss_net_paid#5, s_store_name#11, s_state#13, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, ca_state#25]
+Keys [10]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17]
+Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))]
+Aggregate Attributes [1]: [sum#40]
+Results [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#41]
+
+(71) Exchange
+Input [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#41]
+Arguments: hashpartitioning(c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, 5), ENSURE_REQUIREMENTS, [plan_id=10]
+
+(72) HashAggregate [codegen id : 8]
+Input [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#41]
+Keys [10]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17]
+Functions [1]: [sum(UnscaledValue(ss_net_paid#5))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#30]
+Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#30,17,2) AS netpaid#31]
+
+(73) HashAggregate [codegen id : 8]
+Input [1]: [netpaid#31]
+Keys: []
+Functions [1]: [partial_avg(netpaid#31)]
+Aggregate Attributes [2]: [sum#42, count#43]
+Results [2]: [sum#44, count#45]
+
+(74) Exchange
+Input [2]: [sum#44, count#45]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=11]
+
+(75) HashAggregate [codegen id : 9]
+Input [2]: [sum#44, count#45]
+Keys: []
+Functions [1]: [avg(netpaid#31)]
+Aggregate Attributes [1]: [avg(netpaid#31)#46]
+Results [1]: [(0.05 * avg(netpaid#31)#46) AS (0.05 * avg(netpaid))#47]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/simplified.txt
new file mode 100644
index 0000000..4f6054a
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/simplified.txt
@@ -0,0 +1,116 @@
+WholeStageCodegen (9)
+  Filter [paid]
+    Subquery #1
+      WholeStageCodegen (9)
+        HashAggregate [sum,count] [avg(netpaid),(0.05 * avg(netpaid)),sum,count]
+          InputAdapter
+            Exchange #9
+              WholeStageCodegen (8)
+                HashAggregate [netpaid] [sum,count,sum,count]
+                  HashAggregate [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] [sum(UnscaledValue(ss_net_paid)),netpaid,sum]
+                    InputAdapter
+                      Exchange [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] #10
+                        WholeStageCodegen (7)
+                          HashAggregate [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,ss_net_paid] [sum,sum]
+                            Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state]
+                              BroadcastHashJoin [c_birth_country,s_zip,ca_country,ca_zip]
+                                Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country]
+                                  BroadcastHashJoin [ss_customer_sk,c_customer_sk]
+                                    Project [ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id]
+                                      BroadcastHashJoin [ss_item_sk,i_item_sk]
+                                        Project [ss_item_sk,ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip]
+                                          BroadcastHashJoin [ss_store_sk,s_store_sk]
+                                            Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_net_paid]
+                                              SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk]
+                                                InputAdapter
+                                                  WholeStageCodegen (1)
+                                                    ColumnarToRow
+                                                      InputAdapter
+                                                        CometSort [ss_ticket_number,ss_item_sk]
+                                                          ReusedExchange [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] #3
+                                                InputAdapter
+                                                  WholeStageCodegen (2)
+                                                    ColumnarToRow
+                                                      InputAdapter
+                                                        CometSort [sr_ticket_number,sr_item_sk]
+                                                          ReusedExchange [sr_item_sk,sr_ticket_number] #4
+                                            InputAdapter
+                                              ReusedExchange [s_store_sk,s_store_name,s_state,s_zip] #5
+                                        InputAdapter
+                                          BroadcastExchange #11
+                                            WholeStageCodegen (4)
+                                              ColumnarToRow
+                                                InputAdapter
+                                                  CometFilter [i_item_sk]
+                                                    CometScan parquet spark_catalog.default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id]
+                                    InputAdapter
+                                      ReusedExchange [c_customer_sk,c_first_name,c_last_name,c_birth_country] #7
+                                InputAdapter
+                                  ReusedExchange [ca_state,ca_zip,ca_country] #8
+    HashAggregate [c_last_name,c_first_name,s_store_name,sum,isEmpty] [sum(netpaid),paid,sum,isEmpty]
+      InputAdapter
+        Exchange [c_last_name,c_first_name,s_store_name] #1
+          WholeStageCodegen (8)
+            HashAggregate [c_last_name,c_first_name,s_store_name,netpaid] [sum,isEmpty,sum,isEmpty]
+              HashAggregate [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] [sum(UnscaledValue(ss_net_paid)),netpaid,sum]
+                InputAdapter
+                  Exchange [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] #2
+                    WholeStageCodegen (7)
+                      HashAggregate [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,ss_net_paid] [sum,sum]
+                        Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state]
+                          BroadcastHashJoin [c_birth_country,s_zip,ca_country,ca_zip]
+                            Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country]
+                              BroadcastHashJoin [ss_customer_sk,c_customer_sk]
+                                Project [ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id]
+                                  BroadcastHashJoin [ss_item_sk,i_item_sk]
+                                    Project [ss_item_sk,ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip]
+                                      BroadcastHashJoin [ss_store_sk,s_store_sk]
+                                        Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_net_paid]
+                                          SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk]
+                                            InputAdapter
+                                              WholeStageCodegen (1)
+                                                ColumnarToRow
+                                                  InputAdapter
+                                                    CometSort [ss_ticket_number,ss_item_sk]
+                                                      CometExchange [ss_ticket_number,ss_item_sk] #3
+                                                        CometProject [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid]
+                                                          CometFilter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk]
+                                                            CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk]
+                                            InputAdapter
+                                              WholeStageCodegen (2)
+                                                ColumnarToRow
+                                                  InputAdapter
+                                                    CometSort [sr_ticket_number,sr_item_sk]
+                                                      CometExchange [sr_ticket_number,sr_item_sk] #4
+                                                        CometProject [sr_item_sk,sr_ticket_number]
+                                                          CometFilter [sr_ticket_number,sr_item_sk]
+                                                            CometScan parquet spark_catalog.default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk]
+                                        InputAdapter
+                                          BroadcastExchange #5
+                                            WholeStageCodegen (3)
+                                              ColumnarToRow
+                                                InputAdapter
+                                                  CometProject [s_store_sk,s_store_name,s_state,s_zip]
+                                                    CometFilter [s_market_id,s_store_sk,s_zip]
+                                                      CometScan parquet spark_catalog.default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip]
+                                    InputAdapter
+                                      BroadcastExchange #6
+                                        WholeStageCodegen (4)
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometFilter [i_color,i_item_sk]
+                                                CometScan parquet spark_catalog.default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id]
+                                InputAdapter
+                                  BroadcastExchange #7
+                                    WholeStageCodegen (5)
+                                      ColumnarToRow
+                                        InputAdapter
+                                          CometFilter [c_customer_sk,c_birth_country]
+                                            CometScan parquet spark_catalog.default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country]
+                            InputAdapter
+                              BroadcastExchange #8
+                                WholeStageCodegen (6)
+                                  ColumnarToRow
+                                    InputAdapter
+                                      CometFilter [ca_country,ca_zip]
+                                        CometScan parquet spark_catalog.default.customer_address [ca_state,ca_zip,ca_country]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/explain.txt
new file mode 100644
index 0000000..67f1e7e
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/explain.txt
@@ -0,0 +1,435 @@
+== Physical Plan ==
+* Filter (46)
++- * HashAggregate (45)
+   +- Exchange (44)
+      +- * HashAggregate (43)
+         +- * HashAggregate (42)
+            +- Exchange (41)
+               +- * HashAggregate (40)
+                  +- * Project (39)
+                     +- * BroadcastHashJoin Inner BuildRight (38)
+                        :- * Project (33)
+                        :  +- * BroadcastHashJoin Inner BuildRight (32)
+                        :     :- * Project (27)
+                        :     :  +- * BroadcastHashJoin Inner BuildRight (26)
+                        :     :     :- * Project (21)
+                        :     :     :  +- * BroadcastHashJoin Inner BuildRight (20)
+                        :     :     :     :- * Project (14)
+                        :     :     :     :  +- * SortMergeJoin Inner (13)
+                        :     :     :     :     :- * ColumnarToRow (6)
+                        :     :     :     :     :  +- CometSort (5)
+                        :     :     :     :     :     +- CometExchange (4)
+                        :     :     :     :     :        +- CometProject (3)
+                        :     :     :     :     :           +- CometFilter (2)
+                        :     :     :     :     :              +- CometScan parquet spark_catalog.default.store_sales (1)
+                        :     :     :     :     +- * ColumnarToRow (12)
+                        :     :     :     :        +- CometSort (11)
+                        :     :     :     :           +- CometExchange (10)
+                        :     :     :     :              +- CometProject (9)
+                        :     :     :     :                 +- CometFilter (8)
+                        :     :     :     :                    +- CometScan parquet spark_catalog.default.store_returns (7)
+                        :     :     :     +- BroadcastExchange (19)
+                        :     :     :        +- * ColumnarToRow (18)
+                        :     :     :           +- CometProject (17)
+                        :     :     :              +- CometFilter (16)
+                        :     :     :                 +- CometScan parquet spark_catalog.default.store (15)
+                        :     :     +- BroadcastExchange (25)
+                        :     :        +- * ColumnarToRow (24)
+                        :     :           +- CometFilter (23)
+                        :     :              +- CometScan parquet spark_catalog.default.item (22)
+                        :     +- BroadcastExchange (31)
+                        :        +- * ColumnarToRow (30)
+                        :           +- CometFilter (29)
+                        :              +- CometScan parquet spark_catalog.default.customer (28)
+                        +- BroadcastExchange (37)
+                           +- * ColumnarToRow (36)
+                              +- CometFilter (35)
+                                 +- CometScan parquet spark_catalog.default.customer_address (34)
+
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store_sales]
+PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)]
+ReadSchema: struct<ss_item_sk:int,ss_customer_sk:int,ss_store_sk:int,ss_ticket_number:int,ss_net_paid:decimal(7,2)>
+
+(2) CometFilter
+Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6]
+Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2))
+
+(3) CometProject
+Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6]
+Arguments: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5], [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+
+(4) CometExchange
+Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=1]
+
+(5) CometSort
+Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+Arguments: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5], [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST]
+
+(6) ColumnarToRow [codegen id : 1]
+Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+
+(unknown) Scan parquet spark_catalog.default.store_returns
+Output [3]: [sr_item_sk#7, sr_ticket_number#8, sr_returned_date_sk#9]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store_returns]
+PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)]
+ReadSchema: struct<sr_item_sk:int,sr_ticket_number:int>
+
+(8) CometFilter
+Input [3]: [sr_item_sk#7, sr_ticket_number#8, sr_returned_date_sk#9]
+Condition : (isnotnull(sr_ticket_number#8) AND isnotnull(sr_item_sk#7))
+
+(9) CometProject
+Input [3]: [sr_item_sk#7, sr_ticket_number#8, sr_returned_date_sk#9]
+Arguments: [sr_item_sk#7, sr_ticket_number#8], [sr_item_sk#7, sr_ticket_number#8]
+
+(10) CometExchange
+Input [2]: [sr_item_sk#7, sr_ticket_number#8]
+Arguments: hashpartitioning(sr_ticket_number#8, sr_item_sk#7, 5), ENSURE_REQUIREMENTS, CometNativeShuffle, [plan_id=2]
+
+(11) CometSort
+Input [2]: [sr_item_sk#7, sr_ticket_number#8]
+Arguments: [sr_item_sk#7, sr_ticket_number#8], [sr_ticket_number#8 ASC NULLS FIRST, sr_item_sk#7 ASC NULLS FIRST]
+
+(12) ColumnarToRow [codegen id : 2]
+Input [2]: [sr_item_sk#7, sr_ticket_number#8]
+
+(13) SortMergeJoin [codegen id : 7]
+Left keys [2]: [ss_ticket_number#4, ss_item_sk#1]
+Right keys [2]: [sr_ticket_number#8, sr_item_sk#7]
+Join type: Inner
+Join condition: None
+
+(14) Project [codegen id : 7]
+Output [4]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5]
+Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, sr_item_sk#7, sr_ticket_number#8]
+
+(unknown) Scan parquet spark_catalog.default.store
+Output [5]: [s_store_sk#10, s_store_name#11, s_market_id#12, s_state#13, s_zip#14]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store]
+PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)]
+ReadSchema: struct<s_store_sk:int,s_store_name:string,s_market_id:int,s_state:string,s_zip:string>
+
+(16) CometFilter
+Input [5]: [s_store_sk#10, s_store_name#11, s_market_id#12, s_state#13, s_zip#14]
+Condition : (((isnotnull(s_market_id#12) AND (s_market_id#12 = 8)) AND isnotnull(s_store_sk#10)) AND isnotnull(s_zip#14))
+
+(17) CometProject
+Input [5]: [s_store_sk#10, s_store_name#11, s_market_id#12, s_state#13, s_zip#14]
+Arguments: [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14], [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+
+(18) ColumnarToRow [codegen id : 3]
+Input [4]: [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+
+(19) BroadcastExchange
+Input [4]: [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]
+
+(20) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_store_sk#3]
+Right keys [1]: [s_store_sk#10]
+Join type: Inner
+Join condition: None
+
+(21) Project [codegen id : 7]
+Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14]
+Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5, s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_color), EqualTo(i_color,chiffon             ), IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_current_price:decimal(7,2),i_size:string,i_color:string,i_units:string,i_manager_id:int>
+
+(23) CometFilter
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Condition : ((isnotnull(i_color#18) AND (i_color#18 = chiffon             )) AND isnotnull(i_item_sk#15))
+
+(24) ColumnarToRow [codegen id : 4]
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+
+(25) BroadcastExchange
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
+
+(26) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_item_sk#1]
+Right keys [1]: [i_item_sk#15]
+Join type: Inner
+Join condition: None
+
+(27) Project [codegen id : 7]
+Output [10]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+
+(unknown) Scan parquet spark_catalog.default.customer
+Output [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer]
+PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_birth_country)]
+ReadSchema: struct<c_customer_sk:int,c_first_name:string,c_last_name:string,c_birth_country:string>
+
+(29) CometFilter
+Input [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+Condition : (isnotnull(c_customer_sk#21) AND isnotnull(c_birth_country#24))
+
+(30) ColumnarToRow [codegen id : 5]
+Input [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+
+(31) BroadcastExchange
+Input [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=5]
+
+(32) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_customer_sk#2]
+Right keys [1]: [c_customer_sk#21]
+Join type: Inner
+Join condition: None
+
+(33) Project [codegen id : 7]
+Output [12]: [ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, c_birth_country#24]
+Input [14]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+
+(unknown) Scan parquet spark_catalog.default.customer_address
+Output [3]: [ca_state#25, ca_zip#26, ca_country#27]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_address]
+PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)]
+ReadSchema: struct<ca_state:string,ca_zip:string,ca_country:string>
+
+(35) CometFilter
+Input [3]: [ca_state#25, ca_zip#26, ca_country#27]
+Condition : (isnotnull(ca_country#27) AND isnotnull(ca_zip#26))
+
+(36) ColumnarToRow [codegen id : 6]
+Input [3]: [ca_state#25, ca_zip#26, ca_country#27]
+
+(37) BroadcastExchange
+Input [3]: [ca_state#25, ca_zip#26, ca_country#27]
+Arguments: HashedRelationBroadcastMode(List(upper(input[2, string, false]), input[1, string, false]),false), [plan_id=6]
+
+(38) BroadcastHashJoin [codegen id : 7]
+Left keys [2]: [c_birth_country#24, s_zip#14]
+Right keys [2]: [upper(ca_country#27), ca_zip#26]
+Join type: Inner
+Join condition: None
+
+(39) Project [codegen id : 7]
+Output [11]: [ss_net_paid#5, s_store_name#11, s_state#13, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, ca_state#25]
+Input [15]: [ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, c_birth_country#24, ca_state#25, ca_zip#26, ca_country#27]
+
+(40) HashAggregate [codegen id : 7]
+Input [11]: [ss_net_paid#5, s_store_name#11, s_state#13, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, ca_state#25]
+Keys [10]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17]
+Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))]
+Aggregate Attributes [1]: [sum#28]
+Results [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#29]
+
+(41) Exchange
+Input [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#29]
+Arguments: hashpartitioning(c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, 5), ENSURE_REQUIREMENTS, [plan_id=7]
+
+(42) HashAggregate [codegen id : 8]
+Input [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#29]
+Keys [10]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17]
+Functions [1]: [sum(UnscaledValue(ss_net_paid#5))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#30]
+Results [4]: [c_last_name#23, c_first_name#22, s_store_name#11, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#30,17,2) AS netpaid#31]
+
+(43) HashAggregate [codegen id : 8]
+Input [4]: [c_last_name#23, c_first_name#22, s_store_name#11, netpaid#31]
+Keys [3]: [c_last_name#23, c_first_name#22, s_store_name#11]
+Functions [1]: [partial_sum(netpaid#31)]
+Aggregate Attributes [2]: [sum#32, isEmpty#33]
+Results [5]: [c_last_name#23, c_first_name#22, s_store_name#11, sum#34, isEmpty#35]
+
+(44) Exchange
+Input [5]: [c_last_name#23, c_first_name#22, s_store_name#11, sum#34, isEmpty#35]
+Arguments: hashpartitioning(c_last_name#23, c_first_name#22, s_store_name#11, 5), ENSURE_REQUIREMENTS, [plan_id=8]
+
+(45) HashAggregate [codegen id : 9]
+Input [5]: [c_last_name#23, c_first_name#22, s_store_name#11, sum#34, isEmpty#35]
+Keys [3]: [c_last_name#23, c_first_name#22, s_store_name#11]
+Functions [1]: [sum(netpaid#31)]
+Aggregate Attributes [1]: [sum(netpaid#31)#36]
+Results [4]: [c_last_name#23, c_first_name#22, s_store_name#11, sum(netpaid#31)#36 AS paid#37]
+
+(46) Filter [codegen id : 9]
+Input [4]: [c_last_name#23, c_first_name#22, s_store_name#11, paid#37]
+Condition : (isnotnull(paid#37) AND (cast(paid#37 as decimal(33,8)) > cast(Subquery scalar-subquery#38, [id=#39] as decimal(33,8))))
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 46 Hosting Expression = Subquery scalar-subquery#38, [id=#39]
+* HashAggregate (75)
++- Exchange (74)
+   +- * HashAggregate (73)
+      +- * HashAggregate (72)
+         +- Exchange (71)
+            +- * HashAggregate (70)
+               +- * Project (69)
+                  +- * BroadcastHashJoin Inner BuildRight (68)
+                     :- * Project (66)
+                     :  +- * BroadcastHashJoin Inner BuildRight (65)
+                     :     :- * Project (63)
+                     :     :  +- * BroadcastHashJoin Inner BuildRight (62)
+                     :     :     :- * Project (57)
+                     :     :     :  +- * BroadcastHashJoin Inner BuildRight (56)
+                     :     :     :     :- * Project (54)
+                     :     :     :     :  +- * SortMergeJoin Inner (53)
+                     :     :     :     :     :- * ColumnarToRow (49)
+                     :     :     :     :     :  +- CometSort (48)
+                     :     :     :     :     :     +- ReusedExchange (47)
+                     :     :     :     :     +- * ColumnarToRow (52)
+                     :     :     :     :        +- CometSort (51)
+                     :     :     :     :           +- ReusedExchange (50)
+                     :     :     :     +- ReusedExchange (55)
+                     :     :     +- BroadcastExchange (61)
+                     :     :        +- * ColumnarToRow (60)
+                     :     :           +- CometFilter (59)
+                     :     :              +- CometScan parquet spark_catalog.default.item (58)
+                     :     +- ReusedExchange (64)
+                     +- ReusedExchange (67)
+
+
+(47) ReusedExchange [Reuses operator id: 4]
+Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+
+(48) CometSort
+Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+Arguments: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5], [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST]
+
+(49) ColumnarToRow [codegen id : 1]
+Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5]
+
+(50) ReusedExchange [Reuses operator id: 10]
+Output [2]: [sr_item_sk#7, sr_ticket_number#8]
+
+(51) CometSort
+Input [2]: [sr_item_sk#7, sr_ticket_number#8]
+Arguments: [sr_item_sk#7, sr_ticket_number#8], [sr_ticket_number#8 ASC NULLS FIRST, sr_item_sk#7 ASC NULLS FIRST]
+
+(52) ColumnarToRow [codegen id : 2]
+Input [2]: [sr_item_sk#7, sr_ticket_number#8]
+
+(53) SortMergeJoin [codegen id : 7]
+Left keys [2]: [ss_ticket_number#4, ss_item_sk#1]
+Right keys [2]: [sr_ticket_number#8, sr_item_sk#7]
+Join type: Inner
+Join condition: None
+
+(54) Project [codegen id : 7]
+Output [4]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5]
+Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, sr_item_sk#7, sr_ticket_number#8]
+
+(55) ReusedExchange [Reuses operator id: 19]
+Output [4]: [s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+
+(56) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_store_sk#3]
+Right keys [1]: [s_store_sk#10]
+Join type: Inner
+Join condition: None
+
+(57) Project [codegen id : 7]
+Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14]
+Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5, s_store_sk#10, s_store_name#11, s_state#13, s_zip#14]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_current_price:decimal(7,2),i_size:string,i_color:string,i_units:string,i_manager_id:int>
+
+(59) CometFilter
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Condition : isnotnull(i_item_sk#15)
+
+(60) ColumnarToRow [codegen id : 4]
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+
+(61) BroadcastExchange
+Input [6]: [i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=9]
+
+(62) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_item_sk#1]
+Right keys [1]: [i_item_sk#15]
+Join type: Inner
+Join condition: None
+
+(63) Project [codegen id : 7]
+Output [10]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_item_sk#15, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20]
+
+(64) ReusedExchange [Reuses operator id: 31]
+Output [4]: [c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+
+(65) BroadcastHashJoin [codegen id : 7]
+Left keys [1]: [ss_customer_sk#2]
+Right keys [1]: [c_customer_sk#21]
+Join type: Inner
+Join condition: None
+
+(66) Project [codegen id : 7]
+Output [12]: [ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, c_birth_country#24]
+Input [14]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_customer_sk#21, c_first_name#22, c_last_name#23, c_birth_country#24]
+
+(67) ReusedExchange [Reuses operator id: 37]
+Output [3]: [ca_state#25, ca_zip#26, ca_country#27]
+
+(68) BroadcastHashJoin [codegen id : 7]
+Left keys [2]: [c_birth_country#24, s_zip#14]
+Right keys [2]: [upper(ca_country#27), ca_zip#26]
+Join type: Inner
+Join condition: None
+
+(69) Project [codegen id : 7]
+Output [11]: [ss_net_paid#5, s_store_name#11, s_state#13, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, ca_state#25]
+Input [15]: [ss_net_paid#5, s_store_name#11, s_state#13, s_zip#14, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, c_birth_country#24, ca_state#25, ca_zip#26, ca_country#27]
+
+(70) HashAggregate [codegen id : 7]
+Input [11]: [ss_net_paid#5, s_store_name#11, s_state#13, i_current_price#16, i_size#17, i_color#18, i_units#19, i_manager_id#20, c_first_name#22, c_last_name#23, ca_state#25]
+Keys [10]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17]
+Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))]
+Aggregate Attributes [1]: [sum#40]
+Results [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#41]
+
+(71) Exchange
+Input [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#41]
+Arguments: hashpartitioning(c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, 5), ENSURE_REQUIREMENTS, [plan_id=10]
+
+(72) HashAggregate [codegen id : 8]
+Input [11]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17, sum#41]
+Keys [10]: [c_last_name#23, c_first_name#22, s_store_name#11, ca_state#25, s_state#13, i_color#18, i_current_price#16, i_manager_id#20, i_units#19, i_size#17]
+Functions [1]: [sum(UnscaledValue(ss_net_paid#5))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#30]
+Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#30,17,2) AS netpaid#31]
+
+(73) HashAggregate [codegen id : 8]
+Input [1]: [netpaid#31]
+Keys: []
+Functions [1]: [partial_avg(netpaid#31)]
+Aggregate Attributes [2]: [sum#42, count#43]
+Results [2]: [sum#44, count#45]
+
+(74) Exchange
+Input [2]: [sum#44, count#45]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=11]
+
+(75) HashAggregate [codegen id : 9]
+Input [2]: [sum#44, count#45]
+Keys: []
+Functions [1]: [avg(netpaid#31)]
+Aggregate Attributes [1]: [avg(netpaid#31)#46]
+Results [1]: [(0.05 * avg(netpaid#31)#46) AS (0.05 * avg(netpaid))#47]
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/simplified.txt
new file mode 100644
index 0000000..4f6054a
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/simplified.txt
@@ -0,0 +1,116 @@
+WholeStageCodegen (9)
+  Filter [paid]
+    Subquery #1
+      WholeStageCodegen (9)
+        HashAggregate [sum,count] [avg(netpaid),(0.05 * avg(netpaid)),sum,count]
+          InputAdapter
+            Exchange #9
+              WholeStageCodegen (8)
+                HashAggregate [netpaid] [sum,count,sum,count]
+                  HashAggregate [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] [sum(UnscaledValue(ss_net_paid)),netpaid,sum]
+                    InputAdapter
+                      Exchange [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] #10
+                        WholeStageCodegen (7)
+                          HashAggregate [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,ss_net_paid] [sum,sum]
+                            Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state]
+                              BroadcastHashJoin [c_birth_country,s_zip,ca_country,ca_zip]
+                                Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country]
+                                  BroadcastHashJoin [ss_customer_sk,c_customer_sk]
+                                    Project [ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id]
+                                      BroadcastHashJoin [ss_item_sk,i_item_sk]
+                                        Project [ss_item_sk,ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip]
+                                          BroadcastHashJoin [ss_store_sk,s_store_sk]
+                                            Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_net_paid]
+                                              SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk]
+                                                InputAdapter
+                                                  WholeStageCodegen (1)
+                                                    ColumnarToRow
+                                                      InputAdapter
+                                                        CometSort [ss_ticket_number,ss_item_sk]
+                                                          ReusedExchange [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] #3
+                                                InputAdapter
+                                                  WholeStageCodegen (2)
+                                                    ColumnarToRow
+                                                      InputAdapter
+                                                        CometSort [sr_ticket_number,sr_item_sk]
+                                                          ReusedExchange [sr_item_sk,sr_ticket_number] #4
+                                            InputAdapter
+                                              ReusedExchange [s_store_sk,s_store_name,s_state,s_zip] #5
+                                        InputAdapter
+                                          BroadcastExchange #11
+                                            WholeStageCodegen (4)
+                                              ColumnarToRow
+                                                InputAdapter
+                                                  CometFilter [i_item_sk]
+                                                    CometScan parquet spark_catalog.default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id]
+                                    InputAdapter
+                                      ReusedExchange [c_customer_sk,c_first_name,c_last_name,c_birth_country] #7
+                                InputAdapter
+                                  ReusedExchange [ca_state,ca_zip,ca_country] #8
+    HashAggregate [c_last_name,c_first_name,s_store_name,sum,isEmpty] [sum(netpaid),paid,sum,isEmpty]
+      InputAdapter
+        Exchange [c_last_name,c_first_name,s_store_name] #1
+          WholeStageCodegen (8)
+            HashAggregate [c_last_name,c_first_name,s_store_name,netpaid] [sum,isEmpty,sum,isEmpty]
+              HashAggregate [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] [sum(UnscaledValue(ss_net_paid)),netpaid,sum]
+                InputAdapter
+                  Exchange [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] #2
+                    WholeStageCodegen (7)
+                      HashAggregate [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,ss_net_paid] [sum,sum]
+                        Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state]
+                          BroadcastHashJoin [c_birth_country,s_zip,ca_country,ca_zip]
+                            Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country]
+                              BroadcastHashJoin [ss_customer_sk,c_customer_sk]
+                                Project [ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id]
+                                  BroadcastHashJoin [ss_item_sk,i_item_sk]
+                                    Project [ss_item_sk,ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip]
+                                      BroadcastHashJoin [ss_store_sk,s_store_sk]
+                                        Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_net_paid]
+                                          SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk]
+                                            InputAdapter
+                                              WholeStageCodegen (1)
+                                                ColumnarToRow
+                                                  InputAdapter
+                                                    CometSort [ss_ticket_number,ss_item_sk]
+                                                      CometExchange [ss_ticket_number,ss_item_sk] #3
+                                                        CometProject [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid]
+                                                          CometFilter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk]
+                                                            CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk]
+                                            InputAdapter
+                                              WholeStageCodegen (2)
+                                                ColumnarToRow
+                                                  InputAdapter
+                                                    CometSort [sr_ticket_number,sr_item_sk]
+                                                      CometExchange [sr_ticket_number,sr_item_sk] #4
+                                                        CometProject [sr_item_sk,sr_ticket_number]
+                                                          CometFilter [sr_ticket_number,sr_item_sk]
+                                                            CometScan parquet spark_catalog.default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk]
+                                        InputAdapter
+                                          BroadcastExchange #5
+                                            WholeStageCodegen (3)
+                                              ColumnarToRow
+                                                InputAdapter
+                                                  CometProject [s_store_sk,s_store_name,s_state,s_zip]
+                                                    CometFilter [s_market_id,s_store_sk,s_zip]
+                                                      CometScan parquet spark_catalog.default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip]
+                                    InputAdapter
+                                      BroadcastExchange #6
+                                        WholeStageCodegen (4)
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometFilter [i_color,i_item_sk]
+                                                CometScan parquet spark_catalog.default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id]
+                                InputAdapter
+                                  BroadcastExchange #7
+                                    WholeStageCodegen (5)
+                                      ColumnarToRow
+                                        InputAdapter
+                                          CometFilter [c_customer_sk,c_birth_country]
+                                            CometScan parquet spark_catalog.default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country]
+                            InputAdapter
+                              BroadcastExchange #8
+                                WholeStageCodegen (6)
+                                  ColumnarToRow
+                                    InputAdapter
+                                      CometFilter [ca_country,ca_zip]
+                                        CometScan parquet spark_catalog.default.customer_address [ca_state,ca_zip,ca_country]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/explain.txt
new file mode 100644
index 0000000..7eb30b6
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/explain.txt
@@ -0,0 +1,298 @@
+== Physical Plan ==
+TakeOrderedAndProject (40)
++- * HashAggregate (39)
+   +- Exchange (38)
+      +- * HashAggregate (37)
+         +- * Project (36)
+            +- * BroadcastHashJoin Inner BuildRight (35)
+               :- * Project (30)
+               :  +- * BroadcastHashJoin Inner BuildRight (29)
+               :     :- * Project (24)
+               :     :  +- * BroadcastHashJoin Inner BuildRight (23)
+               :     :     :- * Project (21)
+               :     :     :  +- * BroadcastHashJoin Inner BuildRight (20)
+               :     :     :     :- * Project (18)
+               :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (17)
+               :     :     :     :     :- * Project (15)
+               :     :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (14)
+               :     :     :     :     :     :- * Project (9)
+               :     :     :     :     :     :  +- * BroadcastHashJoin Inner BuildRight (8)
+               :     :     :     :     :     :     :- * ColumnarToRow (3)
+               :     :     :     :     :     :     :  +- CometFilter (2)
+               :     :     :     :     :     :     :     +- CometScan parquet spark_catalog.default.store_sales (1)
+               :     :     :     :     :     :     +- BroadcastExchange (7)
+               :     :     :     :     :     :        +- * ColumnarToRow (6)
+               :     :     :     :     :     :           +- CometFilter (5)
+               :     :     :     :     :     :              +- CometScan parquet spark_catalog.default.store_returns (4)
+               :     :     :     :     :     +- BroadcastExchange (13)
+               :     :     :     :     :        +- * ColumnarToRow (12)
+               :     :     :     :     :           +- CometFilter (11)
+               :     :     :     :     :              +- CometScan parquet spark_catalog.default.catalog_sales (10)
+               :     :     :     :     +- ReusedExchange (16)
+               :     :     :     +- ReusedExchange (19)
+               :     :     +- ReusedExchange (22)
+               :     +- BroadcastExchange (28)
+               :        +- * ColumnarToRow (27)
+               :           +- CometFilter (26)
+               :              +- CometScan parquet spark_catalog.default.store (25)
+               +- BroadcastExchange (34)
+                  +- * ColumnarToRow (33)
+                     +- CometFilter (32)
+                        +- CometScan parquet spark_catalog.default.item (31)
+
+
+(unknown) Scan parquet spark_catalog.default.store_sales
+Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)]
+PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk)]
+ReadSchema: struct<ss_item_sk:int,ss_customer_sk:int,ss_store_sk:int,ss_ticket_number:int,ss_net_profit:decimal(7,2)>
+
+(2) CometFilter
+Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6]
+Condition : (((isnotnull(ss_customer_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_ticket_number#4)) AND isnotnull(ss_store_sk#3))
+
+(3) ColumnarToRow [codegen id : 8]
+Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6]
+
+(unknown) Scan parquet spark_catalog.default.store_returns
+Output [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(sr_returned_date_sk#12), dynamicpruningexpression(sr_returned_date_sk#12 IN dynamicpruning#13)]
+PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)]
+ReadSchema: struct<sr_item_sk:int,sr_customer_sk:int,sr_ticket_number:int,sr_net_loss:decimal(7,2)>
+
+(5) CometFilter
+Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12]
+Condition : ((isnotnull(sr_customer_sk#9) AND isnotnull(sr_item_sk#8)) AND isnotnull(sr_ticket_number#10))
+
+(6) ColumnarToRow [codegen id : 1]
+Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12]
+
+(7) BroadcastExchange
+Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12]
+Arguments: HashedRelationBroadcastMode(List(input[1, int, false], input[0, int, false], input[2, int, false]),false), [plan_id=1]
+
+(8) BroadcastHashJoin [codegen id : 8]
+Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4]
+Right keys [3]: [sr_customer_sk#9, sr_item_sk#8, sr_ticket_number#10]
+Join type: Inner
+Join condition: None
+
+(9) Project [codegen id : 8]
+Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_net_loss#11, sr_returned_date_sk#12]
+Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12]
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [4]: [cs_bill_customer_sk#14, cs_item_sk#15, cs_net_profit#16, cs_sold_date_sk#17]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#17), dynamicpruningexpression(cs_sold_date_sk#17 IN dynamicpruning#18)]
+PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)]
+ReadSchema: struct<cs_bill_customer_sk:int,cs_item_sk:int,cs_net_profit:decimal(7,2)>
+
+(11) CometFilter
+Input [4]: [cs_bill_customer_sk#14, cs_item_sk#15, cs_net_profit#16, cs_sold_date_sk#17]
+Condition : (isnotnull(cs_bill_customer_sk#14) AND isnotnull(cs_item_sk#15))
+
+(12) ColumnarToRow [codegen id : 2]
+Input [4]: [cs_bill_customer_sk#14, cs_item_sk#15, cs_net_profit#16, cs_sold_date_sk#17]
+
+(13) BroadcastExchange
+Input [4]: [cs_bill_customer_sk#14, cs_item_sk#15, cs_net_profit#16, cs_sold_date_sk#17]
+Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[1, int, false] as bigint) & 4294967295))),false), [plan_id=2]
+
+(14) BroadcastHashJoin [codegen id : 8]
+Left keys [2]: [sr_customer_sk#9, sr_item_sk#8]
+Right keys [2]: [cs_bill_customer_sk#14, cs_item_sk#15]
+Join type: Inner
+Join condition: None
+
+(15) Project [codegen id : 8]
+Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#16, cs_sold_date_sk#17]
+Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_net_loss#11, sr_returned_date_sk#12, cs_bill_customer_sk#14, cs_item_sk#15, cs_net_profit#16, cs_sold_date_sk#17]
+
+(16) ReusedExchange [Reuses operator id: 45]
+Output [1]: [d_date_sk#19]
+
+(17) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [ss_sold_date_sk#6]
+Right keys [1]: [d_date_sk#19]
+Join type: Inner
+Join condition: None
+
+(18) Project [codegen id : 8]
+Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#16, cs_sold_date_sk#17]
+Input [9]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#16, cs_sold_date_sk#17, d_date_sk#19]
+
+(19) ReusedExchange [Reuses operator id: 50]
+Output [1]: [d_date_sk#20]
+
+(20) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [sr_returned_date_sk#12]
+Right keys [1]: [d_date_sk#20]
+Join type: Inner
+Join condition: None
+
+(21) Project [codegen id : 8]
+Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#16, cs_sold_date_sk#17]
+Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#16, cs_sold_date_sk#17, d_date_sk#20]
+
+(22) ReusedExchange [Reuses operator id: 50]
+Output [1]: [d_date_sk#21]
+
+(23) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [cs_sold_date_sk#17]
+Right keys [1]: [d_date_sk#21]
+Join type: Inner
+Join condition: None
+
+(24) Project [codegen id : 8]
+Output [5]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#16]
+Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#16, cs_sold_date_sk#17, d_date_sk#21]
+
+(unknown) Scan parquet spark_catalog.default.store
+Output [3]: [s_store_sk#22, s_store_id#23, s_store_name#24]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/store]
+PushedFilters: [IsNotNull(s_store_sk)]
+ReadSchema: struct<s_store_sk:int,s_store_id:string,s_store_name:string>
+
+(26) CometFilter
+Input [3]: [s_store_sk#22, s_store_id#23, s_store_name#24]
+Condition : isnotnull(s_store_sk#22)
+
+(27) ColumnarToRow [codegen id : 6]
+Input [3]: [s_store_sk#22, s_store_id#23, s_store_name#24]
+
+(28) BroadcastExchange
+Input [3]: [s_store_sk#22, s_store_id#23, s_store_name#24]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
+
+(29) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [ss_store_sk#3]
+Right keys [1]: [s_store_sk#22]
+Join type: Inner
+Join condition: None
+
+(30) Project [codegen id : 8]
+Output [6]: [ss_item_sk#1, ss_net_profit#5, sr_net_loss#11, cs_net_profit#16, s_store_id#23, s_store_name#24]
+Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#16, s_store_sk#22, s_store_id#23, s_store_name#24]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [3]: [i_item_sk#25, i_item_id#26, i_item_desc#27]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_item_id:string,i_item_desc:string>
+
+(32) CometFilter
+Input [3]: [i_item_sk#25, i_item_id#26, i_item_desc#27]
+Condition : isnotnull(i_item_sk#25)
+
+(33) ColumnarToRow [codegen id : 7]
+Input [3]: [i_item_sk#25, i_item_id#26, i_item_desc#27]
+
+(34) BroadcastExchange
+Input [3]: [i_item_sk#25, i_item_id#26, i_item_desc#27]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
+
+(35) BroadcastHashJoin [codegen id : 8]
+Left keys [1]: [ss_item_sk#1]
+Right keys [1]: [i_item_sk#25]
+Join type: Inner
+Join condition: None
+
+(36) Project [codegen id : 8]
+Output [7]: [ss_net_profit#5, sr_net_loss#11, cs_net_profit#16, s_store_id#23, s_store_name#24, i_item_id#26, i_item_desc#27]
+Input [9]: [ss_item_sk#1, ss_net_profit#5, sr_net_loss#11, cs_net_profit#16, s_store_id#23, s_store_name#24, i_item_sk#25, i_item_id#26, i_item_desc#27]
+
+(37) HashAggregate [codegen id : 8]
+Input [7]: [ss_net_profit#5, sr_net_loss#11, cs_net_profit#16, s_store_id#23, s_store_name#24, i_item_id#26, i_item_desc#27]
+Keys [4]: [i_item_id#26, i_item_desc#27, s_store_id#23, s_store_name#24]
+Functions [3]: [partial_sum(UnscaledValue(ss_net_profit#5)), partial_sum(UnscaledValue(sr_net_loss#11)), partial_sum(UnscaledValue(cs_net_profit#16))]
+Aggregate Attributes [3]: [sum#28, sum#29, sum#30]
+Results [7]: [i_item_id#26, i_item_desc#27, s_store_id#23, s_store_name#24, sum#31, sum#32, sum#33]
+
+(38) Exchange
+Input [7]: [i_item_id#26, i_item_desc#27, s_store_id#23, s_store_name#24, sum#31, sum#32, sum#33]
+Arguments: hashpartitioning(i_item_id#26, i_item_desc#27, s_store_id#23, s_store_name#24, 5), ENSURE_REQUIREMENTS, [plan_id=5]
+
+(39) HashAggregate [codegen id : 9]
+Input [7]: [i_item_id#26, i_item_desc#27, s_store_id#23, s_store_name#24, sum#31, sum#32, sum#33]
+Keys [4]: [i_item_id#26, i_item_desc#27, s_store_id#23, s_store_name#24]
+Functions [3]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(sr_net_loss#11)), sum(UnscaledValue(cs_net_profit#16))]
+Aggregate Attributes [3]: [sum(UnscaledValue(ss_net_profit#5))#34, sum(UnscaledValue(sr_net_loss#11))#35, sum(UnscaledValue(cs_net_profit#16))#36]
+Results [7]: [i_item_id#26, i_item_desc#27, s_store_id#23, s_store_name#24, MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#34,17,2) AS store_sales_profit#37, MakeDecimal(sum(UnscaledValue(sr_net_loss#11))#35,17,2) AS store_returns_loss#38, MakeDecimal(sum(UnscaledValue(cs_net_profit#16))#36,17,2) AS catalog_sales_profit#39]
+
+(40) TakeOrderedAndProject
+Input [7]: [i_item_id#26, i_item_desc#27, s_store_id#23, s_store_name#24, store_sales_profit#37, store_returns_loss#38, catalog_sales_profit#39]
+Arguments: 100, [i_item_id#26 ASC NULLS FIRST, i_item_desc#27 ASC NULLS FIRST, s_store_id#23 ASC NULLS FIRST, s_store_name#24 ASC NULLS FIRST], [i_item_id#26, i_item_desc#27, s_store_id#23, s_store_name#24, store_sales_profit#37, store_returns_loss#38, catalog_sales_profit#39]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7
+BroadcastExchange (45)
++- * ColumnarToRow (44)
+   +- CometProject (43)
+      +- CometFilter (42)
+         +- CometScan parquet spark_catalog.default.date_dim (41)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [3]: [d_date_sk#19, d_year#40, d_moy#41]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,4), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
+
+(42) CometFilter
+Input [3]: [d_date_sk#19, d_year#40, d_moy#41]
+Condition : ((((isnotnull(d_moy#41) AND isnotnull(d_year#40)) AND (d_moy#41 = 4)) AND (d_year#40 = 2001)) AND isnotnull(d_date_sk#19))
+
+(43) CometProject
+Input [3]: [d_date_sk#19, d_year#40, d_moy#41]
+Arguments: [d_date_sk#19], [d_date_sk#19]
+
+(44) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#19]
+
+(45) BroadcastExchange
+Input [1]: [d_date_sk#19]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
+
+Subquery:2 Hosting operator id = 4 Hosting Expression = sr_returned_date_sk#12 IN dynamicpruning#13
+BroadcastExchange (50)
++- * ColumnarToRow (49)
+   +- CometProject (48)
+      +- CometFilter (47)
+         +- CometScan parquet spark_catalog.default.date_dim (46)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [3]: [d_date_sk#20, d_year#42, d_moy#43]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,10), EqualTo(d_year,2001), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
+
+(47) CometFilter
+Input [3]: [d_date_sk#20, d_year#42, d_moy#43]
+Condition : (((((isnotnull(d_moy#43) AND isnotnull(d_year#42)) AND (d_moy#43 >= 4)) AND (d_moy#43 <= 10)) AND (d_year#42 = 2001)) AND isnotnull(d_date_sk#20))
+
+(48) CometProject
+Input [3]: [d_date_sk#20, d_year#42, d_moy#43]
+Arguments: [d_date_sk#20], [d_date_sk#20]
+
+(49) ColumnarToRow [codegen id : 1]
+Input [1]: [d_date_sk#20]
+
+(50) BroadcastExchange
+Input [1]: [d_date_sk#20]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
+
+Subquery:3 Hosting operator id = 10 Hosting Expression = cs_sold_date_sk#17 IN dynamicpruning#13
+
+
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/simplified.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/simplified.txt
new file mode 100644
index 0000000..eda7f6b
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/simplified.txt
@@ -0,0 +1,76 @@
+TakeOrderedAndProject [i_item_id,i_item_desc,s_store_id,s_store_name,store_sales_profit,store_returns_loss,catalog_sales_profit]
+  WholeStageCodegen (9)
+    HashAggregate [i_item_id,i_item_desc,s_store_id,s_store_name,sum,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(sr_net_loss)),sum(UnscaledValue(cs_net_profit)),store_sales_profit,store_returns_loss,catalog_sales_profit,sum,sum,sum]
+      InputAdapter
+        Exchange [i_item_id,i_item_desc,s_store_id,s_store_name] #1
+          WholeStageCodegen (8)
+            HashAggregate [i_item_id,i_item_desc,s_store_id,s_store_name,ss_net_profit,sr_net_loss,cs_net_profit] [sum,sum,sum,sum,sum,sum]
+              Project [ss_net_profit,sr_net_loss,cs_net_profit,s_store_id,s_store_name,i_item_id,i_item_desc]
+                BroadcastHashJoin [ss_item_sk,i_item_sk]
+                  Project [ss_item_sk,ss_net_profit,sr_net_loss,cs_net_profit,s_store_id,s_store_name]
+                    BroadcastHashJoin [ss_store_sk,s_store_sk]
+                      Project [ss_item_sk,ss_store_sk,ss_net_profit,sr_net_loss,cs_net_profit]
+                        BroadcastHashJoin [cs_sold_date_sk,d_date_sk]
+                          Project [ss_item_sk,ss_store_sk,ss_net_profit,sr_net_loss,cs_net_profit,cs_sold_date_sk]
+                            BroadcastHashJoin [sr_returned_date_sk,d_date_sk]
+                              Project [ss_item_sk,ss_store_sk,ss_net_profit,sr_net_loss,sr_returned_date_sk,cs_net_profit,cs_sold_date_sk]
+                                BroadcastHashJoin [ss_sold_date_sk,d_date_sk]
+                                  Project [ss_item_sk,ss_store_sk,ss_net_profit,ss_sold_date_sk,sr_net_loss,sr_returned_date_sk,cs_net_profit,cs_sold_date_sk]
+                                    BroadcastHashJoin [sr_customer_sk,sr_item_sk,cs_bill_customer_sk,cs_item_sk]
+                                      Project [ss_item_sk,ss_store_sk,ss_net_profit,ss_sold_date_sk,sr_item_sk,sr_customer_sk,sr_net_loss,sr_returned_date_sk]
+                                        BroadcastHashJoin [ss_customer_sk,ss_item_sk,ss_ticket_number,sr_customer_sk,sr_item_sk,sr_ticket_number]
+                                          ColumnarToRow
+                                            InputAdapter
+                                              CometFilter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_store_sk]
+                                                CometScan parquet spark_catalog.default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_profit,ss_sold_date_sk]
+                                                  SubqueryBroadcast [d_date_sk] #1
+                                                    BroadcastExchange #2
+                                                      WholeStageCodegen (1)
+                                                        ColumnarToRow
+                                                          InputAdapter
+                                                            CometProject [d_date_sk]
+                                                              CometFilter [d_moy,d_year,d_date_sk]
+                                                                CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year,d_moy]
+                                          InputAdapter
+                                            BroadcastExchange #3
+                                              WholeStageCodegen (1)
+                                                ColumnarToRow
+                                                  InputAdapter
+                                                    CometFilter [sr_customer_sk,sr_item_sk,sr_ticket_number]
+                                                      CometScan parquet spark_catalog.default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_net_loss,sr_returned_date_sk]
+                                                        SubqueryBroadcast [d_date_sk] #2
+                                                          BroadcastExchange #4
+                                                            WholeStageCodegen (1)
+                                                              ColumnarToRow
+                                                                InputAdapter
+                                                                  CometProject [d_date_sk]
+                                                                    CometFilter [d_moy,d_year,d_date_sk]
+                                                                      CometScan parquet spark_catalog.default.date_dim [d_date_sk,d_year,d_moy]
+                                      InputAdapter
+                                        BroadcastExchange #5
+                                          WholeStageCodegen (2)
+                                            ColumnarToRow
+                                              InputAdapter
+                                                CometFilter [cs_bill_customer_sk,cs_item_sk]
+                                                  CometScan parquet spark_catalog.default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_net_profit,cs_sold_date_sk]
+                                                    ReusedSubquery [d_date_sk] #2
+                                  InputAdapter
+                                    ReusedExchange [d_date_sk] #2
+                              InputAdapter
+                                ReusedExchange [d_date_sk] #4
+                          InputAdapter
+                            ReusedExchange [d_date_sk] #4
+                      InputAdapter
+                        BroadcastExchange #6
+                          WholeStageCodegen (6)
+                            ColumnarToRow
+                              InputAdapter
+                                CometFilter [s_store_sk]
+                                  CometScan parquet spark_catalog.default.store [s_store_sk,s_store_id,s_store_name]
+                  InputAdapter
+                    BroadcastExchange #7
+                      WholeStageCodegen (7)
+                        ColumnarToRow
+                          InputAdapter
+                            CometFilter [i_item_sk]
+                              CometScan parquet spark_catalog.default.item [i_item_sk,i_item_id,i_item_desc]
diff --git a/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26/explain.txt b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26/explain.txt
new file mode 100644
index 0000000..55bae9c
--- /dev/null
+++ b/spark/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26/explain.txt
@@ -0,0 +1,208 @@
+== Physical Plan ==
+TakeOrderedAndProject (30)
++- * HashAggregate (29)
+   +- Exchange (28)
+      +- * HashAggregate (27)
+         +- * Project (26)
+            +- * BroadcastHashJoin Inner BuildRight (25)
+               :- * Project (19)
+               :  +- * BroadcastHashJoin Inner BuildRight (18)
+               :     :- * Project (13)
+               :     :  +- * BroadcastHashJoin Inner BuildRight (12)
+               :     :     :- * Project (10)
+               :     :     :  +- * BroadcastHashJoin Inner BuildRight (9)
+               :     :     :     :- * ColumnarToRow (3)
+               :     :     :     :  +- CometFilter (2)
+               :     :     :     :     +- CometScan parquet spark_catalog.default.catalog_sales (1)
+               :     :     :     +- BroadcastExchange (8)
+               :     :     :        +- * ColumnarToRow (7)
+               :     :     :           +- CometProject (6)
+               :     :     :              +- CometFilter (5)
+               :     :     :                 +- CometScan parquet spark_catalog.default.customer_demographics (4)
+               :     :     +- ReusedExchange (11)
+               :     +- BroadcastExchange (17)
+               :        +- * ColumnarToRow (16)
+               :           +- CometFilter (15)
+               :              +- CometScan parquet spark_catalog.default.item (14)
+               +- BroadcastExchange (24)
+                  +- * ColumnarToRow (23)
+                     +- CometProject (22)
+                        +- CometFilter (21)
+                           +- CometScan parquet spark_catalog.default.promotion (20)
+
+
+(unknown) Scan parquet spark_catalog.default.catalog_sales
+Output [8]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8]
+Batched: true
+Location: InMemoryFileIndex []
+PartitionFilters: [isnotnull(cs_sold_date_sk#8), dynamicpruningexpression(cs_sold_date_sk#8 IN dynamicpruning#9)]
+PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_item_sk), IsNotNull(cs_promo_sk)]
+ReadSchema: struct<cs_bill_cdemo_sk:int,cs_item_sk:int,cs_promo_sk:int,cs_quantity:int,cs_list_price:decimal(7,2),cs_sales_price:decimal(7,2),cs_coupon_amt:decimal(7,2)>
+
+(2) CometFilter
+Input [8]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8]
+Condition : ((isnotnull(cs_bill_cdemo_sk#1) AND isnotnull(cs_item_sk#2)) AND isnotnull(cs_promo_sk#3))
+
+(3) ColumnarToRow [codegen id : 5]
+Input [8]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8]
+
+(unknown) Scan parquet spark_catalog.default.customer_demographics
+Output [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/customer_demographics]
+PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College             ), IsNotNull(cd_demo_sk)]
+ReadSchema: struct<cd_demo_sk:int,cd_gender:string,cd_marital_status:string,cd_education_status:string>
+
+(5) CometFilter
+Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13]
+Condition : ((((((isnotnull(cd_gender#11) AND isnotnull(cd_marital_status#12)) AND isnotnull(cd_education_status#13)) AND (cd_gender#11 = M)) AND (cd_marital_status#12 = S)) AND (cd_education_status#13 = College             )) AND isnotnull(cd_demo_sk#10))
+
+(6) CometProject
+Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13]
+Arguments: [cd_demo_sk#10], [cd_demo_sk#10]
+
+(7) ColumnarToRow [codegen id : 1]
+Input [1]: [cd_demo_sk#10]
+
+(8) BroadcastExchange
+Input [1]: [cd_demo_sk#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
+
+(9) BroadcastHashJoin [codegen id : 5]
+Left keys [1]: [cs_bill_cdemo_sk#1]
+Right keys [1]: [cd_demo_sk#10]
+Join type: Inner
+Join condition: None
+
+(10) Project [codegen id : 5]
+Output [7]: [cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8]
+Input [9]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8, cd_demo_sk#10]
+
+(11) ReusedExchange [Reuses operator id: 35]
+Output [1]: [d_date_sk#14]
+
+(12) BroadcastHashJoin [codegen id : 5]
+Left keys [1]: [cs_sold_date_sk#8]
+Right keys [1]: [d_date_sk#14]
+Join type: Inner
+Join condition: None
+
+(13) Project [codegen id : 5]
+Output [6]: [cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7]
+Input [8]: [cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8, d_date_sk#14]
+
+(unknown) Scan parquet spark_catalog.default.item
+Output [2]: [i_item_sk#15, i_item_id#16]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/item]
+PushedFilters: [IsNotNull(i_item_sk)]
+ReadSchema: struct<i_item_sk:int,i_item_id:string>
+
+(15) CometFilter
+Input [2]: [i_item_sk#15, i_item_id#16]
+Condition : isnotnull(i_item_sk#15)
+
+(16) ColumnarToRow [codegen id : 3]
+Input [2]: [i_item_sk#15, i_item_id#16]
+
+(17) BroadcastExchange
+Input [2]: [i_item_sk#15, i_item_id#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]
+
+(18) BroadcastHashJoin [codegen id : 5]
+Left keys [1]: [cs_item_sk#2]
+Right keys [1]: [i_item_sk#15]
+Join type: Inner
+Join condition: None
+
+(19) Project [codegen id : 5]
+Output [6]: [cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_id#16]
+Input [8]: [cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_sk#15, i_item_id#16]
+
+(unknown) Scan parquet spark_catalog.default.promotion
+Output [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/promotion]
+PushedFilters: [Or(EqualTo(p_channel_email,N),EqualTo(p_channel_event,N)), IsNotNull(p_promo_sk)]
+ReadSchema: struct<p_promo_sk:int,p_channel_email:string,p_channel_event:string>
+
+(21) CometFilter
+Input [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19]
+Condition : (((p_channel_email#18 = N) OR (p_channel_event#19 = N)) AND isnotnull(p_promo_sk#17))
+
+(22) CometProject
+Input [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19]
+Arguments: [p_promo_sk#17], [p_promo_sk#17]
+
+(23) ColumnarToRow [codegen id : 4]
+Input [1]: [p_promo_sk#17]
+
+(24) BroadcastExchange
+Input [1]: [p_promo_sk#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]
+
+(25) BroadcastHashJoin [codegen id : 5]
+Left keys [1]: [cs_promo_sk#3]
+Right keys [1]: [p_promo_sk#17]
+Join type: Inner
+Join condition: None
+
+(26) Project [codegen id : 5]
+Output [5]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_id#16]
+Input [7]: [cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_id#16, p_promo_sk#17]
+
+(27) HashAggregate [codegen id : 5]
+Input [5]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_id#16]
+Keys [1]: [i_item_id#16]
+Functions [4]: [partial_avg(cs_quantity#4), partial_avg(UnscaledValue(cs_list_price#5)), partial_avg(UnscaledValue(cs_coupon_amt#7)), partial_avg(UnscaledValue(cs_sales_price#6))]
+Aggregate Attributes [8]: [sum#20, count#21, sum#22, count#23, sum#24, count#25, sum#26, count#27]
+Results [9]: [i_item_id#16, sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34, count#35]
+
+(28) Exchange
+Input [9]: [i_item_id#16, sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34, count#35]
+Arguments: hashpartitioning(i_item_id#16, 5), ENSURE_REQUIREMENTS, [plan_id=4]
+
+(29) HashAggregate [codegen id : 6]
+Input [9]: [i_item_id#16, sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34, count#35]
+Keys [1]: [i_item_id#16]
+Functions [4]: [avg(cs_quantity#4), avg(UnscaledValue(cs_list_price#5)), avg(UnscaledValue(cs_coupon_amt#7)), avg(UnscaledValue(cs_sales_price#6))]
+Aggregate Attributes [4]: [avg(cs_quantity#4)#36, avg(UnscaledValue(cs_list_price#5))#37, avg(UnscaledValue(cs_coupon_amt#7))#38, avg(UnscaledValue(cs_sales_price#6))#39]
+Results [5]: [i_item_id#16, avg(cs_quantity#4)#36 AS agg1#40, cast((avg(UnscaledValue(cs_list_price#5))#37 / 100.0) as decimal(11,6)) AS agg2#41, cast((avg(UnscaledValue(cs_coupon_amt#7))#38 / 100.0) as decimal(11,6)) AS agg3#42, cast((avg(UnscaledValue(cs_sales_price#6))#39 / 100.0) as decimal(11,6)) AS agg4#43]
+
+(30) TakeOrderedAndProject
+Input [5]: [i_item_id#16, agg1#40, agg2#41, agg3#42, agg4#43]
+Arguments: 100, [i_item_id#16 ASC NULLS FIRST], [i_item_id#16, agg1#40, agg2#41, agg3#42, agg4#43]
+
+===== Subqueries =====
+
+Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#8 IN dynamicpruning#9
+BroadcastExchange (35)
++- * ColumnarToRow (34)
+   +- CometProject (33)
+      +- CometFilter (32)
+         +- CometScan parquet spark_catalog.default.date_dim (31)
+
+
+(unknown) Scan parquet spark_catalog.default.date_dim
+Output [2]: [d_date_sk#14, d_year#44]
+Batched: true
+Location [not included in comparison]/{warehouse_dir}/date_dim]
+PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)]
+ReadSchema: struct<d_date_sk:int,d_year:int>
+
+(32) CometFilter
+Input [2]: [d_date_sk#14, d_year#44]
+Condition : ((isnotnull(d_year#44) AND (d_year#44 = 2000)) AND isnotnull(d_date_sk#14))
+
+(33) CometProject
+Input [2]: [d_date_sk#14, d_year#44]
... 50959 lines suppressed ...