You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by we...@apache.org on 2022/06/10 15:19:38 UTC

[spark] branch branch-3.2 updated: [SPARK-39437][3.2][SQL][TEST] Normalize plan id separately in PlanStabilitySuite

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

wenchen pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
     new af921219010 [SPARK-39437][3.2][SQL][TEST] Normalize plan id separately in PlanStabilitySuite
af921219010 is described below

commit af92121901039cb0e387c770372c06ec1dc5d7c9
Author: Wenchen Fan <we...@databricks.com>
AuthorDate: Fri Jun 10 23:19:15 2022 +0800

    [SPARK-39437][3.2][SQL][TEST] Normalize plan id separately in PlanStabilitySuite
    
    backport https://github.com/apache/spark/pull/36827
    
    ### What changes were proposed in this pull request?
    
    In `PlanStabilitySuite`, we normalize expression IDs by matching `#\d+` in the explain string. However, this regex can match plan id in `Exchange` node as well, which will mess up the normalization if expression IDs and plan IDs overlap.
    
    This PR normalizes plan id separately in `PlanStabilitySuite`.
    
    ### Why are the changes needed?
    
    Make the plan golden file more stable.
    
    ### Does this PR introduce _any_ user-facing change?
    
    no
    
    ### How was this patch tested?
    
    N/A
    
    Closes #36828 from cloud-fan/test2.
    
    Authored-by: Wenchen Fan <we...@databricks.com>
    Signed-off-by: Wenchen Fan <we...@databricks.com>
---
 .../spark/sql/execution/exchange/Exchange.scala    |   2 +-
 .../sql-tests/results/explain-aqe.sql.out          |  42 +-
 .../sql-tests/results/explain-cbo.sql.out          |   2 +-
 .../resources/sql-tests/results/explain.sql.out    |  38 +-
 .../approved-plans-modified/q10.sf100/explain.txt  | 164 ++---
 .../approved-plans-modified/q10/explain.txt        | 104 +--
 .../approved-plans-modified/q19.sf100/explain.txt  | 134 ++--
 .../approved-plans-modified/q19/explain.txt        | 106 +--
 .../approved-plans-modified/q27.sf100/explain.txt  | 174 ++---
 .../approved-plans-modified/q27/explain.txt        | 196 +++---
 .../approved-plans-modified/q3.sf100/explain.txt   |  50 +-
 .../approved-plans-modified/q3/explain.txt         |  48 +-
 .../approved-plans-modified/q34.sf100/explain.txt  |  88 +--
 .../approved-plans-modified/q34/explain.txt        |  78 +--
 .../approved-plans-modified/q42.sf100/explain.txt  |  72 +-
 .../approved-plans-modified/q42/explain.txt        |  48 +-
 .../approved-plans-modified/q43.sf100/explain.txt  |  72 +-
 .../approved-plans-modified/q43/explain.txt        |  48 +-
 .../approved-plans-modified/q46.sf100/explain.txt  | 130 ++--
 .../approved-plans-modified/q46/explain.txt        | 106 +--
 .../approved-plans-modified/q52.sf100/explain.txt  |  72 +-
 .../approved-plans-modified/q52/explain.txt        |  48 +-
 .../approved-plans-modified/q53.sf100/explain.txt  | 112 +--
 .../approved-plans-modified/q53/explain.txt        |  86 +--
 .../approved-plans-modified/q55.sf100/explain.txt  |  72 +-
 .../approved-plans-modified/q55/explain.txt        |  48 +-
 .../approved-plans-modified/q59.sf100/explain.txt  | 126 ++--
 .../approved-plans-modified/q59/explain.txt        | 126 ++--
 .../approved-plans-modified/q63.sf100/explain.txt  | 112 +--
 .../approved-plans-modified/q63/explain.txt        |  86 +--
 .../approved-plans-modified/q65.sf100/explain.txt  | 144 ++--
 .../approved-plans-modified/q65/explain.txt        | 134 ++--
 .../approved-plans-modified/q68.sf100/explain.txt  | 126 ++--
 .../approved-plans-modified/q68/explain.txt        | 106 +--
 .../approved-plans-modified/q7.sf100/explain.txt   |  76 +--
 .../approved-plans-modified/q7/explain.txt         |  88 +--
 .../approved-plans-modified/q73.sf100/explain.txt  |  78 +--
 .../approved-plans-modified/q73/explain.txt        |  78 +--
 .../approved-plans-modified/q79.sf100/explain.txt  |  88 +--
 .../approved-plans-modified/q79/explain.txt        |  70 +-
 .../approved-plans-modified/q89.sf100/explain.txt  |  76 +--
 .../approved-plans-modified/q89/explain.txt        |  88 +--
 .../approved-plans-modified/q98.sf100/explain.txt  |  84 +--
 .../approved-plans-modified/q98/explain.txt        |  64 +-
 .../ss_max.sf100/explain.txt                       |  16 +-
 .../approved-plans-modified/ss_max/explain.txt     |  16 +-
 .../approved-plans-v1_4/q1.sf100/explain.txt       | 138 ++--
 .../approved-plans-v1_4/q1/explain.txt             | 126 ++--
 .../approved-plans-v1_4/q10.sf100/explain.txt      | 170 ++---
 .../approved-plans-v1_4/q10/explain.txt            | 124 ++--
 .../approved-plans-v1_4/q11.sf100/explain.txt      | 336 ++++-----
 .../approved-plans-v1_4/q11/explain.txt            | 306 ++++-----
 .../approved-plans-v1_4/q12.sf100/explain.txt      |  88 +--
 .../approved-plans-v1_4/q12/explain.txt            |  56 +-
 .../approved-plans-v1_4/q13.sf100/explain.txt      |  94 +--
 .../approved-plans-v1_4/q13/explain.txt            |  98 +--
 .../approved-plans-v1_4/q14a.sf100/explain.txt     | 598 ++++++++--------
 .../approved-plans-v1_4/q14a/explain.txt           | 448 ++++++------
 .../approved-plans-v1_4/q14b.sf100/explain.txt     | 530 +++++++--------
 .../approved-plans-v1_4/q14b/explain.txt           | 392 +++++------
 .../approved-plans-v1_4/q15.sf100/explain.txt      |  94 +--
 .../approved-plans-v1_4/q15/explain.txt            |  70 +-
 .../approved-plans-v1_4/q16.sf100/explain.txt      | 126 ++--
 .../approved-plans-v1_4/q16/explain.txt            | 126 ++--
 .../approved-plans-v1_4/q17.sf100/explain.txt      | 170 ++---
 .../approved-plans-v1_4/q17/explain.txt            | 146 ++--
 .../approved-plans-v1_4/q18.sf100/explain.txt      | 158 ++---
 .../approved-plans-v1_4/q18/explain.txt            | 138 ++--
 .../approved-plans-v1_4/q19.sf100/explain.txt      | 120 ++--
 .../approved-plans-v1_4/q19/explain.txt            | 106 +--
 .../approved-plans-v1_4/q2.sf100/explain.txt       |  88 +--
 .../approved-plans-v1_4/q2/explain.txt             |  88 +--
 .../approved-plans-v1_4/q20.sf100/explain.txt      |  88 +--
 .../approved-plans-v1_4/q20/explain.txt            |  56 +-
 .../approved-plans-v1_4/q21.sf100/explain.txt      |  72 +-
 .../approved-plans-v1_4/q21/explain.txt            |  76 +--
 .../approved-plans-v1_4/q22.sf100/explain.txt      |  76 +--
 .../approved-plans-v1_4/q22/explain.txt            |  56 +-
 .../approved-plans-v1_4/q23a.sf100/explain.txt     | 480 ++++++-------
 .../approved-plans-v1_4/q23a/explain.txt           | 330 ++++-----
 .../approved-plans-v1_4/q23b.sf100/explain.txt     | 658 +++++++++---------
 .../approved-plans-v1_4/q23b/explain.txt           | 424 ++++++------
 .../approved-plans-v1_4/q24a.sf100/explain.txt     | 294 ++++----
 .../approved-plans-v1_4/q24a/explain.txt           | 248 +++----
 .../approved-plans-v1_4/q24b.sf100/explain.txt     | 294 ++++----
 .../approved-plans-v1_4/q24b/explain.txt           | 248 +++----
 .../approved-plans-v1_4/q25.sf100/explain.txt      | 170 ++---
 .../approved-plans-v1_4/q25/explain.txt            | 146 ++--
 .../approved-plans-v1_4/q26.sf100/explain.txt      |  86 +--
 .../approved-plans-v1_4/q26/explain.txt            |  88 +--
 .../approved-plans-v1_4/q27.sf100/explain.txt      |  88 +--
 .../approved-plans-v1_4/q27/explain.txt            |  88 +--
 .../approved-plans-v1_4/q28.sf100/explain.txt      | 316 ++++-----
 .../approved-plans-v1_4/q28/explain.txt            | 316 ++++-----
 .../approved-plans-v1_4/q29.sf100/explain.txt      | 186 ++---
 .../approved-plans-v1_4/q29/explain.txt            | 162 ++---
 .../approved-plans-v1_4/q3.sf100/explain.txt       |  50 +-
 .../approved-plans-v1_4/q3/explain.txt             |  48 +-
 .../approved-plans-v1_4/q30.sf100/explain.txt      | 222 +++---
 .../approved-plans-v1_4/q30/explain.txt            | 136 ++--
 .../approved-plans-v1_4/q31.sf100/explain.txt      | 480 ++++++-------
 .../approved-plans-v1_4/q31/explain.txt            | 380 +++++------
 .../approved-plans-v1_4/q32.sf100/explain.txt      | 110 +--
 .../approved-plans-v1_4/q32/explain.txt            |  88 +--
 .../approved-plans-v1_4/q33.sf100/explain.txt      | 206 +++---
 .../approved-plans-v1_4/q33/explain.txt            | 232 +++----
 .../approved-plans-v1_4/q35.sf100/explain.txt      | 182 ++---
 .../approved-plans-v1_4/q35/explain.txt            | 126 ++--
 .../approved-plans-v1_4/q36.sf100/explain.txt      |  76 +--
 .../approved-plans-v1_4/q36/explain.txt            |  76 +--
 .../approved-plans-v1_4/q37.sf100/explain.txt      |  76 +--
 .../approved-plans-v1_4/q37/explain.txt            |  44 +-
 .../approved-plans-v1_4/q38.sf100/explain.txt      | 256 +++----
 .../approved-plans-v1_4/q38/explain.txt            | 138 ++--
 .../approved-plans-v1_4/q39a.sf100/explain.txt     | 178 ++---
 .../approved-plans-v1_4/q39a/explain.txt           | 178 ++---
 .../approved-plans-v1_4/q39b.sf100/explain.txt     | 178 ++---
 .../approved-plans-v1_4/q39b/explain.txt           | 178 ++---
 .../approved-plans-v1_4/q4.sf100/explain.txt       | 510 +++++++-------
 .../approved-plans-v1_4/q4/explain.txt             | 468 ++++++-------
 .../approved-plans-v1_4/q40.sf100/explain.txt      | 116 ++--
 .../approved-plans-v1_4/q40/explain.txt            | 116 ++--
 .../approved-plans-v1_4/q41.sf100/explain.txt      |  16 +-
 .../approved-plans-v1_4/q41/explain.txt            |  16 +-
 .../approved-plans-v1_4/q42.sf100/explain.txt      |  50 +-
 .../approved-plans-v1_4/q42/explain.txt            |  48 +-
 .../approved-plans-v1_4/q43.sf100/explain.txt      |  72 +-
 .../approved-plans-v1_4/q43/explain.txt            |  48 +-
 .../approved-plans-v1_4/q44.sf100/explain.txt      | 132 ++--
 .../approved-plans-v1_4/q44/explain.txt            | 136 ++--
 .../approved-plans-v1_4/q45.sf100/explain.txt      | 120 ++--
 .../approved-plans-v1_4/q45/explain.txt            | 114 ++--
 .../approved-plans-v1_4/q46.sf100/explain.txt      | 178 ++---
 .../approved-plans-v1_4/q46/explain.txt            | 106 +--
 .../approved-plans-v1_4/q47.sf100/explain.txt      | 160 ++---
 .../approved-plans-v1_4/q47/explain.txt            | 158 ++---
 .../approved-plans-v1_4/q48.sf100/explain.txt      |  78 +--
 .../approved-plans-v1_4/q48/explain.txt            |  78 +--
 .../approved-plans-v1_4/q49.sf100/explain.txt      | 336 ++++-----
 .../approved-plans-v1_4/q49/explain.txt            | 316 ++++-----
 .../approved-plans-v1_4/q5.sf100/explain.txt       | 270 ++++----
 .../approved-plans-v1_4/q5/explain.txt             | 248 +++----
 .../approved-plans-v1_4/q50.sf100/explain.txt      | 106 +--
 .../approved-plans-v1_4/q50/explain.txt            |  86 +--
 .../approved-plans-v1_4/q51.sf100/explain.txt      | 138 ++--
 .../approved-plans-v1_4/q51/explain.txt            | 138 ++--
 .../approved-plans-v1_4/q52.sf100/explain.txt      |  50 +-
 .../approved-plans-v1_4/q52/explain.txt            |  48 +-
 .../approved-plans-v1_4/q53.sf100/explain.txt      | 112 +--
 .../approved-plans-v1_4/q53/explain.txt            |  86 +--
 .../approved-plans-v1_4/q54.sf100/explain.txt      | 298 ++++----
 .../approved-plans-v1_4/q54/explain.txt            | 256 +++----
 .../approved-plans-v1_4/q55.sf100/explain.txt      |  42 +-
 .../approved-plans-v1_4/q55/explain.txt            |  48 +-
 .../approved-plans-v1_4/q56.sf100/explain.txt      | 232 +++----
 .../approved-plans-v1_4/q56/explain.txt            | 232 +++----
 .../approved-plans-v1_4/q57.sf100/explain.txt      | 160 ++---
 .../approved-plans-v1_4/q57/explain.txt            | 158 ++---
 .../approved-plans-v1_4/q58.sf100/explain.txt      | 216 +++---
 .../approved-plans-v1_4/q58/explain.txt            | 228 +++----
 .../approved-plans-v1_4/q59.sf100/explain.txt      | 120 ++--
 .../approved-plans-v1_4/q59/explain.txt            | 120 ++--
 .../approved-plans-v1_4/q60.sf100/explain.txt      | 232 +++----
 .../approved-plans-v1_4/q60/explain.txt            | 232 +++----
 .../approved-plans-v1_4/q61.sf100/explain.txt      | 188 ++---
 .../approved-plans-v1_4/q61/explain.txt            | 208 +++---
 .../approved-plans-v1_4/q62.sf100/explain.txt      |  80 +--
 .../approved-plans-v1_4/q62/explain.txt            |  84 +--
 .../approved-plans-v1_4/q63.sf100/explain.txt      | 112 +--
 .../approved-plans-v1_4/q63/explain.txt            |  86 +--
 .../approved-plans-v1_4/q65.sf100/explain.txt      | 154 ++---
 .../approved-plans-v1_4/q65/explain.txt            | 134 ++--
 .../approved-plans-v1_4/q66.sf100/explain.txt      | 188 ++---
 .../approved-plans-v1_4/q66/explain.txt            | 194 +++---
 .../approved-plans-v1_4/q67.sf100/explain.txt      |  82 +--
 .../approved-plans-v1_4/q67/explain.txt            |  76 +--
 .../approved-plans-v1_4/q68.sf100/explain.txt      | 178 ++---
 .../approved-plans-v1_4/q68/explain.txt            | 106 +--
 .../approved-plans-v1_4/q69.sf100/explain.txt      | 162 ++---
 .../approved-plans-v1_4/q69/explain.txt            | 124 ++--
 .../approved-plans-v1_4/q7.sf100/explain.txt       |  86 +--
 .../approved-plans-v1_4/q7/explain.txt             |  88 +--
 .../approved-plans-v1_4/q70.sf100/explain.txt      |  98 +--
 .../approved-plans-v1_4/q70/explain.txt            | 104 +--
 .../approved-plans-v1_4/q71.sf100/explain.txt      | 146 ++--
 .../approved-plans-v1_4/q71/explain.txt            | 146 ++--
 .../approved-plans-v1_4/q72.sf100/explain.txt      | 244 +++----
 .../approved-plans-v1_4/q72/explain.txt            | 220 +++---
 .../approved-plans-v1_4/q73.sf100/explain.txt      |  88 +--
 .../approved-plans-v1_4/q73/explain.txt            |  78 +--
 .../approved-plans-v1_4/q76.sf100/explain.txt      | 128 ++--
 .../approved-plans-v1_4/q76/explain.txt            | 108 +--
 .../approved-plans-v1_4/q77.sf100/explain.txt      | 348 +++++-----
 .../approved-plans-v1_4/q77/explain.txt            | 348 +++++-----
 .../approved-plans-v1_4/q79.sf100/explain.txt      |  88 +--
 .../approved-plans-v1_4/q79/explain.txt            |  70 +-
 .../approved-plans-v1_4/q8.sf100/explain.txt       | 154 ++---
 .../approved-plans-v1_4/q8/explain.txt             | 136 ++--
 .../approved-plans-v1_4/q80.sf100/explain.txt      | 414 +++++------
 .../approved-plans-v1_4/q80/explain.txt            | 414 +++++------
 .../approved-plans-v1_4/q81.sf100/explain.txt      | 230 +++----
 .../approved-plans-v1_4/q81/explain.txt            | 132 ++--
 .../approved-plans-v1_4/q82.sf100/explain.txt      |  76 +--
 .../approved-plans-v1_4/q82/explain.txt            |  44 +-
 .../approved-plans-v1_4/q83.sf100/explain.txt      | 202 +++---
 .../approved-plans-v1_4/q83/explain.txt            | 214 +++---
 .../approved-plans-v1_4/q84.sf100/explain.txt      |  86 +--
 .../approved-plans-v1_4/q84/explain.txt            |  90 +--
 .../approved-plans-v1_4/q85.sf100/explain.txt      | 182 ++---
 .../approved-plans-v1_4/q85/explain.txt            | 178 ++---
 .../approved-plans-v1_4/q86.sf100/explain.txt      |  56 +-
 .../approved-plans-v1_4/q86/explain.txt            |  56 +-
 .../approved-plans-v1_4/q87.sf100/explain.txt      | 256 +++----
 .../approved-plans-v1_4/q87/explain.txt            | 138 ++--
 .../approved-plans-v1_4/q88.sf100/explain.txt      | 560 +++++++--------
 .../approved-plans-v1_4/q88/explain.txt            | 560 +++++++--------
 .../approved-plans-v1_4/q89.sf100/explain.txt      | 114 ++--
 .../approved-plans-v1_4/q89/explain.txt            |  88 +--
 .../approved-plans-v1_4/q9.sf100/explain.txt       | 422 ++++++------
 .../approved-plans-v1_4/q9/explain.txt             | 422 ++++++------
 .../approved-plans-v1_4/q90.sf100/explain.txt      | 132 ++--
 .../approved-plans-v1_4/q90/explain.txt            | 132 ++--
 .../approved-plans-v1_4/q91.sf100/explain.txt      | 142 ++--
 .../approved-plans-v1_4/q91/explain.txt            | 138 ++--
 .../approved-plans-v1_4/q92.sf100/explain.txt      | 128 ++--
 .../approved-plans-v1_4/q92/explain.txt            |  98 +--
 .../approved-plans-v1_4/q93.sf100/explain.txt      |  54 +-
 .../approved-plans-v1_4/q93/explain.txt            |  76 +--
 .../approved-plans-v1_4/q94.sf100/explain.txt      | 126 ++--
 .../approved-plans-v1_4/q94/explain.txt            | 126 ++--
 .../approved-plans-v1_4/q95.sf100/explain.txt      | 174 ++---
 .../approved-plans-v1_4/q95/explain.txt            | 178 ++---
 .../approved-plans-v1_4/q96.sf100/explain.txt      |  56 +-
 .../approved-plans-v1_4/q96/explain.txt            |  56 +-
 .../approved-plans-v1_4/q97.sf100/explain.txt      |  86 +--
 .../approved-plans-v1_4/q97/explain.txt            |  86 +--
 .../approved-plans-v1_4/q98.sf100/explain.txt      |  96 +--
 .../approved-plans-v1_4/q98/explain.txt            |  64 +-
 .../approved-plans-v1_4/q99.sf100/explain.txt      |  80 +--
 .../approved-plans-v1_4/q99/explain.txt            |  84 +--
 .../approved-plans-v2_7/q10a.sf100/explain.txt     | 152 ++---
 .../approved-plans-v2_7/q10a/explain.txt           | 118 ++--
 .../approved-plans-v2_7/q11.sf100/explain.txt      | 332 ++++-----
 .../approved-plans-v2_7/q11/explain.txt            | 302 ++++----
 .../approved-plans-v2_7/q12.sf100/explain.txt      |  88 +--
 .../approved-plans-v2_7/q12/explain.txt            |  56 +-
 .../approved-plans-v2_7/q14.sf100/explain.txt      | 530 +++++++--------
 .../approved-plans-v2_7/q14/explain.txt            | 392 +++++------
 .../approved-plans-v2_7/q14a.sf100/explain.txt     | 754 ++++++++++----------
 .../approved-plans-v2_7/q14a/explain.txt           | 604 ++++++++--------
 .../approved-plans-v2_7/q18a.sf100/explain.txt     | 504 +++++++-------
 .../approved-plans-v2_7/q18a/explain.txt           | 450 ++++++------
 .../approved-plans-v2_7/q20.sf100/explain.txt      |  88 +--
 .../approved-plans-v2_7/q20/explain.txt            |  56 +-
 .../approved-plans-v2_7/q22.sf100/explain.txt      |  70 +-
 .../approved-plans-v2_7/q22/explain.txt            |  42 +-
 .../approved-plans-v2_7/q22a.sf100/explain.txt     | 224 +++---
 .../approved-plans-v2_7/q22a/explain.txt           | 176 ++---
 .../approved-plans-v2_7/q24.sf100/explain.txt      | 298 ++++----
 .../approved-plans-v2_7/q24/explain.txt            | 256 +++----
 .../approved-plans-v2_7/q27a.sf100/explain.txt     | 196 +++---
 .../approved-plans-v2_7/q27a/explain.txt           | 196 +++---
 .../approved-plans-v2_7/q34.sf100/explain.txt      |  88 +--
 .../approved-plans-v2_7/q34/explain.txt            |  78 +--
 .../approved-plans-v2_7/q35.sf100/explain.txt      | 182 ++---
 .../approved-plans-v2_7/q35/explain.txt            | 126 ++--
 .../approved-plans-v2_7/q35a.sf100/explain.txt     | 172 ++---
 .../approved-plans-v2_7/q35a/explain.txt           | 120 ++--
 .../approved-plans-v2_7/q36a.sf100/explain.txt     | 152 ++---
 .../approved-plans-v2_7/q36a/explain.txt           | 140 ++--
 .../approved-plans-v2_7/q47.sf100/explain.txt      | 160 ++---
 .../approved-plans-v2_7/q47/explain.txt            | 158 ++---
 .../approved-plans-v2_7/q49.sf100/explain.txt      | 336 ++++-----
 .../approved-plans-v2_7/q49/explain.txt            | 316 ++++-----
 .../approved-plans-v2_7/q51a.sf100/explain.txt     | 306 ++++-----
 .../approved-plans-v2_7/q51a/explain.txt           | 294 ++++----
 .../approved-plans-v2_7/q57.sf100/explain.txt      | 160 ++---
 .../approved-plans-v2_7/q57/explain.txt            | 158 ++---
 .../approved-plans-v2_7/q5a.sf100/explain.txt      | 350 +++++-----
 .../approved-plans-v2_7/q5a/explain.txt            | 328 ++++-----
 .../approved-plans-v2_7/q6.sf100/explain.txt       | 154 ++---
 .../approved-plans-v2_7/q6/explain.txt             | 168 ++---
 .../approved-plans-v2_7/q64.sf100/explain.txt      | 756 ++++++++++-----------
 .../approved-plans-v2_7/q64/explain.txt            | 660 +++++++++---------
 .../approved-plans-v2_7/q67a.sf100/explain.txt     | 346 +++++-----
 .../approved-plans-v2_7/q67a/explain.txt           | 340 ++++-----
 .../approved-plans-v2_7/q70a.sf100/explain.txt     | 162 ++---
 .../approved-plans-v2_7/q70a/explain.txt           | 168 ++---
 .../approved-plans-v2_7/q72.sf100/explain.txt      | 244 +++----
 .../approved-plans-v2_7/q72/explain.txt            | 220 +++---
 .../approved-plans-v2_7/q74.sf100/explain.txt      | 332 ++++-----
 .../approved-plans-v2_7/q74/explain.txt            | 302 ++++----
 .../approved-plans-v2_7/q75.sf100/explain.txt      | 470 ++++++-------
 .../approved-plans-v2_7/q75/explain.txt            | 470 ++++++-------
 .../approved-plans-v2_7/q77a.sf100/explain.txt     | 428 ++++++------
 .../approved-plans-v2_7/q77a/explain.txt           | 428 ++++++------
 .../approved-plans-v2_7/q78.sf100/explain.txt      | 282 ++++----
 .../approved-plans-v2_7/q78/explain.txt            | 282 ++++----
 .../approved-plans-v2_7/q80a.sf100/explain.txt     | 494 +++++++-------
 .../approved-plans-v2_7/q80a/explain.txt           | 494 +++++++-------
 .../approved-plans-v2_7/q86a.sf100/explain.txt     | 120 ++--
 .../approved-plans-v2_7/q86a/explain.txt           | 120 ++--
 .../approved-plans-v2_7/q98.sf100/explain.txt      |  92 +--
 .../approved-plans-v2_7/q98/explain.txt            |  60 +-
 .../org/apache/spark/sql/PlanStabilitySuite.scala  |  11 +-
 .../org/apache/spark/sql/SQLQueryTestHelper.scala  |   1 +
 .../spark/sql/execution/debug/DebuggingSuite.scala |   4 +-
 307 files changed, 26887 insertions(+), 26877 deletions(-)

diff --git a/sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/Exchange.scala b/sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/Exchange.scala
index 8ceaf88e875..c02beea4f87 100644
--- a/sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/Exchange.scala
+++ b/sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/Exchange.scala
@@ -37,7 +37,7 @@ abstract class Exchange extends UnaryExecNode {
   override def output: Seq[Attribute] = child.output
   final override val nodePatterns: Seq[TreePattern] = Seq(EXCHANGE)
 
-  override def stringArgs: Iterator[Any] = super.stringArgs ++ Iterator(s"[id=#$id]")
+  override def stringArgs: Iterator[Any] = super.stringArgs ++ Iterator(s"[plan_id=$id]")
 }
 
 /**
diff --git a/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out b/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out
index f5e5b46d29c..5e9e9d6c7d6 100644
--- a/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out
@@ -67,10 +67,10 @@ Aggregate [sum(distinct val#x) AS sum(DISTINCT val)#xL]
 == Physical Plan ==
 AdaptiveSparkPlan isFinalPlan=false
 +- HashAggregate(keys=[], functions=[sum(distinct val#x)], output=[sum(DISTINCT val)#xL])
-   +- Exchange SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+   +- Exchange SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
       +- HashAggregate(keys=[], functions=[partial_sum(distinct val#x)], output=[sum#xL])
          +- HashAggregate(keys=[val#x], functions=[], output=[val#x])
-            +- Exchange hashpartitioning(val#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+            +- Exchange hashpartitioning(val#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
                +- HashAggregate(keys=[val#x], functions=[], output=[val#x])
                   +- FileScan parquet default.explain_temp1[val#x] Batched: true, DataFilters: [], Format: Parquet, Location [not included in comparison]/{warehouse_dir}/explain_temp1], PartitionFilters: [], PushedFilters: [], ReadSchema: struct<val:int>
 
@@ -116,7 +116,7 @@ Results [2]: [key#x, max#x]
 
 (4) Exchange
 Input [2]: [key#x, max#x]
-Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (5) HashAggregate
 Input [2]: [key#x, max#x]
@@ -127,7 +127,7 @@ Results [2]: [key#x, max(val#x)#x AS max(val)#x]
 
 (6) Exchange
 Input [2]: [key#x, max(val)#x]
-Arguments: rangepartitioning(key#x ASC NULLS FIRST, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: rangepartitioning(key#x ASC NULLS FIRST, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (7) Sort
 Input [2]: [key#x, max(val)#x]
@@ -178,7 +178,7 @@ Results [2]: [key#x, max#x]
 
 (4) Exchange
 Input [2]: [key#x, max#x]
-Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (5) HashAggregate
 Input [2]: [key#x, max#x]
@@ -249,7 +249,7 @@ Results [2]: [key#x, val#x]
 
 (7) Exchange
 Input [2]: [key#x, val#x]
-Arguments: hashpartitioning(key#x, val#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, val#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (8) HashAggregate
 Input [2]: [key#x, val#x]
@@ -306,7 +306,7 @@ Condition : isnotnull(key#x)
 
 (5) BroadcastExchange
 Input [2]: [key#x, val#x]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=x]
 
 (6) BroadcastHashJoin
 Left keys [1]: [key#x]
@@ -355,7 +355,7 @@ Condition : isnotnull(key#x)
 
 (4) BroadcastExchange
 Input [2]: [key#x, val#x]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=x]
 
 (5) BroadcastHashJoin
 Left keys [1]: [key#x]
@@ -438,7 +438,7 @@ Results [1]: [max#x]
 
 (8) Exchange
 Input [1]: [max#x]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (9) HashAggregate
 Input [1]: [max#x]
@@ -485,7 +485,7 @@ Results [1]: [max#x]
 
 (15) Exchange
 Input [1]: [max#x]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (16) HashAggregate
 Input [1]: [max#x]
@@ -569,7 +569,7 @@ Results [1]: [max#x]
 
 (8) Exchange
 Input [1]: [max#x]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (9) HashAggregate
 Input [1]: [max#x]
@@ -616,7 +616,7 @@ Results [2]: [sum#x, count#xL]
 
 (15) Exchange
 Input [2]: [sum#x, count#xL]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (16) HashAggregate
 Input [2]: [sum#x, count#xL]
@@ -682,7 +682,7 @@ Results [2]: [sum#x, count#xL]
 
 (6) Exchange
 Input [2]: [sum#x, count#xL]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (7) HashAggregate
 Input [2]: [sum#x, count#xL]
@@ -718,7 +718,7 @@ Results [2]: [sum#x, count#xL]
 
 (11) Exchange
 Input [2]: [sum#x, count#xL]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (12) HashAggregate
 Input [2]: [sum#x, count#xL]
@@ -777,7 +777,7 @@ Condition : (isnotnull(key#x) AND (key#x > 10))
 
 (5) BroadcastExchange
 Input [2]: [key#x, val#x]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=x]
 
 (6) BroadcastHashJoin
 Left keys [1]: [key#x]
@@ -837,7 +837,7 @@ Results [2]: [key#x, max#x]
 
 (4) Exchange
 Input [2]: [key#x, max#x]
-Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (5) HashAggregate
 Input [2]: [key#x, max#x]
@@ -866,7 +866,7 @@ Results [2]: [key#x, max#x]
 
 (9) Exchange
 Input [2]: [key#x, max#x]
-Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (10) HashAggregate
 Input [2]: [key#x, max#x]
@@ -877,7 +877,7 @@ Results [2]: [key#x, max(val#x)#x AS max(val)#x]
 
 (11) BroadcastExchange
 Input [2]: [key#x, max(val)#x]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#x]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=x]
 
 (12) BroadcastHashJoin
 Left keys [1]: [key#x]
@@ -964,7 +964,7 @@ Results [3]: [count#xL, sum#xL, count#xL]
 
 (3) Exchange
 Input [3]: [count#xL, sum#xL, count#xL]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (4) HashAggregate
 Input [3]: [count#xL, sum#xL, count#xL]
@@ -1009,7 +1009,7 @@ Results [2]: [key#x, buf#x]
 
 (3) Exchange
 Input [2]: [key#x, buf#x]
-Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (4) ObjectHashAggregate
 Input [2]: [key#x, buf#x]
@@ -1060,7 +1060,7 @@ Results [2]: [key#x, min#x]
 
 (4) Exchange
 Input [2]: [key#x, min#x]
-Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (5) Sort
 Input [2]: [key#x, min#x]
diff --git a/sql/core/src/test/resources/sql-tests/results/explain-cbo.sql.out b/sql/core/src/test/resources/sql-tests/results/explain-cbo.sql.out
index 086b4d2e0b1..902af430b55 100644
--- a/sql/core/src/test/resources/sql-tests/results/explain-cbo.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/explain-cbo.sql.out
@@ -72,7 +72,7 @@ AdaptiveSparkPlan isFinalPlan=false
       :        +- HashAggregate(keys=[], functions=[max(csales#xL)], output=[tpcds_cmax#xL])
       :           +- HashAggregate(keys=[], functions=[partial_max(csales#xL)], output=[max#xL])
       :              +- HashAggregate(keys=[], functions=[sum(b#x)], output=[csales#xL])
-      :                 +- Exchange SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+      :                 +- Exchange SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
       :                    +- HashAggregate(keys=[], functions=[partial_sum(b#x)], output=[sum#xL])
       :                       +- Project [b#x]
       :                          +- Filter (isnotnull(a#x) AND (a#x < 100))
diff --git a/sql/core/src/test/resources/sql-tests/results/explain.sql.out b/sql/core/src/test/resources/sql-tests/results/explain.sql.out
index 4e552d51a39..71237166dc1 100644
--- a/sql/core/src/test/resources/sql-tests/results/explain.sql.out
+++ b/sql/core/src/test/resources/sql-tests/results/explain.sql.out
@@ -66,10 +66,10 @@ Aggregate [sum(distinct val#x) AS sum(DISTINCT val)#xL]
 
 == Physical Plan ==
 *HashAggregate(keys=[], functions=[sum(distinct val#x)], output=[sum(DISTINCT val)#xL])
-+- Exchange SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
++- Exchange SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
    +- *HashAggregate(keys=[], functions=[partial_sum(distinct val#x)], output=[sum#xL])
       +- *HashAggregate(keys=[val#x], functions=[], output=[val#x])
-         +- Exchange hashpartitioning(val#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+         +- Exchange hashpartitioning(val#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
             +- *HashAggregate(keys=[val#x], functions=[], output=[val#x])
                +- *ColumnarToRow
                   +- FileScan parquet default.explain_temp1[val#x] Batched: true, DataFilters: [], Format: Parquet, Location [not included in comparison]/{warehouse_dir}/explain_temp1], PartitionFilters: [], PushedFilters: [], ReadSchema: struct<val:int>
@@ -119,7 +119,7 @@ Results [2]: [key#x, max#x]
 
 (5) Exchange
 Input [2]: [key#x, max#x]
-Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (6) HashAggregate [codegen id : 2]
 Input [2]: [key#x, max#x]
@@ -130,7 +130,7 @@ Results [2]: [key#x, max(val#x)#x AS max(val)#x]
 
 (7) Exchange
 Input [2]: [key#x, max(val)#x]
-Arguments: rangepartitioning(key#x ASC NULLS FIRST, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: rangepartitioning(key#x ASC NULLS FIRST, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (8) Sort [codegen id : 3]
 Input [2]: [key#x, max(val)#x]
@@ -180,7 +180,7 @@ Results [2]: [key#x, max#x]
 
 (5) Exchange
 Input [2]: [key#x, max#x]
-Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (6) HashAggregate [codegen id : 2]
 Input [2]: [key#x, max#x]
@@ -254,7 +254,7 @@ Results [2]: [key#x, val#x]
 
 (9) Exchange
 Input [2]: [key#x, val#x]
-Arguments: hashpartitioning(key#x, val#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, val#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (10) HashAggregate [codegen id : 4]
 Input [2]: [key#x, val#x]
@@ -314,7 +314,7 @@ Condition : isnotnull(key#x)
 
 (7) BroadcastExchange
 Input [2]: [key#x, val#x]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=x]
 
 (8) BroadcastHashJoin [codegen id : 2]
 Left keys [1]: [key#x]
@@ -366,7 +366,7 @@ Condition : isnotnull(key#x)
 
 (6) BroadcastExchange
 Input [2]: [key#x, val#x]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=x]
 
 (7) BroadcastHashJoin [codegen id : 2]
 Left keys [1]: [key#x]
@@ -447,7 +447,7 @@ Results [1]: [max#x]
 
 (9) Exchange
 Input [1]: [max#x]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (10) HashAggregate [codegen id : 2]
 Input [1]: [max#x]
@@ -493,7 +493,7 @@ Results [1]: [max#x]
 
 (16) Exchange
 Input [1]: [max#x]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (17) HashAggregate [codegen id : 2]
 Input [1]: [max#x]
@@ -575,7 +575,7 @@ Results [1]: [max#x]
 
 (9) Exchange
 Input [1]: [max#x]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (10) HashAggregate [codegen id : 2]
 Input [1]: [max#x]
@@ -621,7 +621,7 @@ Results [2]: [sum#x, count#xL]
 
 (16) Exchange
 Input [2]: [sum#x, count#xL]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (17) HashAggregate [codegen id : 2]
 Input [2]: [sum#x, count#xL]
@@ -685,7 +685,7 @@ Results [2]: [sum#x, count#xL]
 
 (7) Exchange
 Input [2]: [sum#x, count#xL]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (8) HashAggregate [codegen id : 2]
 Input [2]: [sum#x, count#xL]
@@ -749,7 +749,7 @@ Condition : (isnotnull(key#x) AND (key#x > 10))
 
 (7) BroadcastExchange
 Input [2]: [key#x, val#x]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=x]
 
 (8) BroadcastHashJoin [codegen id : 2]
 Left keys [1]: [key#x]
@@ -805,7 +805,7 @@ Results [2]: [key#x, max#x]
 
 (5) Exchange
 Input [2]: [key#x, max#x]
-Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (6) HashAggregate [codegen id : 4]
 Input [2]: [key#x, max#x]
@@ -826,7 +826,7 @@ Results [2]: [key#x, max(val#x)#x AS max(val)#x]
 
 (9) BroadcastExchange
 Input [2]: [key#x, max(val)#x]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#x]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=x]
 
 (10) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [key#x]
@@ -912,7 +912,7 @@ Results [3]: [count#xL, sum#xL, count#xL]
 
 (4) Exchange
 Input [3]: [count#xL, sum#xL, count#xL]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=x]
 
 (5) HashAggregate [codegen id : 2]
 Input [3]: [count#xL, sum#xL, count#xL]
@@ -956,7 +956,7 @@ Results [2]: [key#x, buf#x]
 
 (4) Exchange
 Input [2]: [key#x, buf#x]
-Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (5) ObjectHashAggregate
 Input [2]: [key#x, buf#x]
@@ -1006,7 +1006,7 @@ Results [2]: [key#x, min#x]
 
 (5) Exchange
 Input [2]: [key#x, min#x]
-Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x]
+Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [plan_id=x]
 
 (6) Sort [codegen id : 2]
 Input [2]: [key#x, min#x]
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt
index 02ff6fcce53..6c0040711fe 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt
@@ -65,119 +65,119 @@ Condition : ((isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) AND
 
 (4) Exchange
 Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
-Arguments: hashpartitioning(c_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#4]
+Arguments: hashpartitioning(c_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=1]
 
 (5) Sort [codegen id : 2]
 Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
 Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0
 
 (6) Scan parquet default.web_sales
-Output [2]: [ws_bill_customer_sk#5, ws_sold_date_sk#6]
+Output [2]: [ws_bill_customer_sk#4, ws_sold_date_sk#5]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ws_sold_date_sk#6), dynamicpruningexpression(ws_sold_date_sk#6 IN dynamicpruning#7)]
+PartitionFilters: [isnotnull(ws_sold_date_sk#5), dynamicpruningexpression(ws_sold_date_sk#5 IN dynamicpruning#6)]
 PushedFilters: [IsNotNull(ws_bill_customer_sk)]
 ReadSchema: struct<ws_bill_customer_sk:int>
 
 (7) ColumnarToRow [codegen id : 4]
-Input [2]: [ws_bill_customer_sk#5, ws_sold_date_sk#6]
+Input [2]: [ws_bill_customer_sk#4, ws_sold_date_sk#5]
 
 (8) Filter [codegen id : 4]
-Input [2]: [ws_bill_customer_sk#5, ws_sold_date_sk#6]
-Condition : isnotnull(ws_bill_customer_sk#5)
+Input [2]: [ws_bill_customer_sk#4, ws_sold_date_sk#5]
+Condition : isnotnull(ws_bill_customer_sk#4)
 
 (9) ReusedExchange [Reuses operator id: 53]
-Output [1]: [d_date_sk#8]
+Output [1]: [d_date_sk#7]
 
 (10) BroadcastHashJoin [codegen id : 4]
-Left keys [1]: [ws_sold_date_sk#6]
-Right keys [1]: [d_date_sk#8]
+Left keys [1]: [ws_sold_date_sk#5]
+Right keys [1]: [d_date_sk#7]
 Join condition: None
 
 (11) Project [codegen id : 4]
-Output [1]: [ws_bill_customer_sk#5 AS customer_sk#9]
-Input [3]: [ws_bill_customer_sk#5, ws_sold_date_sk#6, d_date_sk#8]
+Output [1]: [ws_bill_customer_sk#4 AS customer_sk#8]
+Input [3]: [ws_bill_customer_sk#4, ws_sold_date_sk#5, d_date_sk#7]
 
 (12) Scan parquet default.catalog_sales
-Output [2]: [cs_ship_customer_sk#10, cs_sold_date_sk#11]
+Output [2]: [cs_ship_customer_sk#9, cs_sold_date_sk#10]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(cs_sold_date_sk#11), dynamicpruningexpression(cs_sold_date_sk#11 IN dynamicpruning#7)]
+PartitionFilters: [isnotnull(cs_sold_date_sk#10), dynamicpruningexpression(cs_sold_date_sk#10 IN dynamicpruning#6)]
 PushedFilters: [IsNotNull(cs_ship_customer_sk)]
 ReadSchema: struct<cs_ship_customer_sk:int>
 
 (13) ColumnarToRow [codegen id : 6]
-Input [2]: [cs_ship_customer_sk#10, cs_sold_date_sk#11]
+Input [2]: [cs_ship_customer_sk#9, cs_sold_date_sk#10]
 
 (14) Filter [codegen id : 6]
-Input [2]: [cs_ship_customer_sk#10, cs_sold_date_sk#11]
-Condition : isnotnull(cs_ship_customer_sk#10)
+Input [2]: [cs_ship_customer_sk#9, cs_sold_date_sk#10]
+Condition : isnotnull(cs_ship_customer_sk#9)
 
 (15) ReusedExchange [Reuses operator id: 53]
-Output [1]: [d_date_sk#12]
+Output [1]: [d_date_sk#11]
 
 (16) BroadcastHashJoin [codegen id : 6]
-Left keys [1]: [cs_sold_date_sk#11]
-Right keys [1]: [d_date_sk#12]
+Left keys [1]: [cs_sold_date_sk#10]
+Right keys [1]: [d_date_sk#11]
 Join condition: None
 
 (17) Project [codegen id : 6]
-Output [1]: [cs_ship_customer_sk#10 AS customer_sk#13]
-Input [3]: [cs_ship_customer_sk#10, cs_sold_date_sk#11, d_date_sk#12]
+Output [1]: [cs_ship_customer_sk#9 AS customer_sk#12]
+Input [3]: [cs_ship_customer_sk#9, cs_sold_date_sk#10, d_date_sk#11]
 
 (18) Union
 
 (19) Exchange
-Input [1]: [customer_sk#9]
-Arguments: hashpartitioning(customer_sk#9, 5), ENSURE_REQUIREMENTS, [id=#14]
+Input [1]: [customer_sk#8]
+Arguments: hashpartitioning(customer_sk#8, 5), ENSURE_REQUIREMENTS, [plan_id=2]
 
 (20) Sort [codegen id : 7]
-Input [1]: [customer_sk#9]
-Arguments: [customer_sk#9 ASC NULLS FIRST], false, 0
+Input [1]: [customer_sk#8]
+Arguments: [customer_sk#8 ASC NULLS FIRST], false, 0
 
 (21) SortMergeJoin [codegen id : 8]
 Left keys [1]: [c_customer_sk#1]
-Right keys [1]: [customer_sk#9]
+Right keys [1]: [customer_sk#8]
 Join condition: None
 
 (22) Scan parquet default.store_sales
-Output [2]: [ss_customer_sk#15, ss_sold_date_sk#16]
+Output [2]: [ss_customer_sk#13, ss_sold_date_sk#14]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#16), dynamicpruningexpression(ss_sold_date_sk#16 IN dynamicpruning#7)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#14), dynamicpruningexpression(ss_sold_date_sk#14 IN dynamicpruning#6)]
 PushedFilters: [IsNotNull(ss_customer_sk)]
 ReadSchema: struct<ss_customer_sk:int>
 
 (23) ColumnarToRow [codegen id : 10]
-Input [2]: [ss_customer_sk#15, ss_sold_date_sk#16]
+Input [2]: [ss_customer_sk#13, ss_sold_date_sk#14]
 
 (24) Filter [codegen id : 10]
-Input [2]: [ss_customer_sk#15, ss_sold_date_sk#16]
-Condition : isnotnull(ss_customer_sk#15)
+Input [2]: [ss_customer_sk#13, ss_sold_date_sk#14]
+Condition : isnotnull(ss_customer_sk#13)
 
 (25) ReusedExchange [Reuses operator id: 53]
-Output [1]: [d_date_sk#17]
+Output [1]: [d_date_sk#15]
 
 (26) BroadcastHashJoin [codegen id : 10]
-Left keys [1]: [ss_sold_date_sk#16]
-Right keys [1]: [d_date_sk#17]
+Left keys [1]: [ss_sold_date_sk#14]
+Right keys [1]: [d_date_sk#15]
 Join condition: None
 
 (27) Project [codegen id : 10]
-Output [1]: [ss_customer_sk#15 AS customer_sk#18]
-Input [3]: [ss_customer_sk#15, ss_sold_date_sk#16, d_date_sk#17]
+Output [1]: [ss_customer_sk#13 AS customer_sk#16]
+Input [3]: [ss_customer_sk#13, ss_sold_date_sk#14, d_date_sk#15]
 
 (28) Exchange
-Input [1]: [customer_sk#18]
-Arguments: hashpartitioning(customer_sk#18, 5), ENSURE_REQUIREMENTS, [id=#19]
+Input [1]: [customer_sk#16]
+Arguments: hashpartitioning(customer_sk#16, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (29) Sort [codegen id : 11]
-Input [1]: [customer_sk#18]
-Arguments: [customer_sk#18 ASC NULLS FIRST], false, 0
+Input [1]: [customer_sk#16]
+Arguments: [customer_sk#16 ASC NULLS FIRST], false, 0
 
 (30) SortMergeJoin [codegen id : 13]
 Left keys [1]: [c_customer_sk#1]
-Right keys [1]: [customer_sk#18]
+Right keys [1]: [customer_sk#16]
 Join condition: None
 
 (31) Project [codegen id : 13]
@@ -185,88 +185,88 @@ Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3]
 Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
 
 (32) Scan parquet default.customer_address
-Output [2]: [ca_address_sk#20, ca_county#21]
+Output [2]: [ca_address_sk#17, ca_county#18]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/customer_address]
 PushedFilters: [In(ca_county, [Dona Ana County,Douglas County,Gaines County,Richland County,Walker County]), IsNotNull(ca_address_sk)]
 ReadSchema: struct<ca_address_sk:int,ca_county:string>
 
 (33) ColumnarToRow [codegen id : 12]
-Input [2]: [ca_address_sk#20, ca_county#21]
+Input [2]: [ca_address_sk#17, ca_county#18]
 
 (34) Filter [codegen id : 12]
-Input [2]: [ca_address_sk#20, ca_county#21]
-Condition : (ca_county#21 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#20))
+Input [2]: [ca_address_sk#17, ca_county#18]
+Condition : (ca_county#18 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#17))
 
 (35) Project [codegen id : 12]
-Output [1]: [ca_address_sk#20]
-Input [2]: [ca_address_sk#20, ca_county#21]
+Output [1]: [ca_address_sk#17]
+Input [2]: [ca_address_sk#17, ca_county#18]
 
 (36) BroadcastExchange
-Input [1]: [ca_address_sk#20]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22]
+Input [1]: [ca_address_sk#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]
 
 (37) BroadcastHashJoin [codegen id : 13]
 Left keys [1]: [c_current_addr_sk#3]
-Right keys [1]: [ca_address_sk#20]
+Right keys [1]: [ca_address_sk#17]
 Join condition: None
 
 (38) Project [codegen id : 13]
 Output [1]: [c_current_cdemo_sk#2]
-Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#20]
+Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#17]
 
 (39) BroadcastExchange
 Input [1]: [c_current_cdemo_sk#2]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 (40) Scan parquet default.customer_demographics
-Output [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
+Output [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
 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>
 
 (41) ColumnarToRow
-Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
+Input [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
 
 (42) Filter
-Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
-Condition : isnotnull(cd_demo_sk#24)
+Input [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
+Condition : isnotnull(cd_demo_sk#19)
 
 (43) BroadcastHashJoin [codegen id : 14]
 Left keys [1]: [c_current_cdemo_sk#2]
-Right keys [1]: [cd_demo_sk#24]
+Right keys [1]: [cd_demo_sk#19]
 Join condition: None
 
 (44) Project [codegen id : 14]
-Output [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
-Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
+Output [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
+Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
 
 (45) HashAggregate [codegen id : 14]
-Input [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
-Keys [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
+Input [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
+Keys [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
 Functions [1]: [partial_count(1)]
-Aggregate Attributes [1]: [count#33]
-Results [9]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#34]
+Aggregate Attributes [1]: [count#28]
+Results [9]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#29]
 
 (46) Exchange
-Input [9]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#34]
-Arguments: hashpartitioning(cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, 5), ENSURE_REQUIREMENTS, [id=#35]
+Input [9]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#29]
+Arguments: hashpartitioning(cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, 5), ENSURE_REQUIREMENTS, [plan_id=6]
 
 (47) HashAggregate [codegen id : 15]
-Input [9]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#34]
-Keys [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
+Input [9]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#29]
+Keys [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
 Functions [1]: [count(1)]
-Aggregate Attributes [1]: [count(1)#36]
-Results [14]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, count(1)#36 AS cnt1#37, cd_purchase_estimate#28, count(1)#36 AS cnt2#38, cd_credit_rating#29, count(1)#36 AS cnt3#39, cd_dep_count#30, count(1)#36 AS cnt4#40, cd_dep_employed_count#31, count(1)#36 AS cnt5#41, cd_dep_college_count#32, count(1)#36 AS cnt6#42]
+Aggregate Attributes [1]: [count(1)#30]
+Results [14]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, count(1)#30 AS cnt1#31, cd_purchase_estimate#23, count(1)#30 AS cnt2#32, cd_credit_rating#24, count(1)#30 AS cnt3#33, cd_dep_count#25, count(1)#30 AS cnt4#34, cd_dep_employed_count#26, count(1)#30 AS cnt5#35, cd_dep_college_count#27, count(1)#30 AS cnt6#36]
 
 (48) TakeOrderedAndProject
-Input [14]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cnt1#37, cd_purchase_estimate#28, cnt2#38, cd_credit_rating#29, cnt3#39, cd_dep_count#30, cnt4#40, cd_dep_employed_count#31, cnt5#41, cd_dep_college_count#32, cnt6#42]
-Arguments: 100, [cd_gender#25 ASC NULLS FIRST, cd_marital_status#26 ASC NULLS FIRST, cd_education_status#27 ASC NULLS FIRST, cd_purchase_estimate#28 ASC NULLS FIRST, cd_credit_rating#29 ASC NULLS FIRST, cd_dep_count#30 ASC NULLS FIRST, cd_dep_employed_count#31 ASC NULLS FIRST, cd_dep_college_count#32 ASC NULLS FIRST], [cd_gender#25, cd_marital_status#26, cd_education_status#27, cnt1#37, cd_purchase_estimate#28, cnt2#38, cd_credit_rating#29, cnt3#39, cd_dep_count#30, cnt4#40, cd_dep_emplo [...]
+Input [14]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cnt1#31, cd_purchase_estimate#23, cnt2#32, cd_credit_rating#24, cnt3#33, cd_dep_count#25, cnt4#34, cd_dep_employed_count#26, cnt5#35, cd_dep_college_count#27, cnt6#36]
+Arguments: 100, [cd_gender#20 ASC NULLS FIRST, cd_marital_status#21 ASC NULLS FIRST, cd_education_status#22 ASC NULLS FIRST, cd_purchase_estimate#23 ASC NULLS FIRST, cd_credit_rating#24 ASC NULLS FIRST, cd_dep_count#25 ASC NULLS FIRST, cd_dep_employed_count#26 ASC NULLS FIRST, cd_dep_college_count#27 ASC NULLS FIRST], [cd_gender#20, cd_marital_status#21, cd_education_status#22, cnt1#31, cd_purchase_estimate#23, cnt2#32, cd_credit_rating#24, cnt3#33, cd_dep_count#25, cnt4#34, cd_dep_emplo [...]
 
 ===== Subqueries =====
 
-Subquery:1 Hosting operator id = 6 Hosting Expression = ws_sold_date_sk#6 IN dynamicpruning#7
+Subquery:1 Hosting operator id = 6 Hosting Expression = ws_sold_date_sk#5 IN dynamicpruning#6
 BroadcastExchange (53)
 +- * Project (52)
    +- * Filter (51)
@@ -275,29 +275,29 @@ BroadcastExchange (53)
 
 
 (49) Scan parquet default.date_dim
-Output [3]: [d_date_sk#8, d_year#43, d_moy#44]
+Output [3]: [d_date_sk#7, d_year#37, d_moy#38]
 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,4), LessThanOrEqual(d_moy,7), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
 
 (50) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#8, d_year#43, d_moy#44]
+Input [3]: [d_date_sk#7, d_year#37, d_moy#38]
 
 (51) Filter [codegen id : 1]
-Input [3]: [d_date_sk#8, d_year#43, d_moy#44]
-Condition : (((((isnotnull(d_year#43) AND isnotnull(d_moy#44)) AND (d_year#43 = 2002)) AND (d_moy#44 >= 4)) AND (d_moy#44 <= 7)) AND isnotnull(d_date_sk#8))
+Input [3]: [d_date_sk#7, d_year#37, d_moy#38]
+Condition : (((((isnotnull(d_year#37) AND isnotnull(d_moy#38)) AND (d_year#37 = 2002)) AND (d_moy#38 >= 4)) AND (d_moy#38 <= 7)) AND isnotnull(d_date_sk#7))
 
 (52) Project [codegen id : 1]
-Output [1]: [d_date_sk#8]
-Input [3]: [d_date_sk#8, d_year#43, d_moy#44]
+Output [1]: [d_date_sk#7]
+Input [3]: [d_date_sk#7, d_year#37, d_moy#38]
 
 (53) BroadcastExchange
-Input [1]: [d_date_sk#8]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#45]
+Input [1]: [d_date_sk#7]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
 
-Subquery:2 Hosting operator id = 12 Hosting Expression = cs_sold_date_sk#11 IN dynamicpruning#7
+Subquery:2 Hosting operator id = 12 Hosting Expression = cs_sold_date_sk#10 IN dynamicpruning#6
 
-Subquery:3 Hosting operator id = 22 Hosting Expression = ss_sold_date_sk#16 IN dynamicpruning#7
+Subquery:3 Hosting operator id = 22 Hosting Expression = ss_sold_date_sk#14 IN dynamicpruning#6
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt
index a565ac50100..3494945bb46 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt
@@ -117,7 +117,7 @@ Input [3]: [cs_ship_customer_sk#9, cs_sold_date_sk#10, d_date_sk#11]
 
 (17) BroadcastExchange
 Input [1]: [customer_sk#8]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (18) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [c_customer_sk#1]
@@ -125,39 +125,39 @@ Right keys [1]: [customer_sk#8]
 Join condition: None
 
 (19) Scan parquet default.store_sales
-Output [2]: [ss_customer_sk#14, ss_sold_date_sk#15]
+Output [2]: [ss_customer_sk#13, ss_sold_date_sk#14]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#15), dynamicpruningexpression(ss_sold_date_sk#15 IN dynamicpruning#6)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#14), dynamicpruningexpression(ss_sold_date_sk#14 IN dynamicpruning#6)]
 PushedFilters: [IsNotNull(ss_customer_sk)]
 ReadSchema: struct<ss_customer_sk:int>
 
 (20) ColumnarToRow [codegen id : 6]
-Input [2]: [ss_customer_sk#14, ss_sold_date_sk#15]
+Input [2]: [ss_customer_sk#13, ss_sold_date_sk#14]
 
 (21) Filter [codegen id : 6]
-Input [2]: [ss_customer_sk#14, ss_sold_date_sk#15]
-Condition : isnotnull(ss_customer_sk#14)
+Input [2]: [ss_customer_sk#13, ss_sold_date_sk#14]
+Condition : isnotnull(ss_customer_sk#13)
 
 (22) ReusedExchange [Reuses operator id: 49]
-Output [1]: [d_date_sk#16]
+Output [1]: [d_date_sk#15]
 
 (23) BroadcastHashJoin [codegen id : 6]
-Left keys [1]: [ss_sold_date_sk#15]
-Right keys [1]: [d_date_sk#16]
+Left keys [1]: [ss_sold_date_sk#14]
+Right keys [1]: [d_date_sk#15]
 Join condition: None
 
 (24) Project [codegen id : 6]
-Output [1]: [ss_customer_sk#14 AS customer_sk#17]
-Input [3]: [ss_customer_sk#14, ss_sold_date_sk#15, d_date_sk#16]
+Output [1]: [ss_customer_sk#13 AS customer_sk#16]
+Input [3]: [ss_customer_sk#13, ss_sold_date_sk#14, d_date_sk#15]
 
 (25) BroadcastExchange
-Input [1]: [customer_sk#17]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18]
+Input [1]: [customer_sk#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (26) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [c_customer_sk#1]
-Right keys [1]: [customer_sk#17]
+Right keys [1]: [customer_sk#16]
 Join condition: None
 
 (27) Project [codegen id : 9]
@@ -165,84 +165,84 @@ Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3]
 Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3]
 
 (28) Scan parquet default.customer_address
-Output [2]: [ca_address_sk#19, ca_county#20]
+Output [2]: [ca_address_sk#17, ca_county#18]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/customer_address]
 PushedFilters: [In(ca_county, [Dona Ana County,Douglas County,Gaines County,Richland County,Walker County]), IsNotNull(ca_address_sk)]
 ReadSchema: struct<ca_address_sk:int,ca_county:string>
 
 (29) ColumnarToRow [codegen id : 7]
-Input [2]: [ca_address_sk#19, ca_county#20]
+Input [2]: [ca_address_sk#17, ca_county#18]
 
 (30) Filter [codegen id : 7]
-Input [2]: [ca_address_sk#19, ca_county#20]
-Condition : (ca_county#20 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#19))
+Input [2]: [ca_address_sk#17, ca_county#18]
+Condition : (ca_county#18 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#17))
 
 (31) Project [codegen id : 7]
-Output [1]: [ca_address_sk#19]
-Input [2]: [ca_address_sk#19, ca_county#20]
+Output [1]: [ca_address_sk#17]
+Input [2]: [ca_address_sk#17, ca_county#18]
 
 (32) BroadcastExchange
-Input [1]: [ca_address_sk#19]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21]
+Input [1]: [ca_address_sk#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]
 
 (33) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [c_current_addr_sk#3]
-Right keys [1]: [ca_address_sk#19]
+Right keys [1]: [ca_address_sk#17]
 Join condition: None
 
 (34) Project [codegen id : 9]
 Output [1]: [c_current_cdemo_sk#2]
-Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#19]
+Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#17]
 
 (35) Scan parquet default.customer_demographics
-Output [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
+Output [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
 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>
 
 (36) ColumnarToRow [codegen id : 8]
-Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
+Input [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
 
 (37) Filter [codegen id : 8]
-Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
-Condition : isnotnull(cd_demo_sk#22)
+Input [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
+Condition : isnotnull(cd_demo_sk#19)
 
 (38) BroadcastExchange
-Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31]
+Input [9]: [cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
 
 (39) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [c_current_cdemo_sk#2]
-Right keys [1]: [cd_demo_sk#22]
+Right keys [1]: [cd_demo_sk#19]
 Join condition: None
 
 (40) Project [codegen id : 9]
-Output [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
-Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
+Output [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
+Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#19, cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
 
 (41) HashAggregate [codegen id : 9]
-Input [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
-Keys [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
+Input [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
+Keys [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
 Functions [1]: [partial_count(1)]
-Aggregate Attributes [1]: [count#32]
-Results [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33]
+Aggregate Attributes [1]: [count#28]
+Results [9]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#29]
 
 (42) Exchange
-Input [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33]
-Arguments: hashpartitioning(cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), ENSURE_REQUIREMENTS, [id=#34]
+Input [9]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#29]
+Arguments: hashpartitioning(cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (43) HashAggregate [codegen id : 10]
-Input [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33]
-Keys [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
+Input [9]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27, count#29]
+Keys [8]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cd_purchase_estimate#23, cd_credit_rating#24, cd_dep_count#25, cd_dep_employed_count#26, cd_dep_college_count#27]
 Functions [1]: [count(1)]
-Aggregate Attributes [1]: [count(1)#35]
-Results [14]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, count(1)#35 AS cnt1#36, cd_purchase_estimate#26, count(1)#35 AS cnt2#37, cd_credit_rating#27, count(1)#35 AS cnt3#38, cd_dep_count#28, count(1)#35 AS cnt4#39, cd_dep_employed_count#29, count(1)#35 AS cnt5#40, cd_dep_college_count#30, count(1)#35 AS cnt6#41]
+Aggregate Attributes [1]: [count(1)#30]
+Results [14]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, count(1)#30 AS cnt1#31, cd_purchase_estimate#23, count(1)#30 AS cnt2#32, cd_credit_rating#24, count(1)#30 AS cnt3#33, cd_dep_count#25, count(1)#30 AS cnt4#34, cd_dep_employed_count#26, count(1)#30 AS cnt5#35, cd_dep_college_count#27, count(1)#30 AS cnt6#36]
 
 (44) TakeOrderedAndProject
-Input [14]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#27, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_employed_count#29, cnt5#40, cd_dep_college_count#30, cnt6#41]
-Arguments: 100, [cd_gender#23 ASC NULLS FIRST, cd_marital_status#24 ASC NULLS FIRST, cd_education_status#25 ASC NULLS FIRST, cd_purchase_estimate#26 ASC NULLS FIRST, cd_credit_rating#27 ASC NULLS FIRST, cd_dep_count#28 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [cd_gender#23, cd_marital_status#24, cd_education_status#25, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#27, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_emplo [...]
+Input [14]: [cd_gender#20, cd_marital_status#21, cd_education_status#22, cnt1#31, cd_purchase_estimate#23, cnt2#32, cd_credit_rating#24, cnt3#33, cd_dep_count#25, cnt4#34, cd_dep_employed_count#26, cnt5#35, cd_dep_college_count#27, cnt6#36]
+Arguments: 100, [cd_gender#20 ASC NULLS FIRST, cd_marital_status#21 ASC NULLS FIRST, cd_education_status#22 ASC NULLS FIRST, cd_purchase_estimate#23 ASC NULLS FIRST, cd_credit_rating#24 ASC NULLS FIRST, cd_dep_count#25 ASC NULLS FIRST, cd_dep_employed_count#26 ASC NULLS FIRST, cd_dep_college_count#27 ASC NULLS FIRST], [cd_gender#20, cd_marital_status#21, cd_education_status#22, cnt1#31, cd_purchase_estimate#23, cnt2#32, cd_credit_rating#24, cnt3#33, cd_dep_count#25, cnt4#34, cd_dep_emplo [...]
 
 ===== Subqueries =====
 
@@ -255,29 +255,29 @@ BroadcastExchange (49)
 
 
 (45) Scan parquet default.date_dim
-Output [3]: [d_date_sk#7, d_year#42, d_moy#43]
+Output [3]: [d_date_sk#7, d_year#37, d_moy#38]
 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,4), LessThanOrEqual(d_moy,7), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
 
 (46) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#7, d_year#42, d_moy#43]
+Input [3]: [d_date_sk#7, d_year#37, d_moy#38]
 
 (47) Filter [codegen id : 1]
-Input [3]: [d_date_sk#7, d_year#42, d_moy#43]
-Condition : (((((isnotnull(d_year#42) AND isnotnull(d_moy#43)) AND (d_year#42 = 2002)) AND (d_moy#43 >= 4)) AND (d_moy#43 <= 7)) AND isnotnull(d_date_sk#7))
+Input [3]: [d_date_sk#7, d_year#37, d_moy#38]
+Condition : (((((isnotnull(d_year#37) AND isnotnull(d_moy#38)) AND (d_year#37 = 2002)) AND (d_moy#38 >= 4)) AND (d_moy#38 <= 7)) AND isnotnull(d_date_sk#7))
 
 (48) Project [codegen id : 1]
 Output [1]: [d_date_sk#7]
-Input [3]: [d_date_sk#7, d_year#42, d_moy#43]
+Input [3]: [d_date_sk#7, d_year#37, d_moy#38]
 
 (49) BroadcastExchange
 Input [1]: [d_date_sk#7]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
 
 Subquery:2 Hosting operator id = 10 Hosting Expression = cs_sold_date_sk#10 IN dynamicpruning#6
 
-Subquery:3 Hosting operator id = 19 Hosting Expression = ss_sold_date_sk#15 IN dynamicpruning#6
+Subquery:3 Hosting operator id = 19 Hosting Expression = ss_sold_date_sk#14 IN dynamicpruning#6
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19.sf100/explain.txt
index 6b4fce45b44..27ebf292c53 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19.sf100/explain.txt
@@ -60,169 +60,169 @@ Input [3]: [d_date_sk#1, d_year#2, d_moy#3]
 
 (5) BroadcastExchange
 Input [1]: [d_date_sk#1]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (6) Scan parquet default.store_sales
-Output [5]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8, ss_sold_date_sk#9]
+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#9), (ss_sold_date_sk#9 >= 2451484), (ss_sold_date_sk#9 <= 2451513), dynamicpruningexpression(ss_sold_date_sk#9 IN dynamicpruning#10)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#8), (ss_sold_date_sk#8 >= 2451484), (ss_sold_date_sk#8 <= 2451513), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)]
 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)>
 
 (7) ColumnarToRow
-Input [5]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8, ss_sold_date_sk#9]
+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) Filter
-Input [5]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8, ss_sold_date_sk#9]
-Condition : ((isnotnull(ss_item_sk#5) AND isnotnull(ss_customer_sk#6)) AND isnotnull(ss_store_sk#7))
+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))
 
 (9) BroadcastHashJoin [codegen id : 2]
 Left keys [1]: [d_date_sk#1]
-Right keys [1]: [ss_sold_date_sk#9]
+Right keys [1]: [ss_sold_date_sk#8]
 Join condition: None
 
 (10) Project [codegen id : 2]
-Output [4]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8]
-Input [6]: [d_date_sk#1, ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8, ss_sold_date_sk#9]
+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]
 
 (11) BroadcastExchange
-Input [4]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8]
-Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#11]
+Input [4]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7]
+Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [plan_id=2]
 
 (12) Scan parquet default.customer
-Output [2]: [c_customer_sk#12, c_current_addr_sk#13]
+Output [2]: [c_customer_sk#10, c_current_addr_sk#11]
 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>
 
 (13) ColumnarToRow
-Input [2]: [c_customer_sk#12, c_current_addr_sk#13]
+Input [2]: [c_customer_sk#10, c_current_addr_sk#11]
 
 (14) Filter
-Input [2]: [c_customer_sk#12, c_current_addr_sk#13]
-Condition : (isnotnull(c_customer_sk#12) AND isnotnull(c_current_addr_sk#13))
+Input [2]: [c_customer_sk#10, c_current_addr_sk#11]
+Condition : (isnotnull(c_customer_sk#10) AND isnotnull(c_current_addr_sk#11))
 
 (15) BroadcastHashJoin [codegen id : 4]
-Left keys [1]: [ss_customer_sk#6]
-Right keys [1]: [c_customer_sk#12]
+Left keys [1]: [ss_customer_sk#5]
+Right keys [1]: [c_customer_sk#10]
 Join condition: None
 
 (16) Project [codegen id : 4]
-Output [4]: [ss_item_sk#5, ss_store_sk#7, ss_ext_sales_price#8, c_current_addr_sk#13]
-Input [6]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8, c_customer_sk#12, c_current_addr_sk#13]
+Output [4]: [ss_item_sk#4, ss_store_sk#6, ss_ext_sales_price#7, c_current_addr_sk#11]
+Input [6]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, c_customer_sk#10, c_current_addr_sk#11]
 
 (17) Scan parquet default.store
-Output [2]: [s_store_sk#14, s_zip#15]
+Output [2]: [s_store_sk#12, s_zip#13]
 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>
 
 (18) ColumnarToRow [codegen id : 3]
-Input [2]: [s_store_sk#14, s_zip#15]
+Input [2]: [s_store_sk#12, s_zip#13]
 
 (19) Filter [codegen id : 3]
-Input [2]: [s_store_sk#14, s_zip#15]
-Condition : (isnotnull(s_zip#15) AND isnotnull(s_store_sk#14))
+Input [2]: [s_store_sk#12, s_zip#13]
+Condition : (isnotnull(s_zip#13) AND isnotnull(s_store_sk#12))
 
 (20) BroadcastExchange
-Input [2]: [s_store_sk#14, s_zip#15]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16]
+Input [2]: [s_store_sk#12, s_zip#13]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
 
 (21) BroadcastHashJoin [codegen id : 4]
-Left keys [1]: [ss_store_sk#7]
-Right keys [1]: [s_store_sk#14]
+Left keys [1]: [ss_store_sk#6]
+Right keys [1]: [s_store_sk#12]
 Join condition: None
 
 (22) Project [codegen id : 4]
-Output [4]: [ss_item_sk#5, ss_ext_sales_price#8, c_current_addr_sk#13, s_zip#15]
-Input [6]: [ss_item_sk#5, ss_store_sk#7, ss_ext_sales_price#8, c_current_addr_sk#13, s_store_sk#14, s_zip#15]
+Output [4]: [ss_item_sk#4, ss_ext_sales_price#7, c_current_addr_sk#11, s_zip#13]
+Input [6]: [ss_item_sk#4, ss_store_sk#6, ss_ext_sales_price#7, c_current_addr_sk#11, s_store_sk#12, s_zip#13]
 
 (23) BroadcastExchange
-Input [4]: [ss_item_sk#5, ss_ext_sales_price#8, c_current_addr_sk#13, s_zip#15]
-Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#17]
+Input [4]: [ss_item_sk#4, ss_ext_sales_price#7, c_current_addr_sk#11, s_zip#13]
+Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [plan_id=4]
 
 (24) Scan parquet default.customer_address
-Output [2]: [ca_address_sk#18, ca_zip#19]
+Output [2]: [ca_address_sk#14, ca_zip#15]
 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) ColumnarToRow
-Input [2]: [ca_address_sk#18, ca_zip#19]
+Input [2]: [ca_address_sk#14, ca_zip#15]
 
 (26) Filter
-Input [2]: [ca_address_sk#18, ca_zip#19]
-Condition : (isnotnull(ca_address_sk#18) AND isnotnull(ca_zip#19))
+Input [2]: [ca_address_sk#14, ca_zip#15]
+Condition : (isnotnull(ca_address_sk#14) AND isnotnull(ca_zip#15))
 
 (27) BroadcastHashJoin [codegen id : 6]
-Left keys [1]: [c_current_addr_sk#13]
-Right keys [1]: [ca_address_sk#18]
-Join condition: NOT (substr(ca_zip#19, 1, 5) = substr(s_zip#15, 1, 5))
+Left keys [1]: [c_current_addr_sk#11]
+Right keys [1]: [ca_address_sk#14]
+Join condition: NOT (substr(ca_zip#15, 1, 5) = substr(s_zip#13, 1, 5))
 
 (28) Project [codegen id : 6]
-Output [2]: [ss_item_sk#5, ss_ext_sales_price#8]
-Input [6]: [ss_item_sk#5, ss_ext_sales_price#8, c_current_addr_sk#13, s_zip#15, ca_address_sk#18, ca_zip#19]
+Output [2]: [ss_item_sk#4, ss_ext_sales_price#7]
+Input [6]: [ss_item_sk#4, ss_ext_sales_price#7, c_current_addr_sk#11, s_zip#13, ca_address_sk#14, ca_zip#15]
 
 (29) Scan parquet default.item
-Output [6]: [i_item_sk#20, i_brand_id#21, i_brand#22, i_manufact_id#23, i_manufact#24, i_manager_id#25]
+Output [6]: [i_item_sk#16, i_brand_id#17, i_brand#18, i_manufact_id#19, i_manufact#20, i_manager_id#21]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,7), 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>
 
 (30) ColumnarToRow [codegen id : 5]
-Input [6]: [i_item_sk#20, i_brand_id#21, i_brand#22, i_manufact_id#23, i_manufact#24, i_manager_id#25]
+Input [6]: [i_item_sk#16, i_brand_id#17, i_brand#18, i_manufact_id#19, i_manufact#20, i_manager_id#21]
 
 (31) Filter [codegen id : 5]
-Input [6]: [i_item_sk#20, i_brand_id#21, i_brand#22, i_manufact_id#23, i_manufact#24, i_manager_id#25]
-Condition : ((isnotnull(i_manager_id#25) AND (i_manager_id#25 = 7)) AND isnotnull(i_item_sk#20))
+Input [6]: [i_item_sk#16, i_brand_id#17, i_brand#18, i_manufact_id#19, i_manufact#20, i_manager_id#21]
+Condition : ((isnotnull(i_manager_id#21) AND (i_manager_id#21 = 7)) AND isnotnull(i_item_sk#16))
 
 (32) Project [codegen id : 5]
-Output [5]: [i_item_sk#20, i_brand_id#21, i_brand#22, i_manufact_id#23, i_manufact#24]
-Input [6]: [i_item_sk#20, i_brand_id#21, i_brand#22, i_manufact_id#23, i_manufact#24, i_manager_id#25]
+Output [5]: [i_item_sk#16, i_brand_id#17, i_brand#18, i_manufact_id#19, i_manufact#20]
+Input [6]: [i_item_sk#16, i_brand_id#17, i_brand#18, i_manufact_id#19, i_manufact#20, i_manager_id#21]
 
 (33) BroadcastExchange
-Input [5]: [i_item_sk#20, i_brand_id#21, i_brand#22, i_manufact_id#23, i_manufact#24]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26]
+Input [5]: [i_item_sk#16, i_brand_id#17, i_brand#18, i_manufact_id#19, i_manufact#20]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 (34) BroadcastHashJoin [codegen id : 6]
-Left keys [1]: [ss_item_sk#5]
-Right keys [1]: [i_item_sk#20]
+Left keys [1]: [ss_item_sk#4]
+Right keys [1]: [i_item_sk#16]
 Join condition: None
 
 (35) Project [codegen id : 6]
-Output [5]: [ss_ext_sales_price#8, i_brand_id#21, i_brand#22, i_manufact_id#23, i_manufact#24]
-Input [7]: [ss_item_sk#5, ss_ext_sales_price#8, i_item_sk#20, i_brand_id#21, i_brand#22, i_manufact_id#23, i_manufact#24]
+Output [5]: [ss_ext_sales_price#7, i_brand_id#17, i_brand#18, i_manufact_id#19, i_manufact#20]
+Input [7]: [ss_item_sk#4, ss_ext_sales_price#7, i_item_sk#16, i_brand_id#17, i_brand#18, i_manufact_id#19, i_manufact#20]
 
 (36) HashAggregate [codegen id : 6]
-Input [5]: [ss_ext_sales_price#8, i_brand_id#21, i_brand#22, i_manufact_id#23, i_manufact#24]
-Keys [4]: [i_brand#22, i_brand_id#21, i_manufact_id#23, i_manufact#24]
-Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))]
-Aggregate Attributes [1]: [sum#27]
-Results [5]: [i_brand#22, i_brand_id#21, i_manufact_id#23, i_manufact#24, sum#28]
+Input [5]: [ss_ext_sales_price#7, i_brand_id#17, i_brand#18, i_manufact_id#19, i_manufact#20]
+Keys [4]: [i_brand#18, i_brand_id#17, i_manufact_id#19, i_manufact#20]
+Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#7))]
+Aggregate Attributes [1]: [sum#22]
+Results [5]: [i_brand#18, i_brand_id#17, i_manufact_id#19, i_manufact#20, sum#23]
 
 (37) Exchange
-Input [5]: [i_brand#22, i_brand_id#21, i_manufact_id#23, i_manufact#24, sum#28]
-Arguments: hashpartitioning(i_brand#22, i_brand_id#21, i_manufact_id#23, i_manufact#24, 5), ENSURE_REQUIREMENTS, [id=#29]
+Input [5]: [i_brand#18, i_brand_id#17, i_manufact_id#19, i_manufact#20, sum#23]
+Arguments: hashpartitioning(i_brand#18, i_brand_id#17, i_manufact_id#19, i_manufact#20, 5), ENSURE_REQUIREMENTS, [plan_id=6]
 
 (38) HashAggregate [codegen id : 7]
-Input [5]: [i_brand#22, i_brand_id#21, i_manufact_id#23, i_manufact#24, sum#28]
-Keys [4]: [i_brand#22, i_brand_id#21, i_manufact_id#23, i_manufact#24]
-Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#30]
-Results [5]: [i_brand_id#21 AS brand_id#31, i_brand#22 AS brand#32, i_manufact_id#23, i_manufact#24, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#30,17,2) AS ext_price#33]
+Input [5]: [i_brand#18, i_brand_id#17, i_manufact_id#19, i_manufact#20, sum#23]
+Keys [4]: [i_brand#18, i_brand_id#17, i_manufact_id#19, i_manufact#20]
+Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#7))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#7))#24]
+Results [5]: [i_brand_id#17 AS brand_id#25, i_brand#18 AS brand#26, i_manufact_id#19, i_manufact#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#24,17,2) AS ext_price#27]
 
 (39) TakeOrderedAndProject
-Input [5]: [brand_id#31, brand#32, i_manufact_id#23, i_manufact#24, ext_price#33]
-Arguments: 100, [ext_price#33 DESC NULLS LAST, brand#32 ASC NULLS FIRST, brand_id#31 ASC NULLS FIRST, i_manufact_id#23 ASC NULLS FIRST, i_manufact#24 ASC NULLS FIRST], [brand_id#31, brand#32, i_manufact_id#23, i_manufact#24, ext_price#33]
+Input [5]: [brand_id#25, brand#26, i_manufact_id#19, i_manufact#20, ext_price#27]
+Arguments: 100, [ext_price#27 DESC NULLS LAST, brand#26 ASC NULLS FIRST, brand_id#25 ASC NULLS FIRST, i_manufact_id#19 ASC NULLS FIRST, i_manufact#20 ASC NULLS FIRST], [brand_id#25, brand#26, i_manufact_id#19, i_manufact#20, ext_price#27]
 
 ===== Subqueries =====
 
-Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#9 IN dynamicpruning#10
+Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9
 ReusedExchange (40)
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19/explain.txt
index e58fb8a1e13..a13166ff0ce 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19/explain.txt
@@ -75,7 +75,7 @@ Condition : ((isnotnull(ss_item_sk#4) AND isnotnull(ss_customer_sk#5)) AND isnot
 
 (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), [id=#9]
+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]
@@ -87,136 +87,136 @@ 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]
 
 (11) Scan parquet default.item
-Output [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15]
+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,7), 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) ColumnarToRow [codegen id : 2]
-Input [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15]
+Input [6]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, i_manager_id#14]
 
 (13) Filter [codegen id : 2]
-Input [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15]
-Condition : ((isnotnull(i_manager_id#15) AND (i_manager_id#15 = 7)) AND isnotnull(i_item_sk#10))
+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 = 7)) AND isnotnull(i_item_sk#9))
 
 (14) Project [codegen id : 2]
-Output [5]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14]
-Input [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15]
+Output [5]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13]
+Input [6]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manufact_id#12, i_manufact#13, i_manager_id#14]
 
 (15) BroadcastExchange
-Input [5]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16]
+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#10]
+Right keys [1]: [i_item_sk#9]
 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#11, i_brand#12, i_manufact_id#13, i_manufact#14]
-Input [9]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14]
+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]
 
 (18) Scan parquet default.customer
-Output [2]: [c_customer_sk#17, c_current_addr_sk#18]
+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) ColumnarToRow [codegen id : 3]
-Input [2]: [c_customer_sk#17, c_current_addr_sk#18]
+Input [2]: [c_customer_sk#15, c_current_addr_sk#16]
 
 (20) Filter [codegen id : 3]
-Input [2]: [c_customer_sk#17, c_current_addr_sk#18]
-Condition : (isnotnull(c_customer_sk#17) AND isnotnull(c_current_addr_sk#18))
+Input [2]: [c_customer_sk#15, c_current_addr_sk#16]
+Condition : (isnotnull(c_customer_sk#15) AND isnotnull(c_current_addr_sk#16))
 
 (21) BroadcastExchange
-Input [2]: [c_customer_sk#17, c_current_addr_sk#18]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19]
+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#17]
+Right keys [1]: [c_customer_sk#15]
 Join condition: None
 
 (23) Project [codegen id : 6]
-Output [7]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, c_current_addr_sk#18]
-Input [9]: [ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, c_customer_sk#17, c_current_addr_sk#18]
+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]
 
 (24) Scan parquet default.customer_address
-Output [2]: [ca_address_sk#20, ca_zip#21]
+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) ColumnarToRow [codegen id : 4]
-Input [2]: [ca_address_sk#20, ca_zip#21]
+Input [2]: [ca_address_sk#17, ca_zip#18]
 
 (26) Filter [codegen id : 4]
-Input [2]: [ca_address_sk#20, ca_zip#21]
-Condition : (isnotnull(ca_address_sk#20) AND isnotnull(ca_zip#21))
+Input [2]: [ca_address_sk#17, ca_zip#18]
+Condition : (isnotnull(ca_address_sk#17) AND isnotnull(ca_zip#18))
 
 (27) BroadcastExchange
-Input [2]: [ca_address_sk#20, ca_zip#21]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22]
+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#18]
-Right keys [1]: [ca_address_sk#20]
+Left keys [1]: [c_current_addr_sk#16]
+Right keys [1]: [ca_address_sk#17]
 Join condition: None
 
 (29) Project [codegen id : 6]
-Output [7]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, ca_zip#21]
-Input [9]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, c_current_addr_sk#18, ca_address_sk#20, ca_zip#21]
+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]
 
 (30) Scan parquet default.store
-Output [2]: [s_store_sk#23, s_zip#24]
+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) ColumnarToRow [codegen id : 5]
-Input [2]: [s_store_sk#23, s_zip#24]
+Input [2]: [s_store_sk#19, s_zip#20]
 
 (32) Filter [codegen id : 5]
-Input [2]: [s_store_sk#23, s_zip#24]
-Condition : (isnotnull(s_zip#24) AND isnotnull(s_store_sk#23))
+Input [2]: [s_store_sk#19, s_zip#20]
+Condition : (isnotnull(s_zip#20) AND isnotnull(s_store_sk#19))
 
 (33) BroadcastExchange
-Input [2]: [s_store_sk#23, s_zip#24]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25]
+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#23]
-Join condition: NOT (substr(ca_zip#21, 1, 5) = substr(s_zip#24, 1, 5))
+Right keys [1]: [s_store_sk#19]
+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#11, i_brand#12, i_manufact_id#13, i_manufact#14]
-Input [9]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, ca_zip#21, s_store_sk#23, s_zip#24]
+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#11, i_brand#12, i_manufact_id#13, i_manufact#14]
-Keys [4]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14]
+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#26]
-Results [5]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, sum#27]
+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#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, sum#27]
-Arguments: hashpartitioning(i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, 5), ENSURE_REQUIREMENTS, [id=#28]
+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#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, sum#27]
-Keys [4]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14]
+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))#29]
-Results [5]: [i_brand_id#11 AS brand_id#30, i_brand#12 AS brand#31, i_manufact_id#13, i_manufact#14, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#29,17,2) AS ext_price#32]
+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#30, brand#31, i_manufact_id#13, i_manufact#14, ext_price#32]
-Arguments: 100, [ext_price#32 DESC NULLS LAST, brand#31 ASC NULLS FIRST, brand_id#30 ASC NULLS FIRST, i_manufact_id#13 ASC NULLS FIRST, i_manufact#14 ASC NULLS FIRST], [brand_id#30, brand#31, i_manufact_id#13, i_manufact#14, ext_price#32]
+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/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt
index 65572cfd770..ae00dddad01 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt
@@ -121,7 +121,7 @@ Input [4]: [cd_demo_sk#11, cd_gender#12, cd_marital_status#13, cd_education_stat
 
 (11) BroadcastExchange
 Input [1]: [cd_demo_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_cdemo_sk#2]
@@ -133,76 +133,76 @@ Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sal
 Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, cd_demo_sk#11]
 
 (14) Scan parquet default.store
-Output [2]: [s_store_sk#16, s_state#17]
+Output [2]: [s_store_sk#15, s_state#16]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [In(s_state, [AL,SD,TN]), IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int,s_state:string>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [2]: [s_store_sk#16, s_state#17]
+Input [2]: [s_store_sk#15, s_state#16]
 
 (16) Filter [codegen id : 3]
-Input [2]: [s_store_sk#16, s_state#17]
-Condition : (s_state#17 IN (TN,AL,SD) AND isnotnull(s_store_sk#16))
+Input [2]: [s_store_sk#15, s_state#16]
+Condition : (s_state#16 IN (TN,AL,SD) AND isnotnull(s_store_sk#15))
 
 (17) BroadcastExchange
-Input [2]: [s_store_sk#16, s_state#17]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18]
+Input [2]: [s_store_sk#15, s_state#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]
 
 (18) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_store_sk#3]
-Right keys [1]: [s_store_sk#16]
+Right keys [1]: [s_store_sk#15]
 Join condition: None
 
 (19) Project [codegen id : 5]
-Output [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#17]
-Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#16, s_state#17]
+Output [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#16]
+Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#15, s_state#16]
 
 (20) Scan parquet default.item
-Output [2]: [i_item_sk#19, i_item_id#20]
+Output [2]: [i_item_sk#17, i_item_id#18]
 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>
 
 (21) ColumnarToRow [codegen id : 4]
-Input [2]: [i_item_sk#19, i_item_id#20]
+Input [2]: [i_item_sk#17, i_item_id#18]
 
 (22) Filter [codegen id : 4]
-Input [2]: [i_item_sk#19, i_item_id#20]
-Condition : isnotnull(i_item_sk#19)
+Input [2]: [i_item_sk#17, i_item_id#18]
+Condition : isnotnull(i_item_sk#17)
 
 (23) BroadcastExchange
-Input [2]: [i_item_sk#19, i_item_id#20]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21]
+Input [2]: [i_item_sk#17, i_item_id#18]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
 
 (24) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_item_sk#1]
-Right keys [1]: [i_item_sk#19]
+Right keys [1]: [i_item_sk#17]
 Join condition: None
 
 (25) Project [codegen id : 5]
-Output [6]: [i_item_id#20, s_state#17, ss_quantity#4 AS agg1#22, ss_list_price#5 AS agg2#23, ss_coupon_amt#7 AS agg3#24, ss_sales_price#6 AS agg4#25]
-Input [8]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#17, i_item_sk#19, i_item_id#20]
+Output [6]: [i_item_id#18, s_state#16, ss_quantity#4 AS agg1#19, ss_list_price#5 AS agg2#20, ss_coupon_amt#7 AS agg3#21, ss_sales_price#6 AS agg4#22]
+Input [8]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#16, i_item_sk#17, i_item_id#18]
 
 (26) HashAggregate [codegen id : 5]
-Input [6]: [i_item_id#20, s_state#17, agg1#22, agg2#23, agg3#24, agg4#25]
-Keys [2]: [i_item_id#20, s_state#17]
-Functions [4]: [partial_avg(agg1#22), partial_avg(UnscaledValue(agg2#23)), partial_avg(UnscaledValue(agg3#24)), partial_avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [8]: [sum#26, count#27, sum#28, count#29, sum#30, count#31, sum#32, count#33]
-Results [10]: [i_item_id#20, s_state#17, sum#34, count#35, sum#36, count#37, sum#38, count#39, sum#40, count#41]
+Input [6]: [i_item_id#18, s_state#16, agg1#19, agg2#20, agg3#21, agg4#22]
+Keys [2]: [i_item_id#18, s_state#16]
+Functions [4]: [partial_avg(agg1#19), partial_avg(UnscaledValue(agg2#20)), partial_avg(UnscaledValue(agg3#21)), partial_avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [8]: [sum#23, count#24, sum#25, count#26, sum#27, count#28, sum#29, count#30]
+Results [10]: [i_item_id#18, s_state#16, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
 
 (27) Exchange
-Input [10]: [i_item_id#20, s_state#17, sum#34, count#35, sum#36, count#37, sum#38, count#39, sum#40, count#41]
-Arguments: hashpartitioning(i_item_id#20, s_state#17, 5), ENSURE_REQUIREMENTS, [id=#42]
+Input [10]: [i_item_id#18, s_state#16, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
+Arguments: hashpartitioning(i_item_id#18, s_state#16, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (28) HashAggregate [codegen id : 6]
-Input [10]: [i_item_id#20, s_state#17, sum#34, count#35, sum#36, count#37, sum#38, count#39, sum#40, count#41]
-Keys [2]: [i_item_id#20, s_state#17]
-Functions [4]: [avg(agg1#22), avg(UnscaledValue(agg2#23)), avg(UnscaledValue(agg3#24)), avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [4]: [avg(agg1#22)#43, avg(UnscaledValue(agg2#23))#44, avg(UnscaledValue(agg3#24))#45, avg(UnscaledValue(agg4#25))#46]
-Results [7]: [i_item_id#20, s_state#17, 0 AS g_state#47, avg(agg1#22)#43 AS agg1#48, cast((avg(UnscaledValue(agg2#23))#44 / 100.0) as decimal(11,6)) AS agg2#49, cast((avg(UnscaledValue(agg3#24))#45 / 100.0) as decimal(11,6)) AS agg3#50, cast((avg(UnscaledValue(agg4#25))#46 / 100.0) as decimal(11,6)) AS agg4#51]
+Input [10]: [i_item_id#18, s_state#16, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
+Keys [2]: [i_item_id#18, s_state#16]
+Functions [4]: [avg(agg1#19), avg(UnscaledValue(agg2#20)), avg(UnscaledValue(agg3#21)), avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [4]: [avg(agg1#19)#39, avg(UnscaledValue(agg2#20))#40, avg(UnscaledValue(agg3#21))#41, avg(UnscaledValue(agg4#22))#42]
+Results [7]: [i_item_id#18, s_state#16, 0 AS g_state#43, avg(agg1#19)#39 AS agg1#44, cast((avg(UnscaledValue(agg2#20))#40 / 100.0) as decimal(11,6)) AS agg2#45, cast((avg(UnscaledValue(agg3#21))#41 / 100.0) as decimal(11,6)) AS agg3#46, cast((avg(UnscaledValue(agg4#22))#42 / 100.0) as decimal(11,6)) AS agg4#47]
 
 (29) Scan parquet default.store_sales
 Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8]
@@ -232,35 +232,35 @@ Output [7]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_
 Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#10]
 
 (35) Scan parquet default.store
-Output [2]: [s_store_sk#16, s_state#17]
+Output [2]: [s_store_sk#15, s_state#16]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [In(s_state, [AL,SD,TN]), IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int,s_state:string>
 
 (36) ColumnarToRow [codegen id : 8]
-Input [2]: [s_store_sk#16, s_state#17]
+Input [2]: [s_store_sk#15, s_state#16]
 
 (37) Filter [codegen id : 8]
-Input [2]: [s_store_sk#16, s_state#17]
-Condition : (s_state#17 IN (TN,AL,SD) AND isnotnull(s_store_sk#16))
+Input [2]: [s_store_sk#15, s_state#16]
+Condition : (s_state#16 IN (TN,AL,SD) AND isnotnull(s_store_sk#15))
 
 (38) Project [codegen id : 8]
-Output [1]: [s_store_sk#16]
-Input [2]: [s_store_sk#16, s_state#17]
+Output [1]: [s_store_sk#15]
+Input [2]: [s_store_sk#15, s_state#16]
 
 (39) BroadcastExchange
-Input [1]: [s_store_sk#16]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#52]
+Input [1]: [s_store_sk#15]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 (40) BroadcastHashJoin [codegen id : 11]
 Left keys [1]: [ss_store_sk#3]
-Right keys [1]: [s_store_sk#16]
+Right keys [1]: [s_store_sk#15]
 Join condition: None
 
 (41) Project [codegen id : 11]
 Output [6]: [ss_item_sk#1, ss_cdemo_sk#2, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7]
-Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#16]
+Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#15]
 
 (42) ReusedExchange [Reuses operator id: 11]
 Output [1]: [cd_demo_sk#11]
@@ -275,34 +275,34 @@ Output [5]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_
 Input [7]: [ss_item_sk#1, ss_cdemo_sk#2, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, cd_demo_sk#11]
 
 (45) ReusedExchange [Reuses operator id: 23]
-Output [2]: [i_item_sk#19, i_item_id#20]
+Output [2]: [i_item_sk#17, i_item_id#18]
 
 (46) BroadcastHashJoin [codegen id : 11]
 Left keys [1]: [ss_item_sk#1]
-Right keys [1]: [i_item_sk#19]
+Right keys [1]: [i_item_sk#17]
 Join condition: None
 
 (47) Project [codegen id : 11]
-Output [5]: [i_item_id#20, ss_quantity#4 AS agg1#22, ss_list_price#5 AS agg2#23, ss_coupon_amt#7 AS agg3#24, ss_sales_price#6 AS agg4#25]
-Input [7]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#19, i_item_id#20]
+Output [5]: [i_item_id#18, ss_quantity#4 AS agg1#19, ss_list_price#5 AS agg2#20, ss_coupon_amt#7 AS agg3#21, ss_sales_price#6 AS agg4#22]
+Input [7]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#17, i_item_id#18]
 
 (48) HashAggregate [codegen id : 11]
-Input [5]: [i_item_id#20, agg1#22, agg2#23, agg3#24, agg4#25]
-Keys [1]: [i_item_id#20]
-Functions [4]: [partial_avg(agg1#22), partial_avg(UnscaledValue(agg2#23)), partial_avg(UnscaledValue(agg3#24)), partial_avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [8]: [sum#53, count#54, sum#55, count#56, sum#57, count#58, sum#59, count#60]
-Results [9]: [i_item_id#20, sum#61, count#62, sum#63, count#64, sum#65, count#66, sum#67, count#68]
+Input [5]: [i_item_id#18, agg1#19, agg2#20, agg3#21, agg4#22]
+Keys [1]: [i_item_id#18]
+Functions [4]: [partial_avg(agg1#19), partial_avg(UnscaledValue(agg2#20)), partial_avg(UnscaledValue(agg3#21)), partial_avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [8]: [sum#48, count#49, sum#50, count#51, sum#52, count#53, sum#54, count#55]
+Results [9]: [i_item_id#18, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63]
 
 (49) Exchange
-Input [9]: [i_item_id#20, sum#61, count#62, sum#63, count#64, sum#65, count#66, sum#67, count#68]
-Arguments: hashpartitioning(i_item_id#20, 5), ENSURE_REQUIREMENTS, [id=#69]
+Input [9]: [i_item_id#18, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63]
+Arguments: hashpartitioning(i_item_id#18, 5), ENSURE_REQUIREMENTS, [plan_id=6]
 
 (50) HashAggregate [codegen id : 12]
-Input [9]: [i_item_id#20, sum#61, count#62, sum#63, count#64, sum#65, count#66, sum#67, count#68]
-Keys [1]: [i_item_id#20]
-Functions [4]: [avg(agg1#22), avg(UnscaledValue(agg2#23)), avg(UnscaledValue(agg3#24)), avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [4]: [avg(agg1#22)#70, avg(UnscaledValue(agg2#23))#71, avg(UnscaledValue(agg3#24))#72, avg(UnscaledValue(agg4#25))#73]
-Results [7]: [i_item_id#20, null AS s_state#74, 1 AS g_state#75, avg(agg1#22)#70 AS agg1#76, cast((avg(UnscaledValue(agg2#23))#71 / 100.0) as decimal(11,6)) AS agg2#77, cast((avg(UnscaledValue(agg3#24))#72 / 100.0) as decimal(11,6)) AS agg3#78, cast((avg(UnscaledValue(agg4#25))#73 / 100.0) as decimal(11,6)) AS agg4#79]
+Input [9]: [i_item_id#18, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63]
+Keys [1]: [i_item_id#18]
+Functions [4]: [avg(agg1#19), avg(UnscaledValue(agg2#20)), avg(UnscaledValue(agg3#21)), avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [4]: [avg(agg1#19)#64, avg(UnscaledValue(agg2#20))#65, avg(UnscaledValue(agg3#21))#66, avg(UnscaledValue(agg4#22))#67]
+Results [7]: [i_item_id#18, null AS s_state#68, 1 AS g_state#69, avg(agg1#19)#64 AS agg1#70, cast((avg(UnscaledValue(agg2#20))#65 / 100.0) as decimal(11,6)) AS agg2#71, cast((avg(UnscaledValue(agg3#21))#66 / 100.0) as decimal(11,6)) AS agg3#72, cast((avg(UnscaledValue(agg4#22))#67 / 100.0) as decimal(11,6)) AS agg4#73]
 
 (51) Scan parquet default.store_sales
 Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8]
@@ -332,16 +332,16 @@ Output [7]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_
 Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#10]
 
 (57) ReusedExchange [Reuses operator id: 39]
-Output [1]: [s_store_sk#16]
+Output [1]: [s_store_sk#15]
 
 (58) BroadcastHashJoin [codegen id : 17]
 Left keys [1]: [ss_store_sk#3]
-Right keys [1]: [s_store_sk#16]
+Right keys [1]: [s_store_sk#15]
 Join condition: None
 
 (59) Project [codegen id : 17]
 Output [6]: [ss_item_sk#1, ss_cdemo_sk#2, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7]
-Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#16]
+Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#15]
 
 (60) ReusedExchange [Reuses operator id: 11]
 Output [1]: [cd_demo_sk#11]
@@ -356,55 +356,55 @@ Output [5]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_
 Input [7]: [ss_item_sk#1, ss_cdemo_sk#2, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, cd_demo_sk#11]
 
 (63) Scan parquet default.item
-Output [1]: [i_item_sk#19]
+Output [1]: [i_item_sk#17]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [IsNotNull(i_item_sk)]
 ReadSchema: struct<i_item_sk:int>
 
 (64) ColumnarToRow [codegen id : 16]
-Input [1]: [i_item_sk#19]
+Input [1]: [i_item_sk#17]
 
 (65) Filter [codegen id : 16]
-Input [1]: [i_item_sk#19]
-Condition : isnotnull(i_item_sk#19)
+Input [1]: [i_item_sk#17]
+Condition : isnotnull(i_item_sk#17)
 
 (66) BroadcastExchange
-Input [1]: [i_item_sk#19]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#80]
+Input [1]: [i_item_sk#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=7]
 
 (67) BroadcastHashJoin [codegen id : 17]
 Left keys [1]: [ss_item_sk#1]
-Right keys [1]: [i_item_sk#19]
+Right keys [1]: [i_item_sk#17]
 Join condition: None
 
 (68) Project [codegen id : 17]
-Output [4]: [ss_quantity#4 AS agg1#22, ss_list_price#5 AS agg2#23, ss_coupon_amt#7 AS agg3#24, ss_sales_price#6 AS agg4#25]
-Input [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#19]
+Output [4]: [ss_quantity#4 AS agg1#19, ss_list_price#5 AS agg2#20, ss_coupon_amt#7 AS agg3#21, ss_sales_price#6 AS agg4#22]
+Input [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#17]
 
 (69) HashAggregate [codegen id : 17]
-Input [4]: [agg1#22, agg2#23, agg3#24, agg4#25]
+Input [4]: [agg1#19, agg2#20, agg3#21, agg4#22]
 Keys: []
-Functions [4]: [partial_avg(agg1#22), partial_avg(UnscaledValue(agg2#23)), partial_avg(UnscaledValue(agg3#24)), partial_avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [8]: [sum#81, count#82, sum#83, count#84, sum#85, count#86, sum#87, count#88]
-Results [8]: [sum#89, count#90, sum#91, count#92, sum#93, count#94, sum#95, count#96]
+Functions [4]: [partial_avg(agg1#19), partial_avg(UnscaledValue(agg2#20)), partial_avg(UnscaledValue(agg3#21)), partial_avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [8]: [sum#74, count#75, sum#76, count#77, sum#78, count#79, sum#80, count#81]
+Results [8]: [sum#82, count#83, sum#84, count#85, sum#86, count#87, sum#88, count#89]
 
 (70) Exchange
-Input [8]: [sum#89, count#90, sum#91, count#92, sum#93, count#94, sum#95, count#96]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#97]
+Input [8]: [sum#82, count#83, sum#84, count#85, sum#86, count#87, sum#88, count#89]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=8]
 
 (71) HashAggregate [codegen id : 18]
-Input [8]: [sum#89, count#90, sum#91, count#92, sum#93, count#94, sum#95, count#96]
+Input [8]: [sum#82, count#83, sum#84, count#85, sum#86, count#87, sum#88, count#89]
 Keys: []
-Functions [4]: [avg(agg1#22), avg(UnscaledValue(agg2#23)), avg(UnscaledValue(agg3#24)), avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [4]: [avg(agg1#22)#98, avg(UnscaledValue(agg2#23))#99, avg(UnscaledValue(agg3#24))#100, avg(UnscaledValue(agg4#25))#101]
-Results [7]: [null AS i_item_id#102, null AS s_state#103, 1 AS g_state#104, avg(agg1#22)#98 AS agg1#105, cast((avg(UnscaledValue(agg2#23))#99 / 100.0) as decimal(11,6)) AS agg2#106, cast((avg(UnscaledValue(agg3#24))#100 / 100.0) as decimal(11,6)) AS agg3#107, cast((avg(UnscaledValue(agg4#25))#101 / 100.0) as decimal(11,6)) AS agg4#108]
+Functions [4]: [avg(agg1#19), avg(UnscaledValue(agg2#20)), avg(UnscaledValue(agg3#21)), avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [4]: [avg(agg1#19)#90, avg(UnscaledValue(agg2#20))#91, avg(UnscaledValue(agg3#21))#92, avg(UnscaledValue(agg4#22))#93]
+Results [7]: [null AS i_item_id#94, null AS s_state#95, 1 AS g_state#96, avg(agg1#19)#90 AS agg1#97, cast((avg(UnscaledValue(agg2#20))#91 / 100.0) as decimal(11,6)) AS agg2#98, cast((avg(UnscaledValue(agg3#21))#92 / 100.0) as decimal(11,6)) AS agg3#99, cast((avg(UnscaledValue(agg4#22))#93 / 100.0) as decimal(11,6)) AS agg4#100]
 
 (72) Union
 
 (73) TakeOrderedAndProject
-Input [7]: [i_item_id#20, s_state#17, g_state#47, agg1#48, agg2#49, agg3#50, agg4#51]
-Arguments: 100, [i_item_id#20 ASC NULLS FIRST, s_state#17 ASC NULLS FIRST], [i_item_id#20, s_state#17, g_state#47, agg1#48, agg2#49, agg3#50, agg4#51]
+Input [7]: [i_item_id#18, s_state#16, g_state#43, agg1#44, agg2#45, agg3#46, agg4#47]
+Arguments: 100, [i_item_id#18 ASC NULLS FIRST, s_state#16 ASC NULLS FIRST], [i_item_id#18, s_state#16, g_state#43, agg1#44, agg2#45, agg3#46, agg4#47]
 
 ===== Subqueries =====
 
@@ -417,26 +417,26 @@ BroadcastExchange (78)
 
 
 (74) Scan parquet default.date_dim
-Output [2]: [d_date_sk#10, d_year#109]
+Output [2]: [d_date_sk#10, d_year#101]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), GreaterThanOrEqual(d_date_sk,2451545), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int>
 
 (75) ColumnarToRow [codegen id : 1]
-Input [2]: [d_date_sk#10, d_year#109]
+Input [2]: [d_date_sk#10, d_year#101]
 
 (76) Filter [codegen id : 1]
-Input [2]: [d_date_sk#10, d_year#109]
-Condition : ((((isnotnull(d_year#109) AND (d_year#109 = 2000)) AND (d_date_sk#10 >= 2451545)) AND (d_date_sk#10 <= 2451910)) AND isnotnull(d_date_sk#10))
+Input [2]: [d_date_sk#10, d_year#101]
+Condition : ((((isnotnull(d_year#101) AND (d_year#101 = 2000)) AND (d_date_sk#10 >= 2451545)) AND (d_date_sk#10 <= 2451910)) AND isnotnull(d_date_sk#10))
 
 (77) Project [codegen id : 1]
 Output [1]: [d_date_sk#10]
-Input [2]: [d_date_sk#10, d_year#109]
+Input [2]: [d_date_sk#10, d_year#101]
 
 (78) BroadcastExchange
 Input [1]: [d_date_sk#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#110]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=9]
 
 Subquery:2 Hosting operator id = 29 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt
index 0fe719015aa..c181d2097b5 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt
@@ -109,7 +109,7 @@ Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_stat
 
 (8) BroadcastExchange
 Input [1]: [cd_demo_sk#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (9) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_cdemo_sk#2]
@@ -121,88 +121,88 @@ Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sal
 Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10]
 
 (11) ReusedExchange [Reuses operator id: 78]
-Output [1]: [d_date_sk#15]
+Output [1]: [d_date_sk#14]
 
 (12) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_sold_date_sk#8]
-Right keys [1]: [d_date_sk#15]
+Right keys [1]: [d_date_sk#14]
 Join condition: None
 
 (13) Project [codegen id : 5]
 Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7]
-Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#15]
+Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#14]
 
 (14) Scan parquet default.store
-Output [2]: [s_store_sk#16, s_state#17]
+Output [2]: [s_store_sk#15, s_state#16]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [In(s_state, [AL,SD,TN]), IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int,s_state:string>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [2]: [s_store_sk#16, s_state#17]
+Input [2]: [s_store_sk#15, s_state#16]
 
 (16) Filter [codegen id : 3]
-Input [2]: [s_store_sk#16, s_state#17]
-Condition : (s_state#17 IN (TN,AL,SD) AND isnotnull(s_store_sk#16))
+Input [2]: [s_store_sk#15, s_state#16]
+Condition : (s_state#16 IN (TN,AL,SD) AND isnotnull(s_store_sk#15))
 
 (17) BroadcastExchange
-Input [2]: [s_store_sk#16, s_state#17]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18]
+Input [2]: [s_store_sk#15, s_state#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]
 
 (18) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_store_sk#3]
-Right keys [1]: [s_store_sk#16]
+Right keys [1]: [s_store_sk#15]
 Join condition: None
 
 (19) Project [codegen id : 5]
-Output [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#17]
-Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#16, s_state#17]
+Output [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#16]
+Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#15, s_state#16]
 
 (20) Scan parquet default.item
-Output [2]: [i_item_sk#19, i_item_id#20]
+Output [2]: [i_item_sk#17, i_item_id#18]
 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>
 
 (21) ColumnarToRow [codegen id : 4]
-Input [2]: [i_item_sk#19, i_item_id#20]
+Input [2]: [i_item_sk#17, i_item_id#18]
 
 (22) Filter [codegen id : 4]
-Input [2]: [i_item_sk#19, i_item_id#20]
-Condition : isnotnull(i_item_sk#19)
+Input [2]: [i_item_sk#17, i_item_id#18]
+Condition : isnotnull(i_item_sk#17)
 
 (23) BroadcastExchange
-Input [2]: [i_item_sk#19, i_item_id#20]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21]
+Input [2]: [i_item_sk#17, i_item_id#18]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
 
 (24) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_item_sk#1]
-Right keys [1]: [i_item_sk#19]
+Right keys [1]: [i_item_sk#17]
 Join condition: None
 
 (25) Project [codegen id : 5]
-Output [6]: [i_item_id#20, s_state#17, ss_quantity#4 AS agg1#22, ss_list_price#5 AS agg2#23, ss_coupon_amt#7 AS agg3#24, ss_sales_price#6 AS agg4#25]
-Input [8]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#17, i_item_sk#19, i_item_id#20]
+Output [6]: [i_item_id#18, s_state#16, ss_quantity#4 AS agg1#19, ss_list_price#5 AS agg2#20, ss_coupon_amt#7 AS agg3#21, ss_sales_price#6 AS agg4#22]
+Input [8]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#16, i_item_sk#17, i_item_id#18]
 
 (26) HashAggregate [codegen id : 5]
-Input [6]: [i_item_id#20, s_state#17, agg1#22, agg2#23, agg3#24, agg4#25]
-Keys [2]: [i_item_id#20, s_state#17]
-Functions [4]: [partial_avg(agg1#22), partial_avg(UnscaledValue(agg2#23)), partial_avg(UnscaledValue(agg3#24)), partial_avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [8]: [sum#26, count#27, sum#28, count#29, sum#30, count#31, sum#32, count#33]
-Results [10]: [i_item_id#20, s_state#17, sum#34, count#35, sum#36, count#37, sum#38, count#39, sum#40, count#41]
+Input [6]: [i_item_id#18, s_state#16, agg1#19, agg2#20, agg3#21, agg4#22]
+Keys [2]: [i_item_id#18, s_state#16]
+Functions [4]: [partial_avg(agg1#19), partial_avg(UnscaledValue(agg2#20)), partial_avg(UnscaledValue(agg3#21)), partial_avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [8]: [sum#23, count#24, sum#25, count#26, sum#27, count#28, sum#29, count#30]
+Results [10]: [i_item_id#18, s_state#16, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
 
 (27) Exchange
-Input [10]: [i_item_id#20, s_state#17, sum#34, count#35, sum#36, count#37, sum#38, count#39, sum#40, count#41]
-Arguments: hashpartitioning(i_item_id#20, s_state#17, 5), ENSURE_REQUIREMENTS, [id=#42]
+Input [10]: [i_item_id#18, s_state#16, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
+Arguments: hashpartitioning(i_item_id#18, s_state#16, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (28) HashAggregate [codegen id : 6]
-Input [10]: [i_item_id#20, s_state#17, sum#34, count#35, sum#36, count#37, sum#38, count#39, sum#40, count#41]
-Keys [2]: [i_item_id#20, s_state#17]
-Functions [4]: [avg(agg1#22), avg(UnscaledValue(agg2#23)), avg(UnscaledValue(agg3#24)), avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [4]: [avg(agg1#22)#43, avg(UnscaledValue(agg2#23))#44, avg(UnscaledValue(agg3#24))#45, avg(UnscaledValue(agg4#25))#46]
-Results [7]: [i_item_id#20, s_state#17, 0 AS g_state#47, avg(agg1#22)#43 AS agg1#48, cast((avg(UnscaledValue(agg2#23))#44 / 100.0) as decimal(11,6)) AS agg2#49, cast((avg(UnscaledValue(agg3#24))#45 / 100.0) as decimal(11,6)) AS agg3#50, cast((avg(UnscaledValue(agg4#25))#46 / 100.0) as decimal(11,6)) AS agg4#51]
+Input [10]: [i_item_id#18, s_state#16, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
+Keys [2]: [i_item_id#18, s_state#16]
+Functions [4]: [avg(agg1#19), avg(UnscaledValue(agg2#20)), avg(UnscaledValue(agg3#21)), avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [4]: [avg(agg1#19)#39, avg(UnscaledValue(agg2#20))#40, avg(UnscaledValue(agg3#21))#41, avg(UnscaledValue(agg4#22))#42]
+Results [7]: [i_item_id#18, s_state#16, 0 AS g_state#43, avg(agg1#19)#39 AS agg1#44, cast((avg(UnscaledValue(agg2#20))#40 / 100.0) as decimal(11,6)) AS agg2#45, cast((avg(UnscaledValue(agg3#21))#41 / 100.0) as decimal(11,6)) AS agg3#46, cast((avg(UnscaledValue(agg4#22))#42 / 100.0) as decimal(11,6)) AS agg4#47]
 
 (29) Scan parquet default.store_sales
 Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8]
@@ -232,77 +232,77 @@ Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sal
 Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10]
 
 (35) ReusedExchange [Reuses operator id: 78]
-Output [1]: [d_date_sk#15]
+Output [1]: [d_date_sk#14]
 
 (36) BroadcastHashJoin [codegen id : 11]
 Left keys [1]: [ss_sold_date_sk#8]
-Right keys [1]: [d_date_sk#15]
+Right keys [1]: [d_date_sk#14]
 Join condition: None
 
 (37) Project [codegen id : 11]
 Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7]
-Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#15]
+Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#14]
 
 (38) Scan parquet default.store
-Output [2]: [s_store_sk#16, s_state#17]
+Output [2]: [s_store_sk#15, s_state#16]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [In(s_state, [AL,SD,TN]), IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int,s_state:string>
 
 (39) ColumnarToRow [codegen id : 9]
-Input [2]: [s_store_sk#16, s_state#17]
+Input [2]: [s_store_sk#15, s_state#16]
 
 (40) Filter [codegen id : 9]
-Input [2]: [s_store_sk#16, s_state#17]
-Condition : (s_state#17 IN (TN,AL,SD) AND isnotnull(s_store_sk#16))
+Input [2]: [s_store_sk#15, s_state#16]
+Condition : (s_state#16 IN (TN,AL,SD) AND isnotnull(s_store_sk#15))
 
 (41) Project [codegen id : 9]
-Output [1]: [s_store_sk#16]
-Input [2]: [s_store_sk#16, s_state#17]
+Output [1]: [s_store_sk#15]
+Input [2]: [s_store_sk#15, s_state#16]
 
 (42) BroadcastExchange
-Input [1]: [s_store_sk#16]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#52]
+Input [1]: [s_store_sk#15]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 (43) BroadcastHashJoin [codegen id : 11]
 Left keys [1]: [ss_store_sk#3]
-Right keys [1]: [s_store_sk#16]
+Right keys [1]: [s_store_sk#15]
 Join condition: None
 
 (44) Project [codegen id : 11]
 Output [5]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7]
-Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#16]
+Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#15]
 
 (45) ReusedExchange [Reuses operator id: 23]
-Output [2]: [i_item_sk#19, i_item_id#20]
+Output [2]: [i_item_sk#17, i_item_id#18]
 
 (46) BroadcastHashJoin [codegen id : 11]
 Left keys [1]: [ss_item_sk#1]
-Right keys [1]: [i_item_sk#19]
+Right keys [1]: [i_item_sk#17]
 Join condition: None
 
 (47) Project [codegen id : 11]
-Output [5]: [i_item_id#20, ss_quantity#4 AS agg1#22, ss_list_price#5 AS agg2#23, ss_coupon_amt#7 AS agg3#24, ss_sales_price#6 AS agg4#25]
-Input [7]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#19, i_item_id#20]
+Output [5]: [i_item_id#18, ss_quantity#4 AS agg1#19, ss_list_price#5 AS agg2#20, ss_coupon_amt#7 AS agg3#21, ss_sales_price#6 AS agg4#22]
+Input [7]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#17, i_item_id#18]
 
 (48) HashAggregate [codegen id : 11]
-Input [5]: [i_item_id#20, agg1#22, agg2#23, agg3#24, agg4#25]
-Keys [1]: [i_item_id#20]
-Functions [4]: [partial_avg(agg1#22), partial_avg(UnscaledValue(agg2#23)), partial_avg(UnscaledValue(agg3#24)), partial_avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [8]: [sum#53, count#54, sum#55, count#56, sum#57, count#58, sum#59, count#60]
-Results [9]: [i_item_id#20, sum#61, count#62, sum#63, count#64, sum#65, count#66, sum#67, count#68]
+Input [5]: [i_item_id#18, agg1#19, agg2#20, agg3#21, agg4#22]
+Keys [1]: [i_item_id#18]
+Functions [4]: [partial_avg(agg1#19), partial_avg(UnscaledValue(agg2#20)), partial_avg(UnscaledValue(agg3#21)), partial_avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [8]: [sum#48, count#49, sum#50, count#51, sum#52, count#53, sum#54, count#55]
+Results [9]: [i_item_id#18, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63]
 
 (49) Exchange
-Input [9]: [i_item_id#20, sum#61, count#62, sum#63, count#64, sum#65, count#66, sum#67, count#68]
-Arguments: hashpartitioning(i_item_id#20, 5), ENSURE_REQUIREMENTS, [id=#69]
+Input [9]: [i_item_id#18, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63]
+Arguments: hashpartitioning(i_item_id#18, 5), ENSURE_REQUIREMENTS, [plan_id=6]
 
 (50) HashAggregate [codegen id : 12]
-Input [9]: [i_item_id#20, sum#61, count#62, sum#63, count#64, sum#65, count#66, sum#67, count#68]
-Keys [1]: [i_item_id#20]
-Functions [4]: [avg(agg1#22), avg(UnscaledValue(agg2#23)), avg(UnscaledValue(agg3#24)), avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [4]: [avg(agg1#22)#70, avg(UnscaledValue(agg2#23))#71, avg(UnscaledValue(agg3#24))#72, avg(UnscaledValue(agg4#25))#73]
-Results [7]: [i_item_id#20, null AS s_state#74, 1 AS g_state#75, avg(agg1#22)#70 AS agg1#76, cast((avg(UnscaledValue(agg2#23))#71 / 100.0) as decimal(11,6)) AS agg2#77, cast((avg(UnscaledValue(agg3#24))#72 / 100.0) as decimal(11,6)) AS agg3#78, cast((avg(UnscaledValue(agg4#25))#73 / 100.0) as decimal(11,6)) AS agg4#79]
+Input [9]: [i_item_id#18, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63]
+Keys [1]: [i_item_id#18]
+Functions [4]: [avg(agg1#19), avg(UnscaledValue(agg2#20)), avg(UnscaledValue(agg3#21)), avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [4]: [avg(agg1#19)#64, avg(UnscaledValue(agg2#20))#65, avg(UnscaledValue(agg3#21))#66, avg(UnscaledValue(agg4#22))#67]
+Results [7]: [i_item_id#18, null AS s_state#68, 1 AS g_state#69, avg(agg1#19)#64 AS agg1#70, cast((avg(UnscaledValue(agg2#20))#65 / 100.0) as decimal(11,6)) AS agg2#71, cast((avg(UnscaledValue(agg3#21))#66 / 100.0) as decimal(11,6)) AS agg3#72, cast((avg(UnscaledValue(agg4#22))#67 / 100.0) as decimal(11,6)) AS agg4#73]
 
 (51) Scan parquet default.store_sales
 Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8]
@@ -332,79 +332,79 @@ Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sal
 Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10]
 
 (57) ReusedExchange [Reuses operator id: 78]
-Output [1]: [d_date_sk#15]
+Output [1]: [d_date_sk#14]
 
 (58) BroadcastHashJoin [codegen id : 17]
 Left keys [1]: [ss_sold_date_sk#8]
-Right keys [1]: [d_date_sk#15]
+Right keys [1]: [d_date_sk#14]
 Join condition: None
 
 (59) Project [codegen id : 17]
 Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7]
-Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#15]
+Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#14]
 
 (60) ReusedExchange [Reuses operator id: 42]
-Output [1]: [s_store_sk#16]
+Output [1]: [s_store_sk#15]
 
 (61) BroadcastHashJoin [codegen id : 17]
 Left keys [1]: [ss_store_sk#3]
-Right keys [1]: [s_store_sk#16]
+Right keys [1]: [s_store_sk#15]
 Join condition: None
 
 (62) Project [codegen id : 17]
 Output [5]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7]
-Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#16]
+Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#15]
 
 (63) Scan parquet default.item
-Output [1]: [i_item_sk#19]
+Output [1]: [i_item_sk#17]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [IsNotNull(i_item_sk)]
 ReadSchema: struct<i_item_sk:int>
 
 (64) ColumnarToRow [codegen id : 16]
-Input [1]: [i_item_sk#19]
+Input [1]: [i_item_sk#17]
 
 (65) Filter [codegen id : 16]
-Input [1]: [i_item_sk#19]
-Condition : isnotnull(i_item_sk#19)
+Input [1]: [i_item_sk#17]
+Condition : isnotnull(i_item_sk#17)
 
 (66) BroadcastExchange
-Input [1]: [i_item_sk#19]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#80]
+Input [1]: [i_item_sk#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=7]
 
 (67) BroadcastHashJoin [codegen id : 17]
 Left keys [1]: [ss_item_sk#1]
-Right keys [1]: [i_item_sk#19]
+Right keys [1]: [i_item_sk#17]
 Join condition: None
 
 (68) Project [codegen id : 17]
-Output [4]: [ss_quantity#4 AS agg1#22, ss_list_price#5 AS agg2#23, ss_coupon_amt#7 AS agg3#24, ss_sales_price#6 AS agg4#25]
-Input [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#19]
+Output [4]: [ss_quantity#4 AS agg1#19, ss_list_price#5 AS agg2#20, ss_coupon_amt#7 AS agg3#21, ss_sales_price#6 AS agg4#22]
+Input [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#17]
 
 (69) HashAggregate [codegen id : 17]
-Input [4]: [agg1#22, agg2#23, agg3#24, agg4#25]
+Input [4]: [agg1#19, agg2#20, agg3#21, agg4#22]
 Keys: []
-Functions [4]: [partial_avg(agg1#22), partial_avg(UnscaledValue(agg2#23)), partial_avg(UnscaledValue(agg3#24)), partial_avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [8]: [sum#81, count#82, sum#83, count#84, sum#85, count#86, sum#87, count#88]
-Results [8]: [sum#89, count#90, sum#91, count#92, sum#93, count#94, sum#95, count#96]
+Functions [4]: [partial_avg(agg1#19), partial_avg(UnscaledValue(agg2#20)), partial_avg(UnscaledValue(agg3#21)), partial_avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [8]: [sum#74, count#75, sum#76, count#77, sum#78, count#79, sum#80, count#81]
+Results [8]: [sum#82, count#83, sum#84, count#85, sum#86, count#87, sum#88, count#89]
 
 (70) Exchange
-Input [8]: [sum#89, count#90, sum#91, count#92, sum#93, count#94, sum#95, count#96]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#97]
+Input [8]: [sum#82, count#83, sum#84, count#85, sum#86, count#87, sum#88, count#89]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=8]
 
 (71) HashAggregate [codegen id : 18]
-Input [8]: [sum#89, count#90, sum#91, count#92, sum#93, count#94, sum#95, count#96]
+Input [8]: [sum#82, count#83, sum#84, count#85, sum#86, count#87, sum#88, count#89]
 Keys: []
-Functions [4]: [avg(agg1#22), avg(UnscaledValue(agg2#23)), avg(UnscaledValue(agg3#24)), avg(UnscaledValue(agg4#25))]
-Aggregate Attributes [4]: [avg(agg1#22)#98, avg(UnscaledValue(agg2#23))#99, avg(UnscaledValue(agg3#24))#100, avg(UnscaledValue(agg4#25))#101]
-Results [7]: [null AS i_item_id#102, null AS s_state#103, 1 AS g_state#104, avg(agg1#22)#98 AS agg1#105, cast((avg(UnscaledValue(agg2#23))#99 / 100.0) as decimal(11,6)) AS agg2#106, cast((avg(UnscaledValue(agg3#24))#100 / 100.0) as decimal(11,6)) AS agg3#107, cast((avg(UnscaledValue(agg4#25))#101 / 100.0) as decimal(11,6)) AS agg4#108]
+Functions [4]: [avg(agg1#19), avg(UnscaledValue(agg2#20)), avg(UnscaledValue(agg3#21)), avg(UnscaledValue(agg4#22))]
+Aggregate Attributes [4]: [avg(agg1#19)#90, avg(UnscaledValue(agg2#20))#91, avg(UnscaledValue(agg3#21))#92, avg(UnscaledValue(agg4#22))#93]
+Results [7]: [null AS i_item_id#94, null AS s_state#95, 1 AS g_state#96, avg(agg1#19)#90 AS agg1#97, cast((avg(UnscaledValue(agg2#20))#91 / 100.0) as decimal(11,6)) AS agg2#98, cast((avg(UnscaledValue(agg3#21))#92 / 100.0) as decimal(11,6)) AS agg3#99, cast((avg(UnscaledValue(agg4#22))#93 / 100.0) as decimal(11,6)) AS agg4#100]
 
 (72) Union
 
 (73) TakeOrderedAndProject
-Input [7]: [i_item_id#20, s_state#17, g_state#47, agg1#48, agg2#49, agg3#50, agg4#51]
-Arguments: 100, [i_item_id#20 ASC NULLS FIRST, s_state#17 ASC NULLS FIRST], [i_item_id#20, s_state#17, g_state#47, agg1#48, agg2#49, agg3#50, agg4#51]
+Input [7]: [i_item_id#18, s_state#16, g_state#43, agg1#44, agg2#45, agg3#46, agg4#47]
+Arguments: 100, [i_item_id#18 ASC NULLS FIRST, s_state#16 ASC NULLS FIRST], [i_item_id#18, s_state#16, g_state#43, agg1#44, agg2#45, agg3#46, agg4#47]
 
 ===== Subqueries =====
 
@@ -417,26 +417,26 @@ BroadcastExchange (78)
 
 
 (74) Scan parquet default.date_dim
-Output [2]: [d_date_sk#15, d_year#109]
+Output [2]: [d_date_sk#14, d_year#101]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), GreaterThanOrEqual(d_date_sk,2451545), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int>
 
 (75) ColumnarToRow [codegen id : 1]
-Input [2]: [d_date_sk#15, d_year#109]
+Input [2]: [d_date_sk#14, d_year#101]
 
 (76) Filter [codegen id : 1]
-Input [2]: [d_date_sk#15, d_year#109]
-Condition : ((((isnotnull(d_year#109) AND (d_year#109 = 2000)) AND (d_date_sk#15 >= 2451545)) AND (d_date_sk#15 <= 2451910)) AND isnotnull(d_date_sk#15))
+Input [2]: [d_date_sk#14, d_year#101]
+Condition : ((((isnotnull(d_year#101) AND (d_year#101 = 2000)) AND (d_date_sk#14 >= 2451545)) AND (d_date_sk#14 <= 2451910)) AND isnotnull(d_date_sk#14))
 
 (77) Project [codegen id : 1]
-Output [1]: [d_date_sk#15]
-Input [2]: [d_date_sk#15, d_year#109]
+Output [1]: [d_date_sk#14]
+Input [2]: [d_date_sk#14, d_year#101]
 
 (78) BroadcastExchange
-Input [1]: [d_date_sk#15]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#110]
+Input [1]: [d_date_sk#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=9]
 
 Subquery:2 Hosting operator id = 29 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt
index 36258b96121..2878785c174 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt
@@ -53,7 +53,7 @@ Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manufact_id#8]
 
 (8) BroadcastExchange
 Input [3]: [i_item_sk#5, i_brand_id#6, i_brand#7]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (9) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [ss_item_sk#1]
@@ -65,38 +65,38 @@ Output [4]: [ss_net_profit#2, ss_sold_date_sk#3, i_brand_id#6, i_brand#7]
 Input [6]: [ss_item_sk#1, ss_net_profit#2, ss_sold_date_sk#3, i_item_sk#5, i_brand_id#6, i_brand#7]
 
 (11) ReusedExchange [Reuses operator id: 22]
-Output [2]: [d_date_sk#10, d_year#11]
+Output [2]: [d_date_sk#9, d_year#10]
 
 (12) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [ss_sold_date_sk#3]
-Right keys [1]: [d_date_sk#10]
+Right keys [1]: [d_date_sk#9]
 Join condition: None
 
 (13) Project [codegen id : 3]
-Output [4]: [d_year#11, ss_net_profit#2, i_brand_id#6, i_brand#7]
-Input [6]: [ss_net_profit#2, ss_sold_date_sk#3, i_brand_id#6, i_brand#7, d_date_sk#10, d_year#11]
+Output [4]: [d_year#10, ss_net_profit#2, i_brand_id#6, i_brand#7]
+Input [6]: [ss_net_profit#2, ss_sold_date_sk#3, i_brand_id#6, i_brand#7, d_date_sk#9, d_year#10]
 
 (14) HashAggregate [codegen id : 3]
-Input [4]: [d_year#11, ss_net_profit#2, i_brand_id#6, i_brand#7]
-Keys [3]: [d_year#11, i_brand#7, i_brand_id#6]
+Input [4]: [d_year#10, ss_net_profit#2, i_brand_id#6, i_brand#7]
+Keys [3]: [d_year#10, i_brand#7, i_brand_id#6]
 Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#2))]
-Aggregate Attributes [1]: [sum#12]
-Results [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#13]
+Aggregate Attributes [1]: [sum#11]
+Results [4]: [d_year#10, i_brand#7, i_brand_id#6, sum#12]
 
 (15) Exchange
-Input [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#13]
-Arguments: hashpartitioning(d_year#11, i_brand#7, i_brand_id#6, 5), ENSURE_REQUIREMENTS, [id=#14]
+Input [4]: [d_year#10, i_brand#7, i_brand_id#6, sum#12]
+Arguments: hashpartitioning(d_year#10, i_brand#7, i_brand_id#6, 5), ENSURE_REQUIREMENTS, [plan_id=2]
 
 (16) HashAggregate [codegen id : 4]
-Input [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#13]
-Keys [3]: [d_year#11, i_brand#7, i_brand_id#6]
+Input [4]: [d_year#10, i_brand#7, i_brand_id#6, sum#12]
+Keys [3]: [d_year#10, i_brand#7, i_brand_id#6]
 Functions [1]: [sum(UnscaledValue(ss_net_profit#2))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#2))#15]
-Results [4]: [d_year#11, i_brand_id#6 AS brand_id#16, i_brand#7 AS brand#17, MakeDecimal(sum(UnscaledValue(ss_net_profit#2))#15,17,2) AS sum_agg#18]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#2))#13]
+Results [4]: [d_year#10, i_brand_id#6 AS brand_id#14, i_brand#7 AS brand#15, MakeDecimal(sum(UnscaledValue(ss_net_profit#2))#13,17,2) AS sum_agg#16]
 
 (17) TakeOrderedAndProject
-Input [4]: [d_year#11, brand_id#16, brand#17, sum_agg#18]
-Arguments: 100, [d_year#11 ASC NULLS FIRST, sum_agg#18 DESC NULLS LAST, brand_id#16 ASC NULLS FIRST], [d_year#11, brand_id#16, brand#17, sum_agg#18]
+Input [4]: [d_year#10, brand_id#14, brand#15, sum_agg#16]
+Arguments: 100, [d_year#10 ASC NULLS FIRST, sum_agg#16 DESC NULLS LAST, brand_id#14 ASC NULLS FIRST], [d_year#10, brand_id#14, brand#15, sum_agg#16]
 
 ===== Subqueries =====
 
@@ -109,25 +109,25 @@ BroadcastExchange (22)
 
 
 (18) Scan parquet default.date_dim
-Output [3]: [d_date_sk#10, d_year#11, d_moy#19]
+Output [3]: [d_date_sk#9, d_year#10, d_moy#17]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_moy), EqualTo(d_moy,12), Or(Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2415355),LessThanOrEqual(d_date_sk,2415385)),And(GreaterThanOrEqual(d_date_sk,2415720),LessThanOrEqual(d_date_sk,2415750))),Or(And(GreaterThanOrEqual(d_date_sk,2416085),LessThanOrEqual(d_date_sk,2416115)),And(GreaterThanOrEqual(d_date_sk,2416450),LessThanOrEqual(d_date_sk,2416480)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2416816),LessThanOrEqual(d_date_sk,2416846)),And(GreaterTh [...]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
 
 (19) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#11, d_moy#19]
+Input [3]: [d_date_sk#9, d_year#10, d_moy#17]
 
 (20) Filter [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#11, d_moy#19]
-Condition : (((isnotnull(d_moy#19) AND (d_moy#19 = 12)) AND ((((((((((d_date_sk#10 >= 2415355) AND (d_date_sk#10 <= 2415385)) OR ((d_date_sk#10 >= 2415720) AND (d_date_sk#10 <= 2415750))) OR (((d_date_sk#10 >= 2416085) AND (d_date_sk#10 <= 2416115)) OR ((d_date_sk#10 >= 2416450) AND (d_date_sk#10 <= 2416480)))) OR ((((d_date_sk#10 >= 2416816) AND (d_date_sk#10 <= 2416846)) OR ((d_date_sk#10 >= 2417181) AND (d_date_sk#10 <= 2417211))) OR ((d_date_sk#10 >= 2417546) AND (d_date_sk#10 <= 241 [...]
+Input [3]: [d_date_sk#9, d_year#10, d_moy#17]
+Condition : (((isnotnull(d_moy#17) AND (d_moy#17 = 12)) AND ((((((((((d_date_sk#9 >= 2415355) AND (d_date_sk#9 <= 2415385)) OR ((d_date_sk#9 >= 2415720) AND (d_date_sk#9 <= 2415750))) OR (((d_date_sk#9 >= 2416085) AND (d_date_sk#9 <= 2416115)) OR ((d_date_sk#9 >= 2416450) AND (d_date_sk#9 <= 2416480)))) OR ((((d_date_sk#9 >= 2416816) AND (d_date_sk#9 <= 2416846)) OR ((d_date_sk#9 >= 2417181) AND (d_date_sk#9 <= 2417211))) OR ((d_date_sk#9 >= 2417546) AND (d_date_sk#9 <= 2417576)))) OR (( [...]
 
 (21) Project [codegen id : 1]
-Output [2]: [d_date_sk#10, d_year#11]
-Input [3]: [d_date_sk#10, d_year#11, d_moy#19]
+Output [2]: [d_date_sk#9, d_year#10]
+Input [3]: [d_date_sk#9, d_year#10, d_moy#17]
 
 (22) BroadcastExchange
-Input [2]: [d_date_sk#10, d_year#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20]
+Input [2]: [d_date_sk#9, d_year#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=3]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3/explain.txt
index a60caf19f23..c6c1e51e936 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3/explain.txt
@@ -57,7 +57,7 @@ Condition : isnotnull(ss_item_sk#4)
 
 (8) BroadcastExchange
 Input [3]: [ss_item_sk#4, ss_net_profit#5, ss_sold_date_sk#6]
-Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7]
+Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [plan_id=1]
 
 (9) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [d_date_sk#1]
@@ -69,55 +69,55 @@ Output [3]: [d_year#2, ss_item_sk#4, ss_net_profit#5]
 Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#4, ss_net_profit#5, ss_sold_date_sk#6]
 
 (11) Scan parquet default.item
-Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11]
+Output [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,436), IsNotNull(i_item_sk)]
 ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_brand:string,i_manufact_id:int>
 
 (12) ColumnarToRow [codegen id : 2]
-Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11]
+Input [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10]
 
 (13) Filter [codegen id : 2]
-Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11]
-Condition : ((isnotnull(i_manufact_id#11) AND (i_manufact_id#11 = 436)) AND isnotnull(i_item_sk#8))
+Input [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10]
+Condition : ((isnotnull(i_manufact_id#10) AND (i_manufact_id#10 = 436)) AND isnotnull(i_item_sk#7))
 
 (14) Project [codegen id : 2]
-Output [3]: [i_item_sk#8, i_brand_id#9, i_brand#10]
-Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11]
+Output [3]: [i_item_sk#7, i_brand_id#8, i_brand#9]
+Input [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10]
 
 (15) BroadcastExchange
-Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12]
+Input [3]: [i_item_sk#7, i_brand_id#8, i_brand#9]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (16) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [ss_item_sk#4]
-Right keys [1]: [i_item_sk#8]
+Right keys [1]: [i_item_sk#7]
 Join condition: None
 
 (17) Project [codegen id : 3]
-Output [4]: [d_year#2, ss_net_profit#5, i_brand_id#9, i_brand#10]
-Input [6]: [d_year#2, ss_item_sk#4, ss_net_profit#5, i_item_sk#8, i_brand_id#9, i_brand#10]
+Output [4]: [d_year#2, ss_net_profit#5, i_brand_id#8, i_brand#9]
+Input [6]: [d_year#2, ss_item_sk#4, ss_net_profit#5, i_item_sk#7, i_brand_id#8, i_brand#9]
 
 (18) HashAggregate [codegen id : 3]
-Input [4]: [d_year#2, ss_net_profit#5, i_brand_id#9, i_brand#10]
-Keys [3]: [d_year#2, i_brand#10, i_brand_id#9]
+Input [4]: [d_year#2, ss_net_profit#5, i_brand_id#8, i_brand#9]
+Keys [3]: [d_year#2, i_brand#9, i_brand_id#8]
 Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#5))]
-Aggregate Attributes [1]: [sum#13]
-Results [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14]
+Aggregate Attributes [1]: [sum#11]
+Results [4]: [d_year#2, i_brand#9, i_brand_id#8, sum#12]
 
 (19) Exchange
-Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14]
-Arguments: hashpartitioning(d_year#2, i_brand#10, i_brand_id#9, 5), ENSURE_REQUIREMENTS, [id=#15]
+Input [4]: [d_year#2, i_brand#9, i_brand_id#8, sum#12]
+Arguments: hashpartitioning(d_year#2, i_brand#9, i_brand_id#8, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (20) HashAggregate [codegen id : 4]
-Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14]
-Keys [3]: [d_year#2, i_brand#10, i_brand_id#9]
+Input [4]: [d_year#2, i_brand#9, i_brand_id#8, sum#12]
+Keys [3]: [d_year#2, i_brand#9, i_brand_id#8]
 Functions [1]: [sum(UnscaledValue(ss_net_profit#5))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#5))#16]
-Results [4]: [d_year#2, i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#16,17,2) AS sum_agg#19]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#5))#13]
+Results [4]: [d_year#2, i_brand_id#8 AS brand_id#14, i_brand#9 AS brand#15, MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#13,17,2) AS sum_agg#16]
 
 (21) TakeOrderedAndProject
-Input [4]: [d_year#2, brand_id#17, brand#18, sum_agg#19]
-Arguments: 100, [d_year#2 ASC NULLS FIRST, sum_agg#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [d_year#2, brand_id#17, brand#18, sum_agg#19]
+Input [4]: [d_year#2, brand_id#14, brand#15, sum_agg#16]
+Arguments: 100, [d_year#2 ASC NULLS FIRST, sum_agg#16 DESC NULLS LAST, brand_id#14 ASC NULLS FIRST], [d_year#2, brand_id#14, brand#15, sum_agg#16]
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt
index bdc8690e8d3..bdd5dda489c 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt
@@ -83,7 +83,7 @@ Input [2]: [s_store_sk#8, s_county#9]
 
 (11) BroadcastExchange
 Input [1]: [s_store_sk#8]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#3]
@@ -95,104 +95,104 @@ Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4]
 Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#8]
 
 (14) Scan parquet default.household_demographics
-Output [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Output [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/household_demographics]
 PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000         ),EqualTo(hd_buy_potential,Unknown        )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)]
 ReadSchema: struct<hd_demo_sk:int,hd_buy_potential:string,hd_dep_count:int,hd_vehicle_count:int>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 
 (16) Filter [codegen id : 3]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
-Condition : (((((isnotnull(hd_vehicle_count#14) AND isnotnull(hd_dep_count#13)) AND ((hd_buy_potential#12 = >10000         ) OR (hd_buy_potential#12 = Unknown        ))) AND (hd_vehicle_count#14 > 0)) AND ((cast(hd_dep_count#13 as double) / cast(hd_vehicle_count#14 as double)) > 1.2)) AND isnotnull(hd_demo_sk#11))
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
+Condition : (((((isnotnull(hd_vehicle_count#13) AND isnotnull(hd_dep_count#12)) AND ((hd_buy_potential#11 = >10000         ) OR (hd_buy_potential#11 = Unknown        ))) AND (hd_vehicle_count#13 > 0)) AND ((cast(hd_dep_count#12 as double) / cast(hd_vehicle_count#13 as double)) > 1.2)) AND isnotnull(hd_demo_sk#10))
 
 (17) Project [codegen id : 3]
-Output [1]: [hd_demo_sk#11]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Output [1]: [hd_demo_sk#10]
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 
 (18) BroadcastExchange
-Input [1]: [hd_demo_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15]
+Input [1]: [hd_demo_sk#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (19) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_hdemo_sk#2]
-Right keys [1]: [hd_demo_sk#11]
+Right keys [1]: [hd_demo_sk#10]
 Join condition: None
 
 (20) Project [codegen id : 4]
 Output [2]: [ss_customer_sk#1, ss_ticket_number#4]
-Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#11]
+Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#10]
 
 (21) HashAggregate [codegen id : 4]
 Input [2]: [ss_customer_sk#1, ss_ticket_number#4]
 Keys [2]: [ss_ticket_number#4, ss_customer_sk#1]
 Functions [1]: [partial_count(1)]
-Aggregate Attributes [1]: [count#16]
-Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
+Aggregate Attributes [1]: [count#14]
+Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
 
 (22) Exchange
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
-Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#18]
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
+Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (23) HashAggregate [codegen id : 5]
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
 Keys [2]: [ss_ticket_number#4, ss_customer_sk#1]
 Functions [1]: [count(1)]
-Aggregate Attributes [1]: [count(1)#19]
-Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#19 AS cnt#20]
+Aggregate Attributes [1]: [count(1)#16]
+Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#16 AS cnt#17]
 
 (24) Filter [codegen id : 5]
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#20]
-Condition : ((cnt#20 >= 15) AND (cnt#20 <= 20))
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#17]
+Condition : ((cnt#17 >= 15) AND (cnt#17 <= 20))
 
 (25) Exchange
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#20]
-Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#21]
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#17]
+Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (26) Sort [codegen id : 6]
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#20]
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#17]
 Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0
 
 (27) Scan parquet default.customer
-Output [5]: [c_customer_sk#22, c_salutation#23, c_first_name#24, c_last_name#25, c_preferred_cust_flag#26]
+Output [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/customer]
 PushedFilters: [IsNotNull(c_customer_sk)]
 ReadSchema: struct<c_customer_sk:int,c_salutation:string,c_first_name:string,c_last_name:string,c_preferred_cust_flag:string>
 
 (28) ColumnarToRow [codegen id : 7]
-Input [5]: [c_customer_sk#22, c_salutation#23, c_first_name#24, c_last_name#25, c_preferred_cust_flag#26]
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 
 (29) Filter [codegen id : 7]
-Input [5]: [c_customer_sk#22, c_salutation#23, c_first_name#24, c_last_name#25, c_preferred_cust_flag#26]
-Condition : isnotnull(c_customer_sk#22)
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
+Condition : isnotnull(c_customer_sk#18)
 
 (30) Exchange
-Input [5]: [c_customer_sk#22, c_salutation#23, c_first_name#24, c_last_name#25, c_preferred_cust_flag#26]
-Arguments: hashpartitioning(c_customer_sk#22, 5), ENSURE_REQUIREMENTS, [id=#27]
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
+Arguments: hashpartitioning(c_customer_sk#18, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (31) Sort [codegen id : 8]
-Input [5]: [c_customer_sk#22, c_salutation#23, c_first_name#24, c_last_name#25, c_preferred_cust_flag#26]
-Arguments: [c_customer_sk#22 ASC NULLS FIRST], false, 0
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
+Arguments: [c_customer_sk#18 ASC NULLS FIRST], false, 0
 
 (32) SortMergeJoin [codegen id : 9]
 Left keys [1]: [ss_customer_sk#1]
-Right keys [1]: [c_customer_sk#22]
+Right keys [1]: [c_customer_sk#18]
 Join condition: None
 
 (33) Project [codegen id : 9]
-Output [6]: [c_last_name#25, c_first_name#24, c_salutation#23, c_preferred_cust_flag#26, ss_ticket_number#4, cnt#20]
-Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#20, c_customer_sk#22, c_salutation#23, c_first_name#24, c_last_name#25, c_preferred_cust_flag#26]
+Output [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#17, c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 
 (34) Exchange
-Input [6]: [c_last_name#25, c_first_name#24, c_salutation#23, c_preferred_cust_flag#26, ss_ticket_number#4, cnt#20]
-Arguments: rangepartitioning(c_last_name#25 ASC NULLS FIRST, c_first_name#24 ASC NULLS FIRST, c_salutation#23 ASC NULLS FIRST, c_preferred_cust_flag#26 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#28]
+Input [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Arguments: rangepartitioning(c_last_name#21 ASC NULLS FIRST, c_first_name#20 ASC NULLS FIRST, c_salutation#19 ASC NULLS FIRST, c_preferred_cust_flag#22 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [plan_id=6]
 
 (35) Sort [codegen id : 10]
-Input [6]: [c_last_name#25, c_first_name#24, c_salutation#23, c_preferred_cust_flag#26, ss_ticket_number#4, cnt#20]
-Arguments: [c_last_name#25 ASC NULLS FIRST, c_first_name#24 ASC NULLS FIRST, c_salutation#23 ASC NULLS FIRST, c_preferred_cust_flag#26 DESC NULLS LAST], true, 0
+Input [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Arguments: [c_last_name#21 ASC NULLS FIRST, c_first_name#20 ASC NULLS FIRST, c_salutation#19 ASC NULLS FIRST, c_preferred_cust_flag#22 DESC NULLS LAST], true, 0
 
 ===== Subqueries =====
 
@@ -205,25 +205,25 @@ BroadcastExchange (40)
 
 
 (36) Scan parquet default.date_dim
-Output [3]: [d_date_sk#7, d_year#29, d_dom#30]
+Output [3]: [d_date_sk#7, d_year#23, d_dom#24]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450816), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_dom:int>
 
 (37) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#7, d_year#29, d_dom#30]
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
 
 (38) Filter [codegen id : 1]
-Input [3]: [d_date_sk#7, d_year#29, d_dom#30]
-Condition : (((((((d_dom#30 >= 1) AND (d_dom#30 <= 3)) OR ((d_dom#30 >= 25) AND (d_dom#30 <= 28))) AND d_year#29 IN (1998,1999,2000)) AND (d_date_sk#7 >= 2450816)) AND (d_date_sk#7 <= 2451910)) AND isnotnull(d_date_sk#7))
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
+Condition : (((((((d_dom#24 >= 1) AND (d_dom#24 <= 3)) OR ((d_dom#24 >= 25) AND (d_dom#24 <= 28))) AND d_year#23 IN (1998,1999,2000)) AND (d_date_sk#7 >= 2450816)) AND (d_date_sk#7 <= 2451910)) AND isnotnull(d_date_sk#7))
 
 (39) Project [codegen id : 1]
 Output [1]: [d_date_sk#7]
-Input [3]: [d_date_sk#7, d_year#29, d_dom#30]
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
 
 (40) BroadcastExchange
 Input [1]: [d_date_sk#7]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34/explain.txt
index b2b1d9c7822..dddd98f235c 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34/explain.txt
@@ -80,7 +80,7 @@ Input [2]: [s_store_sk#8, s_county#9]
 
 (11) BroadcastExchange
 Input [1]: [s_store_sk#8]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#3]
@@ -92,92 +92,92 @@ Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4]
 Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#8]
 
 (14) Scan parquet default.household_demographics
-Output [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Output [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/household_demographics]
 PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000         ),EqualTo(hd_buy_potential,Unknown        )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)]
 ReadSchema: struct<hd_demo_sk:int,hd_buy_potential:string,hd_dep_count:int,hd_vehicle_count:int>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 
 (16) Filter [codegen id : 3]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
-Condition : (((((isnotnull(hd_vehicle_count#14) AND isnotnull(hd_dep_count#13)) AND ((hd_buy_potential#12 = >10000         ) OR (hd_buy_potential#12 = Unknown        ))) AND (hd_vehicle_count#14 > 0)) AND ((cast(hd_dep_count#13 as double) / cast(hd_vehicle_count#14 as double)) > 1.2)) AND isnotnull(hd_demo_sk#11))
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
+Condition : (((((isnotnull(hd_vehicle_count#13) AND isnotnull(hd_dep_count#12)) AND ((hd_buy_potential#11 = >10000         ) OR (hd_buy_potential#11 = Unknown        ))) AND (hd_vehicle_count#13 > 0)) AND ((cast(hd_dep_count#12 as double) / cast(hd_vehicle_count#13 as double)) > 1.2)) AND isnotnull(hd_demo_sk#10))
 
 (17) Project [codegen id : 3]
-Output [1]: [hd_demo_sk#11]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Output [1]: [hd_demo_sk#10]
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 
 (18) BroadcastExchange
-Input [1]: [hd_demo_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15]
+Input [1]: [hd_demo_sk#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (19) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_hdemo_sk#2]
-Right keys [1]: [hd_demo_sk#11]
+Right keys [1]: [hd_demo_sk#10]
 Join condition: None
 
 (20) Project [codegen id : 4]
 Output [2]: [ss_customer_sk#1, ss_ticket_number#4]
-Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#11]
+Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#10]
 
 (21) HashAggregate [codegen id : 4]
 Input [2]: [ss_customer_sk#1, ss_ticket_number#4]
 Keys [2]: [ss_ticket_number#4, ss_customer_sk#1]
 Functions [1]: [partial_count(1)]
-Aggregate Attributes [1]: [count#16]
-Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
+Aggregate Attributes [1]: [count#14]
+Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
 
 (22) Exchange
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
-Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#18]
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
+Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (23) HashAggregate [codegen id : 6]
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
 Keys [2]: [ss_ticket_number#4, ss_customer_sk#1]
 Functions [1]: [count(1)]
-Aggregate Attributes [1]: [count(1)#19]
-Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#19 AS cnt#20]
+Aggregate Attributes [1]: [count(1)#16]
+Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#16 AS cnt#17]
 
 (24) Filter [codegen id : 6]
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#20]
-Condition : ((cnt#20 >= 15) AND (cnt#20 <= 20))
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#17]
+Condition : ((cnt#17 >= 15) AND (cnt#17 <= 20))
 
 (25) Scan parquet default.customer
-Output [5]: [c_customer_sk#21, c_salutation#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25]
+Output [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/customer]
 PushedFilters: [IsNotNull(c_customer_sk)]
 ReadSchema: struct<c_customer_sk:int,c_salutation:string,c_first_name:string,c_last_name:string,c_preferred_cust_flag:string>
 
 (26) ColumnarToRow [codegen id : 5]
-Input [5]: [c_customer_sk#21, c_salutation#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25]
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 
 (27) Filter [codegen id : 5]
-Input [5]: [c_customer_sk#21, c_salutation#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25]
-Condition : isnotnull(c_customer_sk#21)
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
+Condition : isnotnull(c_customer_sk#18)
 
 (28) BroadcastExchange
-Input [5]: [c_customer_sk#21, c_salutation#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26]
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
 
 (29) BroadcastHashJoin [codegen id : 6]
 Left keys [1]: [ss_customer_sk#1]
-Right keys [1]: [c_customer_sk#21]
+Right keys [1]: [c_customer_sk#18]
 Join condition: None
 
 (30) Project [codegen id : 6]
-Output [6]: [c_last_name#24, c_first_name#23, c_salutation#22, c_preferred_cust_flag#25, ss_ticket_number#4, cnt#20]
-Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#20, c_customer_sk#21, c_salutation#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25]
+Output [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#17, c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 
 (31) Exchange
-Input [6]: [c_last_name#24, c_first_name#23, c_salutation#22, c_preferred_cust_flag#25, ss_ticket_number#4, cnt#20]
-Arguments: rangepartitioning(c_last_name#24 ASC NULLS FIRST, c_first_name#23 ASC NULLS FIRST, c_salutation#22 ASC NULLS FIRST, c_preferred_cust_flag#25 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#27]
+Input [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Arguments: rangepartitioning(c_last_name#21 ASC NULLS FIRST, c_first_name#20 ASC NULLS FIRST, c_salutation#19 ASC NULLS FIRST, c_preferred_cust_flag#22 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (32) Sort [codegen id : 7]
-Input [6]: [c_last_name#24, c_first_name#23, c_salutation#22, c_preferred_cust_flag#25, ss_ticket_number#4, cnt#20]
-Arguments: [c_last_name#24 ASC NULLS FIRST, c_first_name#23 ASC NULLS FIRST, c_salutation#22 ASC NULLS FIRST, c_preferred_cust_flag#25 DESC NULLS LAST], true, 0
+Input [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Arguments: [c_last_name#21 ASC NULLS FIRST, c_first_name#20 ASC NULLS FIRST, c_salutation#19 ASC NULLS FIRST, c_preferred_cust_flag#22 DESC NULLS LAST], true, 0
 
 ===== Subqueries =====
 
@@ -190,25 +190,25 @@ BroadcastExchange (37)
 
 
 (33) Scan parquet default.date_dim
-Output [3]: [d_date_sk#7, d_year#28, d_dom#29]
+Output [3]: [d_date_sk#7, d_year#23, d_dom#24]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450816), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_dom:int>
 
 (34) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#7, d_year#28, d_dom#29]
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
 
 (35) Filter [codegen id : 1]
-Input [3]: [d_date_sk#7, d_year#28, d_dom#29]
-Condition : (((((((d_dom#29 >= 1) AND (d_dom#29 <= 3)) OR ((d_dom#29 >= 25) AND (d_dom#29 <= 28))) AND d_year#28 IN (1998,1999,2000)) AND (d_date_sk#7 >= 2450816)) AND (d_date_sk#7 <= 2451910)) AND isnotnull(d_date_sk#7))
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
+Condition : (((((((d_dom#24 >= 1) AND (d_dom#24 <= 3)) OR ((d_dom#24 >= 25) AND (d_dom#24 <= 28))) AND d_year#23 IN (1998,1999,2000)) AND (d_date_sk#7 >= 2450816)) AND (d_date_sk#7 <= 2451910)) AND isnotnull(d_date_sk#7))
 
 (36) Project [codegen id : 1]
 Output [1]: [d_date_sk#7]
-Input [3]: [d_date_sk#7, d_year#28, d_dom#29]
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
 
 (37) BroadcastExchange
 Input [1]: [d_date_sk#7]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt
index 5e83e995a37..a7ad5b09175 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt
@@ -42,88 +42,88 @@ Input [3]: [d_date_sk#1, d_year#2, d_moy#3]
 
 (5) BroadcastExchange
 Input [2]: [d_date_sk#1, d_year#2]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (6) Scan parquet default.store_sales
-Output [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
+Output [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#7), (ss_sold_date_sk#7 >= 2451149), (ss_sold_date_sk#7 <= 2451179), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#6), (ss_sold_date_sk#6 >= 2451149), (ss_sold_date_sk#6 <= 2451179), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)]
 PushedFilters: [IsNotNull(ss_item_sk)]
 ReadSchema: struct<ss_item_sk:int,ss_ext_sales_price:decimal(7,2)>
 
 (7) ColumnarToRow
-Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
+Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 
 (8) Filter
-Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
-Condition : isnotnull(ss_item_sk#5)
+Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
+Condition : isnotnull(ss_item_sk#4)
 
 (9) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [d_date_sk#1]
-Right keys [1]: [ss_sold_date_sk#7]
+Right keys [1]: [ss_sold_date_sk#6]
 Join condition: None
 
 (10) Project [codegen id : 3]
-Output [3]: [d_year#2, ss_item_sk#5, ss_ext_sales_price#6]
-Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
+Output [3]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5]
+Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 
 (11) Scan parquet default.item
-Output [4]: [i_item_sk#9, i_category_id#10, i_category#11, i_manager_id#12]
+Output [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)]
 ReadSchema: struct<i_item_sk:int,i_category_id:int,i_category:string,i_manager_id:int>
 
 (12) ColumnarToRow [codegen id : 2]
-Input [4]: [i_item_sk#9, i_category_id#10, i_category#11, i_manager_id#12]
+Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11]
 
 (13) Filter [codegen id : 2]
-Input [4]: [i_item_sk#9, i_category_id#10, i_category#11, i_manager_id#12]
-Condition : ((isnotnull(i_manager_id#12) AND (i_manager_id#12 = 1)) AND isnotnull(i_item_sk#9))
+Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11]
+Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 1)) AND isnotnull(i_item_sk#8))
 
 (14) Project [codegen id : 2]
-Output [3]: [i_item_sk#9, i_category_id#10, i_category#11]
-Input [4]: [i_item_sk#9, i_category_id#10, i_category#11, i_manager_id#12]
+Output [3]: [i_item_sk#8, i_category_id#9, i_category#10]
+Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11]
 
 (15) BroadcastExchange
-Input [3]: [i_item_sk#9, i_category_id#10, i_category#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13]
+Input [3]: [i_item_sk#8, i_category_id#9, i_category#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (16) BroadcastHashJoin [codegen id : 3]
-Left keys [1]: [ss_item_sk#5]
-Right keys [1]: [i_item_sk#9]
+Left keys [1]: [ss_item_sk#4]
+Right keys [1]: [i_item_sk#8]
 Join condition: None
 
 (17) Project [codegen id : 3]
-Output [4]: [d_year#2, ss_ext_sales_price#6, i_category_id#10, i_category#11]
-Input [6]: [d_year#2, ss_item_sk#5, ss_ext_sales_price#6, i_item_sk#9, i_category_id#10, i_category#11]
+Output [4]: [d_year#2, ss_ext_sales_price#5, i_category_id#9, i_category#10]
+Input [6]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_category_id#9, i_category#10]
 
 (18) HashAggregate [codegen id : 3]
-Input [4]: [d_year#2, ss_ext_sales_price#6, i_category_id#10, i_category#11]
-Keys [3]: [d_year#2, i_category_id#10, i_category#11]
-Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#6))]
-Aggregate Attributes [1]: [sum#14]
-Results [4]: [d_year#2, i_category_id#10, i_category#11, sum#15]
+Input [4]: [d_year#2, ss_ext_sales_price#5, i_category_id#9, i_category#10]
+Keys [3]: [d_year#2, i_category_id#9, i_category#10]
+Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))]
+Aggregate Attributes [1]: [sum#12]
+Results [4]: [d_year#2, i_category_id#9, i_category#10, sum#13]
 
 (19) Exchange
-Input [4]: [d_year#2, i_category_id#10, i_category#11, sum#15]
-Arguments: hashpartitioning(d_year#2, i_category_id#10, i_category#11, 5), ENSURE_REQUIREMENTS, [id=#16]
+Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#13]
+Arguments: hashpartitioning(d_year#2, i_category_id#9, i_category#10, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (20) HashAggregate [codegen id : 4]
-Input [4]: [d_year#2, i_category_id#10, i_category#11, sum#15]
-Keys [3]: [d_year#2, i_category_id#10, i_category#11]
-Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#17]
-Results [4]: [d_year#2, i_category_id#10, i_category#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#17,17,2) AS sum(ss_ext_sales_price)#18]
+Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#13]
+Keys [3]: [d_year#2, i_category_id#9, i_category#10]
+Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#14]
+Results [4]: [d_year#2, i_category_id#9, i_category#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#14,17,2) AS sum(ss_ext_sales_price)#15]
 
 (21) TakeOrderedAndProject
-Input [4]: [d_year#2, i_category_id#10, i_category#11, sum(ss_ext_sales_price)#18]
-Arguments: 100, [sum(ss_ext_sales_price)#18 DESC NULLS LAST, d_year#2 ASC NULLS FIRST, i_category_id#10 ASC NULLS FIRST, i_category#11 ASC NULLS FIRST], [d_year#2, i_category_id#10, i_category#11, sum(ss_ext_sales_price)#18]
+Input [4]: [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#15]
+Arguments: 100, [sum(ss_ext_sales_price)#15 DESC NULLS LAST, d_year#2 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#15]
 
 ===== Subqueries =====
 
-Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8
+Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7
 ReusedExchange (22)
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42/explain.txt
index 255f39414f9..a77e0cac142 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42/explain.txt
@@ -57,7 +57,7 @@ Condition : isnotnull(ss_item_sk#4)
 
 (8) BroadcastExchange
 Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
-Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7]
+Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [plan_id=1]
 
 (9) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [d_date_sk#1]
@@ -69,55 +69,55 @@ Output [3]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5]
 Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 
 (11) Scan parquet default.item
-Output [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11]
+Output [4]: [i_item_sk#7, i_category_id#8, i_category#9, i_manager_id#10]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)]
 ReadSchema: struct<i_item_sk:int,i_category_id:int,i_category:string,i_manager_id:int>
 
 (12) ColumnarToRow [codegen id : 2]
-Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11]
+Input [4]: [i_item_sk#7, i_category_id#8, i_category#9, i_manager_id#10]
 
 (13) Filter [codegen id : 2]
-Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11]
-Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 1)) AND isnotnull(i_item_sk#8))
+Input [4]: [i_item_sk#7, i_category_id#8, i_category#9, i_manager_id#10]
+Condition : ((isnotnull(i_manager_id#10) AND (i_manager_id#10 = 1)) AND isnotnull(i_item_sk#7))
 
 (14) Project [codegen id : 2]
-Output [3]: [i_item_sk#8, i_category_id#9, i_category#10]
-Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11]
+Output [3]: [i_item_sk#7, i_category_id#8, i_category#9]
+Input [4]: [i_item_sk#7, i_category_id#8, i_category#9, i_manager_id#10]
 
 (15) BroadcastExchange
-Input [3]: [i_item_sk#8, i_category_id#9, i_category#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12]
+Input [3]: [i_item_sk#7, i_category_id#8, i_category#9]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (16) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [ss_item_sk#4]
-Right keys [1]: [i_item_sk#8]
+Right keys [1]: [i_item_sk#7]
 Join condition: None
 
 (17) Project [codegen id : 3]
-Output [4]: [d_year#2, ss_ext_sales_price#5, i_category_id#9, i_category#10]
-Input [6]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_category_id#9, i_category#10]
+Output [4]: [d_year#2, ss_ext_sales_price#5, i_category_id#8, i_category#9]
+Input [6]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#7, i_category_id#8, i_category#9]
 
 (18) HashAggregate [codegen id : 3]
-Input [4]: [d_year#2, ss_ext_sales_price#5, i_category_id#9, i_category#10]
-Keys [3]: [d_year#2, i_category_id#9, i_category#10]
+Input [4]: [d_year#2, ss_ext_sales_price#5, i_category_id#8, i_category#9]
+Keys [3]: [d_year#2, i_category_id#8, i_category#9]
 Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))]
-Aggregate Attributes [1]: [sum#13]
-Results [4]: [d_year#2, i_category_id#9, i_category#10, sum#14]
+Aggregate Attributes [1]: [sum#11]
+Results [4]: [d_year#2, i_category_id#8, i_category#9, sum#12]
 
 (19) Exchange
-Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#14]
-Arguments: hashpartitioning(d_year#2, i_category_id#9, i_category#10, 5), ENSURE_REQUIREMENTS, [id=#15]
+Input [4]: [d_year#2, i_category_id#8, i_category#9, sum#12]
+Arguments: hashpartitioning(d_year#2, i_category_id#8, i_category#9, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (20) HashAggregate [codegen id : 4]
-Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#14]
-Keys [3]: [d_year#2, i_category_id#9, i_category#10]
+Input [4]: [d_year#2, i_category_id#8, i_category#9, sum#12]
+Keys [3]: [d_year#2, i_category_id#8, i_category#9]
 Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#16]
-Results [4]: [d_year#2, i_category_id#9, i_category#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#16,17,2) AS sum(ss_ext_sales_price)#17]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#13]
+Results [4]: [d_year#2, i_category_id#8, i_category#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#13,17,2) AS sum(ss_ext_sales_price)#14]
 
 (21) TakeOrderedAndProject
-Input [4]: [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17]
-Arguments: 100, [sum(ss_ext_sales_price)#17 DESC NULLS LAST, d_year#2 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17]
+Input [4]: [d_year#2, i_category_id#8, i_category#9, sum(ss_ext_sales_price)#14]
+Arguments: 100, [sum(ss_ext_sales_price)#14 DESC NULLS LAST, d_year#2 ASC NULLS FIRST, i_category_id#8 ASC NULLS FIRST, i_category#9 ASC NULLS FIRST], [d_year#2, i_category_id#8, i_category#9, sum(ss_ext_sales_price)#14]
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43.sf100/explain.txt
index 72454cf27c3..bd95073599f 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43.sf100/explain.txt
@@ -42,88 +42,88 @@ Input [3]: [d_date_sk#1, d_year#2, d_day_name#3]
 
 (5) BroadcastExchange
 Input [2]: [d_date_sk#1, d_day_name#3]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (6) Scan parquet default.store_sales
-Output [3]: [ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7]
+Output [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#7), (ss_sold_date_sk#7 >= 2450816), (ss_sold_date_sk#7 <= 2451179), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#6), (ss_sold_date_sk#6 >= 2450816), (ss_sold_date_sk#6 <= 2451179), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)]
 PushedFilters: [IsNotNull(ss_store_sk)]
 ReadSchema: struct<ss_store_sk:int,ss_sales_price:decimal(7,2)>
 
 (7) ColumnarToRow
-Input [3]: [ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7]
+Input [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6]
 
 (8) Filter
-Input [3]: [ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7]
-Condition : isnotnull(ss_store_sk#5)
+Input [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6]
+Condition : isnotnull(ss_store_sk#4)
 
 (9) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [d_date_sk#1]
-Right keys [1]: [ss_sold_date_sk#7]
+Right keys [1]: [ss_sold_date_sk#6]
 Join condition: None
 
 (10) Project [codegen id : 3]
-Output [3]: [d_day_name#3, ss_store_sk#5, ss_sales_price#6]
-Input [5]: [d_date_sk#1, d_day_name#3, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7]
+Output [3]: [d_day_name#3, ss_store_sk#4, ss_sales_price#5]
+Input [5]: [d_date_sk#1, d_day_name#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6]
 
 (11) Scan parquet default.store
-Output [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12]
+Output [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_gmt_offset), EqualTo(s_gmt_offset,-5.00), IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int,s_store_id:string,s_store_name:string,s_gmt_offset:decimal(5,2)>
 
 (12) ColumnarToRow [codegen id : 2]
-Input [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12]
+Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11]
 
 (13) Filter [codegen id : 2]
-Input [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12]
-Condition : ((isnotnull(s_gmt_offset#12) AND (s_gmt_offset#12 = -5.00)) AND isnotnull(s_store_sk#9))
+Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11]
+Condition : ((isnotnull(s_gmt_offset#11) AND (s_gmt_offset#11 = -5.00)) AND isnotnull(s_store_sk#8))
 
 (14) Project [codegen id : 2]
-Output [3]: [s_store_sk#9, s_store_id#10, s_store_name#11]
-Input [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12]
+Output [3]: [s_store_sk#8, s_store_id#9, s_store_name#10]
+Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11]
 
 (15) BroadcastExchange
-Input [3]: [s_store_sk#9, s_store_id#10, s_store_name#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13]
+Input [3]: [s_store_sk#8, s_store_id#9, s_store_name#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (16) BroadcastHashJoin [codegen id : 3]
-Left keys [1]: [ss_store_sk#5]
-Right keys [1]: [s_store_sk#9]
+Left keys [1]: [ss_store_sk#4]
+Right keys [1]: [s_store_sk#8]
 Join condition: None
 
 (17) Project [codegen id : 3]
-Output [4]: [d_day_name#3, ss_sales_price#6, s_store_id#10, s_store_name#11]
-Input [6]: [d_day_name#3, ss_store_sk#5, ss_sales_price#6, s_store_sk#9, s_store_id#10, s_store_name#11]
+Output [4]: [d_day_name#3, ss_sales_price#5, s_store_id#9, s_store_name#10]
+Input [6]: [d_day_name#3, ss_store_sk#4, ss_sales_price#5, s_store_sk#8, s_store_id#9, s_store_name#10]
 
 (18) HashAggregate [codegen id : 3]
-Input [4]: [d_day_name#3, ss_sales_price#6, s_store_id#10, s_store_name#11]
-Keys [2]: [s_store_name#11, s_store_id#10]
-Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#6 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#6 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#6 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#6 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#6 END)), partial_sum(Unsc [...]
-Aggregate Attributes [7]: [sum#14, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20]
-Results [9]: [s_store_name#11, s_store_id#10, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27]
+Input [4]: [d_day_name#3, ss_sales_price#5, s_store_id#9, s_store_name#10]
+Keys [2]: [s_store_name#10, s_store_id#9]
+Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#5 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#5 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#5 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 END)), partial_sum(Unsc [...]
+Aggregate Attributes [7]: [sum#12, sum#13, sum#14, sum#15, sum#16, sum#17, sum#18]
+Results [9]: [s_store_name#10, s_store_id#9, sum#19, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25]
 
 (19) Exchange
-Input [9]: [s_store_name#11, s_store_id#10, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27]
-Arguments: hashpartitioning(s_store_name#11, s_store_id#10, 5), ENSURE_REQUIREMENTS, [id=#28]
+Input [9]: [s_store_name#10, s_store_id#9, sum#19, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25]
+Arguments: hashpartitioning(s_store_name#10, s_store_id#9, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (20) HashAggregate [codegen id : 4]
-Input [9]: [s_store_name#11, s_store_id#10, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27]
-Keys [2]: [s_store_name#11, s_store_id#10]
-Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#6 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#6 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#6 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#6 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#6 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday   ) T [...]
-Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#6 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#6 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#6 END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#6 END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#6 END))#33, sum(UnscaledValue(CASE WHEN (d [...]
-Results [9]: [s_store_name#11, s_store_id#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#6 END))#29,17,2) AS sun_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#6 END))#30,17,2) AS mon_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#6 END))#31,17,2) AS tue_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_pr [...]
+Input [9]: [s_store_name#10, s_store_id#9, sum#19, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25]
+Keys [2]: [s_store_name#10, s_store_id#9]
+Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#5 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#5 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#5 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday   ) T [...]
+Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#5 END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#5 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#5 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 END))#30, sum(UnscaledValue(CASE WHEN (d [...]
+Results [9]: [s_store_name#10, s_store_id#9, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#5 END))#26,17,2) AS sun_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#5 END))#27,17,2) AS mon_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#5 END))#28,17,2) AS tue_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_pri [...]
 
 (21) TakeOrderedAndProject
-Input [9]: [s_store_name#11, s_store_id#10, sun_sales#36, mon_sales#37, tue_sales#38, wed_sales#39, thu_sales#40, fri_sales#41, sat_sales#42]
-Arguments: 100, [s_store_name#11 ASC NULLS FIRST, s_store_id#10 ASC NULLS FIRST, sun_sales#36 ASC NULLS FIRST, mon_sales#37 ASC NULLS FIRST, tue_sales#38 ASC NULLS FIRST, wed_sales#39 ASC NULLS FIRST, thu_sales#40 ASC NULLS FIRST, fri_sales#41 ASC NULLS FIRST, sat_sales#42 ASC NULLS FIRST], [s_store_name#11, s_store_id#10, sun_sales#36, mon_sales#37, tue_sales#38, wed_sales#39, thu_sales#40, fri_sales#41, sat_sales#42]
+Input [9]: [s_store_name#10, s_store_id#9, sun_sales#33, mon_sales#34, tue_sales#35, wed_sales#36, thu_sales#37, fri_sales#38, sat_sales#39]
+Arguments: 100, [s_store_name#10 ASC NULLS FIRST, s_store_id#9 ASC NULLS FIRST, sun_sales#33 ASC NULLS FIRST, mon_sales#34 ASC NULLS FIRST, tue_sales#35 ASC NULLS FIRST, wed_sales#36 ASC NULLS FIRST, thu_sales#37 ASC NULLS FIRST, fri_sales#38 ASC NULLS FIRST, sat_sales#39 ASC NULLS FIRST], [s_store_name#10, s_store_id#9, sun_sales#33, mon_sales#34, tue_sales#35, wed_sales#36, thu_sales#37, fri_sales#38, sat_sales#39]
 
 ===== Subqueries =====
 
-Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8
+Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7
 ReusedExchange (22)
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43/explain.txt
index 74911c78e91..18475905e6d 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43/explain.txt
@@ -57,7 +57,7 @@ Condition : isnotnull(ss_store_sk#4)
 
 (8) BroadcastExchange
 Input [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6]
-Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7]
+Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [plan_id=1]
 
 (9) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [d_date_sk#1]
@@ -69,55 +69,55 @@ Output [3]: [d_day_name#3, ss_store_sk#4, ss_sales_price#5]
 Input [5]: [d_date_sk#1, d_day_name#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6]
 
 (11) Scan parquet default.store
-Output [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11]
+Output [4]: [s_store_sk#7, s_store_id#8, s_store_name#9, s_gmt_offset#10]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_gmt_offset), EqualTo(s_gmt_offset,-5.00), IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int,s_store_id:string,s_store_name:string,s_gmt_offset:decimal(5,2)>
 
 (12) ColumnarToRow [codegen id : 2]
-Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11]
+Input [4]: [s_store_sk#7, s_store_id#8, s_store_name#9, s_gmt_offset#10]
 
 (13) Filter [codegen id : 2]
-Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11]
-Condition : ((isnotnull(s_gmt_offset#11) AND (s_gmt_offset#11 = -5.00)) AND isnotnull(s_store_sk#8))
+Input [4]: [s_store_sk#7, s_store_id#8, s_store_name#9, s_gmt_offset#10]
+Condition : ((isnotnull(s_gmt_offset#10) AND (s_gmt_offset#10 = -5.00)) AND isnotnull(s_store_sk#7))
 
 (14) Project [codegen id : 2]
-Output [3]: [s_store_sk#8, s_store_id#9, s_store_name#10]
-Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11]
+Output [3]: [s_store_sk#7, s_store_id#8, s_store_name#9]
+Input [4]: [s_store_sk#7, s_store_id#8, s_store_name#9, s_gmt_offset#10]
 
 (15) BroadcastExchange
-Input [3]: [s_store_sk#8, s_store_id#9, s_store_name#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12]
+Input [3]: [s_store_sk#7, s_store_id#8, s_store_name#9]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (16) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [ss_store_sk#4]
-Right keys [1]: [s_store_sk#8]
+Right keys [1]: [s_store_sk#7]
 Join condition: None
 
 (17) Project [codegen id : 3]
-Output [4]: [d_day_name#3, ss_sales_price#5, s_store_id#9, s_store_name#10]
-Input [6]: [d_day_name#3, ss_store_sk#4, ss_sales_price#5, s_store_sk#8, s_store_id#9, s_store_name#10]
+Output [4]: [d_day_name#3, ss_sales_price#5, s_store_id#8, s_store_name#9]
+Input [6]: [d_day_name#3, ss_store_sk#4, ss_sales_price#5, s_store_sk#7, s_store_id#8, s_store_name#9]
 
 (18) HashAggregate [codegen id : 3]
-Input [4]: [d_day_name#3, ss_sales_price#5, s_store_id#9, s_store_name#10]
-Keys [2]: [s_store_name#10, s_store_id#9]
+Input [4]: [d_day_name#3, ss_sales_price#5, s_store_id#8, s_store_name#9]
+Keys [2]: [s_store_name#9, s_store_id#8]
 Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#5 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#5 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#5 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 END)), partial_sum(Unsc [...]
-Aggregate Attributes [7]: [sum#13, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19]
-Results [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26]
+Aggregate Attributes [7]: [sum#11, sum#12, sum#13, sum#14, sum#15, sum#16, sum#17]
+Results [9]: [s_store_name#9, s_store_id#8, sum#18, sum#19, sum#20, sum#21, sum#22, sum#23, sum#24]
 
 (19) Exchange
-Input [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26]
-Arguments: hashpartitioning(s_store_name#10, s_store_id#9, 5), ENSURE_REQUIREMENTS, [id=#27]
+Input [9]: [s_store_name#9, s_store_id#8, sum#18, sum#19, sum#20, sum#21, sum#22, sum#23, sum#24]
+Arguments: hashpartitioning(s_store_name#9, s_store_id#8, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (20) HashAggregate [codegen id : 4]
-Input [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26]
-Keys [2]: [s_store_name#10, s_store_id#9]
+Input [9]: [s_store_name#9, s_store_id#8, sum#18, sum#19, sum#20, sum#21, sum#22, sum#23, sum#24]
+Keys [2]: [s_store_name#9, s_store_id#8]
 Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#5 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#5 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#5 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday   ) T [...]
-Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#5 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#5 END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#5 END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 END))#32, sum(UnscaledValue(CASE WHEN (d [...]
-Results [9]: [s_store_name#10, s_store_id#9, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#5 END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#5 END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#5 END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_pri [...]
+Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#5 END))#25, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#5 END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#5 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 END))#29, sum(UnscaledValue(CASE WHEN (d [...]
+Results [9]: [s_store_name#9, s_store_id#8, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday   ) THEN ss_sales_price#5 END))#25,17,2) AS sun_sales#32, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday   ) THEN ss_sales_price#5 END))#26,17,2) AS mon_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday  ) THEN ss_sales_price#5 END))#27,17,2) AS tue_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_pric [...]
 
 (21) TakeOrderedAndProject
-Input [9]: [s_store_name#10, s_store_id#9, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41]
-Arguments: 100, [s_store_name#10 ASC NULLS FIRST, s_store_id#9 ASC NULLS FIRST, sun_sales#35 ASC NULLS FIRST, mon_sales#36 ASC NULLS FIRST, tue_sales#37 ASC NULLS FIRST, wed_sales#38 ASC NULLS FIRST, thu_sales#39 ASC NULLS FIRST, fri_sales#40 ASC NULLS FIRST, sat_sales#41 ASC NULLS FIRST], [s_store_name#10, s_store_id#9, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41]
+Input [9]: [s_store_name#9, s_store_id#8, sun_sales#32, mon_sales#33, tue_sales#34, wed_sales#35, thu_sales#36, fri_sales#37, sat_sales#38]
+Arguments: 100, [s_store_name#9 ASC NULLS FIRST, s_store_id#8 ASC NULLS FIRST, sun_sales#32 ASC NULLS FIRST, mon_sales#33 ASC NULLS FIRST, tue_sales#34 ASC NULLS FIRST, wed_sales#35 ASC NULLS FIRST, thu_sales#36 ASC NULLS FIRST, fri_sales#37 ASC NULLS FIRST, sat_sales#38 ASC NULLS FIRST], [s_store_name#9, s_store_id#8, sun_sales#32, mon_sales#33, tue_sales#34, wed_sales#35, thu_sales#36, fri_sales#37, sat_sales#38]
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt
index 4ea916a38b2..48a3708fa4d 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt
@@ -95,7 +95,7 @@ Input [2]: [s_store_sk#11, s_city#12]
 
 (11) BroadcastExchange
 Input [1]: [s_store_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#4]
@@ -107,155 +107,155 @@ Output [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5,
 Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#11]
 
 (14) Scan parquet default.household_demographics
-Output [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
+Output [3]: [hd_demo_sk#13, hd_dep_count#14, hd_vehicle_count#15]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/household_demographics]
 PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)]
 ReadSchema: struct<hd_demo_sk:int,hd_dep_count:int,hd_vehicle_count:int>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
+Input [3]: [hd_demo_sk#13, hd_dep_count#14, hd_vehicle_count#15]
 
 (16) Filter [codegen id : 3]
-Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
-Condition : (((hd_dep_count#15 = 5) OR (hd_vehicle_count#16 = 3)) AND isnotnull(hd_demo_sk#14))
+Input [3]: [hd_demo_sk#13, hd_dep_count#14, hd_vehicle_count#15]
+Condition : (((hd_dep_count#14 = 5) OR (hd_vehicle_count#15 = 3)) AND isnotnull(hd_demo_sk#13))
 
 (17) Project [codegen id : 3]
-Output [1]: [hd_demo_sk#14]
-Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
+Output [1]: [hd_demo_sk#13]
+Input [3]: [hd_demo_sk#13, hd_dep_count#14, hd_vehicle_count#15]
 
 (18) BroadcastExchange
-Input [1]: [hd_demo_sk#14]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17]
+Input [1]: [hd_demo_sk#13]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (19) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_hdemo_sk#2]
-Right keys [1]: [hd_demo_sk#14]
+Right keys [1]: [hd_demo_sk#13]
 Join condition: None
 
 (20) Project [codegen id : 4]
 Output [5]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7]
-Input [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, hd_demo_sk#14]
+Input [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, hd_demo_sk#13]
 
 (21) Exchange
 Input [5]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7]
-Arguments: hashpartitioning(ss_addr_sk#3, 5), ENSURE_REQUIREMENTS, [id=#18]
+Arguments: hashpartitioning(ss_addr_sk#3, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (22) Sort [codegen id : 5]
 Input [5]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7]
 Arguments: [ss_addr_sk#3 ASC NULLS FIRST], false, 0
 
 (23) Scan parquet default.customer_address
-Output [2]: [ca_address_sk#19, ca_city#20]
+Output [2]: [ca_address_sk#16, ca_city#17]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/customer_address]
 PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)]
 ReadSchema: struct<ca_address_sk:int,ca_city:string>
 
 (24) ColumnarToRow [codegen id : 6]
-Input [2]: [ca_address_sk#19, ca_city#20]
+Input [2]: [ca_address_sk#16, ca_city#17]
 
 (25) Filter [codegen id : 6]
-Input [2]: [ca_address_sk#19, ca_city#20]
-Condition : (isnotnull(ca_address_sk#19) AND isnotnull(ca_city#20))
+Input [2]: [ca_address_sk#16, ca_city#17]
+Condition : (isnotnull(ca_address_sk#16) AND isnotnull(ca_city#17))
 
 (26) Exchange
-Input [2]: [ca_address_sk#19, ca_city#20]
-Arguments: hashpartitioning(ca_address_sk#19, 5), ENSURE_REQUIREMENTS, [id=#21]
+Input [2]: [ca_address_sk#16, ca_city#17]
+Arguments: hashpartitioning(ca_address_sk#16, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (27) Sort [codegen id : 7]
-Input [2]: [ca_address_sk#19, ca_city#20]
-Arguments: [ca_address_sk#19 ASC NULLS FIRST], false, 0
+Input [2]: [ca_address_sk#16, ca_city#17]
+Arguments: [ca_address_sk#16 ASC NULLS FIRST], false, 0
 
 (28) SortMergeJoin [codegen id : 8]
 Left keys [1]: [ss_addr_sk#3]
-Right keys [1]: [ca_address_sk#19]
+Right keys [1]: [ca_address_sk#16]
 Join condition: None
 
 (29) Project [codegen id : 8]
-Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#20]
-Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_address_sk#19, ca_city#20]
+Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#17]
+Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_address_sk#16, ca_city#17]
 
 (30) HashAggregate [codegen id : 8]
-Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#20]
-Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#20]
+Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#17]
+Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#17]
 Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#6)), partial_sum(UnscaledValue(ss_net_profit#7))]
-Aggregate Attributes [2]: [sum#22, sum#23]
-Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#20, sum#24, sum#25]
+Aggregate Attributes [2]: [sum#18, sum#19]
+Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#17, sum#20, sum#21]
 
 (31) HashAggregate [codegen id : 8]
-Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#20, sum#24, sum#25]
-Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#20]
+Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#17, sum#20, sum#21]
+Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#17]
 Functions [2]: [sum(UnscaledValue(ss_coupon_amt#6)), sum(UnscaledValue(ss_net_profit#7))]
-Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#26, sum(UnscaledValue(ss_net_profit#7))#27]
-Results [5]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#20 AS bought_city#28, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#26,17,2) AS amt#29, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#27,17,2) AS profit#30]
+Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#22, sum(UnscaledValue(ss_net_profit#7))#23]
+Results [5]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#17 AS bought_city#24, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#22,17,2) AS amt#25, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#23,17,2) AS profit#26]
 
 (32) Exchange
-Input [5]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#28, amt#29, profit#30]
-Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#31]
+Input [5]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#24, amt#25, profit#26]
+Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (33) Sort [codegen id : 9]
-Input [5]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#28, amt#29, profit#30]
+Input [5]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#24, amt#25, profit#26]
 Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0
 
 (34) Scan parquet default.customer
-Output [4]: [c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
+Output [4]: [c_customer_sk#27, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
 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,c_first_name:string,c_last_name:string>
 
 (35) ColumnarToRow [codegen id : 10]
-Input [4]: [c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
+Input [4]: [c_customer_sk#27, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
 
 (36) Filter [codegen id : 10]
-Input [4]: [c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
-Condition : (isnotnull(c_customer_sk#32) AND isnotnull(c_current_addr_sk#33))
+Input [4]: [c_customer_sk#27, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
+Condition : (isnotnull(c_customer_sk#27) AND isnotnull(c_current_addr_sk#28))
 
 (37) Exchange
-Input [4]: [c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
-Arguments: hashpartitioning(c_customer_sk#32, 5), ENSURE_REQUIREMENTS, [id=#36]
+Input [4]: [c_customer_sk#27, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
+Arguments: hashpartitioning(c_customer_sk#27, 5), ENSURE_REQUIREMENTS, [plan_id=6]
 
 (38) Sort [codegen id : 11]
-Input [4]: [c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
-Arguments: [c_customer_sk#32 ASC NULLS FIRST], false, 0
+Input [4]: [c_customer_sk#27, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
+Arguments: [c_customer_sk#27 ASC NULLS FIRST], false, 0
 
 (39) SortMergeJoin [codegen id : 12]
 Left keys [1]: [ss_customer_sk#1]
-Right keys [1]: [c_customer_sk#32]
+Right keys [1]: [c_customer_sk#27]
 Join condition: None
 
 (40) Project [codegen id : 12]
-Output [7]: [ss_ticket_number#5, bought_city#28, amt#29, profit#30, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
-Input [9]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#28, amt#29, profit#30, c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
+Output [7]: [ss_ticket_number#5, bought_city#24, amt#25, profit#26, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
+Input [9]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#24, amt#25, profit#26, c_customer_sk#27, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
 
 (41) Exchange
-Input [7]: [ss_ticket_number#5, bought_city#28, amt#29, profit#30, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
-Arguments: hashpartitioning(c_current_addr_sk#33, 5), ENSURE_REQUIREMENTS, [id=#37]
+Input [7]: [ss_ticket_number#5, bought_city#24, amt#25, profit#26, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
+Arguments: hashpartitioning(c_current_addr_sk#28, 5), ENSURE_REQUIREMENTS, [plan_id=7]
 
 (42) Sort [codegen id : 13]
-Input [7]: [ss_ticket_number#5, bought_city#28, amt#29, profit#30, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
-Arguments: [c_current_addr_sk#33 ASC NULLS FIRST], false, 0
+Input [7]: [ss_ticket_number#5, bought_city#24, amt#25, profit#26, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
+Arguments: [c_current_addr_sk#28 ASC NULLS FIRST], false, 0
 
 (43) ReusedExchange [Reuses operator id: 26]
-Output [2]: [ca_address_sk#38, ca_city#39]
+Output [2]: [ca_address_sk#31, ca_city#32]
 
 (44) Sort [codegen id : 15]
-Input [2]: [ca_address_sk#38, ca_city#39]
-Arguments: [ca_address_sk#38 ASC NULLS FIRST], false, 0
+Input [2]: [ca_address_sk#31, ca_city#32]
+Arguments: [ca_address_sk#31 ASC NULLS FIRST], false, 0
 
 (45) SortMergeJoin [codegen id : 16]
-Left keys [1]: [c_current_addr_sk#33]
-Right keys [1]: [ca_address_sk#38]
-Join condition: NOT (ca_city#39 = bought_city#28)
+Left keys [1]: [c_current_addr_sk#28]
+Right keys [1]: [ca_address_sk#31]
+Join condition: NOT (ca_city#32 = bought_city#24)
 
 (46) Project [codegen id : 16]
-Output [7]: [c_last_name#35, c_first_name#34, ca_city#39, bought_city#28, ss_ticket_number#5, amt#29, profit#30]
-Input [9]: [ss_ticket_number#5, bought_city#28, amt#29, profit#30, c_current_addr_sk#33, c_first_name#34, c_last_name#35, ca_address_sk#38, ca_city#39]
+Output [7]: [c_last_name#30, c_first_name#29, ca_city#32, bought_city#24, ss_ticket_number#5, amt#25, profit#26]
+Input [9]: [ss_ticket_number#5, bought_city#24, amt#25, profit#26, c_current_addr_sk#28, c_first_name#29, c_last_name#30, ca_address_sk#31, ca_city#32]
 
 (47) TakeOrderedAndProject
-Input [7]: [c_last_name#35, c_first_name#34, ca_city#39, bought_city#28, ss_ticket_number#5, amt#29, profit#30]
-Arguments: 100, [c_last_name#35 ASC NULLS FIRST, c_first_name#34 ASC NULLS FIRST, ca_city#39 ASC NULLS FIRST, bought_city#28 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#35, c_first_name#34, ca_city#39, bought_city#28, ss_ticket_number#5, amt#29, profit#30]
+Input [7]: [c_last_name#30, c_first_name#29, ca_city#32, bought_city#24, ss_ticket_number#5, amt#25, profit#26]
+Arguments: 100, [c_last_name#30 ASC NULLS FIRST, c_first_name#29 ASC NULLS FIRST, ca_city#32 ASC NULLS FIRST, bought_city#24 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#30, c_first_name#29, ca_city#32, bought_city#24, ss_ticket_number#5, amt#25, profit#26]
 
 ===== Subqueries =====
 
@@ -268,25 +268,25 @@ BroadcastExchange (52)
 
 
 (48) Scan parquet default.date_dim
-Output [3]: [d_date_sk#10, d_year#40, d_dow#41]
+Output [3]: [d_date_sk#10, d_year#33, d_dow#34]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [In(d_dow, [0,6]), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451181,2451182,2451188,2451189,2451195,2451196,2451202,2451203,2451209,2451210,2451216,2451217,2451223,2451224,2451230,2451231,2451237,2451238,2451244,2451245,2451251,2451252,2451258,2451259,2451265,2451266,2451272,2451273,2451279,2451280,2451286,2451287,2451293,2451294,2451300,2451301,2451307,2451308,2451314,2451315,2451321,2451322,2451328,2451329,2451335,2451336,2451342,2451343,2451349,2451350,2451356,24513 [...]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_dow:int>
 
 (49) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#40, d_dow#41]
+Input [3]: [d_date_sk#10, d_year#33, d_dow#34]
 
 (50) Filter [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#40, d_dow#41]
-Condition : (((d_dow#41 IN (6,0) AND d_year#40 IN (1999,2000,2001)) AND d_date_sk#10 INSET 2451181, 2451182, 2451188, 2451189, 2451195, 2451196, 2451202, 2451203, 2451209, 2451210, 2451216, 2451217, 2451223, 2451224, 2451230, 2451231, 2451237, 2451238, 2451244, 2451245, 2451251, 2451252, 2451258, 2451259, 2451265, 2451266, 2451272, 2451273, 2451279, 2451280, 2451286, 2451287, 2451293, 2451294, 2451300, 2451301, 2451307, 2451308, 2451314, 2451315, 2451321, 2451322, 2451328, 2451329, 24513 [...]
+Input [3]: [d_date_sk#10, d_year#33, d_dow#34]
+Condition : (((d_dow#34 IN (6,0) AND d_year#33 IN (1999,2000,2001)) AND d_date_sk#10 INSET 2451181, 2451182, 2451188, 2451189, 2451195, 2451196, 2451202, 2451203, 2451209, 2451210, 2451216, 2451217, 2451223, 2451224, 2451230, 2451231, 2451237, 2451238, 2451244, 2451245, 2451251, 2451252, 2451258, 2451259, 2451265, 2451266, 2451272, 2451273, 2451279, 2451280, 2451286, 2451287, 2451293, 2451294, 2451300, 2451301, 2451307, 2451308, 2451314, 2451315, 2451321, 2451322, 2451328, 2451329, 24513 [...]
 
 (51) Project [codegen id : 1]
 Output [1]: [d_date_sk#10]
-Input [3]: [d_date_sk#10, d_year#40, d_dow#41]
+Input [3]: [d_date_sk#10, d_year#33, d_dow#34]
 
 (52) BroadcastExchange
 Input [1]: [d_date_sk#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#42]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=8]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46/explain.txt
index 5d36c1d7cd2..618ab37aa7c 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46/explain.txt
@@ -87,7 +87,7 @@ Input [2]: [s_store_sk#11, s_city#12]
 
 (11) BroadcastExchange
 Input [1]: [s_store_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_store_sk#4]
@@ -99,123 +99,123 @@ Output [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5,
 Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#11]
 
 (14) Scan parquet default.household_demographics
-Output [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
+Output [3]: [hd_demo_sk#13, hd_dep_count#14, hd_vehicle_count#15]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/household_demographics]
 PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)]
 ReadSchema: struct<hd_demo_sk:int,hd_dep_count:int,hd_vehicle_count:int>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
+Input [3]: [hd_demo_sk#13, hd_dep_count#14, hd_vehicle_count#15]
 
 (16) Filter [codegen id : 3]
-Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
-Condition : (((hd_dep_count#15 = 5) OR (hd_vehicle_count#16 = 3)) AND isnotnull(hd_demo_sk#14))
+Input [3]: [hd_demo_sk#13, hd_dep_count#14, hd_vehicle_count#15]
+Condition : (((hd_dep_count#14 = 5) OR (hd_vehicle_count#15 = 3)) AND isnotnull(hd_demo_sk#13))
 
 (17) Project [codegen id : 3]
-Output [1]: [hd_demo_sk#14]
-Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
+Output [1]: [hd_demo_sk#13]
+Input [3]: [hd_demo_sk#13, hd_dep_count#14, hd_vehicle_count#15]
 
 (18) BroadcastExchange
-Input [1]: [hd_demo_sk#14]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17]
+Input [1]: [hd_demo_sk#13]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (19) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_hdemo_sk#2]
-Right keys [1]: [hd_demo_sk#14]
+Right keys [1]: [hd_demo_sk#13]
 Join condition: None
 
 (20) Project [codegen id : 5]
 Output [5]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7]
-Input [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, hd_demo_sk#14]
+Input [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, hd_demo_sk#13]
 
 (21) Scan parquet default.customer_address
-Output [2]: [ca_address_sk#18, ca_city#19]
+Output [2]: [ca_address_sk#16, ca_city#17]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/customer_address]
 PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)]
 ReadSchema: struct<ca_address_sk:int,ca_city:string>
 
 (22) ColumnarToRow [codegen id : 4]
-Input [2]: [ca_address_sk#18, ca_city#19]
+Input [2]: [ca_address_sk#16, ca_city#17]
 
 (23) Filter [codegen id : 4]
-Input [2]: [ca_address_sk#18, ca_city#19]
-Condition : (isnotnull(ca_address_sk#18) AND isnotnull(ca_city#19))
+Input [2]: [ca_address_sk#16, ca_city#17]
+Condition : (isnotnull(ca_address_sk#16) AND isnotnull(ca_city#17))
 
 (24) BroadcastExchange
-Input [2]: [ca_address_sk#18, ca_city#19]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20]
+Input [2]: [ca_address_sk#16, ca_city#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
 
 (25) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_addr_sk#3]
-Right keys [1]: [ca_address_sk#18]
+Right keys [1]: [ca_address_sk#16]
 Join condition: None
 
 (26) Project [codegen id : 5]
-Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#19]
-Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_address_sk#18, ca_city#19]
+Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#17]
+Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_address_sk#16, ca_city#17]
 
 (27) HashAggregate [codegen id : 5]
-Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#19]
-Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#19]
+Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#17]
+Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#17]
 Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#6)), partial_sum(UnscaledValue(ss_net_profit#7))]
-Aggregate Attributes [2]: [sum#21, sum#22]
-Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#19, sum#23, sum#24]
+Aggregate Attributes [2]: [sum#18, sum#19]
+Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#17, sum#20, sum#21]
 
 (28) Exchange
-Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#19, sum#23, sum#24]
-Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#19, 5), ENSURE_REQUIREMENTS, [id=#25]
+Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#17, sum#20, sum#21]
+Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#17, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (29) HashAggregate [codegen id : 8]
-Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#19, sum#23, sum#24]
-Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#19]
+Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#17, sum#20, sum#21]
+Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#17]
 Functions [2]: [sum(UnscaledValue(ss_coupon_amt#6)), sum(UnscaledValue(ss_net_profit#7))]
-Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#26, sum(UnscaledValue(ss_net_profit#7))#27]
-Results [5]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#19 AS bought_city#28, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#26,17,2) AS amt#29, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#27,17,2) AS profit#30]
+Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#22, sum(UnscaledValue(ss_net_profit#7))#23]
+Results [5]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#17 AS bought_city#24, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#22,17,2) AS amt#25, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#23,17,2) AS profit#26]
 
 (30) Scan parquet default.customer
-Output [4]: [c_customer_sk#31, c_current_addr_sk#32, c_first_name#33, c_last_name#34]
+Output [4]: [c_customer_sk#27, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
 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,c_first_name:string,c_last_name:string>
 
 (31) ColumnarToRow [codegen id : 6]
-Input [4]: [c_customer_sk#31, c_current_addr_sk#32, c_first_name#33, c_last_name#34]
+Input [4]: [c_customer_sk#27, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
 
 (32) Filter [codegen id : 6]
-Input [4]: [c_customer_sk#31, c_current_addr_sk#32, c_first_name#33, c_last_name#34]
-Condition : (isnotnull(c_customer_sk#31) AND isnotnull(c_current_addr_sk#32))
+Input [4]: [c_customer_sk#27, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
+Condition : (isnotnull(c_customer_sk#27) AND isnotnull(c_current_addr_sk#28))
 
 (33) BroadcastExchange
-Input [4]: [c_customer_sk#31, c_current_addr_sk#32, c_first_name#33, c_last_name#34]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#35]
+Input [4]: [c_customer_sk#27, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
+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#1]
-Right keys [1]: [c_customer_sk#31]
+Right keys [1]: [c_customer_sk#27]
 Join condition: None
 
 (35) Project [codegen id : 8]
-Output [7]: [ss_ticket_number#5, bought_city#28, amt#29, profit#30, c_current_addr_sk#32, c_first_name#33, c_last_name#34]
-Input [9]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#28, amt#29, profit#30, c_customer_sk#31, c_current_addr_sk#32, c_first_name#33, c_last_name#34]
+Output [7]: [ss_ticket_number#5, bought_city#24, amt#25, profit#26, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
+Input [9]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#24, amt#25, profit#26, c_customer_sk#27, c_current_addr_sk#28, c_first_name#29, c_last_name#30]
 
 (36) ReusedExchange [Reuses operator id: 24]
-Output [2]: [ca_address_sk#36, ca_city#37]
+Output [2]: [ca_address_sk#31, ca_city#32]
 
 (37) BroadcastHashJoin [codegen id : 8]
-Left keys [1]: [c_current_addr_sk#32]
-Right keys [1]: [ca_address_sk#36]
-Join condition: NOT (ca_city#37 = bought_city#28)
+Left keys [1]: [c_current_addr_sk#28]
+Right keys [1]: [ca_address_sk#31]
+Join condition: NOT (ca_city#32 = bought_city#24)
 
 (38) Project [codegen id : 8]
-Output [7]: [c_last_name#34, c_first_name#33, ca_city#37, bought_city#28, ss_ticket_number#5, amt#29, profit#30]
-Input [9]: [ss_ticket_number#5, bought_city#28, amt#29, profit#30, c_current_addr_sk#32, c_first_name#33, c_last_name#34, ca_address_sk#36, ca_city#37]
+Output [7]: [c_last_name#30, c_first_name#29, ca_city#32, bought_city#24, ss_ticket_number#5, amt#25, profit#26]
+Input [9]: [ss_ticket_number#5, bought_city#24, amt#25, profit#26, c_current_addr_sk#28, c_first_name#29, c_last_name#30, ca_address_sk#31, ca_city#32]
 
 (39) TakeOrderedAndProject
-Input [7]: [c_last_name#34, c_first_name#33, ca_city#37, bought_city#28, ss_ticket_number#5, amt#29, profit#30]
-Arguments: 100, [c_last_name#34 ASC NULLS FIRST, c_first_name#33 ASC NULLS FIRST, ca_city#37 ASC NULLS FIRST, bought_city#28 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#34, c_first_name#33, ca_city#37, bought_city#28, ss_ticket_number#5, amt#29, profit#30]
+Input [7]: [c_last_name#30, c_first_name#29, ca_city#32, bought_city#24, ss_ticket_number#5, amt#25, profit#26]
+Arguments: 100, [c_last_name#30 ASC NULLS FIRST, c_first_name#29 ASC NULLS FIRST, ca_city#32 ASC NULLS FIRST, bought_city#24 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#30, c_first_name#29, ca_city#32, bought_city#24, ss_ticket_number#5, amt#25, profit#26]
 
 ===== Subqueries =====
 
@@ -228,25 +228,25 @@ BroadcastExchange (44)
 
 
 (40) Scan parquet default.date_dim
-Output [3]: [d_date_sk#10, d_year#38, d_dow#39]
+Output [3]: [d_date_sk#10, d_year#33, d_dow#34]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [In(d_dow, [0,6]), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451181,2451182,2451188,2451189,2451195,2451196,2451202,2451203,2451209,2451210,2451216,2451217,2451223,2451224,2451230,2451231,2451237,2451238,2451244,2451245,2451251,2451252,2451258,2451259,2451265,2451266,2451272,2451273,2451279,2451280,2451286,2451287,2451293,2451294,2451300,2451301,2451307,2451308,2451314,2451315,2451321,2451322,2451328,2451329,2451335,2451336,2451342,2451343,2451349,2451350,2451356,24513 [...]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_dow:int>
 
 (41) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#38, d_dow#39]
+Input [3]: [d_date_sk#10, d_year#33, d_dow#34]
 
 (42) Filter [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#38, d_dow#39]
-Condition : (((d_dow#39 IN (6,0) AND d_year#38 IN (1999,2000,2001)) AND d_date_sk#10 INSET 2451181, 2451182, 2451188, 2451189, 2451195, 2451196, 2451202, 2451203, 2451209, 2451210, 2451216, 2451217, 2451223, 2451224, 2451230, 2451231, 2451237, 2451238, 2451244, 2451245, 2451251, 2451252, 2451258, 2451259, 2451265, 2451266, 2451272, 2451273, 2451279, 2451280, 2451286, 2451287, 2451293, 2451294, 2451300, 2451301, 2451307, 2451308, 2451314, 2451315, 2451321, 2451322, 2451328, 2451329, 24513 [...]
+Input [3]: [d_date_sk#10, d_year#33, d_dow#34]
+Condition : (((d_dow#34 IN (6,0) AND d_year#33 IN (1999,2000,2001)) AND d_date_sk#10 INSET 2451181, 2451182, 2451188, 2451189, 2451195, 2451196, 2451202, 2451203, 2451209, 2451210, 2451216, 2451217, 2451223, 2451224, 2451230, 2451231, 2451237, 2451238, 2451244, 2451245, 2451251, 2451252, 2451258, 2451259, 2451265, 2451266, 2451272, 2451273, 2451279, 2451280, 2451286, 2451287, 2451293, 2451294, 2451300, 2451301, 2451307, 2451308, 2451314, 2451315, 2451321, 2451322, 2451328, 2451329, 24513 [...]
 
 (43) Project [codegen id : 1]
 Output [1]: [d_date_sk#10]
-Input [3]: [d_date_sk#10, d_year#38, d_dow#39]
+Input [3]: [d_date_sk#10, d_year#33, d_dow#34]
 
 (44) BroadcastExchange
 Input [1]: [d_date_sk#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#40]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt
index 02f680fc0dd..eb1ec98eb63 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt
@@ -42,88 +42,88 @@ Input [3]: [d_date_sk#1, d_year#2, d_moy#3]
 
 (5) BroadcastExchange
 Input [2]: [d_date_sk#1, d_year#2]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (6) Scan parquet default.store_sales
-Output [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
+Output [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#7), (ss_sold_date_sk#7 >= 2451149), (ss_sold_date_sk#7 <= 2451179), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#6), (ss_sold_date_sk#6 >= 2451149), (ss_sold_date_sk#6 <= 2451179), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)]
 PushedFilters: [IsNotNull(ss_item_sk)]
 ReadSchema: struct<ss_item_sk:int,ss_ext_sales_price:decimal(7,2)>
 
 (7) ColumnarToRow
-Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
+Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 
 (8) Filter
-Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
-Condition : isnotnull(ss_item_sk#5)
+Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
+Condition : isnotnull(ss_item_sk#4)
 
 (9) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [d_date_sk#1]
-Right keys [1]: [ss_sold_date_sk#7]
+Right keys [1]: [ss_sold_date_sk#6]
 Join condition: None
 
 (10) Project [codegen id : 3]
-Output [3]: [d_year#2, ss_item_sk#5, ss_ext_sales_price#6]
-Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
+Output [3]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5]
+Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 
 (11) Scan parquet default.item
-Output [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12]
+Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)]
 ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_brand:string,i_manager_id:int>
 
 (12) ColumnarToRow [codegen id : 2]
-Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12]
+Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
 
 (13) Filter [codegen id : 2]
-Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12]
-Condition : ((isnotnull(i_manager_id#12) AND (i_manager_id#12 = 1)) AND isnotnull(i_item_sk#9))
+Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
+Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 1)) AND isnotnull(i_item_sk#8))
 
 (14) Project [codegen id : 2]
-Output [3]: [i_item_sk#9, i_brand_id#10, i_brand#11]
-Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12]
+Output [3]: [i_item_sk#8, i_brand_id#9, i_brand#10]
+Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
 
 (15) BroadcastExchange
-Input [3]: [i_item_sk#9, i_brand_id#10, i_brand#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13]
+Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (16) BroadcastHashJoin [codegen id : 3]
-Left keys [1]: [ss_item_sk#5]
-Right keys [1]: [i_item_sk#9]
+Left keys [1]: [ss_item_sk#4]
+Right keys [1]: [i_item_sk#8]
 Join condition: None
 
 (17) Project [codegen id : 3]
-Output [4]: [d_year#2, ss_ext_sales_price#6, i_brand_id#10, i_brand#11]
-Input [6]: [d_year#2, ss_item_sk#5, ss_ext_sales_price#6, i_item_sk#9, i_brand_id#10, i_brand#11]
+Output [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#9, i_brand#10]
+Input [6]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_brand_id#9, i_brand#10]
 
 (18) HashAggregate [codegen id : 3]
-Input [4]: [d_year#2, ss_ext_sales_price#6, i_brand_id#10, i_brand#11]
-Keys [3]: [d_year#2, i_brand#11, i_brand_id#10]
-Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#6))]
-Aggregate Attributes [1]: [sum#14]
-Results [4]: [d_year#2, i_brand#11, i_brand_id#10, sum#15]
+Input [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#9, i_brand#10]
+Keys [3]: [d_year#2, i_brand#10, i_brand_id#9]
+Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))]
+Aggregate Attributes [1]: [sum#12]
+Results [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#13]
 
 (19) Exchange
-Input [4]: [d_year#2, i_brand#11, i_brand_id#10, sum#15]
-Arguments: hashpartitioning(d_year#2, i_brand#11, i_brand_id#10, 5), ENSURE_REQUIREMENTS, [id=#16]
+Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#13]
+Arguments: hashpartitioning(d_year#2, i_brand#10, i_brand_id#9, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (20) HashAggregate [codegen id : 4]
-Input [4]: [d_year#2, i_brand#11, i_brand_id#10, sum#15]
-Keys [3]: [d_year#2, i_brand#11, i_brand_id#10]
-Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#17]
-Results [4]: [d_year#2, i_brand_id#10 AS brand_id#18, i_brand#11 AS brand#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#17,17,2) AS ext_price#20]
+Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#13]
+Keys [3]: [d_year#2, i_brand#10, i_brand_id#9]
+Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#14]
+Results [4]: [d_year#2, i_brand_id#9 AS brand_id#15, i_brand#10 AS brand#16, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#14,17,2) AS ext_price#17]
 
 (21) TakeOrderedAndProject
-Input [4]: [d_year#2, brand_id#18, brand#19, ext_price#20]
-Arguments: 100, [d_year#2 ASC NULLS FIRST, ext_price#20 DESC NULLS LAST, brand_id#18 ASC NULLS FIRST], [d_year#2, brand_id#18, brand#19, ext_price#20]
+Input [4]: [d_year#2, brand_id#15, brand#16, ext_price#17]
+Arguments: 100, [d_year#2 ASC NULLS FIRST, ext_price#17 DESC NULLS LAST, brand_id#15 ASC NULLS FIRST], [d_year#2, brand_id#15, brand#16, ext_price#17]
 
 ===== Subqueries =====
 
-Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8
+Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7
 ReusedExchange (22)
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52/explain.txt
index 8d081d60f9e..012a1cc0d40 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52/explain.txt
@@ -57,7 +57,7 @@ Condition : isnotnull(ss_item_sk#4)
 
 (8) BroadcastExchange
 Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
-Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7]
+Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [plan_id=1]
 
 (9) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [d_date_sk#1]
@@ -69,55 +69,55 @@ Output [3]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5]
 Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 
 (11) Scan parquet default.item
-Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
+Output [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manager_id#10]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)]
 ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_brand:string,i_manager_id:int>
 
 (12) ColumnarToRow [codegen id : 2]
-Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
+Input [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manager_id#10]
 
 (13) Filter [codegen id : 2]
-Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
-Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 1)) AND isnotnull(i_item_sk#8))
+Input [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manager_id#10]
+Condition : ((isnotnull(i_manager_id#10) AND (i_manager_id#10 = 1)) AND isnotnull(i_item_sk#7))
 
 (14) Project [codegen id : 2]
-Output [3]: [i_item_sk#8, i_brand_id#9, i_brand#10]
-Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
+Output [3]: [i_item_sk#7, i_brand_id#8, i_brand#9]
+Input [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manager_id#10]
 
 (15) BroadcastExchange
-Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12]
+Input [3]: [i_item_sk#7, i_brand_id#8, i_brand#9]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (16) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [ss_item_sk#4]
-Right keys [1]: [i_item_sk#8]
+Right keys [1]: [i_item_sk#7]
 Join condition: None
 
 (17) Project [codegen id : 3]
-Output [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#9, i_brand#10]
-Input [6]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_brand_id#9, i_brand#10]
+Output [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#8, i_brand#9]
+Input [6]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#7, i_brand_id#8, i_brand#9]
 
 (18) HashAggregate [codegen id : 3]
-Input [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#9, i_brand#10]
-Keys [3]: [d_year#2, i_brand#10, i_brand_id#9]
+Input [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#8, i_brand#9]
+Keys [3]: [d_year#2, i_brand#9, i_brand_id#8]
 Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))]
-Aggregate Attributes [1]: [sum#13]
-Results [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14]
+Aggregate Attributes [1]: [sum#11]
+Results [4]: [d_year#2, i_brand#9, i_brand_id#8, sum#12]
 
 (19) Exchange
-Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14]
-Arguments: hashpartitioning(d_year#2, i_brand#10, i_brand_id#9, 5), ENSURE_REQUIREMENTS, [id=#15]
+Input [4]: [d_year#2, i_brand#9, i_brand_id#8, sum#12]
+Arguments: hashpartitioning(d_year#2, i_brand#9, i_brand_id#8, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (20) HashAggregate [codegen id : 4]
-Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14]
-Keys [3]: [d_year#2, i_brand#10, i_brand_id#9]
+Input [4]: [d_year#2, i_brand#9, i_brand_id#8, sum#12]
+Keys [3]: [d_year#2, i_brand#9, i_brand_id#8]
 Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#16]
-Results [4]: [d_year#2, i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#16,17,2) AS ext_price#19]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#13]
+Results [4]: [d_year#2, i_brand_id#8 AS brand_id#14, i_brand#9 AS brand#15, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#13,17,2) AS ext_price#16]
 
 (21) TakeOrderedAndProject
-Input [4]: [d_year#2, brand_id#17, brand#18, ext_price#19]
-Arguments: 100, [d_year#2 ASC NULLS FIRST, ext_price#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [d_year#2, brand_id#17, brand#18, ext_price#19]
+Input [4]: [d_year#2, brand_id#14, brand#15, ext_price#16]
+Arguments: 100, [d_year#2 ASC NULLS FIRST, ext_price#16 DESC NULLS LAST, brand_id#14 ASC NULLS FIRST], [d_year#2, brand_id#14, brand#15, ext_price#16]
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53.sf100/explain.txt
index d100e73a4de..8dae5f9eda3 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53.sf100/explain.txt
@@ -49,116 +49,116 @@ Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5]
 
 (5) BroadcastExchange
 Input [2]: [i_item_sk#1, i_manufact_id#5]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (6) Scan parquet default.store_sales
-Output [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
+Output [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#14), (ss_sold_date_sk#14 >= 2451911), (ss_sold_date_sk#14 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#14 IN dynamicpruning#15)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#13), (ss_sold_date_sk#13 >= 2451911), (ss_sold_date_sk#13 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#13 IN dynamicpruning#14)]
 PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)]
 ReadSchema: struct<ss_item_sk:int,ss_store_sk:int,ss_sales_price:decimal(7,2)>
 
 (7) ColumnarToRow
-Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
+Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
 
 (8) Filter
-Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
-Condition : (isnotnull(ss_item_sk#11) AND isnotnull(ss_store_sk#12))
+Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
+Condition : (isnotnull(ss_item_sk#10) AND isnotnull(ss_store_sk#11))
 
 (9) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [i_item_sk#1]
-Right keys [1]: [ss_item_sk#11]
+Right keys [1]: [ss_item_sk#10]
 Join condition: None
 
 (10) Project [codegen id : 4]
-Output [4]: [i_manufact_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
-Input [6]: [i_item_sk#1, i_manufact_id#5, ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
+Output [4]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
+Input [6]: [i_item_sk#1, i_manufact_id#5, ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
 
 (11) Scan parquet default.store
-Output [1]: [s_store_sk#16]
+Output [1]: [s_store_sk#15]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int>
 
 (12) ColumnarToRow [codegen id : 2]
-Input [1]: [s_store_sk#16]
+Input [1]: [s_store_sk#15]
 
 (13) Filter [codegen id : 2]
-Input [1]: [s_store_sk#16]
-Condition : isnotnull(s_store_sk#16)
+Input [1]: [s_store_sk#15]
+Condition : isnotnull(s_store_sk#15)
 
 (14) BroadcastExchange
-Input [1]: [s_store_sk#16]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17]
+Input [1]: [s_store_sk#15]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]
 
 (15) BroadcastHashJoin [codegen id : 4]
-Left keys [1]: [ss_store_sk#12]
-Right keys [1]: [s_store_sk#16]
+Left keys [1]: [ss_store_sk#11]
+Right keys [1]: [s_store_sk#15]
 Join condition: None
 
 (16) Project [codegen id : 4]
-Output [3]: [i_manufact_id#5, ss_sales_price#13, ss_sold_date_sk#14]
-Input [5]: [i_manufact_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14, s_store_sk#16]
+Output [3]: [i_manufact_id#5, ss_sales_price#12, ss_sold_date_sk#13]
+Input [5]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13, s_store_sk#15]
 
 (17) ReusedExchange [Reuses operator id: 33]
-Output [2]: [d_date_sk#18, d_qoy#19]
+Output [2]: [d_date_sk#16, d_qoy#17]
 
 (18) BroadcastHashJoin [codegen id : 4]
-Left keys [1]: [ss_sold_date_sk#14]
-Right keys [1]: [d_date_sk#18]
+Left keys [1]: [ss_sold_date_sk#13]
+Right keys [1]: [d_date_sk#16]
 Join condition: None
 
 (19) Project [codegen id : 4]
-Output [3]: [i_manufact_id#5, ss_sales_price#13, d_qoy#19]
-Input [5]: [i_manufact_id#5, ss_sales_price#13, ss_sold_date_sk#14, d_date_sk#18, d_qoy#19]
+Output [3]: [i_manufact_id#5, ss_sales_price#12, d_qoy#17]
+Input [5]: [i_manufact_id#5, ss_sales_price#12, ss_sold_date_sk#13, d_date_sk#16, d_qoy#17]
 
 (20) HashAggregate [codegen id : 4]
-Input [3]: [i_manufact_id#5, ss_sales_price#13, d_qoy#19]
-Keys [2]: [i_manufact_id#5, d_qoy#19]
-Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#13))]
-Aggregate Attributes [1]: [sum#20]
-Results [3]: [i_manufact_id#5, d_qoy#19, sum#21]
+Input [3]: [i_manufact_id#5, ss_sales_price#12, d_qoy#17]
+Keys [2]: [i_manufact_id#5, d_qoy#17]
+Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#12))]
+Aggregate Attributes [1]: [sum#18]
+Results [3]: [i_manufact_id#5, d_qoy#17, sum#19]
 
 (21) Exchange
-Input [3]: [i_manufact_id#5, d_qoy#19, sum#21]
-Arguments: hashpartitioning(i_manufact_id#5, d_qoy#19, 5), ENSURE_REQUIREMENTS, [id=#22]
+Input [3]: [i_manufact_id#5, d_qoy#17, sum#19]
+Arguments: hashpartitioning(i_manufact_id#5, d_qoy#17, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (22) HashAggregate [codegen id : 5]
-Input [3]: [i_manufact_id#5, d_qoy#19, sum#21]
-Keys [2]: [i_manufact_id#5, d_qoy#19]
-Functions [1]: [sum(UnscaledValue(ss_sales_price#13))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#13))#23]
-Results [3]: [i_manufact_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#23,17,2) AS sum_sales#24, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#23,17,2) AS _w0#25]
+Input [3]: [i_manufact_id#5, d_qoy#17, sum#19]
+Keys [2]: [i_manufact_id#5, d_qoy#17]
+Functions [1]: [sum(UnscaledValue(ss_sales_price#12))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#12))#20]
+Results [3]: [i_manufact_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#20,17,2) AS _w0#22]
 
 (23) Exchange
-Input [3]: [i_manufact_id#5, sum_sales#24, _w0#25]
-Arguments: hashpartitioning(i_manufact_id#5, 5), ENSURE_REQUIREMENTS, [id=#26]
+Input [3]: [i_manufact_id#5, sum_sales#21, _w0#22]
+Arguments: hashpartitioning(i_manufact_id#5, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (24) Sort [codegen id : 6]
-Input [3]: [i_manufact_id#5, sum_sales#24, _w0#25]
+Input [3]: [i_manufact_id#5, sum_sales#21, _w0#22]
 Arguments: [i_manufact_id#5 ASC NULLS FIRST], false, 0
 
 (25) Window
-Input [3]: [i_manufact_id#5, sum_sales#24, _w0#25]
-Arguments: [avg(_w0#25) windowspecdefinition(i_manufact_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#27], [i_manufact_id#5]
+Input [3]: [i_manufact_id#5, sum_sales#21, _w0#22]
+Arguments: [avg(_w0#22) windowspecdefinition(i_manufact_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#23], [i_manufact_id#5]
 
 (26) Filter [codegen id : 7]
-Input [4]: [i_manufact_id#5, sum_sales#24, _w0#25, avg_quarterly_sales#27]
-Condition : (isnotnull(avg_quarterly_sales#27) AND ((avg_quarterly_sales#27 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#24 as decimal(22,6))) - promote_precision(cast(avg_quarterly_sales#27 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_quarterly_sales#27 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
+Input [4]: [i_manufact_id#5, sum_sales#21, _w0#22, avg_quarterly_sales#23]
+Condition : (isnotnull(avg_quarterly_sales#23) AND ((avg_quarterly_sales#23 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_quarterly_sales#23 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_quarterly_sales#23 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
 
 (27) Project [codegen id : 7]
-Output [3]: [i_manufact_id#5, sum_sales#24, avg_quarterly_sales#27]
-Input [4]: [i_manufact_id#5, sum_sales#24, _w0#25, avg_quarterly_sales#27]
+Output [3]: [i_manufact_id#5, sum_sales#21, avg_quarterly_sales#23]
+Input [4]: [i_manufact_id#5, sum_sales#21, _w0#22, avg_quarterly_sales#23]
 
 (28) TakeOrderedAndProject
-Input [3]: [i_manufact_id#5, sum_sales#24, avg_quarterly_sales#27]
-Arguments: 100, [avg_quarterly_sales#27 ASC NULLS FIRST, sum_sales#24 ASC NULLS FIRST, i_manufact_id#5 ASC NULLS FIRST], [i_manufact_id#5, sum_sales#24, avg_quarterly_sales#27]
+Input [3]: [i_manufact_id#5, sum_sales#21, avg_quarterly_sales#23]
+Arguments: 100, [avg_quarterly_sales#23 ASC NULLS FIRST, sum_sales#21 ASC NULLS FIRST, i_manufact_id#5 ASC NULLS FIRST], [i_manufact_id#5, sum_sales#21, avg_quarterly_sales#23]
 
 ===== Subqueries =====
 
-Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#14 IN dynamicpruning#15
+Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#13 IN dynamicpruning#14
 BroadcastExchange (33)
 +- * Project (32)
    +- * Filter (31)
@@ -167,25 +167,25 @@ BroadcastExchange (33)
 
 
 (29) Scan parquet default.date_dim
-Output [3]: [d_date_sk#18, d_month_seq#28, d_qoy#19]
+Output [3]: [d_date_sk#16, d_month_seq#24, d_qoy#17]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [In(d_month_seq, [1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222,1223]), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2452275), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_month_seq:int,d_qoy:int>
 
 (30) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#18, d_month_seq#28, d_qoy#19]
+Input [3]: [d_date_sk#16, d_month_seq#24, d_qoy#17]
 
 (31) Filter [codegen id : 1]
-Input [3]: [d_date_sk#18, d_month_seq#28, d_qoy#19]
-Condition : (((d_month_seq#28 INSET 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223 AND (d_date_sk#18 >= 2451911)) AND (d_date_sk#18 <= 2452275)) AND isnotnull(d_date_sk#18))
+Input [3]: [d_date_sk#16, d_month_seq#24, d_qoy#17]
+Condition : (((d_month_seq#24 INSET 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223 AND (d_date_sk#16 >= 2451911)) AND (d_date_sk#16 <= 2452275)) AND isnotnull(d_date_sk#16))
 
 (32) Project [codegen id : 1]
-Output [2]: [d_date_sk#18, d_qoy#19]
-Input [3]: [d_date_sk#18, d_month_seq#28, d_qoy#19]
+Output [2]: [d_date_sk#16, d_qoy#17]
+Input [3]: [d_date_sk#16, d_month_seq#24, d_qoy#17]
 
 (33) BroadcastExchange
-Input [2]: [d_date_sk#18, d_qoy#19]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29]
+Input [2]: [d_date_sk#16, d_qoy#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53/explain.txt
index 2b7ace43773..6410e38de51 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53/explain.txt
@@ -64,7 +64,7 @@ Condition : (isnotnull(ss_item_sk#10) AND isnotnull(ss_store_sk#11))
 
 (8) BroadcastExchange
 Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
 
 (9) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [i_item_sk#1]
@@ -76,85 +76,85 @@ Output [4]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk
 Input [6]: [i_item_sk#1, i_manufact_id#5, ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
 
 (11) ReusedExchange [Reuses operator id: 33]
-Output [2]: [d_date_sk#16, d_qoy#17]
+Output [2]: [d_date_sk#15, d_qoy#16]
 
 (12) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_sold_date_sk#13]
-Right keys [1]: [d_date_sk#16]
+Right keys [1]: [d_date_sk#15]
 Join condition: None
 
 (13) Project [codegen id : 4]
-Output [4]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, d_qoy#17]
-Input [6]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13, d_date_sk#16, d_qoy#17]
+Output [4]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, d_qoy#16]
+Input [6]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13, d_date_sk#15, d_qoy#16]
 
 (14) Scan parquet default.store
-Output [1]: [s_store_sk#18]
+Output [1]: [s_store_sk#17]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [1]: [s_store_sk#18]
+Input [1]: [s_store_sk#17]
 
 (16) Filter [codegen id : 3]
-Input [1]: [s_store_sk#18]
-Condition : isnotnull(s_store_sk#18)
+Input [1]: [s_store_sk#17]
+Condition : isnotnull(s_store_sk#17)
 
 (17) BroadcastExchange
-Input [1]: [s_store_sk#18]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19]
+Input [1]: [s_store_sk#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]
 
 (18) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#11]
-Right keys [1]: [s_store_sk#18]
+Right keys [1]: [s_store_sk#17]
 Join condition: None
 
 (19) Project [codegen id : 4]
-Output [3]: [i_manufact_id#5, ss_sales_price#12, d_qoy#17]
-Input [5]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, d_qoy#17, s_store_sk#18]
+Output [3]: [i_manufact_id#5, ss_sales_price#12, d_qoy#16]
+Input [5]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, d_qoy#16, s_store_sk#17]
 
 (20) HashAggregate [codegen id : 4]
-Input [3]: [i_manufact_id#5, ss_sales_price#12, d_qoy#17]
-Keys [2]: [i_manufact_id#5, d_qoy#17]
+Input [3]: [i_manufact_id#5, ss_sales_price#12, d_qoy#16]
+Keys [2]: [i_manufact_id#5, d_qoy#16]
 Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#12))]
-Aggregate Attributes [1]: [sum#20]
-Results [3]: [i_manufact_id#5, d_qoy#17, sum#21]
+Aggregate Attributes [1]: [sum#18]
+Results [3]: [i_manufact_id#5, d_qoy#16, sum#19]
 
 (21) Exchange
-Input [3]: [i_manufact_id#5, d_qoy#17, sum#21]
-Arguments: hashpartitioning(i_manufact_id#5, d_qoy#17, 5), ENSURE_REQUIREMENTS, [id=#22]
+Input [3]: [i_manufact_id#5, d_qoy#16, sum#19]
+Arguments: hashpartitioning(i_manufact_id#5, d_qoy#16, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (22) HashAggregate [codegen id : 5]
-Input [3]: [i_manufact_id#5, d_qoy#17, sum#21]
-Keys [2]: [i_manufact_id#5, d_qoy#17]
+Input [3]: [i_manufact_id#5, d_qoy#16, sum#19]
+Keys [2]: [i_manufact_id#5, d_qoy#16]
 Functions [1]: [sum(UnscaledValue(ss_sales_price#12))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#12))#23]
-Results [3]: [i_manufact_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#23,17,2) AS sum_sales#24, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#23,17,2) AS _w0#25]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#12))#20]
+Results [3]: [i_manufact_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#20,17,2) AS _w0#22]
 
 (23) Exchange
-Input [3]: [i_manufact_id#5, sum_sales#24, _w0#25]
-Arguments: hashpartitioning(i_manufact_id#5, 5), ENSURE_REQUIREMENTS, [id=#26]
+Input [3]: [i_manufact_id#5, sum_sales#21, _w0#22]
+Arguments: hashpartitioning(i_manufact_id#5, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (24) Sort [codegen id : 6]
-Input [3]: [i_manufact_id#5, sum_sales#24, _w0#25]
+Input [3]: [i_manufact_id#5, sum_sales#21, _w0#22]
 Arguments: [i_manufact_id#5 ASC NULLS FIRST], false, 0
 
 (25) Window
-Input [3]: [i_manufact_id#5, sum_sales#24, _w0#25]
-Arguments: [avg(_w0#25) windowspecdefinition(i_manufact_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#27], [i_manufact_id#5]
+Input [3]: [i_manufact_id#5, sum_sales#21, _w0#22]
+Arguments: [avg(_w0#22) windowspecdefinition(i_manufact_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#23], [i_manufact_id#5]
 
 (26) Filter [codegen id : 7]
-Input [4]: [i_manufact_id#5, sum_sales#24, _w0#25, avg_quarterly_sales#27]
-Condition : (isnotnull(avg_quarterly_sales#27) AND ((avg_quarterly_sales#27 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#24 as decimal(22,6))) - promote_precision(cast(avg_quarterly_sales#27 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_quarterly_sales#27 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
+Input [4]: [i_manufact_id#5, sum_sales#21, _w0#22, avg_quarterly_sales#23]
+Condition : (isnotnull(avg_quarterly_sales#23) AND ((avg_quarterly_sales#23 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_quarterly_sales#23 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_quarterly_sales#23 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
 
 (27) Project [codegen id : 7]
-Output [3]: [i_manufact_id#5, sum_sales#24, avg_quarterly_sales#27]
-Input [4]: [i_manufact_id#5, sum_sales#24, _w0#25, avg_quarterly_sales#27]
+Output [3]: [i_manufact_id#5, sum_sales#21, avg_quarterly_sales#23]
+Input [4]: [i_manufact_id#5, sum_sales#21, _w0#22, avg_quarterly_sales#23]
 
 (28) TakeOrderedAndProject
-Input [3]: [i_manufact_id#5, sum_sales#24, avg_quarterly_sales#27]
-Arguments: 100, [avg_quarterly_sales#27 ASC NULLS FIRST, sum_sales#24 ASC NULLS FIRST, i_manufact_id#5 ASC NULLS FIRST], [i_manufact_id#5, sum_sales#24, avg_quarterly_sales#27]
+Input [3]: [i_manufact_id#5, sum_sales#21, avg_quarterly_sales#23]
+Arguments: 100, [avg_quarterly_sales#23 ASC NULLS FIRST, sum_sales#21 ASC NULLS FIRST, i_manufact_id#5 ASC NULLS FIRST], [i_manufact_id#5, sum_sales#21, avg_quarterly_sales#23]
 
 ===== Subqueries =====
 
@@ -167,25 +167,25 @@ BroadcastExchange (33)
 
 
 (29) Scan parquet default.date_dim
-Output [3]: [d_date_sk#16, d_month_seq#28, d_qoy#17]
+Output [3]: [d_date_sk#15, d_month_seq#24, d_qoy#16]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [In(d_month_seq, [1212,1213,1214,1215,1216,1217,1218,1219,1220,1221,1222,1223]), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2452275), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_month_seq:int,d_qoy:int>
 
 (30) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#16, d_month_seq#28, d_qoy#17]
+Input [3]: [d_date_sk#15, d_month_seq#24, d_qoy#16]
 
 (31) Filter [codegen id : 1]
-Input [3]: [d_date_sk#16, d_month_seq#28, d_qoy#17]
-Condition : (((d_month_seq#28 INSET 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223 AND (d_date_sk#16 >= 2451911)) AND (d_date_sk#16 <= 2452275)) AND isnotnull(d_date_sk#16))
+Input [3]: [d_date_sk#15, d_month_seq#24, d_qoy#16]
+Condition : (((d_month_seq#24 INSET 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1221, 1222, 1223 AND (d_date_sk#15 >= 2451911)) AND (d_date_sk#15 <= 2452275)) AND isnotnull(d_date_sk#15))
 
 (32) Project [codegen id : 1]
-Output [2]: [d_date_sk#16, d_qoy#17]
-Input [3]: [d_date_sk#16, d_month_seq#28, d_qoy#17]
+Output [2]: [d_date_sk#15, d_qoy#16]
+Input [3]: [d_date_sk#15, d_month_seq#24, d_qoy#16]
 
 (33) BroadcastExchange
-Input [2]: [d_date_sk#16, d_qoy#17]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29]
+Input [2]: [d_date_sk#15, d_qoy#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt
index df4d94f40bc..1bed4285522 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt
@@ -42,88 +42,88 @@ Input [3]: [d_date_sk#1, d_year#2, d_moy#3]
 
 (5) BroadcastExchange
 Input [1]: [d_date_sk#1]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (6) Scan parquet default.store_sales
-Output [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
+Output [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#7), (ss_sold_date_sk#7 >= 2452215), (ss_sold_date_sk#7 <= 2452244), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#6), (ss_sold_date_sk#6 >= 2452215), (ss_sold_date_sk#6 <= 2452244), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)]
 PushedFilters: [IsNotNull(ss_item_sk)]
 ReadSchema: struct<ss_item_sk:int,ss_ext_sales_price:decimal(7,2)>
 
 (7) ColumnarToRow
-Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
+Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 
 (8) Filter
-Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
-Condition : isnotnull(ss_item_sk#5)
+Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
+Condition : isnotnull(ss_item_sk#4)
 
 (9) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [d_date_sk#1]
-Right keys [1]: [ss_sold_date_sk#7]
+Right keys [1]: [ss_sold_date_sk#6]
 Join condition: None
 
 (10) Project [codegen id : 3]
-Output [2]: [ss_item_sk#5, ss_ext_sales_price#6]
-Input [4]: [d_date_sk#1, ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7]
+Output [2]: [ss_item_sk#4, ss_ext_sales_price#5]
+Input [4]: [d_date_sk#1, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 
 (11) Scan parquet default.item
-Output [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12]
+Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,48), IsNotNull(i_item_sk)]
 ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_brand:string,i_manager_id:int>
 
 (12) ColumnarToRow [codegen id : 2]
-Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12]
+Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
 
 (13) Filter [codegen id : 2]
-Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12]
-Condition : ((isnotnull(i_manager_id#12) AND (i_manager_id#12 = 48)) AND isnotnull(i_item_sk#9))
+Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
+Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 48)) AND isnotnull(i_item_sk#8))
 
 (14) Project [codegen id : 2]
-Output [3]: [i_item_sk#9, i_brand_id#10, i_brand#11]
-Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12]
+Output [3]: [i_item_sk#8, i_brand_id#9, i_brand#10]
+Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
 
 (15) BroadcastExchange
-Input [3]: [i_item_sk#9, i_brand_id#10, i_brand#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13]
+Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (16) BroadcastHashJoin [codegen id : 3]
-Left keys [1]: [ss_item_sk#5]
-Right keys [1]: [i_item_sk#9]
+Left keys [1]: [ss_item_sk#4]
+Right keys [1]: [i_item_sk#8]
 Join condition: None
 
 (17) Project [codegen id : 3]
-Output [3]: [ss_ext_sales_price#6, i_brand_id#10, i_brand#11]
-Input [5]: [ss_item_sk#5, ss_ext_sales_price#6, i_item_sk#9, i_brand_id#10, i_brand#11]
+Output [3]: [ss_ext_sales_price#5, i_brand_id#9, i_brand#10]
+Input [5]: [ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_brand_id#9, i_brand#10]
 
 (18) HashAggregate [codegen id : 3]
-Input [3]: [ss_ext_sales_price#6, i_brand_id#10, i_brand#11]
-Keys [2]: [i_brand#11, i_brand_id#10]
-Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#6))]
-Aggregate Attributes [1]: [sum#14]
-Results [3]: [i_brand#11, i_brand_id#10, sum#15]
+Input [3]: [ss_ext_sales_price#5, i_brand_id#9, i_brand#10]
+Keys [2]: [i_brand#10, i_brand_id#9]
+Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))]
+Aggregate Attributes [1]: [sum#12]
+Results [3]: [i_brand#10, i_brand_id#9, sum#13]
 
 (19) Exchange
-Input [3]: [i_brand#11, i_brand_id#10, sum#15]
-Arguments: hashpartitioning(i_brand#11, i_brand_id#10, 5), ENSURE_REQUIREMENTS, [id=#16]
+Input [3]: [i_brand#10, i_brand_id#9, sum#13]
+Arguments: hashpartitioning(i_brand#10, i_brand_id#9, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (20) HashAggregate [codegen id : 4]
-Input [3]: [i_brand#11, i_brand_id#10, sum#15]
-Keys [2]: [i_brand#11, i_brand_id#10]
-Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#17]
-Results [3]: [i_brand_id#10 AS brand_id#18, i_brand#11 AS brand#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#17,17,2) AS ext_price#20]
+Input [3]: [i_brand#10, i_brand_id#9, sum#13]
+Keys [2]: [i_brand#10, i_brand_id#9]
+Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#14]
+Results [3]: [i_brand_id#9 AS brand_id#15, i_brand#10 AS brand#16, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#14,17,2) AS ext_price#17]
 
 (21) TakeOrderedAndProject
-Input [3]: [brand_id#18, brand#19, ext_price#20]
-Arguments: 100, [ext_price#20 DESC NULLS LAST, brand_id#18 ASC NULLS FIRST], [brand_id#18, brand#19, ext_price#20]
+Input [3]: [brand_id#15, brand#16, ext_price#17]
+Arguments: 100, [ext_price#17 DESC NULLS LAST, brand_id#15 ASC NULLS FIRST], [brand_id#15, brand#16, ext_price#17]
 
 ===== Subqueries =====
 
-Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8
+Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7
 ReusedExchange (22)
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55/explain.txt
index a10fc3256db..c9a41a65969 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55/explain.txt
@@ -57,7 +57,7 @@ Condition : isnotnull(ss_item_sk#4)
 
 (8) BroadcastExchange
 Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
-Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7]
+Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [plan_id=1]
 
 (9) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [d_date_sk#1]
@@ -69,55 +69,55 @@ Output [2]: [ss_item_sk#4, ss_ext_sales_price#5]
 Input [4]: [d_date_sk#1, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6]
 
 (11) Scan parquet default.item
-Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
+Output [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manager_id#10]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,48), IsNotNull(i_item_sk)]
 ReadSchema: struct<i_item_sk:int,i_brand_id:int,i_brand:string,i_manager_id:int>
 
 (12) ColumnarToRow [codegen id : 2]
-Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
+Input [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manager_id#10]
 
 (13) Filter [codegen id : 2]
-Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
-Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 48)) AND isnotnull(i_item_sk#8))
+Input [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manager_id#10]
+Condition : ((isnotnull(i_manager_id#10) AND (i_manager_id#10 = 48)) AND isnotnull(i_item_sk#7))
 
 (14) Project [codegen id : 2]
-Output [3]: [i_item_sk#8, i_brand_id#9, i_brand#10]
-Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11]
+Output [3]: [i_item_sk#7, i_brand_id#8, i_brand#9]
+Input [4]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manager_id#10]
 
 (15) BroadcastExchange
-Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12]
+Input [3]: [i_item_sk#7, i_brand_id#8, i_brand#9]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (16) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [ss_item_sk#4]
-Right keys [1]: [i_item_sk#8]
+Right keys [1]: [i_item_sk#7]
 Join condition: None
 
 (17) Project [codegen id : 3]
-Output [3]: [ss_ext_sales_price#5, i_brand_id#9, i_brand#10]
-Input [5]: [ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_brand_id#9, i_brand#10]
+Output [3]: [ss_ext_sales_price#5, i_brand_id#8, i_brand#9]
+Input [5]: [ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#7, i_brand_id#8, i_brand#9]
 
 (18) HashAggregate [codegen id : 3]
-Input [3]: [ss_ext_sales_price#5, i_brand_id#9, i_brand#10]
-Keys [2]: [i_brand#10, i_brand_id#9]
+Input [3]: [ss_ext_sales_price#5, i_brand_id#8, i_brand#9]
+Keys [2]: [i_brand#9, i_brand_id#8]
 Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))]
-Aggregate Attributes [1]: [sum#13]
-Results [3]: [i_brand#10, i_brand_id#9, sum#14]
+Aggregate Attributes [1]: [sum#11]
+Results [3]: [i_brand#9, i_brand_id#8, sum#12]
 
 (19) Exchange
-Input [3]: [i_brand#10, i_brand_id#9, sum#14]
-Arguments: hashpartitioning(i_brand#10, i_brand_id#9, 5), ENSURE_REQUIREMENTS, [id=#15]
+Input [3]: [i_brand#9, i_brand_id#8, sum#12]
+Arguments: hashpartitioning(i_brand#9, i_brand_id#8, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (20) HashAggregate [codegen id : 4]
-Input [3]: [i_brand#10, i_brand_id#9, sum#14]
-Keys [2]: [i_brand#10, i_brand_id#9]
+Input [3]: [i_brand#9, i_brand_id#8, sum#12]
+Keys [2]: [i_brand#9, i_brand_id#8]
 Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#16]
-Results [3]: [i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#16,17,2) AS ext_price#19]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#13]
+Results [3]: [i_brand_id#8 AS brand_id#14, i_brand#9 AS brand#15, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#13,17,2) AS ext_price#16]
 
 (21) TakeOrderedAndProject
-Input [3]: [brand_id#17, brand#18, ext_price#19]
-Arguments: 100, [ext_price#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [brand_id#17, brand#18, ext_price#19]
+Input [3]: [brand_id#14, brand#15, ext_price#16]
+Arguments: 100, [ext_price#16 DESC NULLS LAST, brand_id#14 ASC NULLS FIRST], [brand_id#14, brand#15, ext_price#16]
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59.sf100/explain.txt
index 8f71448cb76..74dbf2cab3a 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59.sf100/explain.txt
@@ -83,7 +83,7 @@ Condition : (isnotnull(d_date_sk#4) AND isnotnull(d_week_seq#5))
 
 (7) BroadcastExchange
 Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
 
 (8) BroadcastHashJoin [codegen id : 2]
 Left keys [1]: [ss_sold_date_sk#3]
@@ -98,77 +98,77 @@ Input [6]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3, d_date_sk#4, d_w
 Input [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6]
 Keys [2]: [d_week_seq#5, ss_store_sk#1]
 Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END)), partial_sum(Unsc [...]
-Aggregate Attributes [7]: [sum#8, sum#9, sum#10, sum#11, sum#12, sum#13, sum#14]
-Results [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21]
+Aggregate Attributes [7]: [sum#7, sum#8, sum#9, sum#10, sum#11, sum#12, sum#13]
+Results [9]: [d_week_seq#5, ss_store_sk#1, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20]
 
 (11) Exchange
-Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21]
-Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [id=#22]
+Input [9]: [d_week_seq#5, ss_store_sk#1, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20]
+Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=2]
 
 (12) HashAggregate [codegen id : 10]
-Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21]
+Input [9]: [d_week_seq#5, ss_store_sk#1, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20]
 Keys [2]: [d_week_seq#5, ss_store_sk#1]
 Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday   ) T [...]
-Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#23, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END))#25, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END))#27, sum(UnscaledValue(CASE WHEN (d [...]
-Results [9]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#23,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#24,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END))#25,17,2) AS tue_sales#32, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price [...]
+Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#21, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#22, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END))#23, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END))#25, sum(UnscaledValue(CASE WHEN (d [...]
+Results [9]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#21,17,2) AS sun_sales#28, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#22,17,2) AS mon_sales#29, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END))#23,17,2) AS tue_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price [...]
 
 (13) Scan parquet default.store
-Output [3]: [s_store_sk#37, s_store_id#38, s_store_name#39]
+Output [3]: [s_store_sk#35, s_store_id#36, s_store_name#37]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)]
 ReadSchema: struct<s_store_sk:int,s_store_id:string,s_store_name:string>
 
 (14) ColumnarToRow [codegen id : 3]
-Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39]
+Input [3]: [s_store_sk#35, s_store_id#36, s_store_name#37]
 
 (15) Filter [codegen id : 3]
-Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39]
-Condition : (isnotnull(s_store_sk#37) AND isnotnull(s_store_id#38))
+Input [3]: [s_store_sk#35, s_store_id#36, s_store_name#37]
+Condition : (isnotnull(s_store_sk#35) AND isnotnull(s_store_id#36))
 
 (16) BroadcastExchange
-Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40]
+Input [3]: [s_store_sk#35, s_store_id#36, s_store_name#37]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
 
 (17) BroadcastHashJoin [codegen id : 10]
 Left keys [1]: [ss_store_sk#1]
-Right keys [1]: [s_store_sk#37]
+Right keys [1]: [s_store_sk#35]
 Join condition: None
 
 (18) Project [codegen id : 10]
-Output [10]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39]
-Input [12]: [d_week_seq#5, ss_store_sk#1, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#37, s_store_id#38, s_store_name#39]
+Output [10]: [d_week_seq#5, sun_sales#28, mon_sales#29, tue_sales#30, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_id#36, s_store_name#37]
+Input [12]: [d_week_seq#5, ss_store_sk#1, sun_sales#28, mon_sales#29, tue_sales#30, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_sk#35, s_store_id#36, s_store_name#37]
 
 (19) Scan parquet default.date_dim
-Output [2]: [d_month_seq#41, d_week_seq#42]
+Output [2]: [d_month_seq#38, d_week_seq#39]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1185), LessThanOrEqual(d_month_seq,1196), IsNotNull(d_week_seq)]
 ReadSchema: struct<d_month_seq:int,d_week_seq:int>
 
 (20) ColumnarToRow [codegen id : 4]
-Input [2]: [d_month_seq#41, d_week_seq#42]
+Input [2]: [d_month_seq#38, d_week_seq#39]
 
 (21) Filter [codegen id : 4]
-Input [2]: [d_month_seq#41, d_week_seq#42]
-Condition : (((isnotnull(d_month_seq#41) AND (d_month_seq#41 >= 1185)) AND (d_month_seq#41 <= 1196)) AND isnotnull(d_week_seq#42))
+Input [2]: [d_month_seq#38, d_week_seq#39]
+Condition : (((isnotnull(d_month_seq#38) AND (d_month_seq#38 >= 1185)) AND (d_month_seq#38 <= 1196)) AND isnotnull(d_week_seq#39))
 
 (22) Project [codegen id : 4]
-Output [1]: [d_week_seq#42]
-Input [2]: [d_month_seq#41, d_week_seq#42]
+Output [1]: [d_week_seq#39]
+Input [2]: [d_month_seq#38, d_week_seq#39]
 
 (23) BroadcastExchange
-Input [1]: [d_week_seq#42]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#43]
+Input [1]: [d_week_seq#39]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]
 
 (24) BroadcastHashJoin [codegen id : 10]
 Left keys [1]: [d_week_seq#5]
-Right keys [1]: [d_week_seq#42]
+Right keys [1]: [d_week_seq#39]
 Join condition: None
 
 (25) Project [codegen id : 10]
-Output [10]: [s_store_name#39 AS s_store_name1#44, d_week_seq#5 AS d_week_seq1#45, s_store_id#38 AS s_store_id1#46, sun_sales#30 AS sun_sales1#47, mon_sales#31 AS mon_sales1#48, tue_sales#32 AS tue_sales1#49, wed_sales#33 AS wed_sales1#50, thu_sales#34 AS thu_sales1#51, fri_sales#35 AS fri_sales1#52, sat_sales#36 AS sat_sales1#53]
-Input [11]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39, d_week_seq#42]
+Output [10]: [s_store_name#37 AS s_store_name1#40, d_week_seq#5 AS d_week_seq1#41, s_store_id#36 AS s_store_id1#42, sun_sales#28 AS sun_sales1#43, mon_sales#29 AS mon_sales1#44, tue_sales#30 AS tue_sales1#45, wed_sales#31 AS wed_sales1#46, thu_sales#32 AS thu_sales1#47, fri_sales#33 AS fri_sales1#48, sat_sales#34 AS sat_sales1#49]
+Input [11]: [d_week_seq#5, sun_sales#28, mon_sales#29, tue_sales#30, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_id#36, s_store_name#37, d_week_seq#39]
 
 (26) Scan parquet default.store_sales
 Output [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3]
@@ -201,92 +201,92 @@ Input [6]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3, d_date_sk#4, d_w
 Input [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6]
 Keys [2]: [d_week_seq#5, ss_store_sk#1]
 Functions [6]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday   ) THEN ss_sales_price#2 END)), partial_sum(Unsc [...]
-Aggregate Attributes [6]: [sum#54, sum#55, sum#56, sum#57, sum#58, sum#59]
-Results [8]: [d_week_seq#5, ss_store_sk#1, sum#60, sum#61, sum#62, sum#63, sum#64, sum#65]
+Aggregate Attributes [6]: [sum#50, sum#51, sum#52, sum#53, sum#54, sum#55]
+Results [8]: [d_week_seq#5, ss_store_sk#1, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61]
 
 (33) Exchange
-Input [8]: [d_week_seq#5, ss_store_sk#1, sum#60, sum#61, sum#62, sum#63, sum#64, sum#65]
-Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [id=#66]
+Input [8]: [d_week_seq#5, ss_store_sk#1, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61]
+Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (34) HashAggregate [codegen id : 9]
-Input [8]: [d_week_seq#5, ss_store_sk#1, sum#60, sum#61, sum#62, sum#63, sum#64, sum#65]
+Input [8]: [d_week_seq#5, ss_store_sk#1, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61]
 Keys [2]: [d_week_seq#5, ss_store_sk#1]
 Functions [6]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday   ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) T [...]
-Aggregate Attributes [6]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#23, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday   ) THEN ss_sales_price#2 END))#28, sum(UnscaledValue(CASE WHEN (d [...]
-Results [8]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#23,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#24,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#26,17,2) AS wed_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price [...]
+Aggregate Attributes [6]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#21, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#22, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END))#25, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday   ) THEN ss_sales_price#2 END))#26, sum(UnscaledValue(CASE WHEN (d [...]
+Results [8]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#21,17,2) AS sun_sales#28, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#22,17,2) AS mon_sales#29, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#24,17,2) AS wed_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price [...]
 
 (35) Scan parquet default.store
-Output [2]: [s_store_sk#67, s_store_id#68]
+Output [2]: [s_store_sk#62, s_store_id#63]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)]
 ReadSchema: struct<s_store_sk:int,s_store_id:string>
 
 (36) ColumnarToRow [codegen id : 7]
-Input [2]: [s_store_sk#67, s_store_id#68]
+Input [2]: [s_store_sk#62, s_store_id#63]
 
 (37) Filter [codegen id : 7]
-Input [2]: [s_store_sk#67, s_store_id#68]
-Condition : (isnotnull(s_store_sk#67) AND isnotnull(s_store_id#68))
+Input [2]: [s_store_sk#62, s_store_id#63]
+Condition : (isnotnull(s_store_sk#62) AND isnotnull(s_store_id#63))
 
 (38) BroadcastExchange
-Input [2]: [s_store_sk#67, s_store_id#68]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69]
+Input [2]: [s_store_sk#62, s_store_id#63]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=6]
 
 (39) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [ss_store_sk#1]
-Right keys [1]: [s_store_sk#67]
+Right keys [1]: [s_store_sk#62]
 Join condition: None
 
 (40) Project [codegen id : 9]
-Output [8]: [d_week_seq#5, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#68]
-Input [10]: [d_week_seq#5, ss_store_sk#1, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#67, s_store_id#68]
+Output [8]: [d_week_seq#5, sun_sales#28, mon_sales#29, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_id#63]
+Input [10]: [d_week_seq#5, ss_store_sk#1, sun_sales#28, mon_sales#29, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_sk#62, s_store_id#63]
 
 (41) Scan parquet default.date_dim
-Output [2]: [d_month_seq#70, d_week_seq#71]
+Output [2]: [d_month_seq#64, d_week_seq#65]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1197), LessThanOrEqual(d_month_seq,1208), IsNotNull(d_week_seq)]
 ReadSchema: struct<d_month_seq:int,d_week_seq:int>
 
 (42) ColumnarToRow [codegen id : 8]
-Input [2]: [d_month_seq#70, d_week_seq#71]
+Input [2]: [d_month_seq#64, d_week_seq#65]
 
 (43) Filter [codegen id : 8]
-Input [2]: [d_month_seq#70, d_week_seq#71]
-Condition : (((isnotnull(d_month_seq#70) AND (d_month_seq#70 >= 1197)) AND (d_month_seq#70 <= 1208)) AND isnotnull(d_week_seq#71))
+Input [2]: [d_month_seq#64, d_week_seq#65]
+Condition : (((isnotnull(d_month_seq#64) AND (d_month_seq#64 >= 1197)) AND (d_month_seq#64 <= 1208)) AND isnotnull(d_week_seq#65))
 
 (44) Project [codegen id : 8]
-Output [1]: [d_week_seq#71]
-Input [2]: [d_month_seq#70, d_week_seq#71]
+Output [1]: [d_week_seq#65]
+Input [2]: [d_month_seq#64, d_week_seq#65]
 
 (45) BroadcastExchange
-Input [1]: [d_week_seq#71]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#72]
+Input [1]: [d_week_seq#65]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
 
 (46) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [d_week_seq#5]
-Right keys [1]: [d_week_seq#71]
+Right keys [1]: [d_week_seq#65]
 Join condition: None
 
 (47) Project [codegen id : 9]
-Output [8]: [d_week_seq#5 AS d_week_seq2#73, s_store_id#68 AS s_store_id2#74, sun_sales#30 AS sun_sales2#75, mon_sales#31 AS mon_sales2#76, wed_sales#33 AS wed_sales2#77, thu_sales#34 AS thu_sales2#78, fri_sales#35 AS fri_sales2#79, sat_sales#36 AS sat_sales2#80]
-Input [9]: [d_week_seq#5, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#68, d_week_seq#71]
+Output [8]: [d_week_seq#5 AS d_week_seq2#66, s_store_id#63 AS s_store_id2#67, sun_sales#28 AS sun_sales2#68, mon_sales#29 AS mon_sales2#69, wed_sales#31 AS wed_sales2#70, thu_sales#32 AS thu_sales2#71, fri_sales#33 AS fri_sales2#72, sat_sales#34 AS sat_sales2#73]
+Input [9]: [d_week_seq#5, sun_sales#28, mon_sales#29, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_id#63, d_week_seq#65]
 
 (48) BroadcastExchange
-Input [8]: [d_week_seq2#73, s_store_id2#74, sun_sales2#75, mon_sales2#76, wed_sales2#77, thu_sales2#78, fri_sales2#79, sat_sales2#80]
-Arguments: HashedRelationBroadcastMode(List(input[1, string, true], (input[0, int, true] - 52)),false), [id=#81]
+Input [8]: [d_week_seq2#66, s_store_id2#67, sun_sales2#68, mon_sales2#69, wed_sales2#70, thu_sales2#71, fri_sales2#72, sat_sales2#73]
+Arguments: HashedRelationBroadcastMode(List(input[1, string, true], (input[0, int, true] - 52)),false), [plan_id=8]
 
 (49) BroadcastHashJoin [codegen id : 10]
-Left keys [2]: [s_store_id1#46, d_week_seq1#45]
-Right keys [2]: [s_store_id2#74, (d_week_seq2#73 - 52)]
+Left keys [2]: [s_store_id1#42, d_week_seq1#41]
+Right keys [2]: [s_store_id2#67, (d_week_seq2#66 - 52)]
 Join condition: None
 
 (50) Project [codegen id : 10]
-Output [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, CheckOverflow((promote_precision(sun_sales1#47) / promote_precision(sun_sales2#75)), DecimalType(37,20), true) AS (sun_sales1 / sun_sales2)#82, CheckOverflow((promote_precision(mon_sales1#48) / promote_precision(mon_sales2#76)), DecimalType(37,20), true) AS (mon_sales1 / mon_sales2)#83, CheckOverflow((promote_precision(tue_sales1#49) / promote_precision(tue_sales1#49)), DecimalType(37,20), true) AS (tue_sales1 / tue_sales1)# [...]
-Input [18]: [s_store_name1#44, d_week_seq1#45, s_store_id1#46, sun_sales1#47, mon_sales1#48, tue_sales1#49, wed_sales1#50, thu_sales1#51, fri_sales1#52, sat_sales1#53, d_week_seq2#73, s_store_id2#74, sun_sales2#75, mon_sales2#76, wed_sales2#77, thu_sales2#78, fri_sales2#79, sat_sales2#80]
+Output [10]: [s_store_name1#40, s_store_id1#42, d_week_seq1#41, CheckOverflow((promote_precision(sun_sales1#43) / promote_precision(sun_sales2#68)), DecimalType(37,20), true) AS (sun_sales1 / sun_sales2)#74, CheckOverflow((promote_precision(mon_sales1#44) / promote_precision(mon_sales2#69)), DecimalType(37,20), true) AS (mon_sales1 / mon_sales2)#75, CheckOverflow((promote_precision(tue_sales1#45) / promote_precision(tue_sales1#45)), DecimalType(37,20), true) AS (tue_sales1 / tue_sales1)# [...]
+Input [18]: [s_store_name1#40, d_week_seq1#41, s_store_id1#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#66, s_store_id2#67, sun_sales2#68, mon_sales2#69, wed_sales2#70, thu_sales2#71, fri_sales2#72, sat_sales2#73]
 
 (51) TakeOrderedAndProject
-Input [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#82, (mon_sales1 / mon_sales2)#83, (tue_sales1 / tue_sales1)#84, (wed_sales1 / wed_sales2)#85, (thu_sales1 / thu_sales2)#86, (fri_sales1 / fri_sales2)#87, (sat_sales1 / sat_sales2)#88]
-Arguments: 100, [s_store_name1#44 ASC NULLS FIRST, s_store_id1#46 ASC NULLS FIRST, d_week_seq1#45 ASC NULLS FIRST], [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#82, (mon_sales1 / mon_sales2)#83, (tue_sales1 / tue_sales1)#84, (wed_sales1 / wed_sales2)#85, (thu_sales1 / thu_sales2)#86, (fri_sales1 / fri_sales2)#87, (sat_sales1 / sat_sales2)#88]
+Input [10]: [s_store_name1#40, s_store_id1#42, d_week_seq1#41, (sun_sales1 / sun_sales2)#74, (mon_sales1 / mon_sales2)#75, (tue_sales1 / tue_sales1)#76, (wed_sales1 / wed_sales2)#77, (thu_sales1 / thu_sales2)#78, (fri_sales1 / fri_sales2)#79, (sat_sales1 / sat_sales2)#80]
+Arguments: 100, [s_store_name1#40 ASC NULLS FIRST, s_store_id1#42 ASC NULLS FIRST, d_week_seq1#41 ASC NULLS FIRST], [s_store_name1#40, s_store_id1#42, d_week_seq1#41, (sun_sales1 / sun_sales2)#74, (mon_sales1 / mon_sales2)#75, (tue_sales1 / tue_sales1)#76, (wed_sales1 / wed_sales2)#77, (thu_sales1 / thu_sales2)#78, (fri_sales1 / fri_sales2)#79, (sat_sales1 / sat_sales2)#80]
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59/explain.txt
index 8f71448cb76..74dbf2cab3a 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59/explain.txt
@@ -83,7 +83,7 @@ Condition : (isnotnull(d_date_sk#4) AND isnotnull(d_week_seq#5))
 
 (7) BroadcastExchange
 Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
 
 (8) BroadcastHashJoin [codegen id : 2]
 Left keys [1]: [ss_sold_date_sk#3]
@@ -98,77 +98,77 @@ Input [6]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3, d_date_sk#4, d_w
 Input [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6]
 Keys [2]: [d_week_seq#5, ss_store_sk#1]
 Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END)), partial_sum(Unsc [...]
-Aggregate Attributes [7]: [sum#8, sum#9, sum#10, sum#11, sum#12, sum#13, sum#14]
-Results [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21]
+Aggregate Attributes [7]: [sum#7, sum#8, sum#9, sum#10, sum#11, sum#12, sum#13]
+Results [9]: [d_week_seq#5, ss_store_sk#1, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20]
 
 (11) Exchange
-Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21]
-Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [id=#22]
+Input [9]: [d_week_seq#5, ss_store_sk#1, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20]
+Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=2]
 
 (12) HashAggregate [codegen id : 10]
-Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21]
+Input [9]: [d_week_seq#5, ss_store_sk#1, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20]
 Keys [2]: [d_week_seq#5, ss_store_sk#1]
 Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday   ) T [...]
-Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#23, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END))#25, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END))#27, sum(UnscaledValue(CASE WHEN (d [...]
-Results [9]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#23,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#24,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END))#25,17,2) AS tue_sales#32, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price [...]
+Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#21, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#22, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END))#23, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END))#25, sum(UnscaledValue(CASE WHEN (d [...]
+Results [9]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#21,17,2) AS sun_sales#28, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#22,17,2) AS mon_sales#29, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday  ) THEN ss_sales_price#2 END))#23,17,2) AS tue_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price [...]
 
 (13) Scan parquet default.store
-Output [3]: [s_store_sk#37, s_store_id#38, s_store_name#39]
+Output [3]: [s_store_sk#35, s_store_id#36, s_store_name#37]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)]
 ReadSchema: struct<s_store_sk:int,s_store_id:string,s_store_name:string>
 
 (14) ColumnarToRow [codegen id : 3]
-Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39]
+Input [3]: [s_store_sk#35, s_store_id#36, s_store_name#37]
 
 (15) Filter [codegen id : 3]
-Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39]
-Condition : (isnotnull(s_store_sk#37) AND isnotnull(s_store_id#38))
+Input [3]: [s_store_sk#35, s_store_id#36, s_store_name#37]
+Condition : (isnotnull(s_store_sk#35) AND isnotnull(s_store_id#36))
 
 (16) BroadcastExchange
-Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40]
+Input [3]: [s_store_sk#35, s_store_id#36, s_store_name#37]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
 
 (17) BroadcastHashJoin [codegen id : 10]
 Left keys [1]: [ss_store_sk#1]
-Right keys [1]: [s_store_sk#37]
+Right keys [1]: [s_store_sk#35]
 Join condition: None
 
 (18) Project [codegen id : 10]
-Output [10]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39]
-Input [12]: [d_week_seq#5, ss_store_sk#1, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#37, s_store_id#38, s_store_name#39]
+Output [10]: [d_week_seq#5, sun_sales#28, mon_sales#29, tue_sales#30, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_id#36, s_store_name#37]
+Input [12]: [d_week_seq#5, ss_store_sk#1, sun_sales#28, mon_sales#29, tue_sales#30, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_sk#35, s_store_id#36, s_store_name#37]
 
 (19) Scan parquet default.date_dim
-Output [2]: [d_month_seq#41, d_week_seq#42]
+Output [2]: [d_month_seq#38, d_week_seq#39]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1185), LessThanOrEqual(d_month_seq,1196), IsNotNull(d_week_seq)]
 ReadSchema: struct<d_month_seq:int,d_week_seq:int>
 
 (20) ColumnarToRow [codegen id : 4]
-Input [2]: [d_month_seq#41, d_week_seq#42]
+Input [2]: [d_month_seq#38, d_week_seq#39]
 
 (21) Filter [codegen id : 4]
-Input [2]: [d_month_seq#41, d_week_seq#42]
-Condition : (((isnotnull(d_month_seq#41) AND (d_month_seq#41 >= 1185)) AND (d_month_seq#41 <= 1196)) AND isnotnull(d_week_seq#42))
+Input [2]: [d_month_seq#38, d_week_seq#39]
+Condition : (((isnotnull(d_month_seq#38) AND (d_month_seq#38 >= 1185)) AND (d_month_seq#38 <= 1196)) AND isnotnull(d_week_seq#39))
 
 (22) Project [codegen id : 4]
-Output [1]: [d_week_seq#42]
-Input [2]: [d_month_seq#41, d_week_seq#42]
+Output [1]: [d_week_seq#39]
+Input [2]: [d_month_seq#38, d_week_seq#39]
 
 (23) BroadcastExchange
-Input [1]: [d_week_seq#42]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#43]
+Input [1]: [d_week_seq#39]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]
 
 (24) BroadcastHashJoin [codegen id : 10]
 Left keys [1]: [d_week_seq#5]
-Right keys [1]: [d_week_seq#42]
+Right keys [1]: [d_week_seq#39]
 Join condition: None
 
 (25) Project [codegen id : 10]
-Output [10]: [s_store_name#39 AS s_store_name1#44, d_week_seq#5 AS d_week_seq1#45, s_store_id#38 AS s_store_id1#46, sun_sales#30 AS sun_sales1#47, mon_sales#31 AS mon_sales1#48, tue_sales#32 AS tue_sales1#49, wed_sales#33 AS wed_sales1#50, thu_sales#34 AS thu_sales1#51, fri_sales#35 AS fri_sales1#52, sat_sales#36 AS sat_sales1#53]
-Input [11]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39, d_week_seq#42]
+Output [10]: [s_store_name#37 AS s_store_name1#40, d_week_seq#5 AS d_week_seq1#41, s_store_id#36 AS s_store_id1#42, sun_sales#28 AS sun_sales1#43, mon_sales#29 AS mon_sales1#44, tue_sales#30 AS tue_sales1#45, wed_sales#31 AS wed_sales1#46, thu_sales#32 AS thu_sales1#47, fri_sales#33 AS fri_sales1#48, sat_sales#34 AS sat_sales1#49]
+Input [11]: [d_week_seq#5, sun_sales#28, mon_sales#29, tue_sales#30, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_id#36, s_store_name#37, d_week_seq#39]
 
 (26) Scan parquet default.store_sales
 Output [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3]
@@ -201,92 +201,92 @@ Input [6]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3, d_date_sk#4, d_w
 Input [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6]
 Keys [2]: [d_week_seq#5, ss_store_sk#1]
 Functions [6]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday   ) THEN ss_sales_price#2 END)), partial_sum(Unsc [...]
-Aggregate Attributes [6]: [sum#54, sum#55, sum#56, sum#57, sum#58, sum#59]
-Results [8]: [d_week_seq#5, ss_store_sk#1, sum#60, sum#61, sum#62, sum#63, sum#64, sum#65]
+Aggregate Attributes [6]: [sum#50, sum#51, sum#52, sum#53, sum#54, sum#55]
+Results [8]: [d_week_seq#5, ss_store_sk#1, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61]
 
 (33) Exchange
-Input [8]: [d_week_seq#5, ss_store_sk#1, sum#60, sum#61, sum#62, sum#63, sum#64, sum#65]
-Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [id=#66]
+Input [8]: [d_week_seq#5, ss_store_sk#1, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61]
+Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (34) HashAggregate [codegen id : 9]
-Input [8]: [d_week_seq#5, ss_store_sk#1, sum#60, sum#61, sum#62, sum#63, sum#64, sum#65]
+Input [8]: [d_week_seq#5, ss_store_sk#1, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61]
 Keys [2]: [d_week_seq#5, ss_store_sk#1]
 Functions [6]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday   ) THEN ss_sales_price#2 END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) T [...]
-Aggregate Attributes [6]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#23, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday   ) THEN ss_sales_price#2 END))#28, sum(UnscaledValue(CASE WHEN (d [...]
-Results [8]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#23,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#24,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#26,17,2) AS wed_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price [...]
+Aggregate Attributes [6]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#21, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#22, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 END))#25, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday   ) THEN ss_sales_price#2 END))#26, sum(UnscaledValue(CASE WHEN (d [...]
+Results [8]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday   ) THEN ss_sales_price#2 END))#21,17,2) AS sun_sales#28, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday   ) THEN ss_sales_price#2 END))#22,17,2) AS mon_sales#29, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 END))#24,17,2) AS wed_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price [...]
 
 (35) Scan parquet default.store
-Output [2]: [s_store_sk#67, s_store_id#68]
+Output [2]: [s_store_sk#62, s_store_id#63]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)]
 ReadSchema: struct<s_store_sk:int,s_store_id:string>
 
 (36) ColumnarToRow [codegen id : 7]
-Input [2]: [s_store_sk#67, s_store_id#68]
+Input [2]: [s_store_sk#62, s_store_id#63]
 
 (37) Filter [codegen id : 7]
-Input [2]: [s_store_sk#67, s_store_id#68]
-Condition : (isnotnull(s_store_sk#67) AND isnotnull(s_store_id#68))
+Input [2]: [s_store_sk#62, s_store_id#63]
+Condition : (isnotnull(s_store_sk#62) AND isnotnull(s_store_id#63))
 
 (38) BroadcastExchange
-Input [2]: [s_store_sk#67, s_store_id#68]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69]
+Input [2]: [s_store_sk#62, s_store_id#63]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=6]
 
 (39) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [ss_store_sk#1]
-Right keys [1]: [s_store_sk#67]
+Right keys [1]: [s_store_sk#62]
 Join condition: None
 
 (40) Project [codegen id : 9]
-Output [8]: [d_week_seq#5, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#68]
-Input [10]: [d_week_seq#5, ss_store_sk#1, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#67, s_store_id#68]
+Output [8]: [d_week_seq#5, sun_sales#28, mon_sales#29, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_id#63]
+Input [10]: [d_week_seq#5, ss_store_sk#1, sun_sales#28, mon_sales#29, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_sk#62, s_store_id#63]
 
 (41) Scan parquet default.date_dim
-Output [2]: [d_month_seq#70, d_week_seq#71]
+Output [2]: [d_month_seq#64, d_week_seq#65]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1197), LessThanOrEqual(d_month_seq,1208), IsNotNull(d_week_seq)]
 ReadSchema: struct<d_month_seq:int,d_week_seq:int>
 
 (42) ColumnarToRow [codegen id : 8]
-Input [2]: [d_month_seq#70, d_week_seq#71]
+Input [2]: [d_month_seq#64, d_week_seq#65]
 
 (43) Filter [codegen id : 8]
-Input [2]: [d_month_seq#70, d_week_seq#71]
-Condition : (((isnotnull(d_month_seq#70) AND (d_month_seq#70 >= 1197)) AND (d_month_seq#70 <= 1208)) AND isnotnull(d_week_seq#71))
+Input [2]: [d_month_seq#64, d_week_seq#65]
+Condition : (((isnotnull(d_month_seq#64) AND (d_month_seq#64 >= 1197)) AND (d_month_seq#64 <= 1208)) AND isnotnull(d_week_seq#65))
 
 (44) Project [codegen id : 8]
-Output [1]: [d_week_seq#71]
-Input [2]: [d_month_seq#70, d_week_seq#71]
+Output [1]: [d_week_seq#65]
+Input [2]: [d_month_seq#64, d_week_seq#65]
 
 (45) BroadcastExchange
-Input [1]: [d_week_seq#71]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#72]
+Input [1]: [d_week_seq#65]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
 
 (46) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [d_week_seq#5]
-Right keys [1]: [d_week_seq#71]
+Right keys [1]: [d_week_seq#65]
 Join condition: None
 
 (47) Project [codegen id : 9]
-Output [8]: [d_week_seq#5 AS d_week_seq2#73, s_store_id#68 AS s_store_id2#74, sun_sales#30 AS sun_sales2#75, mon_sales#31 AS mon_sales2#76, wed_sales#33 AS wed_sales2#77, thu_sales#34 AS thu_sales2#78, fri_sales#35 AS fri_sales2#79, sat_sales#36 AS sat_sales2#80]
-Input [9]: [d_week_seq#5, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#68, d_week_seq#71]
+Output [8]: [d_week_seq#5 AS d_week_seq2#66, s_store_id#63 AS s_store_id2#67, sun_sales#28 AS sun_sales2#68, mon_sales#29 AS mon_sales2#69, wed_sales#31 AS wed_sales2#70, thu_sales#32 AS thu_sales2#71, fri_sales#33 AS fri_sales2#72, sat_sales#34 AS sat_sales2#73]
+Input [9]: [d_week_seq#5, sun_sales#28, mon_sales#29, wed_sales#31, thu_sales#32, fri_sales#33, sat_sales#34, s_store_id#63, d_week_seq#65]
 
 (48) BroadcastExchange
-Input [8]: [d_week_seq2#73, s_store_id2#74, sun_sales2#75, mon_sales2#76, wed_sales2#77, thu_sales2#78, fri_sales2#79, sat_sales2#80]
-Arguments: HashedRelationBroadcastMode(List(input[1, string, true], (input[0, int, true] - 52)),false), [id=#81]
+Input [8]: [d_week_seq2#66, s_store_id2#67, sun_sales2#68, mon_sales2#69, wed_sales2#70, thu_sales2#71, fri_sales2#72, sat_sales2#73]
+Arguments: HashedRelationBroadcastMode(List(input[1, string, true], (input[0, int, true] - 52)),false), [plan_id=8]
 
 (49) BroadcastHashJoin [codegen id : 10]
-Left keys [2]: [s_store_id1#46, d_week_seq1#45]
-Right keys [2]: [s_store_id2#74, (d_week_seq2#73 - 52)]
+Left keys [2]: [s_store_id1#42, d_week_seq1#41]
+Right keys [2]: [s_store_id2#67, (d_week_seq2#66 - 52)]
 Join condition: None
 
 (50) Project [codegen id : 10]
-Output [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, CheckOverflow((promote_precision(sun_sales1#47) / promote_precision(sun_sales2#75)), DecimalType(37,20), true) AS (sun_sales1 / sun_sales2)#82, CheckOverflow((promote_precision(mon_sales1#48) / promote_precision(mon_sales2#76)), DecimalType(37,20), true) AS (mon_sales1 / mon_sales2)#83, CheckOverflow((promote_precision(tue_sales1#49) / promote_precision(tue_sales1#49)), DecimalType(37,20), true) AS (tue_sales1 / tue_sales1)# [...]
-Input [18]: [s_store_name1#44, d_week_seq1#45, s_store_id1#46, sun_sales1#47, mon_sales1#48, tue_sales1#49, wed_sales1#50, thu_sales1#51, fri_sales1#52, sat_sales1#53, d_week_seq2#73, s_store_id2#74, sun_sales2#75, mon_sales2#76, wed_sales2#77, thu_sales2#78, fri_sales2#79, sat_sales2#80]
+Output [10]: [s_store_name1#40, s_store_id1#42, d_week_seq1#41, CheckOverflow((promote_precision(sun_sales1#43) / promote_precision(sun_sales2#68)), DecimalType(37,20), true) AS (sun_sales1 / sun_sales2)#74, CheckOverflow((promote_precision(mon_sales1#44) / promote_precision(mon_sales2#69)), DecimalType(37,20), true) AS (mon_sales1 / mon_sales2)#75, CheckOverflow((promote_precision(tue_sales1#45) / promote_precision(tue_sales1#45)), DecimalType(37,20), true) AS (tue_sales1 / tue_sales1)# [...]
+Input [18]: [s_store_name1#40, d_week_seq1#41, s_store_id1#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#66, s_store_id2#67, sun_sales2#68, mon_sales2#69, wed_sales2#70, thu_sales2#71, fri_sales2#72, sat_sales2#73]
 
 (51) TakeOrderedAndProject
-Input [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#82, (mon_sales1 / mon_sales2)#83, (tue_sales1 / tue_sales1)#84, (wed_sales1 / wed_sales2)#85, (thu_sales1 / thu_sales2)#86, (fri_sales1 / fri_sales2)#87, (sat_sales1 / sat_sales2)#88]
-Arguments: 100, [s_store_name1#44 ASC NULLS FIRST, s_store_id1#46 ASC NULLS FIRST, d_week_seq1#45 ASC NULLS FIRST], [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#82, (mon_sales1 / mon_sales2)#83, (tue_sales1 / tue_sales1)#84, (wed_sales1 / wed_sales2)#85, (thu_sales1 / thu_sales2)#86, (fri_sales1 / fri_sales2)#87, (sat_sales1 / sat_sales2)#88]
+Input [10]: [s_store_name1#40, s_store_id1#42, d_week_seq1#41, (sun_sales1 / sun_sales2)#74, (mon_sales1 / mon_sales2)#75, (tue_sales1 / tue_sales1)#76, (wed_sales1 / wed_sales2)#77, (thu_sales1 / thu_sales2)#78, (fri_sales1 / fri_sales2)#79, (sat_sales1 / sat_sales2)#80]
+Arguments: 100, [s_store_name1#40 ASC NULLS FIRST, s_store_id1#42 ASC NULLS FIRST, d_week_seq1#41 ASC NULLS FIRST], [s_store_name1#40, s_store_id1#42, d_week_seq1#41, (sun_sales1 / sun_sales2)#74, (mon_sales1 / mon_sales2)#75, (tue_sales1 / tue_sales1)#76, (wed_sales1 / wed_sales2)#77, (thu_sales1 / thu_sales2)#78, (fri_sales1 / fri_sales2)#79, (sat_sales1 / sat_sales2)#80]
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt
index 1e722cf779d..6d0734c3e0d 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt
@@ -49,116 +49,116 @@ Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5]
 
 (5) BroadcastExchange
 Input [2]: [i_item_sk#1, i_manager_id#5]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (6) Scan parquet default.store_sales
-Output [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
+Output [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#14), (ss_sold_date_sk#14 >= 2452123), (ss_sold_date_sk#14 <= 2452487), dynamicpruningexpression(ss_sold_date_sk#14 IN dynamicpruning#15)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#13), (ss_sold_date_sk#13 >= 2452123), (ss_sold_date_sk#13 <= 2452487), dynamicpruningexpression(ss_sold_date_sk#13 IN dynamicpruning#14)]
 PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)]
 ReadSchema: struct<ss_item_sk:int,ss_store_sk:int,ss_sales_price:decimal(7,2)>
 
 (7) ColumnarToRow
-Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
+Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
 
 (8) Filter
-Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
-Condition : (isnotnull(ss_item_sk#11) AND isnotnull(ss_store_sk#12))
+Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
+Condition : (isnotnull(ss_item_sk#10) AND isnotnull(ss_store_sk#11))
 
 (9) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [i_item_sk#1]
-Right keys [1]: [ss_item_sk#11]
+Right keys [1]: [ss_item_sk#10]
 Join condition: None
 
 (10) Project [codegen id : 4]
-Output [4]: [i_manager_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
-Input [6]: [i_item_sk#1, i_manager_id#5, ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
+Output [4]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
+Input [6]: [i_item_sk#1, i_manager_id#5, ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
 
 (11) Scan parquet default.store
-Output [1]: [s_store_sk#16]
+Output [1]: [s_store_sk#15]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int>
 
 (12) ColumnarToRow [codegen id : 2]
-Input [1]: [s_store_sk#16]
+Input [1]: [s_store_sk#15]
 
 (13) Filter [codegen id : 2]
-Input [1]: [s_store_sk#16]
-Condition : isnotnull(s_store_sk#16)
+Input [1]: [s_store_sk#15]
+Condition : isnotnull(s_store_sk#15)
 
 (14) BroadcastExchange
-Input [1]: [s_store_sk#16]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17]
+Input [1]: [s_store_sk#15]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]
 
 (15) BroadcastHashJoin [codegen id : 4]
-Left keys [1]: [ss_store_sk#12]
-Right keys [1]: [s_store_sk#16]
+Left keys [1]: [ss_store_sk#11]
+Right keys [1]: [s_store_sk#15]
 Join condition: None
 
 (16) Project [codegen id : 4]
-Output [3]: [i_manager_id#5, ss_sales_price#13, ss_sold_date_sk#14]
-Input [5]: [i_manager_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14, s_store_sk#16]
+Output [3]: [i_manager_id#5, ss_sales_price#12, ss_sold_date_sk#13]
+Input [5]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13, s_store_sk#15]
 
 (17) ReusedExchange [Reuses operator id: 33]
-Output [2]: [d_date_sk#18, d_moy#19]
+Output [2]: [d_date_sk#16, d_moy#17]
 
 (18) BroadcastHashJoin [codegen id : 4]
-Left keys [1]: [ss_sold_date_sk#14]
-Right keys [1]: [d_date_sk#18]
+Left keys [1]: [ss_sold_date_sk#13]
+Right keys [1]: [d_date_sk#16]
 Join condition: None
 
 (19) Project [codegen id : 4]
-Output [3]: [i_manager_id#5, ss_sales_price#13, d_moy#19]
-Input [5]: [i_manager_id#5, ss_sales_price#13, ss_sold_date_sk#14, d_date_sk#18, d_moy#19]
+Output [3]: [i_manager_id#5, ss_sales_price#12, d_moy#17]
+Input [5]: [i_manager_id#5, ss_sales_price#12, ss_sold_date_sk#13, d_date_sk#16, d_moy#17]
 
 (20) HashAggregate [codegen id : 4]
-Input [3]: [i_manager_id#5, ss_sales_price#13, d_moy#19]
-Keys [2]: [i_manager_id#5, d_moy#19]
-Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#13))]
-Aggregate Attributes [1]: [sum#20]
-Results [3]: [i_manager_id#5, d_moy#19, sum#21]
+Input [3]: [i_manager_id#5, ss_sales_price#12, d_moy#17]
+Keys [2]: [i_manager_id#5, d_moy#17]
+Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#12))]
+Aggregate Attributes [1]: [sum#18]
+Results [3]: [i_manager_id#5, d_moy#17, sum#19]
 
 (21) Exchange
-Input [3]: [i_manager_id#5, d_moy#19, sum#21]
-Arguments: hashpartitioning(i_manager_id#5, d_moy#19, 5), ENSURE_REQUIREMENTS, [id=#22]
+Input [3]: [i_manager_id#5, d_moy#17, sum#19]
+Arguments: hashpartitioning(i_manager_id#5, d_moy#17, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (22) HashAggregate [codegen id : 5]
-Input [3]: [i_manager_id#5, d_moy#19, sum#21]
-Keys [2]: [i_manager_id#5, d_moy#19]
-Functions [1]: [sum(UnscaledValue(ss_sales_price#13))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#13))#23]
-Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#23,17,2) AS sum_sales#24, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#23,17,2) AS _w0#25]
+Input [3]: [i_manager_id#5, d_moy#17, sum#19]
+Keys [2]: [i_manager_id#5, d_moy#17]
+Functions [1]: [sum(UnscaledValue(ss_sales_price#12))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#12))#20]
+Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#20,17,2) AS _w0#22]
 
 (23) Exchange
-Input [3]: [i_manager_id#5, sum_sales#24, _w0#25]
-Arguments: hashpartitioning(i_manager_id#5, 5), ENSURE_REQUIREMENTS, [id=#26]
+Input [3]: [i_manager_id#5, sum_sales#21, _w0#22]
+Arguments: hashpartitioning(i_manager_id#5, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (24) Sort [codegen id : 6]
-Input [3]: [i_manager_id#5, sum_sales#24, _w0#25]
+Input [3]: [i_manager_id#5, sum_sales#21, _w0#22]
 Arguments: [i_manager_id#5 ASC NULLS FIRST], false, 0
 
 (25) Window
-Input [3]: [i_manager_id#5, sum_sales#24, _w0#25]
-Arguments: [avg(_w0#25) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#27], [i_manager_id#5]
+Input [3]: [i_manager_id#5, sum_sales#21, _w0#22]
+Arguments: [avg(_w0#22) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#23], [i_manager_id#5]
 
 (26) Filter [codegen id : 7]
-Input [4]: [i_manager_id#5, sum_sales#24, _w0#25, avg_monthly_sales#27]
-Condition : (isnotnull(avg_monthly_sales#27) AND ((avg_monthly_sales#27 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#24 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#27 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#27 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
+Input [4]: [i_manager_id#5, sum_sales#21, _w0#22, avg_monthly_sales#23]
+Condition : (isnotnull(avg_monthly_sales#23) AND ((avg_monthly_sales#23 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#23 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#23 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
 
 (27) Project [codegen id : 7]
-Output [3]: [i_manager_id#5, sum_sales#24, avg_monthly_sales#27]
-Input [4]: [i_manager_id#5, sum_sales#24, _w0#25, avg_monthly_sales#27]
+Output [3]: [i_manager_id#5, sum_sales#21, avg_monthly_sales#23]
+Input [4]: [i_manager_id#5, sum_sales#21, _w0#22, avg_monthly_sales#23]
 
 (28) TakeOrderedAndProject
-Input [3]: [i_manager_id#5, sum_sales#24, avg_monthly_sales#27]
-Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#27 ASC NULLS FIRST, sum_sales#24 ASC NULLS FIRST], [i_manager_id#5, sum_sales#24, avg_monthly_sales#27]
+Input [3]: [i_manager_id#5, sum_sales#21, avg_monthly_sales#23]
+Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#23 ASC NULLS FIRST, sum_sales#21 ASC NULLS FIRST], [i_manager_id#5, sum_sales#21, avg_monthly_sales#23]
 
 ===== Subqueries =====
 
-Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#14 IN dynamicpruning#15
+Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#13 IN dynamicpruning#14
 BroadcastExchange (33)
 +- * Project (32)
    +- * Filter (31)
@@ -167,25 +167,25 @@ BroadcastExchange (33)
 
 
 (29) Scan parquet default.date_dim
-Output [3]: [d_date_sk#18, d_month_seq#28, d_moy#19]
+Output [3]: [d_date_sk#16, d_month_seq#24, d_moy#17]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [In(d_month_seq, [1219,1220,1221,1222,1223,1224,1225,1226,1227,1228,1229,1230]), GreaterThanOrEqual(d_date_sk,2452123), LessThanOrEqual(d_date_sk,2452487), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_month_seq:int,d_moy:int>
 
 (30) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#18, d_month_seq#28, d_moy#19]
+Input [3]: [d_date_sk#16, d_month_seq#24, d_moy#17]
 
 (31) Filter [codegen id : 1]
-Input [3]: [d_date_sk#18, d_month_seq#28, d_moy#19]
-Condition : (((d_month_seq#28 INSET 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230 AND (d_date_sk#18 >= 2452123)) AND (d_date_sk#18 <= 2452487)) AND isnotnull(d_date_sk#18))
+Input [3]: [d_date_sk#16, d_month_seq#24, d_moy#17]
+Condition : (((d_month_seq#24 INSET 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230 AND (d_date_sk#16 >= 2452123)) AND (d_date_sk#16 <= 2452487)) AND isnotnull(d_date_sk#16))
 
 (32) Project [codegen id : 1]
-Output [2]: [d_date_sk#18, d_moy#19]
-Input [3]: [d_date_sk#18, d_month_seq#28, d_moy#19]
+Output [2]: [d_date_sk#16, d_moy#17]
+Input [3]: [d_date_sk#16, d_month_seq#24, d_moy#17]
 
 (33) BroadcastExchange
-Input [2]: [d_date_sk#18, d_moy#19]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29]
+Input [2]: [d_date_sk#16, d_moy#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63/explain.txt
index 35eaebb171a..d7953e56df5 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63/explain.txt
@@ -64,7 +64,7 @@ Condition : (isnotnull(ss_item_sk#10) AND isnotnull(ss_store_sk#11))
 
 (8) BroadcastExchange
 Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
 
 (9) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [i_item_sk#1]
@@ -76,85 +76,85 @@ Output [4]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#
 Input [6]: [i_item_sk#1, i_manager_id#5, ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13]
 
 (11) ReusedExchange [Reuses operator id: 33]
-Output [2]: [d_date_sk#16, d_moy#17]
+Output [2]: [d_date_sk#15, d_moy#16]
 
 (12) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_sold_date_sk#13]
-Right keys [1]: [d_date_sk#16]
+Right keys [1]: [d_date_sk#15]
 Join condition: None
 
 (13) Project [codegen id : 4]
-Output [4]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, d_moy#17]
-Input [6]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13, d_date_sk#16, d_moy#17]
+Output [4]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, d_moy#16]
+Input [6]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13, d_date_sk#15, d_moy#16]
 
 (14) Scan parquet default.store
-Output [1]: [s_store_sk#18]
+Output [1]: [s_store_sk#17]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [1]: [s_store_sk#18]
+Input [1]: [s_store_sk#17]
 
 (16) Filter [codegen id : 3]
-Input [1]: [s_store_sk#18]
-Condition : isnotnull(s_store_sk#18)
+Input [1]: [s_store_sk#17]
+Condition : isnotnull(s_store_sk#17)
 
 (17) BroadcastExchange
-Input [1]: [s_store_sk#18]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19]
+Input [1]: [s_store_sk#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]
 
 (18) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#11]
-Right keys [1]: [s_store_sk#18]
+Right keys [1]: [s_store_sk#17]
 Join condition: None
 
 (19) Project [codegen id : 4]
-Output [3]: [i_manager_id#5, ss_sales_price#12, d_moy#17]
-Input [5]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, d_moy#17, s_store_sk#18]
+Output [3]: [i_manager_id#5, ss_sales_price#12, d_moy#16]
+Input [5]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, d_moy#16, s_store_sk#17]
 
 (20) HashAggregate [codegen id : 4]
-Input [3]: [i_manager_id#5, ss_sales_price#12, d_moy#17]
-Keys [2]: [i_manager_id#5, d_moy#17]
+Input [3]: [i_manager_id#5, ss_sales_price#12, d_moy#16]
+Keys [2]: [i_manager_id#5, d_moy#16]
 Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#12))]
-Aggregate Attributes [1]: [sum#20]
-Results [3]: [i_manager_id#5, d_moy#17, sum#21]
+Aggregate Attributes [1]: [sum#18]
+Results [3]: [i_manager_id#5, d_moy#16, sum#19]
 
 (21) Exchange
-Input [3]: [i_manager_id#5, d_moy#17, sum#21]
-Arguments: hashpartitioning(i_manager_id#5, d_moy#17, 5), ENSURE_REQUIREMENTS, [id=#22]
+Input [3]: [i_manager_id#5, d_moy#16, sum#19]
+Arguments: hashpartitioning(i_manager_id#5, d_moy#16, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (22) HashAggregate [codegen id : 5]
-Input [3]: [i_manager_id#5, d_moy#17, sum#21]
-Keys [2]: [i_manager_id#5, d_moy#17]
+Input [3]: [i_manager_id#5, d_moy#16, sum#19]
+Keys [2]: [i_manager_id#5, d_moy#16]
 Functions [1]: [sum(UnscaledValue(ss_sales_price#12))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#12))#23]
-Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#23,17,2) AS sum_sales#24, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#23,17,2) AS _w0#25]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#12))#20]
+Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#20,17,2) AS _w0#22]
 
 (23) Exchange
-Input [3]: [i_manager_id#5, sum_sales#24, _w0#25]
-Arguments: hashpartitioning(i_manager_id#5, 5), ENSURE_REQUIREMENTS, [id=#26]
+Input [3]: [i_manager_id#5, sum_sales#21, _w0#22]
+Arguments: hashpartitioning(i_manager_id#5, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (24) Sort [codegen id : 6]
-Input [3]: [i_manager_id#5, sum_sales#24, _w0#25]
+Input [3]: [i_manager_id#5, sum_sales#21, _w0#22]
 Arguments: [i_manager_id#5 ASC NULLS FIRST], false, 0
 
 (25) Window
-Input [3]: [i_manager_id#5, sum_sales#24, _w0#25]
-Arguments: [avg(_w0#25) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#27], [i_manager_id#5]
+Input [3]: [i_manager_id#5, sum_sales#21, _w0#22]
+Arguments: [avg(_w0#22) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#23], [i_manager_id#5]
 
 (26) Filter [codegen id : 7]
-Input [4]: [i_manager_id#5, sum_sales#24, _w0#25, avg_monthly_sales#27]
-Condition : (isnotnull(avg_monthly_sales#27) AND ((avg_monthly_sales#27 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#24 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#27 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#27 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
+Input [4]: [i_manager_id#5, sum_sales#21, _w0#22, avg_monthly_sales#23]
+Condition : (isnotnull(avg_monthly_sales#23) AND ((avg_monthly_sales#23 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#23 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#23 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
 
 (27) Project [codegen id : 7]
-Output [3]: [i_manager_id#5, sum_sales#24, avg_monthly_sales#27]
-Input [4]: [i_manager_id#5, sum_sales#24, _w0#25, avg_monthly_sales#27]
+Output [3]: [i_manager_id#5, sum_sales#21, avg_monthly_sales#23]
+Input [4]: [i_manager_id#5, sum_sales#21, _w0#22, avg_monthly_sales#23]
 
 (28) TakeOrderedAndProject
-Input [3]: [i_manager_id#5, sum_sales#24, avg_monthly_sales#27]
-Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#27 ASC NULLS FIRST, sum_sales#24 ASC NULLS FIRST], [i_manager_id#5, sum_sales#24, avg_monthly_sales#27]
+Input [3]: [i_manager_id#5, sum_sales#21, avg_monthly_sales#23]
+Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#23 ASC NULLS FIRST, sum_sales#21 ASC NULLS FIRST], [i_manager_id#5, sum_sales#21, avg_monthly_sales#23]
 
 ===== Subqueries =====
 
@@ -167,25 +167,25 @@ BroadcastExchange (33)
 
 
 (29) Scan parquet default.date_dim
-Output [3]: [d_date_sk#16, d_month_seq#28, d_moy#17]
+Output [3]: [d_date_sk#15, d_month_seq#24, d_moy#16]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [In(d_month_seq, [1219,1220,1221,1222,1223,1224,1225,1226,1227,1228,1229,1230]), GreaterThanOrEqual(d_date_sk,2452123), LessThanOrEqual(d_date_sk,2452487), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_month_seq:int,d_moy:int>
 
 (30) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#16, d_month_seq#28, d_moy#17]
+Input [3]: [d_date_sk#15, d_month_seq#24, d_moy#16]
 
 (31) Filter [codegen id : 1]
-Input [3]: [d_date_sk#16, d_month_seq#28, d_moy#17]
-Condition : (((d_month_seq#28 INSET 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230 AND (d_date_sk#16 >= 2452123)) AND (d_date_sk#16 <= 2452487)) AND isnotnull(d_date_sk#16))
+Input [3]: [d_date_sk#15, d_month_seq#24, d_moy#16]
+Condition : (((d_month_seq#24 INSET 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230 AND (d_date_sk#15 >= 2452123)) AND (d_date_sk#15 <= 2452487)) AND isnotnull(d_date_sk#15))
 
 (32) Project [codegen id : 1]
-Output [2]: [d_date_sk#16, d_moy#17]
-Input [3]: [d_date_sk#16, d_month_seq#28, d_moy#17]
+Output [2]: [d_date_sk#15, d_moy#16]
+Input [3]: [d_date_sk#15, d_month_seq#24, d_moy#16]
 
 (33) BroadcastExchange
-Input [2]: [d_date_sk#16, d_moy#17]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29]
+Input [2]: [d_date_sk#15, d_moy#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt
index 7066bd1ed14..22b76a6c9d5 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt
@@ -75,152 +75,152 @@ Results [3]: [ss_store_sk#2, ss_item_sk#1, sum#8]
 
 (8) Exchange
 Input [3]: [ss_store_sk#2, ss_item_sk#1, sum#8]
-Arguments: hashpartitioning(ss_store_sk#2, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9]
+Arguments: hashpartitioning(ss_store_sk#2, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=1]
 
 (9) HashAggregate [codegen id : 7]
 Input [3]: [ss_store_sk#2, ss_item_sk#1, sum#8]
 Keys [2]: [ss_store_sk#2, ss_item_sk#1]
 Functions [1]: [sum(UnscaledValue(ss_sales_price#3))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#3))#10]
-Results [3]: [ss_store_sk#2, ss_item_sk#1, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#10,17,2) AS revenue#11]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#3))#9]
+Results [3]: [ss_store_sk#2, ss_item_sk#1, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#9,17,2) AS revenue#10]
 
 (10) Filter [codegen id : 7]
-Input [3]: [ss_store_sk#2, ss_item_sk#1, revenue#11]
-Condition : isnotnull(revenue#11)
+Input [3]: [ss_store_sk#2, ss_item_sk#1, revenue#10]
+Condition : isnotnull(revenue#10)
 
 (11) Scan parquet default.store_sales
-Output [4]: [ss_item_sk#12, ss_store_sk#13, ss_sales_price#14, ss_sold_date_sk#15]
+Output [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#15), (ss_sold_date_sk#15 >= 2451911), (ss_sold_date_sk#15 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#15 IN dynamicpruning#5)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#14), (ss_sold_date_sk#14 >= 2451911), (ss_sold_date_sk#14 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#14 IN dynamicpruning#5)]
 PushedFilters: [IsNotNull(ss_store_sk)]
 ReadSchema: struct<ss_item_sk:int,ss_store_sk:int,ss_sales_price:decimal(7,2)>
 
 (12) ColumnarToRow [codegen id : 4]
-Input [4]: [ss_item_sk#12, ss_store_sk#13, ss_sales_price#14, ss_sold_date_sk#15]
+Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
 
 (13) Filter [codegen id : 4]
-Input [4]: [ss_item_sk#12, ss_store_sk#13, ss_sales_price#14, ss_sold_date_sk#15]
-Condition : isnotnull(ss_store_sk#13)
+Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14]
+Condition : isnotnull(ss_store_sk#12)
 
 (14) ReusedExchange [Reuses operator id: 43]
-Output [1]: [d_date_sk#16]
+Output [1]: [d_date_sk#15]
 
 (15) BroadcastHashJoin [codegen id : 4]
-Left keys [1]: [ss_sold_date_sk#15]
-Right keys [1]: [d_date_sk#16]
+Left keys [1]: [ss_sold_date_sk#14]
+Right keys [1]: [d_date_sk#15]
 Join condition: None
 
 (16) Project [codegen id : 4]
-Output [3]: [ss_item_sk#12, ss_store_sk#13, ss_sales_price#14]
-Input [5]: [ss_item_sk#12, ss_store_sk#13, ss_sales_price#14, ss_sold_date_sk#15, d_date_sk#16]
+Output [3]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13]
+Input [5]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14, d_date_sk#15]
 
 (17) HashAggregate [codegen id : 4]
-Input [3]: [ss_item_sk#12, ss_store_sk#13, ss_sales_price#14]
-Keys [2]: [ss_store_sk#13, ss_item_sk#12]
-Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#14))]
-Aggregate Attributes [1]: [sum#17]
-Results [3]: [ss_store_sk#13, ss_item_sk#12, sum#18]
+Input [3]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13]
+Keys [2]: [ss_store_sk#12, ss_item_sk#11]
+Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#13))]
+Aggregate Attributes [1]: [sum#16]
+Results [3]: [ss_store_sk#12, ss_item_sk#11, sum#17]
 
 (18) Exchange
-Input [3]: [ss_store_sk#13, ss_item_sk#12, sum#18]
-Arguments: hashpartitioning(ss_store_sk#13, ss_item_sk#12, 5), ENSURE_REQUIREMENTS, [id=#19]
+Input [3]: [ss_store_sk#12, ss_item_sk#11, sum#17]
+Arguments: hashpartitioning(ss_store_sk#12, ss_item_sk#11, 5), ENSURE_REQUIREMENTS, [plan_id=2]
 
 (19) HashAggregate [codegen id : 5]
-Input [3]: [ss_store_sk#13, ss_item_sk#12, sum#18]
-Keys [2]: [ss_store_sk#13, ss_item_sk#12]
-Functions [1]: [sum(UnscaledValue(ss_sales_price#14))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#14))#20]
-Results [2]: [ss_store_sk#13, MakeDecimal(sum(UnscaledValue(ss_sales_price#14))#20,17,2) AS revenue#21]
+Input [3]: [ss_store_sk#12, ss_item_sk#11, sum#17]
+Keys [2]: [ss_store_sk#12, ss_item_sk#11]
+Functions [1]: [sum(UnscaledValue(ss_sales_price#13))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#13))#18]
+Results [2]: [ss_store_sk#12, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#18,17,2) AS revenue#19]
 
 (20) HashAggregate [codegen id : 5]
-Input [2]: [ss_store_sk#13, revenue#21]
-Keys [1]: [ss_store_sk#13]
-Functions [1]: [partial_avg(revenue#21)]
-Aggregate Attributes [2]: [sum#22, count#23]
-Results [3]: [ss_store_sk#13, sum#24, count#25]
+Input [2]: [ss_store_sk#12, revenue#19]
+Keys [1]: [ss_store_sk#12]
+Functions [1]: [partial_avg(revenue#19)]
+Aggregate Attributes [2]: [sum#20, count#21]
+Results [3]: [ss_store_sk#12, sum#22, count#23]
 
 (21) Exchange
-Input [3]: [ss_store_sk#13, sum#24, count#25]
-Arguments: hashpartitioning(ss_store_sk#13, 5), ENSURE_REQUIREMENTS, [id=#26]
+Input [3]: [ss_store_sk#12, sum#22, count#23]
+Arguments: hashpartitioning(ss_store_sk#12, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (22) HashAggregate [codegen id : 6]
-Input [3]: [ss_store_sk#13, sum#24, count#25]
-Keys [1]: [ss_store_sk#13]
-Functions [1]: [avg(revenue#21)]
-Aggregate Attributes [1]: [avg(revenue#21)#27]
-Results [2]: [ss_store_sk#13, avg(revenue#21)#27 AS ave#28]
+Input [3]: [ss_store_sk#12, sum#22, count#23]
+Keys [1]: [ss_store_sk#12]
+Functions [1]: [avg(revenue#19)]
+Aggregate Attributes [1]: [avg(revenue#19)#24]
+Results [2]: [ss_store_sk#12, avg(revenue#19)#24 AS ave#25]
 
 (23) BroadcastExchange
-Input [2]: [ss_store_sk#13, ave#28]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29]
+Input [2]: [ss_store_sk#12, ave#25]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=4]
 
 (24) BroadcastHashJoin [codegen id : 7]
 Left keys [1]: [ss_store_sk#2]
-Right keys [1]: [ss_store_sk#13]
-Join condition: (cast(revenue#11 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#28)), DecimalType(23,7), true))
+Right keys [1]: [ss_store_sk#12]
+Join condition: (cast(revenue#10 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#25)), DecimalType(23,7), true))
 
 (25) Project [codegen id : 7]
-Output [3]: [ss_store_sk#2, ss_item_sk#1, revenue#11]
-Input [5]: [ss_store_sk#2, ss_item_sk#1, revenue#11, ss_store_sk#13, ave#28]
+Output [3]: [ss_store_sk#2, ss_item_sk#1, revenue#10]
+Input [5]: [ss_store_sk#2, ss_item_sk#1, revenue#10, ss_store_sk#12, ave#25]
 
 (26) BroadcastExchange
-Input [3]: [ss_store_sk#2, ss_item_sk#1, revenue#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30]
+Input [3]: [ss_store_sk#2, ss_item_sk#1, revenue#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 (27) Scan parquet default.store
-Output [2]: [s_store_sk#31, s_store_name#32]
+Output [2]: [s_store_sk#26, s_store_name#27]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int,s_store_name:string>
 
 (28) ColumnarToRow
-Input [2]: [s_store_sk#31, s_store_name#32]
+Input [2]: [s_store_sk#26, s_store_name#27]
 
 (29) Filter
-Input [2]: [s_store_sk#31, s_store_name#32]
-Condition : isnotnull(s_store_sk#31)
+Input [2]: [s_store_sk#26, s_store_name#27]
+Condition : isnotnull(s_store_sk#26)
 
 (30) BroadcastHashJoin [codegen id : 8]
 Left keys [1]: [ss_store_sk#2]
-Right keys [1]: [s_store_sk#31]
+Right keys [1]: [s_store_sk#26]
 Join condition: None
 
 (31) Project [codegen id : 8]
-Output [3]: [ss_item_sk#1, revenue#11, s_store_name#32]
-Input [5]: [ss_store_sk#2, ss_item_sk#1, revenue#11, s_store_sk#31, s_store_name#32]
+Output [3]: [ss_item_sk#1, revenue#10, s_store_name#27]
+Input [5]: [ss_store_sk#2, ss_item_sk#1, revenue#10, s_store_sk#26, s_store_name#27]
 
 (32) BroadcastExchange
-Input [3]: [ss_item_sk#1, revenue#11, s_store_name#32]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#33]
+Input [3]: [ss_item_sk#1, revenue#10, s_store_name#27]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
 
 (33) Scan parquet default.item
-Output [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38]
+Output [5]: [i_item_sk#28, i_item_desc#29, i_current_price#30, i_wholesale_cost#31, i_brand#32]
 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,i_current_price:decimal(7,2),i_wholesale_cost:decimal(7,2),i_brand:string>
 
 (34) ColumnarToRow
-Input [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38]
+Input [5]: [i_item_sk#28, i_item_desc#29, i_current_price#30, i_wholesale_cost#31, i_brand#32]
 
 (35) Filter
-Input [5]: [i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38]
-Condition : isnotnull(i_item_sk#34)
+Input [5]: [i_item_sk#28, i_item_desc#29, i_current_price#30, i_wholesale_cost#31, i_brand#32]
+Condition : isnotnull(i_item_sk#28)
 
 (36) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [ss_item_sk#1]
-Right keys [1]: [i_item_sk#34]
+Right keys [1]: [i_item_sk#28]
 Join condition: None
 
 (37) Project [codegen id : 9]
-Output [6]: [s_store_name#32, i_item_desc#35, revenue#11, i_current_price#36, i_wholesale_cost#37, i_brand#38]
-Input [8]: [ss_item_sk#1, revenue#11, s_store_name#32, i_item_sk#34, i_item_desc#35, i_current_price#36, i_wholesale_cost#37, i_brand#38]
+Output [6]: [s_store_name#27, i_item_desc#29, revenue#10, i_current_price#30, i_wholesale_cost#31, i_brand#32]
+Input [8]: [ss_item_sk#1, revenue#10, s_store_name#27, i_item_sk#28, i_item_desc#29, i_current_price#30, i_wholesale_cost#31, i_brand#32]
 
 (38) TakeOrderedAndProject
-Input [6]: [s_store_name#32, i_item_desc#35, revenue#11, i_current_price#36, i_wholesale_cost#37, i_brand#38]
-Arguments: 100, [s_store_name#32 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST], [s_store_name#32, i_item_desc#35, revenue#11, i_current_price#36, i_wholesale_cost#37, i_brand#38]
+Input [6]: [s_store_name#27, i_item_desc#29, revenue#10, i_current_price#30, i_wholesale_cost#31, i_brand#32]
+Arguments: 100, [s_store_name#27 ASC NULLS FIRST, i_item_desc#29 ASC NULLS FIRST], [s_store_name#27, i_item_desc#29, revenue#10, i_current_price#30, i_wholesale_cost#31, i_brand#32]
 
 ===== Subqueries =====
 
@@ -233,27 +233,27 @@ BroadcastExchange (43)
 
 
 (39) Scan parquet default.date_dim
-Output [2]: [d_date_sk#6, d_month_seq#39]
+Output [2]: [d_date_sk#6, d_month_seq#33]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2452275), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_month_seq:int>
 
 (40) ColumnarToRow [codegen id : 1]
-Input [2]: [d_date_sk#6, d_month_seq#39]
+Input [2]: [d_date_sk#6, d_month_seq#33]
 
 (41) Filter [codegen id : 1]
-Input [2]: [d_date_sk#6, d_month_seq#39]
-Condition : (((((isnotnull(d_month_seq#39) AND (d_month_seq#39 >= 1212)) AND (d_month_seq#39 <= 1223)) AND (d_date_sk#6 >= 2451911)) AND (d_date_sk#6 <= 2452275)) AND isnotnull(d_date_sk#6))
+Input [2]: [d_date_sk#6, d_month_seq#33]
+Condition : (((((isnotnull(d_month_seq#33) AND (d_month_seq#33 >= 1212)) AND (d_month_seq#33 <= 1223)) AND (d_date_sk#6 >= 2451911)) AND (d_date_sk#6 <= 2452275)) AND isnotnull(d_date_sk#6))
 
 (42) Project [codegen id : 1]
 Output [1]: [d_date_sk#6]
-Input [2]: [d_date_sk#6, d_month_seq#39]
+Input [2]: [d_date_sk#6, d_month_seq#33]
 
 (43) BroadcastExchange
 Input [1]: [d_date_sk#6]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#40]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
 
-Subquery:2 Hosting operator id = 11 Hosting Expression = ss_sold_date_sk#15 IN dynamicpruning#5
+Subquery:2 Hosting operator id = 11 Hosting Expression = ss_sold_date_sk#14 IN dynamicpruning#5
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65/explain.txt
index 02c9fdd520c..0ab4da69f62 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65/explain.txt
@@ -89,22 +89,22 @@ Results [3]: [ss_store_sk#4, ss_item_sk#3, sum#10]
 
 (11) Exchange
 Input [3]: [ss_store_sk#4, ss_item_sk#3, sum#10]
-Arguments: hashpartitioning(ss_store_sk#4, ss_item_sk#3, 5), ENSURE_REQUIREMENTS, [id=#11]
+Arguments: hashpartitioning(ss_store_sk#4, ss_item_sk#3, 5), ENSURE_REQUIREMENTS, [plan_id=1]
 
 (12) HashAggregate [codegen id : 3]
 Input [3]: [ss_store_sk#4, ss_item_sk#3, sum#10]
 Keys [2]: [ss_store_sk#4, ss_item_sk#3]
 Functions [1]: [sum(UnscaledValue(ss_sales_price#5))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#5))#12]
-Results [3]: [ss_store_sk#4, ss_item_sk#3, MakeDecimal(sum(UnscaledValue(ss_sales_price#5))#12,17,2) AS revenue#13]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#5))#11]
+Results [3]: [ss_store_sk#4, ss_item_sk#3, MakeDecimal(sum(UnscaledValue(ss_sales_price#5))#11,17,2) AS revenue#12]
 
 (13) Filter [codegen id : 3]
-Input [3]: [ss_store_sk#4, ss_item_sk#3, revenue#13]
-Condition : isnotnull(revenue#13)
+Input [3]: [ss_store_sk#4, ss_item_sk#3, revenue#12]
+Condition : isnotnull(revenue#12)
 
 (14) BroadcastExchange
-Input [3]: [ss_store_sk#4, ss_item_sk#3, revenue#13]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14]
+Input [3]: [ss_store_sk#4, ss_item_sk#3, revenue#12]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (15) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [s_store_sk#1]
@@ -112,115 +112,115 @@ Right keys [1]: [ss_store_sk#4]
 Join condition: None
 
 (16) Project [codegen id : 9]
-Output [4]: [s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#13]
-Input [5]: [s_store_sk#1, s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#13]
+Output [4]: [s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#12]
+Input [5]: [s_store_sk#1, s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#12]
 
 (17) Scan parquet default.item
-Output [5]: [i_item_sk#15, i_item_desc#16, i_current_price#17, i_wholesale_cost#18, i_brand#19]
+Output [5]: [i_item_sk#13, i_item_desc#14, i_current_price#15, i_wholesale_cost#16, i_brand#17]
 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,i_current_price:decimal(7,2),i_wholesale_cost:decimal(7,2),i_brand:string>
 
 (18) ColumnarToRow [codegen id : 4]
-Input [5]: [i_item_sk#15, i_item_desc#16, i_current_price#17, i_wholesale_cost#18, i_brand#19]
+Input [5]: [i_item_sk#13, i_item_desc#14, i_current_price#15, i_wholesale_cost#16, i_brand#17]
 
 (19) Filter [codegen id : 4]
-Input [5]: [i_item_sk#15, i_item_desc#16, i_current_price#17, i_wholesale_cost#18, i_brand#19]
-Condition : isnotnull(i_item_sk#15)
+Input [5]: [i_item_sk#13, i_item_desc#14, i_current_price#15, i_wholesale_cost#16, i_brand#17]
+Condition : isnotnull(i_item_sk#13)
 
 (20) BroadcastExchange
-Input [5]: [i_item_sk#15, i_item_desc#16, i_current_price#17, i_wholesale_cost#18, i_brand#19]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20]
+Input [5]: [i_item_sk#13, i_item_desc#14, i_current_price#15, i_wholesale_cost#16, i_brand#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
 
 (21) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [ss_item_sk#3]
-Right keys [1]: [i_item_sk#15]
+Right keys [1]: [i_item_sk#13]
 Join condition: None
 
 (22) Project [codegen id : 9]
-Output [7]: [s_store_name#2, ss_store_sk#4, revenue#13, i_item_desc#16, i_current_price#17, i_wholesale_cost#18, i_brand#19]
-Input [9]: [s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#13, i_item_sk#15, i_item_desc#16, i_current_price#17, i_wholesale_cost#18, i_brand#19]
+Output [7]: [s_store_name#2, ss_store_sk#4, revenue#12, i_item_desc#14, i_current_price#15, i_wholesale_cost#16, i_brand#17]
+Input [9]: [s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#12, i_item_sk#13, i_item_desc#14, i_current_price#15, i_wholesale_cost#16, i_brand#17]
 
 (23) Scan parquet default.store_sales
-Output [4]: [ss_item_sk#21, ss_store_sk#22, ss_sales_price#23, ss_sold_date_sk#24]
+Output [4]: [ss_item_sk#18, ss_store_sk#19, ss_sales_price#20, ss_sold_date_sk#21]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#24), (ss_sold_date_sk#24 >= 2451911), (ss_sold_date_sk#24 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#24 IN dynamicpruning#7)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#21), (ss_sold_date_sk#21 >= 2451911), (ss_sold_date_sk#21 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#21 IN dynamicpruning#7)]
 PushedFilters: [IsNotNull(ss_store_sk)]
 ReadSchema: struct<ss_item_sk:int,ss_store_sk:int,ss_sales_price:decimal(7,2)>
 
 (24) ColumnarToRow [codegen id : 6]
-Input [4]: [ss_item_sk#21, ss_store_sk#22, ss_sales_price#23, ss_sold_date_sk#24]
+Input [4]: [ss_item_sk#18, ss_store_sk#19, ss_sales_price#20, ss_sold_date_sk#21]
 
 (25) Filter [codegen id : 6]
-Input [4]: [ss_item_sk#21, ss_store_sk#22, ss_sales_price#23, ss_sold_date_sk#24]
-Condition : isnotnull(ss_store_sk#22)
+Input [4]: [ss_item_sk#18, ss_store_sk#19, ss_sales_price#20, ss_sold_date_sk#21]
+Condition : isnotnull(ss_store_sk#19)
 
 (26) ReusedExchange [Reuses operator id: 43]
-Output [1]: [d_date_sk#25]
+Output [1]: [d_date_sk#22]
 
 (27) BroadcastHashJoin [codegen id : 6]
-Left keys [1]: [ss_sold_date_sk#24]
-Right keys [1]: [d_date_sk#25]
+Left keys [1]: [ss_sold_date_sk#21]
+Right keys [1]: [d_date_sk#22]
 Join condition: None
 
 (28) Project [codegen id : 6]
-Output [3]: [ss_item_sk#21, ss_store_sk#22, ss_sales_price#23]
-Input [5]: [ss_item_sk#21, ss_store_sk#22, ss_sales_price#23, ss_sold_date_sk#24, d_date_sk#25]
+Output [3]: [ss_item_sk#18, ss_store_sk#19, ss_sales_price#20]
+Input [5]: [ss_item_sk#18, ss_store_sk#19, ss_sales_price#20, ss_sold_date_sk#21, d_date_sk#22]
 
 (29) HashAggregate [codegen id : 6]
-Input [3]: [ss_item_sk#21, ss_store_sk#22, ss_sales_price#23]
-Keys [2]: [ss_store_sk#22, ss_item_sk#21]
-Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#23))]
-Aggregate Attributes [1]: [sum#26]
-Results [3]: [ss_store_sk#22, ss_item_sk#21, sum#27]
+Input [3]: [ss_item_sk#18, ss_store_sk#19, ss_sales_price#20]
+Keys [2]: [ss_store_sk#19, ss_item_sk#18]
+Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#20))]
+Aggregate Attributes [1]: [sum#23]
+Results [3]: [ss_store_sk#19, ss_item_sk#18, sum#24]
 
 (30) Exchange
-Input [3]: [ss_store_sk#22, ss_item_sk#21, sum#27]
-Arguments: hashpartitioning(ss_store_sk#22, ss_item_sk#21, 5), ENSURE_REQUIREMENTS, [id=#28]
+Input [3]: [ss_store_sk#19, ss_item_sk#18, sum#24]
+Arguments: hashpartitioning(ss_store_sk#19, ss_item_sk#18, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (31) HashAggregate [codegen id : 7]
-Input [3]: [ss_store_sk#22, ss_item_sk#21, sum#27]
-Keys [2]: [ss_store_sk#22, ss_item_sk#21]
-Functions [1]: [sum(UnscaledValue(ss_sales_price#23))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#23))#29]
-Results [2]: [ss_store_sk#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#23))#29,17,2) AS revenue#30]
+Input [3]: [ss_store_sk#19, ss_item_sk#18, sum#24]
+Keys [2]: [ss_store_sk#19, ss_item_sk#18]
+Functions [1]: [sum(UnscaledValue(ss_sales_price#20))]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#20))#25]
+Results [2]: [ss_store_sk#19, MakeDecimal(sum(UnscaledValue(ss_sales_price#20))#25,17,2) AS revenue#26]
 
 (32) HashAggregate [codegen id : 7]
-Input [2]: [ss_store_sk#22, revenue#30]
-Keys [1]: [ss_store_sk#22]
-Functions [1]: [partial_avg(revenue#30)]
-Aggregate Attributes [2]: [sum#31, count#32]
-Results [3]: [ss_store_sk#22, sum#33, count#34]
+Input [2]: [ss_store_sk#19, revenue#26]
+Keys [1]: [ss_store_sk#19]
+Functions [1]: [partial_avg(revenue#26)]
+Aggregate Attributes [2]: [sum#27, count#28]
+Results [3]: [ss_store_sk#19, sum#29, count#30]
 
 (33) Exchange
-Input [3]: [ss_store_sk#22, sum#33, count#34]
-Arguments: hashpartitioning(ss_store_sk#22, 5), ENSURE_REQUIREMENTS, [id=#35]
+Input [3]: [ss_store_sk#19, sum#29, count#30]
+Arguments: hashpartitioning(ss_store_sk#19, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (34) HashAggregate [codegen id : 8]
-Input [3]: [ss_store_sk#22, sum#33, count#34]
-Keys [1]: [ss_store_sk#22]
-Functions [1]: [avg(revenue#30)]
-Aggregate Attributes [1]: [avg(revenue#30)#36]
-Results [2]: [ss_store_sk#22, avg(revenue#30)#36 AS ave#37]
+Input [3]: [ss_store_sk#19, sum#29, count#30]
+Keys [1]: [ss_store_sk#19]
+Functions [1]: [avg(revenue#26)]
+Aggregate Attributes [1]: [avg(revenue#26)#31]
+Results [2]: [ss_store_sk#19, avg(revenue#26)#31 AS ave#32]
 
 (35) BroadcastExchange
-Input [2]: [ss_store_sk#22, ave#37]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#38]
+Input [2]: [ss_store_sk#19, ave#32]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
 
 (36) BroadcastHashJoin [codegen id : 9]
 Left keys [1]: [ss_store_sk#4]
-Right keys [1]: [ss_store_sk#22]
-Join condition: (cast(revenue#13 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#37)), DecimalType(23,7), true))
+Right keys [1]: [ss_store_sk#19]
+Join condition: (cast(revenue#12 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#32)), DecimalType(23,7), true))
 
 (37) Project [codegen id : 9]
-Output [6]: [s_store_name#2, i_item_desc#16, revenue#13, i_current_price#17, i_wholesale_cost#18, i_brand#19]
-Input [9]: [s_store_name#2, ss_store_sk#4, revenue#13, i_item_desc#16, i_current_price#17, i_wholesale_cost#18, i_brand#19, ss_store_sk#22, ave#37]
+Output [6]: [s_store_name#2, i_item_desc#14, revenue#12, i_current_price#15, i_wholesale_cost#16, i_brand#17]
+Input [9]: [s_store_name#2, ss_store_sk#4, revenue#12, i_item_desc#14, i_current_price#15, i_wholesale_cost#16, i_brand#17, ss_store_sk#19, ave#32]
 
 (38) TakeOrderedAndProject
-Input [6]: [s_store_name#2, i_item_desc#16, revenue#13, i_current_price#17, i_wholesale_cost#18, i_brand#19]
-Arguments: 100, [s_store_name#2 ASC NULLS FIRST, i_item_desc#16 ASC NULLS FIRST], [s_store_name#2, i_item_desc#16, revenue#13, i_current_price#17, i_wholesale_cost#18, i_brand#19]
+Input [6]: [s_store_name#2, i_item_desc#14, revenue#12, i_current_price#15, i_wholesale_cost#16, i_brand#17]
+Arguments: 100, [s_store_name#2 ASC NULLS FIRST, i_item_desc#14 ASC NULLS FIRST], [s_store_name#2, i_item_desc#14, revenue#12, i_current_price#15, i_wholesale_cost#16, i_brand#17]
 
 ===== Subqueries =====
 
@@ -233,27 +233,27 @@ BroadcastExchange (43)
 
 
 (39) Scan parquet default.date_dim
-Output [2]: [d_date_sk#8, d_month_seq#39]
+Output [2]: [d_date_sk#8, d_month_seq#33]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2452275), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_month_seq:int>
 
 (40) ColumnarToRow [codegen id : 1]
-Input [2]: [d_date_sk#8, d_month_seq#39]
+Input [2]: [d_date_sk#8, d_month_seq#33]
 
 (41) Filter [codegen id : 1]
-Input [2]: [d_date_sk#8, d_month_seq#39]
-Condition : (((((isnotnull(d_month_seq#39) AND (d_month_seq#39 >= 1212)) AND (d_month_seq#39 <= 1223)) AND (d_date_sk#8 >= 2451911)) AND (d_date_sk#8 <= 2452275)) AND isnotnull(d_date_sk#8))
+Input [2]: [d_date_sk#8, d_month_seq#33]
+Condition : (((((isnotnull(d_month_seq#33) AND (d_month_seq#33 >= 1212)) AND (d_month_seq#33 <= 1223)) AND (d_date_sk#8 >= 2451911)) AND (d_date_sk#8 <= 2452275)) AND isnotnull(d_date_sk#8))
 
 (42) Project [codegen id : 1]
 Output [1]: [d_date_sk#8]
-Input [2]: [d_date_sk#8, d_month_seq#39]
+Input [2]: [d_date_sk#8, d_month_seq#33]
 
 (43) BroadcastExchange
 Input [1]: [d_date_sk#8]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#40]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=7]
 
-Subquery:2 Hosting operator id = 23 Hosting Expression = ss_sold_date_sk#24 IN dynamicpruning#7
+Subquery:2 Hosting operator id = 23 Hosting Expression = ss_sold_date_sk#21 IN dynamicpruning#7
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt
index 020f7344233..48a9282c67f 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt
@@ -93,7 +93,7 @@ Input [2]: [s_store_sk#12, s_city#13]
 
 (11) BroadcastExchange
 Input [1]: [s_store_sk#12]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#4]
@@ -105,150 +105,150 @@ Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5,
 Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, s_store_sk#12]
 
 (14) Scan parquet default.household_demographics
-Output [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
+Output [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/household_demographics]
 PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)]
 ReadSchema: struct<hd_demo_sk:int,hd_dep_count:int,hd_vehicle_count:int>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
+Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
 
 (16) Filter [codegen id : 3]
-Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
-Condition : (((hd_dep_count#16 = 5) OR (hd_vehicle_count#17 = 3)) AND isnotnull(hd_demo_sk#15))
+Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
+Condition : (((hd_dep_count#15 = 5) OR (hd_vehicle_count#16 = 3)) AND isnotnull(hd_demo_sk#14))
 
 (17) Project [codegen id : 3]
-Output [1]: [hd_demo_sk#15]
-Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
+Output [1]: [hd_demo_sk#14]
+Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
 
 (18) BroadcastExchange
-Input [1]: [hd_demo_sk#15]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18]
+Input [1]: [hd_demo_sk#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (19) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_hdemo_sk#2]
-Right keys [1]: [hd_demo_sk#15]
+Right keys [1]: [hd_demo_sk#14]
 Join condition: None
 
 (20) Project [codegen id : 4]
 Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8]
-Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, hd_demo_sk#15]
+Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, hd_demo_sk#14]
 
 (21) BroadcastExchange
 Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8]
-Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#19]
+Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [plan_id=3]
 
 (22) Scan parquet default.customer_address
-Output [2]: [ca_address_sk#20, ca_city#21]
+Output [2]: [ca_address_sk#17, ca_city#18]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/customer_address]
 PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)]
 ReadSchema: struct<ca_address_sk:int,ca_city:string>
 
 (23) ColumnarToRow
-Input [2]: [ca_address_sk#20, ca_city#21]
+Input [2]: [ca_address_sk#17, ca_city#18]
 
 (24) Filter
-Input [2]: [ca_address_sk#20, ca_city#21]
-Condition : (isnotnull(ca_address_sk#20) AND isnotnull(ca_city#21))
+Input [2]: [ca_address_sk#17, ca_city#18]
+Condition : (isnotnull(ca_address_sk#17) AND isnotnull(ca_city#18))
 
 (25) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_addr_sk#3]
-Right keys [1]: [ca_address_sk#20]
+Right keys [1]: [ca_address_sk#17]
 Join condition: None
 
 (26) Project [codegen id : 5]
-Output [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#21]
-Input [8]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_address_sk#20, ca_city#21]
+Output [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#18]
+Input [8]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_address_sk#17, ca_city#18]
 
 (27) HashAggregate [codegen id : 5]
-Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#21]
-Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#21]
+Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#18]
+Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18]
 Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#6)), partial_sum(UnscaledValue(ss_ext_list_price#7)), partial_sum(UnscaledValue(ss_ext_tax#8))]
-Aggregate Attributes [3]: [sum#22, sum#23, sum#24]
-Results [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#21, sum#25, sum#26, sum#27]
+Aggregate Attributes [3]: [sum#19, sum#20, sum#21]
+Results [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18, sum#22, sum#23, sum#24]
 
 (28) Exchange
-Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#21, sum#25, sum#26, sum#27]
-Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#21, 5), ENSURE_REQUIREMENTS, [id=#28]
+Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18, sum#22, sum#23, sum#24]
+Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (29) HashAggregate [codegen id : 6]
-Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#21, sum#25, sum#26, sum#27]
-Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#21]
+Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18, sum#22, sum#23, sum#24]
+Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18]
 Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#6)), sum(UnscaledValue(ss_ext_list_price#7)), sum(UnscaledValue(ss_ext_tax#8))]
-Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#6))#29, sum(UnscaledValue(ss_ext_list_price#7))#30, sum(UnscaledValue(ss_ext_tax#8))#31]
-Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#21 AS bought_city#32, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#29,17,2) AS extended_price#33, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#7))#30,17,2) AS list_price#34, MakeDecimal(sum(UnscaledValue(ss_ext_tax#8))#31,17,2) AS extended_tax#35]
+Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#6))#25, sum(UnscaledValue(ss_ext_list_price#7))#26, sum(UnscaledValue(ss_ext_tax#8))#27]
+Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#18 AS bought_city#28, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#25,17,2) AS extended_price#29, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#7))#26,17,2) AS list_price#30, MakeDecimal(sum(UnscaledValue(ss_ext_tax#8))#27,17,2) AS extended_tax#31]
 
 (30) BroadcastExchange
-Input [6]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#32, extended_price#33, list_price#34, extended_tax#35]
-Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#36]
+Input [6]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#28, extended_price#29, list_price#30, extended_tax#31]
+Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [plan_id=5]
 
 (31) Scan parquet default.customer
-Output [4]: [c_customer_sk#37, c_current_addr_sk#38, c_first_name#39, c_last_name#40]
+Output [4]: [c_customer_sk#32, c_current_addr_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), IsNotNull(c_current_addr_sk)]
 ReadSchema: struct<c_customer_sk:int,c_current_addr_sk:int,c_first_name:string,c_last_name:string>
 
 (32) ColumnarToRow
-Input [4]: [c_customer_sk#37, c_current_addr_sk#38, c_first_name#39, c_last_name#40]
+Input [4]: [c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
 
 (33) Filter
-Input [4]: [c_customer_sk#37, c_current_addr_sk#38, c_first_name#39, c_last_name#40]
-Condition : (isnotnull(c_customer_sk#37) AND isnotnull(c_current_addr_sk#38))
+Input [4]: [c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
+Condition : (isnotnull(c_customer_sk#32) AND isnotnull(c_current_addr_sk#33))
 
 (34) BroadcastHashJoin [codegen id : 7]
 Left keys [1]: [ss_customer_sk#1]
-Right keys [1]: [c_customer_sk#37]
+Right keys [1]: [c_customer_sk#32]
 Join condition: None
 
 (35) Project [codegen id : 7]
-Output [8]: [ss_ticket_number#5, bought_city#32, extended_price#33, list_price#34, extended_tax#35, c_current_addr_sk#38, c_first_name#39, c_last_name#40]
-Input [10]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#32, extended_price#33, list_price#34, extended_tax#35, c_customer_sk#37, c_current_addr_sk#38, c_first_name#39, c_last_name#40]
+Output [8]: [ss_ticket_number#5, bought_city#28, extended_price#29, list_price#30, extended_tax#31, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
+Input [10]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#28, extended_price#29, list_price#30, extended_tax#31, c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
 
 (36) Exchange
-Input [8]: [ss_ticket_number#5, bought_city#32, extended_price#33, list_price#34, extended_tax#35, c_current_addr_sk#38, c_first_name#39, c_last_name#40]
-Arguments: hashpartitioning(c_current_addr_sk#38, 5), ENSURE_REQUIREMENTS, [id=#41]
+Input [8]: [ss_ticket_number#5, bought_city#28, extended_price#29, list_price#30, extended_tax#31, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
+Arguments: hashpartitioning(c_current_addr_sk#33, 5), ENSURE_REQUIREMENTS, [plan_id=6]
 
 (37) Sort [codegen id : 8]
-Input [8]: [ss_ticket_number#5, bought_city#32, extended_price#33, list_price#34, extended_tax#35, c_current_addr_sk#38, c_first_name#39, c_last_name#40]
-Arguments: [c_current_addr_sk#38 ASC NULLS FIRST], false, 0
+Input [8]: [ss_ticket_number#5, bought_city#28, extended_price#29, list_price#30, extended_tax#31, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
+Arguments: [c_current_addr_sk#33 ASC NULLS FIRST], false, 0
 
 (38) Scan parquet default.customer_address
-Output [2]: [ca_address_sk#42, ca_city#43]
+Output [2]: [ca_address_sk#36, ca_city#37]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/customer_address]
 PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)]
 ReadSchema: struct<ca_address_sk:int,ca_city:string>
 
 (39) ColumnarToRow [codegen id : 9]
-Input [2]: [ca_address_sk#42, ca_city#43]
+Input [2]: [ca_address_sk#36, ca_city#37]
 
 (40) Filter [codegen id : 9]
-Input [2]: [ca_address_sk#42, ca_city#43]
-Condition : (isnotnull(ca_address_sk#42) AND isnotnull(ca_city#43))
+Input [2]: [ca_address_sk#36, ca_city#37]
+Condition : (isnotnull(ca_address_sk#36) AND isnotnull(ca_city#37))
 
 (41) Exchange
-Input [2]: [ca_address_sk#42, ca_city#43]
-Arguments: hashpartitioning(ca_address_sk#42, 5), ENSURE_REQUIREMENTS, [id=#44]
+Input [2]: [ca_address_sk#36, ca_city#37]
+Arguments: hashpartitioning(ca_address_sk#36, 5), ENSURE_REQUIREMENTS, [plan_id=7]
 
 (42) Sort [codegen id : 10]
-Input [2]: [ca_address_sk#42, ca_city#43]
-Arguments: [ca_address_sk#42 ASC NULLS FIRST], false, 0
+Input [2]: [ca_address_sk#36, ca_city#37]
+Arguments: [ca_address_sk#36 ASC NULLS FIRST], false, 0
 
 (43) SortMergeJoin [codegen id : 11]
-Left keys [1]: [c_current_addr_sk#38]
-Right keys [1]: [ca_address_sk#42]
-Join condition: NOT (ca_city#43 = bought_city#32)
+Left keys [1]: [c_current_addr_sk#33]
+Right keys [1]: [ca_address_sk#36]
+Join condition: NOT (ca_city#37 = bought_city#28)
 
 (44) Project [codegen id : 11]
-Output [8]: [c_last_name#40, c_first_name#39, ca_city#43, bought_city#32, ss_ticket_number#5, extended_price#33, extended_tax#35, list_price#34]
-Input [10]: [ss_ticket_number#5, bought_city#32, extended_price#33, list_price#34, extended_tax#35, c_current_addr_sk#38, c_first_name#39, c_last_name#40, ca_address_sk#42, ca_city#43]
+Output [8]: [c_last_name#35, c_first_name#34, ca_city#37, bought_city#28, ss_ticket_number#5, extended_price#29, extended_tax#31, list_price#30]
+Input [10]: [ss_ticket_number#5, bought_city#28, extended_price#29, list_price#30, extended_tax#31, c_current_addr_sk#33, c_first_name#34, c_last_name#35, ca_address_sk#36, ca_city#37]
 
 (45) TakeOrderedAndProject
-Input [8]: [c_last_name#40, c_first_name#39, ca_city#43, bought_city#32, ss_ticket_number#5, extended_price#33, extended_tax#35, list_price#34]
-Arguments: 100, [c_last_name#40 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#40, c_first_name#39, ca_city#43, bought_city#32, ss_ticket_number#5, extended_price#33, extended_tax#35, list_price#34]
+Input [8]: [c_last_name#35, c_first_name#34, ca_city#37, bought_city#28, ss_ticket_number#5, extended_price#29, extended_tax#31, list_price#30]
+Arguments: 100, [c_last_name#35 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#35, c_first_name#34, ca_city#37, bought_city#28, ss_ticket_number#5, extended_price#29, extended_tax#31, list_price#30]
 
 ===== Subqueries =====
 
@@ -261,25 +261,25 @@ BroadcastExchange (50)
 
 
 (46) Scan parquet default.date_dim
-Output [3]: [d_date_sk#11, d_year#45, d_dom#46]
+Output [3]: [d_date_sk#11, d_year#38, d_dom#39]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451180,2451181,2451211,2451212,2451239,2451240,2451270,2451271,2451300,2451301,2451331,2451332,2451361,2451362,2451392,2451393,2451423,2451424,2451453,2451454,2451484,2451485,2451514,2451515,2451545,2451546,2451576,2451577,2451605,2451606,2451636,2451637,2451666,2451667,2451697,2451698,2451727,2451728,2451758,2451759,2451789,2451790,2451819,2451820,245185 [...]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_dom:int>
 
 (47) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#11, d_year#45, d_dom#46]
+Input [3]: [d_date_sk#11, d_year#38, d_dom#39]
 
 (48) Filter [codegen id : 1]
-Input [3]: [d_date_sk#11, d_year#45, d_dom#46]
-Condition : (((((isnotnull(d_dom#46) AND (d_dom#46 >= 1)) AND (d_dom#46 <= 2)) AND d_year#45 IN (1999,2000,2001)) AND d_date_sk#11 INSET 2451180, 2451181, 2451211, 2451212, 2451239, 2451240, 2451270, 2451271, 2451300, 2451301, 2451331, 2451332, 2451361, 2451362, 2451392, 2451393, 2451423, 2451424, 2451453, 2451454, 2451484, 2451485, 2451514, 2451515, 2451545, 2451546, 2451576, 2451577, 2451605, 2451606, 2451636, 2451637, 2451666, 2451667, 2451697, 2451698, 2451727, 2451728, 2451758, 2451 [...]
+Input [3]: [d_date_sk#11, d_year#38, d_dom#39]
+Condition : (((((isnotnull(d_dom#39) AND (d_dom#39 >= 1)) AND (d_dom#39 <= 2)) AND d_year#38 IN (1999,2000,2001)) AND d_date_sk#11 INSET 2451180, 2451181, 2451211, 2451212, 2451239, 2451240, 2451270, 2451271, 2451300, 2451301, 2451331, 2451332, 2451361, 2451362, 2451392, 2451393, 2451423, 2451424, 2451453, 2451454, 2451484, 2451485, 2451514, 2451515, 2451545, 2451546, 2451576, 2451577, 2451605, 2451606, 2451636, 2451637, 2451666, 2451667, 2451697, 2451698, 2451727, 2451728, 2451758, 2451 [...]
 
 (49) Project [codegen id : 1]
 Output [1]: [d_date_sk#11]
-Input [3]: [d_date_sk#11, d_year#45, d_dom#46]
+Input [3]: [d_date_sk#11, d_year#38, d_dom#39]
 
 (50) BroadcastExchange
 Input [1]: [d_date_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#47]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=8]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68/explain.txt
index 63f007cf120..d0cf7f02991 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68/explain.txt
@@ -87,7 +87,7 @@ Input [2]: [s_store_sk#12, s_city#13]
 
 (11) BroadcastExchange
 Input [1]: [s_store_sk#12]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_store_sk#4]
@@ -99,123 +99,123 @@ Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5,
 Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, s_store_sk#12]
 
 (14) Scan parquet default.household_demographics
-Output [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
+Output [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/household_demographics]
 PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)]
 ReadSchema: struct<hd_demo_sk:int,hd_dep_count:int,hd_vehicle_count:int>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
+Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
 
 (16) Filter [codegen id : 3]
-Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
-Condition : (((hd_dep_count#16 = 5) OR (hd_vehicle_count#17 = 3)) AND isnotnull(hd_demo_sk#15))
+Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
+Condition : (((hd_dep_count#15 = 5) OR (hd_vehicle_count#16 = 3)) AND isnotnull(hd_demo_sk#14))
 
 (17) Project [codegen id : 3]
-Output [1]: [hd_demo_sk#15]
-Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
+Output [1]: [hd_demo_sk#14]
+Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
 
 (18) BroadcastExchange
-Input [1]: [hd_demo_sk#15]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18]
+Input [1]: [hd_demo_sk#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (19) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_hdemo_sk#2]
-Right keys [1]: [hd_demo_sk#15]
+Right keys [1]: [hd_demo_sk#14]
 Join condition: None
 
 (20) Project [codegen id : 5]
 Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8]
-Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, hd_demo_sk#15]
+Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, hd_demo_sk#14]
 
 (21) Scan parquet default.customer_address
-Output [2]: [ca_address_sk#19, ca_city#20]
+Output [2]: [ca_address_sk#17, ca_city#18]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/customer_address]
 PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)]
 ReadSchema: struct<ca_address_sk:int,ca_city:string>
 
 (22) ColumnarToRow [codegen id : 4]
-Input [2]: [ca_address_sk#19, ca_city#20]
+Input [2]: [ca_address_sk#17, ca_city#18]
 
 (23) Filter [codegen id : 4]
-Input [2]: [ca_address_sk#19, ca_city#20]
-Condition : (isnotnull(ca_address_sk#19) AND isnotnull(ca_city#20))
+Input [2]: [ca_address_sk#17, ca_city#18]
+Condition : (isnotnull(ca_address_sk#17) AND isnotnull(ca_city#18))
 
 (24) BroadcastExchange
-Input [2]: [ca_address_sk#19, ca_city#20]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21]
+Input [2]: [ca_address_sk#17, ca_city#18]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
 
 (25) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_addr_sk#3]
-Right keys [1]: [ca_address_sk#19]
+Right keys [1]: [ca_address_sk#17]
 Join condition: None
 
 (26) Project [codegen id : 5]
-Output [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#20]
-Input [8]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_address_sk#19, ca_city#20]
+Output [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#18]
+Input [8]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_address_sk#17, ca_city#18]
 
 (27) HashAggregate [codegen id : 5]
-Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#20]
-Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#20]
+Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#18]
+Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18]
 Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#6)), partial_sum(UnscaledValue(ss_ext_list_price#7)), partial_sum(UnscaledValue(ss_ext_tax#8))]
-Aggregate Attributes [3]: [sum#22, sum#23, sum#24]
-Results [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#20, sum#25, sum#26, sum#27]
+Aggregate Attributes [3]: [sum#19, sum#20, sum#21]
+Results [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18, sum#22, sum#23, sum#24]
 
 (28) Exchange
-Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#20, sum#25, sum#26, sum#27]
-Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#20, 5), ENSURE_REQUIREMENTS, [id=#28]
+Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18, sum#22, sum#23, sum#24]
+Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (29) HashAggregate [codegen id : 8]
-Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#20, sum#25, sum#26, sum#27]
-Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#20]
+Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18, sum#22, sum#23, sum#24]
+Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#18]
 Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#6)), sum(UnscaledValue(ss_ext_list_price#7)), sum(UnscaledValue(ss_ext_tax#8))]
-Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#6))#29, sum(UnscaledValue(ss_ext_list_price#7))#30, sum(UnscaledValue(ss_ext_tax#8))#31]
-Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#20 AS bought_city#32, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#29,17,2) AS extended_price#33, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#7))#30,17,2) AS list_price#34, MakeDecimal(sum(UnscaledValue(ss_ext_tax#8))#31,17,2) AS extended_tax#35]
+Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#6))#25, sum(UnscaledValue(ss_ext_list_price#7))#26, sum(UnscaledValue(ss_ext_tax#8))#27]
+Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#18 AS bought_city#28, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#25,17,2) AS extended_price#29, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#7))#26,17,2) AS list_price#30, MakeDecimal(sum(UnscaledValue(ss_ext_tax#8))#27,17,2) AS extended_tax#31]
 
 (30) Scan parquet default.customer
-Output [4]: [c_customer_sk#36, c_current_addr_sk#37, c_first_name#38, c_last_name#39]
+Output [4]: [c_customer_sk#32, c_current_addr_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), IsNotNull(c_current_addr_sk)]
 ReadSchema: struct<c_customer_sk:int,c_current_addr_sk:int,c_first_name:string,c_last_name:string>
 
 (31) ColumnarToRow [codegen id : 6]
-Input [4]: [c_customer_sk#36, c_current_addr_sk#37, c_first_name#38, c_last_name#39]
+Input [4]: [c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
 
 (32) Filter [codegen id : 6]
-Input [4]: [c_customer_sk#36, c_current_addr_sk#37, c_first_name#38, c_last_name#39]
-Condition : (isnotnull(c_customer_sk#36) AND isnotnull(c_current_addr_sk#37))
+Input [4]: [c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
+Condition : (isnotnull(c_customer_sk#32) AND isnotnull(c_current_addr_sk#33))
 
 (33) BroadcastExchange
-Input [4]: [c_customer_sk#36, c_current_addr_sk#37, c_first_name#38, c_last_name#39]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40]
+Input [4]: [c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
+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#1]
-Right keys [1]: [c_customer_sk#36]
+Right keys [1]: [c_customer_sk#32]
 Join condition: None
 
 (35) Project [codegen id : 8]
-Output [8]: [ss_ticket_number#5, bought_city#32, extended_price#33, list_price#34, extended_tax#35, c_current_addr_sk#37, c_first_name#38, c_last_name#39]
-Input [10]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#32, extended_price#33, list_price#34, extended_tax#35, c_customer_sk#36, c_current_addr_sk#37, c_first_name#38, c_last_name#39]
+Output [8]: [ss_ticket_number#5, bought_city#28, extended_price#29, list_price#30, extended_tax#31, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
+Input [10]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#28, extended_price#29, list_price#30, extended_tax#31, c_customer_sk#32, c_current_addr_sk#33, c_first_name#34, c_last_name#35]
 
 (36) ReusedExchange [Reuses operator id: 24]
-Output [2]: [ca_address_sk#41, ca_city#42]
+Output [2]: [ca_address_sk#36, ca_city#37]
 
 (37) BroadcastHashJoin [codegen id : 8]
-Left keys [1]: [c_current_addr_sk#37]
-Right keys [1]: [ca_address_sk#41]
-Join condition: NOT (ca_city#42 = bought_city#32)
+Left keys [1]: [c_current_addr_sk#33]
+Right keys [1]: [ca_address_sk#36]
+Join condition: NOT (ca_city#37 = bought_city#28)
 
 (38) Project [codegen id : 8]
-Output [8]: [c_last_name#39, c_first_name#38, ca_city#42, bought_city#32, ss_ticket_number#5, extended_price#33, extended_tax#35, list_price#34]
-Input [10]: [ss_ticket_number#5, bought_city#32, extended_price#33, list_price#34, extended_tax#35, c_current_addr_sk#37, c_first_name#38, c_last_name#39, ca_address_sk#41, ca_city#42]
+Output [8]: [c_last_name#35, c_first_name#34, ca_city#37, bought_city#28, ss_ticket_number#5, extended_price#29, extended_tax#31, list_price#30]
+Input [10]: [ss_ticket_number#5, bought_city#28, extended_price#29, list_price#30, extended_tax#31, c_current_addr_sk#33, c_first_name#34, c_last_name#35, ca_address_sk#36, ca_city#37]
 
 (39) TakeOrderedAndProject
-Input [8]: [c_last_name#39, c_first_name#38, ca_city#42, bought_city#32, ss_ticket_number#5, extended_price#33, extended_tax#35, list_price#34]
-Arguments: 100, [c_last_name#39 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#39, c_first_name#38, ca_city#42, bought_city#32, ss_ticket_number#5, extended_price#33, extended_tax#35, list_price#34]
+Input [8]: [c_last_name#35, c_first_name#34, ca_city#37, bought_city#28, ss_ticket_number#5, extended_price#29, extended_tax#31, list_price#30]
+Arguments: 100, [c_last_name#35 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#35, c_first_name#34, ca_city#37, bought_city#28, ss_ticket_number#5, extended_price#29, extended_tax#31, list_price#30]
 
 ===== Subqueries =====
 
@@ -228,25 +228,25 @@ BroadcastExchange (44)
 
 
 (40) Scan parquet default.date_dim
-Output [3]: [d_date_sk#11, d_year#43, d_dom#44]
+Output [3]: [d_date_sk#11, d_year#38, d_dom#39]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451180,2451181,2451211,2451212,2451239,2451240,2451270,2451271,2451300,2451301,2451331,2451332,2451361,2451362,2451392,2451393,2451423,2451424,2451453,2451454,2451484,2451485,2451514,2451515,2451545,2451546,2451576,2451577,2451605,2451606,2451636,2451637,2451666,2451667,2451697,2451698,2451727,2451728,2451758,2451759,2451789,2451790,2451819,2451820,245185 [...]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_dom:int>
 
 (41) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#11, d_year#43, d_dom#44]
+Input [3]: [d_date_sk#11, d_year#38, d_dom#39]
 
 (42) Filter [codegen id : 1]
-Input [3]: [d_date_sk#11, d_year#43, d_dom#44]
-Condition : (((((isnotnull(d_dom#44) AND (d_dom#44 >= 1)) AND (d_dom#44 <= 2)) AND d_year#43 IN (1999,2000,2001)) AND d_date_sk#11 INSET 2451180, 2451181, 2451211, 2451212, 2451239, 2451240, 2451270, 2451271, 2451300, 2451301, 2451331, 2451332, 2451361, 2451362, 2451392, 2451393, 2451423, 2451424, 2451453, 2451454, 2451484, 2451485, 2451514, 2451515, 2451545, 2451546, 2451576, 2451577, 2451605, 2451606, 2451636, 2451637, 2451666, 2451667, 2451697, 2451698, 2451727, 2451728, 2451758, 2451 [...]
+Input [3]: [d_date_sk#11, d_year#38, d_dom#39]
+Condition : (((((isnotnull(d_dom#39) AND (d_dom#39 >= 1)) AND (d_dom#39 <= 2)) AND d_year#38 IN (1999,2000,2001)) AND d_date_sk#11 INSET 2451180, 2451181, 2451211, 2451212, 2451239, 2451240, 2451270, 2451271, 2451300, 2451301, 2451331, 2451332, 2451361, 2451362, 2451392, 2451393, 2451423, 2451424, 2451453, 2451454, 2451484, 2451485, 2451514, 2451515, 2451545, 2451546, 2451576, 2451577, 2451605, 2451606, 2451636, 2451637, 2451666, 2451667, 2451697, 2451698, 2451727, 2451728, 2451758, 2451 [...]
 
 (43) Project [codegen id : 1]
 Output [1]: [d_date_sk#11]
-Input [3]: [d_date_sk#11, d_year#43, d_dom#44]
+Input [3]: [d_date_sk#11, d_year#38, d_dom#39]
 
 (44) BroadcastExchange
 Input [1]: [d_date_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#45]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7.sf100/explain.txt
index adbc64c43ff..7e79f01f2ed 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7.sf100/explain.txt
@@ -78,7 +78,7 @@ Input [3]: [p_promo_sk#11, p_channel_email#12, p_channel_event#13]
 
 (11) BroadcastExchange
 Input [1]: [p_promo_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_promo_sk#3]
@@ -90,84 +90,84 @@ Output [6]: [ss_item_sk#1, ss_cdemo_sk#2, ss_quantity#4, ss_list_price#5, ss_sal
 Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, p_promo_sk#11]
 
 (14) Scan parquet default.customer_demographics
-Output [4]: [cd_demo_sk#15, cd_gender#16, cd_marital_status#17, cd_education_status#18]
+Output [4]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17]
 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,F), EqualTo(cd_marital_status,W), EqualTo(cd_education_status,Primary             ), IsNotNull(cd_demo_sk)]
 ReadSchema: struct<cd_demo_sk:int,cd_gender:string,cd_marital_status:string,cd_education_status:string>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [4]: [cd_demo_sk#15, cd_gender#16, cd_marital_status#17, cd_education_status#18]
+Input [4]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17]
 
 (16) Filter [codegen id : 3]
-Input [4]: [cd_demo_sk#15, cd_gender#16, cd_marital_status#17, cd_education_status#18]
-Condition : ((((((isnotnull(cd_gender#16) AND isnotnull(cd_marital_status#17)) AND isnotnull(cd_education_status#18)) AND (cd_gender#16 = F)) AND (cd_marital_status#17 = W)) AND (cd_education_status#18 = Primary             )) AND isnotnull(cd_demo_sk#15))
+Input [4]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17]
+Condition : ((((((isnotnull(cd_gender#15) AND isnotnull(cd_marital_status#16)) AND isnotnull(cd_education_status#17)) AND (cd_gender#15 = F)) AND (cd_marital_status#16 = W)) AND (cd_education_status#17 = Primary             )) AND isnotnull(cd_demo_sk#14))
 
 (17) Project [codegen id : 3]
-Output [1]: [cd_demo_sk#15]
-Input [4]: [cd_demo_sk#15, cd_gender#16, cd_marital_status#17, cd_education_status#18]
+Output [1]: [cd_demo_sk#14]
+Input [4]: [cd_demo_sk#14, cd_gender#15, cd_marital_status#16, cd_education_status#17]
 
 (18) BroadcastExchange
-Input [1]: [cd_demo_sk#15]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19]
+Input [1]: [cd_demo_sk#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (19) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_cdemo_sk#2]
-Right keys [1]: [cd_demo_sk#15]
+Right keys [1]: [cd_demo_sk#14]
 Join condition: None
 
 (20) Project [codegen id : 5]
 Output [5]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7]
-Input [7]: [ss_item_sk#1, ss_cdemo_sk#2, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, cd_demo_sk#15]
+Input [7]: [ss_item_sk#1, ss_cdemo_sk#2, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, cd_demo_sk#14]
 
 (21) Scan parquet default.item
-Output [2]: [i_item_sk#20, i_item_id#21]
+Output [2]: [i_item_sk#18, i_item_id#19]
 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>
 
 (22) ColumnarToRow [codegen id : 4]
-Input [2]: [i_item_sk#20, i_item_id#21]
+Input [2]: [i_item_sk#18, i_item_id#19]
 
 (23) Filter [codegen id : 4]
-Input [2]: [i_item_sk#20, i_item_id#21]
-Condition : isnotnull(i_item_sk#20)
+Input [2]: [i_item_sk#18, i_item_id#19]
+Condition : isnotnull(i_item_sk#18)
 
 (24) BroadcastExchange
-Input [2]: [i_item_sk#20, i_item_id#21]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22]
+Input [2]: [i_item_sk#18, i_item_id#19]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=3]
 
 (25) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_item_sk#1]
-Right keys [1]: [i_item_sk#20]
+Right keys [1]: [i_item_sk#18]
 Join condition: None
 
 (26) Project [codegen id : 5]
-Output [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#21]
-Input [7]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#20, i_item_id#21]
+Output [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#19]
+Input [7]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#18, i_item_id#19]
 
 (27) HashAggregate [codegen id : 5]
-Input [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#21]
-Keys [1]: [i_item_id#21]
+Input [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#19]
+Keys [1]: [i_item_id#19]
 Functions [4]: [partial_avg(ss_quantity#4), partial_avg(UnscaledValue(ss_list_price#5)), partial_avg(UnscaledValue(ss_coupon_amt#7)), partial_avg(UnscaledValue(ss_sales_price#6))]
-Aggregate Attributes [8]: [sum#23, count#24, sum#25, count#26, sum#27, count#28, sum#29, count#30]
-Results [9]: [i_item_id#21, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
+Aggregate Attributes [8]: [sum#20, count#21, sum#22, count#23, sum#24, count#25, sum#26, count#27]
+Results [9]: [i_item_id#19, sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34, count#35]
 
 (28) Exchange
-Input [9]: [i_item_id#21, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
-Arguments: hashpartitioning(i_item_id#21, 5), ENSURE_REQUIREMENTS, [id=#39]
+Input [9]: [i_item_id#19, sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34, count#35]
+Arguments: hashpartitioning(i_item_id#19, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (29) HashAggregate [codegen id : 6]
-Input [9]: [i_item_id#21, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
-Keys [1]: [i_item_id#21]
+Input [9]: [i_item_id#19, sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34, count#35]
+Keys [1]: [i_item_id#19]
 Functions [4]: [avg(ss_quantity#4), avg(UnscaledValue(ss_list_price#5)), avg(UnscaledValue(ss_coupon_amt#7)), avg(UnscaledValue(ss_sales_price#6))]
-Aggregate Attributes [4]: [avg(ss_quantity#4)#40, avg(UnscaledValue(ss_list_price#5))#41, avg(UnscaledValue(ss_coupon_amt#7))#42, avg(UnscaledValue(ss_sales_price#6))#43]
-Results [5]: [i_item_id#21, avg(ss_quantity#4)#40 AS agg1#44, cast((avg(UnscaledValue(ss_list_price#5))#41 / 100.0) as decimal(11,6)) AS agg2#45, cast((avg(UnscaledValue(ss_coupon_amt#7))#42 / 100.0) as decimal(11,6)) AS agg3#46, cast((avg(UnscaledValue(ss_sales_price#6))#43 / 100.0) as decimal(11,6)) AS agg4#47]
+Aggregate Attributes [4]: [avg(ss_quantity#4)#36, avg(UnscaledValue(ss_list_price#5))#37, avg(UnscaledValue(ss_coupon_amt#7))#38, avg(UnscaledValue(ss_sales_price#6))#39]
+Results [5]: [i_item_id#19, avg(ss_quantity#4)#36 AS agg1#40, cast((avg(UnscaledValue(ss_list_price#5))#37 / 100.0) as decimal(11,6)) AS agg2#41, cast((avg(UnscaledValue(ss_coupon_amt#7))#38 / 100.0) as decimal(11,6)) AS agg3#42, cast((avg(UnscaledValue(ss_sales_price#6))#39 / 100.0) as decimal(11,6)) AS agg4#43]
 
 (30) TakeOrderedAndProject
-Input [5]: [i_item_id#21, agg1#44, agg2#45, agg3#46, agg4#47]
-Arguments: 100, [i_item_id#21 ASC NULLS FIRST], [i_item_id#21, agg1#44, agg2#45, agg3#46, agg4#47]
+Input [5]: [i_item_id#19, agg1#40, agg2#41, agg3#42, agg4#43]
+Arguments: 100, [i_item_id#19 ASC NULLS FIRST], [i_item_id#19, agg1#40, agg2#41, agg3#42, agg4#43]
 
 ===== Subqueries =====
 
@@ -180,25 +180,25 @@ BroadcastExchange (35)
 
 
 (31) Scan parquet default.date_dim
-Output [2]: [d_date_sk#10, d_year#48]
+Output [2]: [d_date_sk#10, d_year#44]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2450815), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int>
 
 (32) ColumnarToRow [codegen id : 1]
-Input [2]: [d_date_sk#10, d_year#48]
+Input [2]: [d_date_sk#10, d_year#44]
 
 (33) Filter [codegen id : 1]
-Input [2]: [d_date_sk#10, d_year#48]
-Condition : ((((isnotnull(d_year#48) AND (d_year#48 = 1998)) AND (d_date_sk#10 >= 2450815)) AND (d_date_sk#10 <= 2451179)) AND isnotnull(d_date_sk#10))
+Input [2]: [d_date_sk#10, d_year#44]
+Condition : ((((isnotnull(d_year#44) AND (d_year#44 = 1998)) AND (d_date_sk#10 >= 2450815)) AND (d_date_sk#10 <= 2451179)) AND isnotnull(d_date_sk#10))
 
 (34) Project [codegen id : 1]
 Output [1]: [d_date_sk#10]
-Input [2]: [d_date_sk#10, d_year#48]
+Input [2]: [d_date_sk#10, d_year#44]
 
 (35) BroadcastExchange
 Input [1]: [d_date_sk#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#49]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7/explain.txt
index afcfd4816dc..54fb333a149 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7/explain.txt
@@ -66,7 +66,7 @@ Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_stat
 
 (8) BroadcastExchange
 Input [1]: [cd_demo_sk#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (9) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_cdemo_sk#2]
@@ -78,96 +78,96 @@ Output [7]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sal
 Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10]
 
 (11) ReusedExchange [Reuses operator id: 35]
-Output [1]: [d_date_sk#15]
+Output [1]: [d_date_sk#14]
 
 (12) BroadcastHashJoin [codegen id : 5]
 Left keys [1]: [ss_sold_date_sk#8]
-Right keys [1]: [d_date_sk#15]
+Right keys [1]: [d_date_sk#14]
 Join condition: None
 
 (13) Project [codegen id : 5]
 Output [6]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7]
-Input [8]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#15]
+Input [8]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#14]
 
 (14) Scan parquet default.item
-Output [2]: [i_item_sk#16, i_item_id#17]
+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) ColumnarToRow [codegen id : 3]
-Input [2]: [i_item_sk#16, i_item_id#17]
+Input [2]: [i_item_sk#15, i_item_id#16]
 
 (16) Filter [codegen id : 3]
-Input [2]: [i_item_sk#16, i_item_id#17]
-Condition : isnotnull(i_item_sk#16)
+Input [2]: [i_item_sk#15, i_item_id#16]
+Condition : isnotnull(i_item_sk#15)
 
 (17) BroadcastExchange
-Input [2]: [i_item_sk#16, i_item_id#17]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18]
+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]: [ss_item_sk#1]
-Right keys [1]: [i_item_sk#16]
+Right keys [1]: [i_item_sk#15]
 Join condition: None
 
 (19) Project [codegen id : 5]
-Output [6]: [ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#17]
-Input [8]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#16, i_item_id#17]
+Output [6]: [ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#16]
+Input [8]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#15, i_item_id#16]
 
 (20) Scan parquet default.promotion
-Output [3]: [p_promo_sk#19, p_channel_email#20, p_channel_event#21]
+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) ColumnarToRow [codegen id : 4]
-Input [3]: [p_promo_sk#19, p_channel_email#20, p_channel_event#21]
+Input [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19]
 
 (22) Filter [codegen id : 4]
-Input [3]: [p_promo_sk#19, p_channel_email#20, p_channel_event#21]
-Condition : (((p_channel_email#20 = N) OR (p_channel_event#21 = N)) AND isnotnull(p_promo_sk#19))
+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))
 
 (23) Project [codegen id : 4]
-Output [1]: [p_promo_sk#19]
-Input [3]: [p_promo_sk#19, p_channel_email#20, p_channel_event#21]
+Output [1]: [p_promo_sk#17]
+Input [3]: [p_promo_sk#17, p_channel_email#18, p_channel_event#19]
 
 (24) BroadcastExchange
-Input [1]: [p_promo_sk#19]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22]
+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]: [ss_promo_sk#3]
-Right keys [1]: [p_promo_sk#19]
+Right keys [1]: [p_promo_sk#17]
 Join condition: None
 
 (26) Project [codegen id : 5]
-Output [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#17]
-Input [7]: [ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#17, p_promo_sk#19]
+Output [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#16]
+Input [7]: [ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#16, p_promo_sk#17]
 
 (27) HashAggregate [codegen id : 5]
-Input [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#17]
-Keys [1]: [i_item_id#17]
+Input [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#16]
+Keys [1]: [i_item_id#16]
 Functions [4]: [partial_avg(ss_quantity#4), partial_avg(UnscaledValue(ss_list_price#5)), partial_avg(UnscaledValue(ss_coupon_amt#7)), partial_avg(UnscaledValue(ss_sales_price#6))]
-Aggregate Attributes [8]: [sum#23, count#24, sum#25, count#26, sum#27, count#28, sum#29, count#30]
-Results [9]: [i_item_id#17, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
+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#17, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
-Arguments: hashpartitioning(i_item_id#17, 5), ENSURE_REQUIREMENTS, [id=#39]
+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#17, sum#31, count#32, sum#33, count#34, sum#35, count#36, sum#37, count#38]
-Keys [1]: [i_item_id#17]
+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(ss_quantity#4), avg(UnscaledValue(ss_list_price#5)), avg(UnscaledValue(ss_coupon_amt#7)), avg(UnscaledValue(ss_sales_price#6))]
-Aggregate Attributes [4]: [avg(ss_quantity#4)#40, avg(UnscaledValue(ss_list_price#5))#41, avg(UnscaledValue(ss_coupon_amt#7))#42, avg(UnscaledValue(ss_sales_price#6))#43]
-Results [5]: [i_item_id#17, avg(ss_quantity#4)#40 AS agg1#44, cast((avg(UnscaledValue(ss_list_price#5))#41 / 100.0) as decimal(11,6)) AS agg2#45, cast((avg(UnscaledValue(ss_coupon_amt#7))#42 / 100.0) as decimal(11,6)) AS agg3#46, cast((avg(UnscaledValue(ss_sales_price#6))#43 / 100.0) as decimal(11,6)) AS agg4#47]
+Aggregate Attributes [4]: [avg(ss_quantity#4)#36, avg(UnscaledValue(ss_list_price#5))#37, avg(UnscaledValue(ss_coupon_amt#7))#38, avg(UnscaledValue(ss_sales_price#6))#39]
+Results [5]: [i_item_id#16, avg(ss_quantity#4)#36 AS agg1#40, cast((avg(UnscaledValue(ss_list_price#5))#37 / 100.0) as decimal(11,6)) AS agg2#41, cast((avg(UnscaledValue(ss_coupon_amt#7))#38 / 100.0) as decimal(11,6)) AS agg3#42, cast((avg(UnscaledValue(ss_sales_price#6))#39 / 100.0) as decimal(11,6)) AS agg4#43]
 
 (30) TakeOrderedAndProject
-Input [5]: [i_item_id#17, agg1#44, agg2#45, agg3#46, agg4#47]
-Arguments: 100, [i_item_id#17 ASC NULLS FIRST], [i_item_id#17, agg1#44, agg2#45, agg3#46, agg4#47]
+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 =====
 
@@ -180,25 +180,25 @@ BroadcastExchange (35)
 
 
 (31) Scan parquet default.date_dim
-Output [2]: [d_date_sk#15, d_year#48]
+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,1998), GreaterThanOrEqual(d_date_sk,2450815), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int>
 
 (32) ColumnarToRow [codegen id : 1]
-Input [2]: [d_date_sk#15, d_year#48]
+Input [2]: [d_date_sk#14, d_year#44]
 
 (33) Filter [codegen id : 1]
-Input [2]: [d_date_sk#15, d_year#48]
-Condition : ((((isnotnull(d_year#48) AND (d_year#48 = 1998)) AND (d_date_sk#15 >= 2450815)) AND (d_date_sk#15 <= 2451179)) AND isnotnull(d_date_sk#15))
+Input [2]: [d_date_sk#14, d_year#44]
+Condition : ((((isnotnull(d_year#44) AND (d_year#44 = 1998)) AND (d_date_sk#14 >= 2450815)) AND (d_date_sk#14 <= 2451179)) AND isnotnull(d_date_sk#14))
 
 (34) Project [codegen id : 1]
-Output [1]: [d_date_sk#15]
-Input [2]: [d_date_sk#15, d_year#48]
+Output [1]: [d_date_sk#14]
+Input [2]: [d_date_sk#14, d_year#44]
 
 (35) BroadcastExchange
-Input [1]: [d_date_sk#15]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#49]
+Input [1]: [d_date_sk#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73.sf100/explain.txt
index 1419499d54d..4cd58b14426 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73.sf100/explain.txt
@@ -80,7 +80,7 @@ Input [2]: [s_store_sk#8, s_county#9]
 
 (11) BroadcastExchange
 Input [1]: [s_store_sk#8]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#3]
@@ -92,92 +92,92 @@ Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4]
 Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#8]
 
 (14) Scan parquet default.household_demographics
-Output [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Output [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/household_demographics]
 PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000         ),EqualTo(hd_buy_potential,Unknown        )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)]
 ReadSchema: struct<hd_demo_sk:int,hd_buy_potential:string,hd_dep_count:int,hd_vehicle_count:int>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 
 (16) Filter [codegen id : 3]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
-Condition : (((((isnotnull(hd_vehicle_count#14) AND isnotnull(hd_dep_count#13)) AND ((hd_buy_potential#12 = >10000         ) OR (hd_buy_potential#12 = Unknown        ))) AND (hd_vehicle_count#14 > 0)) AND ((cast(hd_dep_count#13 as double) / cast(hd_vehicle_count#14 as double)) > 1.0)) AND isnotnull(hd_demo_sk#11))
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
+Condition : (((((isnotnull(hd_vehicle_count#13) AND isnotnull(hd_dep_count#12)) AND ((hd_buy_potential#11 = >10000         ) OR (hd_buy_potential#11 = Unknown        ))) AND (hd_vehicle_count#13 > 0)) AND ((cast(hd_dep_count#12 as double) / cast(hd_vehicle_count#13 as double)) > 1.0)) AND isnotnull(hd_demo_sk#10))
 
 (17) Project [codegen id : 3]
-Output [1]: [hd_demo_sk#11]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Output [1]: [hd_demo_sk#10]
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 
 (18) BroadcastExchange
-Input [1]: [hd_demo_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15]
+Input [1]: [hd_demo_sk#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (19) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_hdemo_sk#2]
-Right keys [1]: [hd_demo_sk#11]
+Right keys [1]: [hd_demo_sk#10]
 Join condition: None
 
 (20) Project [codegen id : 4]
 Output [2]: [ss_customer_sk#1, ss_ticket_number#4]
-Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#11]
+Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#10]
 
 (21) HashAggregate [codegen id : 4]
 Input [2]: [ss_customer_sk#1, ss_ticket_number#4]
 Keys [2]: [ss_ticket_number#4, ss_customer_sk#1]
 Functions [1]: [partial_count(1)]
-Aggregate Attributes [1]: [count#16]
-Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
+Aggregate Attributes [1]: [count#14]
+Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
 
 (22) Exchange
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
-Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#18]
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
+Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (23) HashAggregate [codegen id : 5]
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
 Keys [2]: [ss_ticket_number#4, ss_customer_sk#1]
 Functions [1]: [count(1)]
-Aggregate Attributes [1]: [count(1)#19]
-Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#19 AS cnt#20]
+Aggregate Attributes [1]: [count(1)#16]
+Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#16 AS cnt#17]
 
 (24) Filter [codegen id : 5]
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#20]
-Condition : ((cnt#20 >= 1) AND (cnt#20 <= 5))
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#17]
+Condition : ((cnt#17 >= 1) AND (cnt#17 <= 5))
 
 (25) BroadcastExchange
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#20]
-Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#21]
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#17]
+Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [plan_id=4]
 
 (26) Scan parquet default.customer
-Output [5]: [c_customer_sk#22, c_salutation#23, c_first_name#24, c_last_name#25, c_preferred_cust_flag#26]
+Output [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/customer]
 PushedFilters: [IsNotNull(c_customer_sk)]
 ReadSchema: struct<c_customer_sk:int,c_salutation:string,c_first_name:string,c_last_name:string,c_preferred_cust_flag:string>
 
 (27) ColumnarToRow
-Input [5]: [c_customer_sk#22, c_salutation#23, c_first_name#24, c_last_name#25, c_preferred_cust_flag#26]
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 
 (28) Filter
-Input [5]: [c_customer_sk#22, c_salutation#23, c_first_name#24, c_last_name#25, c_preferred_cust_flag#26]
-Condition : isnotnull(c_customer_sk#22)
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
+Condition : isnotnull(c_customer_sk#18)
 
 (29) BroadcastHashJoin [codegen id : 6]
 Left keys [1]: [ss_customer_sk#1]
-Right keys [1]: [c_customer_sk#22]
+Right keys [1]: [c_customer_sk#18]
 Join condition: None
 
 (30) Project [codegen id : 6]
-Output [6]: [c_last_name#25, c_first_name#24, c_salutation#23, c_preferred_cust_flag#26, ss_ticket_number#4, cnt#20]
-Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#20, c_customer_sk#22, c_salutation#23, c_first_name#24, c_last_name#25, c_preferred_cust_flag#26]
+Output [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#17, c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 
 (31) Exchange
-Input [6]: [c_last_name#25, c_first_name#24, c_salutation#23, c_preferred_cust_flag#26, ss_ticket_number#4, cnt#20]
-Arguments: rangepartitioning(cnt#20 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#27]
+Input [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Arguments: rangepartitioning(cnt#17 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (32) Sort [codegen id : 7]
-Input [6]: [c_last_name#25, c_first_name#24, c_salutation#23, c_preferred_cust_flag#26, ss_ticket_number#4, cnt#20]
-Arguments: [cnt#20 DESC NULLS LAST], true, 0
+Input [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Arguments: [cnt#17 DESC NULLS LAST], true, 0
 
 ===== Subqueries =====
 
@@ -190,25 +190,25 @@ BroadcastExchange (37)
 
 
 (33) Scan parquet default.date_dim
-Output [3]: [d_date_sk#7, d_year#28, d_dom#29]
+Output [3]: [d_date_sk#7, d_year#23, d_dom#24]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1998,1999,2000]), In(d_date_sk, [2450815,2450816,2450846,2450847,2450874,2450875,2450905,2450906,2450935,2450936,2450966,2450967,2450996,2450997,2451027,2451028,2451058,2451059,2451088,2451089,2451119,2451120,2451149,2451150,2451180,2451181,2451211,2451212,2451239,2451240,2451270,2451271,2451300,2451301,2451331,2451332,2451361,2451362,2451392,2451393,2451423,2451424,2451453,2451454,245148 [...]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_dom:int>
 
 (34) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#7, d_year#28, d_dom#29]
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
 
 (35) Filter [codegen id : 1]
-Input [3]: [d_date_sk#7, d_year#28, d_dom#29]
-Condition : (((((isnotnull(d_dom#29) AND (d_dom#29 >= 1)) AND (d_dom#29 <= 2)) AND d_year#28 IN (1998,1999,2000)) AND d_date_sk#7 INSET 2450815, 2450816, 2450846, 2450847, 2450874, 2450875, 2450905, 2450906, 2450935, 2450936, 2450966, 2450967, 2450996, 2450997, 2451027, 2451028, 2451058, 2451059, 2451088, 2451089, 2451119, 2451120, 2451149, 2451150, 2451180, 2451181, 2451211, 2451212, 2451239, 2451240, 2451270, 2451271, 2451300, 2451301, 2451331, 2451332, 2451361, 2451362, 2451392, 24513 [...]
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
+Condition : (((((isnotnull(d_dom#24) AND (d_dom#24 >= 1)) AND (d_dom#24 <= 2)) AND d_year#23 IN (1998,1999,2000)) AND d_date_sk#7 INSET 2450815, 2450816, 2450846, 2450847, 2450874, 2450875, 2450905, 2450906, 2450935, 2450936, 2450966, 2450967, 2450996, 2450997, 2451027, 2451028, 2451058, 2451059, 2451088, 2451089, 2451119, 2451120, 2451149, 2451150, 2451180, 2451181, 2451211, 2451212, 2451239, 2451240, 2451270, 2451271, 2451300, 2451301, 2451331, 2451332, 2451361, 2451362, 2451392, 24513 [...]
 
 (36) Project [codegen id : 1]
 Output [1]: [d_date_sk#7]
-Input [3]: [d_date_sk#7, d_year#28, d_dom#29]
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
 
 (37) BroadcastExchange
 Input [1]: [d_date_sk#7]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73/explain.txt
index e86ea3648e7..de226086405 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73/explain.txt
@@ -80,7 +80,7 @@ Input [2]: [s_store_sk#8, s_county#9]
 
 (11) BroadcastExchange
 Input [1]: [s_store_sk#8]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#3]
@@ -92,92 +92,92 @@ Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4]
 Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#8]
 
 (14) Scan parquet default.household_demographics
-Output [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Output [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/household_demographics]
 PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000         ),EqualTo(hd_buy_potential,Unknown        )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)]
 ReadSchema: struct<hd_demo_sk:int,hd_buy_potential:string,hd_dep_count:int,hd_vehicle_count:int>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 
 (16) Filter [codegen id : 3]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
-Condition : (((((isnotnull(hd_vehicle_count#14) AND isnotnull(hd_dep_count#13)) AND ((hd_buy_potential#12 = >10000         ) OR (hd_buy_potential#12 = Unknown        ))) AND (hd_vehicle_count#14 > 0)) AND ((cast(hd_dep_count#13 as double) / cast(hd_vehicle_count#14 as double)) > 1.0)) AND isnotnull(hd_demo_sk#11))
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
+Condition : (((((isnotnull(hd_vehicle_count#13) AND isnotnull(hd_dep_count#12)) AND ((hd_buy_potential#11 = >10000         ) OR (hd_buy_potential#11 = Unknown        ))) AND (hd_vehicle_count#13 > 0)) AND ((cast(hd_dep_count#12 as double) / cast(hd_vehicle_count#13 as double)) > 1.0)) AND isnotnull(hd_demo_sk#10))
 
 (17) Project [codegen id : 3]
-Output [1]: [hd_demo_sk#11]
-Input [4]: [hd_demo_sk#11, hd_buy_potential#12, hd_dep_count#13, hd_vehicle_count#14]
+Output [1]: [hd_demo_sk#10]
+Input [4]: [hd_demo_sk#10, hd_buy_potential#11, hd_dep_count#12, hd_vehicle_count#13]
 
 (18) BroadcastExchange
-Input [1]: [hd_demo_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15]
+Input [1]: [hd_demo_sk#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (19) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_hdemo_sk#2]
-Right keys [1]: [hd_demo_sk#11]
+Right keys [1]: [hd_demo_sk#10]
 Join condition: None
 
 (20) Project [codegen id : 4]
 Output [2]: [ss_customer_sk#1, ss_ticket_number#4]
-Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#11]
+Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#10]
 
 (21) HashAggregate [codegen id : 4]
 Input [2]: [ss_customer_sk#1, ss_ticket_number#4]
 Keys [2]: [ss_ticket_number#4, ss_customer_sk#1]
 Functions [1]: [partial_count(1)]
-Aggregate Attributes [1]: [count#16]
-Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
+Aggregate Attributes [1]: [count#14]
+Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
 
 (22) Exchange
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
-Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#18]
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
+Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (23) HashAggregate [codegen id : 6]
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#17]
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#15]
 Keys [2]: [ss_ticket_number#4, ss_customer_sk#1]
 Functions [1]: [count(1)]
-Aggregate Attributes [1]: [count(1)#19]
-Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#19 AS cnt#20]
+Aggregate Attributes [1]: [count(1)#16]
+Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#16 AS cnt#17]
 
 (24) Filter [codegen id : 6]
-Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#20]
-Condition : ((cnt#20 >= 1) AND (cnt#20 <= 5))
+Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#17]
+Condition : ((cnt#17 >= 1) AND (cnt#17 <= 5))
 
 (25) Scan parquet default.customer
-Output [5]: [c_customer_sk#21, c_salutation#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25]
+Output [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/customer]
 PushedFilters: [IsNotNull(c_customer_sk)]
 ReadSchema: struct<c_customer_sk:int,c_salutation:string,c_first_name:string,c_last_name:string,c_preferred_cust_flag:string>
 
 (26) ColumnarToRow [codegen id : 5]
-Input [5]: [c_customer_sk#21, c_salutation#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25]
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 
 (27) Filter [codegen id : 5]
-Input [5]: [c_customer_sk#21, c_salutation#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25]
-Condition : isnotnull(c_customer_sk#21)
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
+Condition : isnotnull(c_customer_sk#18)
 
 (28) BroadcastExchange
-Input [5]: [c_customer_sk#21, c_salutation#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26]
+Input [5]: [c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
 
 (29) BroadcastHashJoin [codegen id : 6]
 Left keys [1]: [ss_customer_sk#1]
-Right keys [1]: [c_customer_sk#21]
+Right keys [1]: [c_customer_sk#18]
 Join condition: None
 
 (30) Project [codegen id : 6]
-Output [6]: [c_last_name#24, c_first_name#23, c_salutation#22, c_preferred_cust_flag#25, ss_ticket_number#4, cnt#20]
-Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#20, c_customer_sk#21, c_salutation#22, c_first_name#23, c_last_name#24, c_preferred_cust_flag#25]
+Output [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#17, c_customer_sk#18, c_salutation#19, c_first_name#20, c_last_name#21, c_preferred_cust_flag#22]
 
 (31) Exchange
-Input [6]: [c_last_name#24, c_first_name#23, c_salutation#22, c_preferred_cust_flag#25, ss_ticket_number#4, cnt#20]
-Arguments: rangepartitioning(cnt#20 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#27]
+Input [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Arguments: rangepartitioning(cnt#17 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (32) Sort [codegen id : 7]
-Input [6]: [c_last_name#24, c_first_name#23, c_salutation#22, c_preferred_cust_flag#25, ss_ticket_number#4, cnt#20]
-Arguments: [cnt#20 DESC NULLS LAST], true, 0
+Input [6]: [c_last_name#21, c_first_name#20, c_salutation#19, c_preferred_cust_flag#22, ss_ticket_number#4, cnt#17]
+Arguments: [cnt#17 DESC NULLS LAST], true, 0
 
 ===== Subqueries =====
 
@@ -190,25 +190,25 @@ BroadcastExchange (37)
 
 
 (33) Scan parquet default.date_dim
-Output [3]: [d_date_sk#7, d_year#28, d_dom#29]
+Output [3]: [d_date_sk#7, d_year#23, d_dom#24]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1998,1999,2000]), In(d_date_sk, [2450815,2450816,2450846,2450847,2450874,2450875,2450905,2450906,2450935,2450936,2450966,2450967,2450996,2450997,2451027,2451028,2451058,2451059,2451088,2451089,2451119,2451120,2451149,2451150,2451180,2451181,2451211,2451212,2451239,2451240,2451270,2451271,2451300,2451301,2451331,2451332,2451361,2451362,2451392,2451393,2451423,2451424,2451453,2451454,245148 [...]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_dom:int>
 
 (34) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#7, d_year#28, d_dom#29]
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
 
 (35) Filter [codegen id : 1]
-Input [3]: [d_date_sk#7, d_year#28, d_dom#29]
-Condition : (((((isnotnull(d_dom#29) AND (d_dom#29 >= 1)) AND (d_dom#29 <= 2)) AND d_year#28 IN (1998,1999,2000)) AND d_date_sk#7 INSET 2450815, 2450816, 2450846, 2450847, 2450874, 2450875, 2450905, 2450906, 2450935, 2450936, 2450966, 2450967, 2450996, 2450997, 2451027, 2451028, 2451058, 2451059, 2451088, 2451089, 2451119, 2451120, 2451149, 2451150, 2451180, 2451181, 2451211, 2451212, 2451239, 2451240, 2451270, 2451271, 2451300, 2451301, 2451331, 2451332, 2451361, 2451362, 2451392, 24513 [...]
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
+Condition : (((((isnotnull(d_dom#24) AND (d_dom#24 >= 1)) AND (d_dom#24 <= 2)) AND d_year#23 IN (1998,1999,2000)) AND d_date_sk#7 INSET 2450815, 2450816, 2450846, 2450847, 2450874, 2450875, 2450905, 2450906, 2450935, 2450936, 2450966, 2450967, 2450996, 2450997, 2451027, 2451028, 2451058, 2451059, 2451088, 2451089, 2451119, 2451120, 2451149, 2451150, 2451180, 2451181, 2451211, 2451212, 2451239, 2451240, 2451270, 2451271, 2451300, 2451301, 2451331, 2451332, 2451361, 2451362, 2451392, 24513 [...]
 
 (36) Project [codegen id : 1]
 Output [1]: [d_date_sk#7]
-Input [3]: [d_date_sk#7, d_year#28, d_dom#29]
+Input [3]: [d_date_sk#7, d_year#23, d_dom#24]
 
 (37) BroadcastExchange
 Input [1]: [d_date_sk#7]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt
index 739c29798ad..4943e951d72 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt
@@ -81,7 +81,7 @@ Input [3]: [hd_demo_sk#11, hd_dep_count#12, hd_vehicle_count#13]
 
 (11) BroadcastExchange
 Input [1]: [hd_demo_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_hdemo_sk#2]
@@ -93,96 +93,96 @@ Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5,
 Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, hd_demo_sk#11]
 
 (14) Scan parquet default.store
-Output [3]: [s_store_sk#15, s_number_employees#16, s_city#17]
+Output [3]: [s_store_sk#14, s_number_employees#15, s_city#16]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_number_employees), GreaterThanOrEqual(s_number_employees,200), LessThanOrEqual(s_number_employees,295), IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int,s_number_employees:int,s_city:string>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [3]: [s_store_sk#15, s_number_employees#16, s_city#17]
+Input [3]: [s_store_sk#14, s_number_employees#15, s_city#16]
 
 (16) Filter [codegen id : 3]
-Input [3]: [s_store_sk#15, s_number_employees#16, s_city#17]
-Condition : (((isnotnull(s_number_employees#16) AND (s_number_employees#16 >= 200)) AND (s_number_employees#16 <= 295)) AND isnotnull(s_store_sk#15))
+Input [3]: [s_store_sk#14, s_number_employees#15, s_city#16]
+Condition : (((isnotnull(s_number_employees#15) AND (s_number_employees#15 >= 200)) AND (s_number_employees#15 <= 295)) AND isnotnull(s_store_sk#14))
 
 (17) Project [codegen id : 3]
-Output [2]: [s_store_sk#15, s_city#17]
-Input [3]: [s_store_sk#15, s_number_employees#16, s_city#17]
+Output [2]: [s_store_sk#14, s_city#16]
+Input [3]: [s_store_sk#14, s_number_employees#15, s_city#16]
 
 (18) BroadcastExchange
-Input [2]: [s_store_sk#15, s_city#17]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18]
+Input [2]: [s_store_sk#14, s_city#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (19) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#4]
-Right keys [1]: [s_store_sk#15]
+Right keys [1]: [s_store_sk#14]
 Join condition: None
 
 (20) Project [codegen id : 4]
-Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#17]
-Input [8]: [ss_customer_sk#1, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#15, s_city#17]
+Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#16]
+Input [8]: [ss_customer_sk#1, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#14, s_city#16]
 
 (21) HashAggregate [codegen id : 4]
-Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#17]
-Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#17]
+Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#16]
+Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16]
 Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#6)), partial_sum(UnscaledValue(ss_net_profit#7))]
-Aggregate Attributes [2]: [sum#19, sum#20]
-Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#17, sum#21, sum#22]
+Aggregate Attributes [2]: [sum#17, sum#18]
+Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, sum#19, sum#20]
 
 (22) Exchange
-Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#17, sum#21, sum#22]
-Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#17, 5), ENSURE_REQUIREMENTS, [id=#23]
+Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, sum#19, sum#20]
+Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (23) HashAggregate [codegen id : 5]
-Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#17, sum#21, sum#22]
-Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#17]
+Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, sum#19, sum#20]
+Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16]
 Functions [2]: [sum(UnscaledValue(ss_coupon_amt#6)), sum(UnscaledValue(ss_net_profit#7))]
-Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#24, sum(UnscaledValue(ss_net_profit#7))#25]
-Results [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#17, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#24,17,2) AS amt#26, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#25,17,2) AS profit#27]
+Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#21, sum(UnscaledValue(ss_net_profit#7))#22]
+Results [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#16, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#21,17,2) AS amt#23, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#22,17,2) AS profit#24]
 
 (24) Exchange
-Input [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#17, amt#26, profit#27]
-Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#28]
+Input [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#16, amt#23, profit#24]
+Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (25) Sort [codegen id : 6]
-Input [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#17, amt#26, profit#27]
+Input [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#16, amt#23, profit#24]
 Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0
 
 (26) Scan parquet default.customer
-Output [3]: [c_customer_sk#29, c_first_name#30, c_last_name#31]
+Output [3]: [c_customer_sk#25, c_first_name#26, c_last_name#27]
 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>
 
 (27) ColumnarToRow [codegen id : 7]
-Input [3]: [c_customer_sk#29, c_first_name#30, c_last_name#31]
+Input [3]: [c_customer_sk#25, c_first_name#26, c_last_name#27]
 
 (28) Filter [codegen id : 7]
-Input [3]: [c_customer_sk#29, c_first_name#30, c_last_name#31]
-Condition : isnotnull(c_customer_sk#29)
+Input [3]: [c_customer_sk#25, c_first_name#26, c_last_name#27]
+Condition : isnotnull(c_customer_sk#25)
 
 (29) Exchange
-Input [3]: [c_customer_sk#29, c_first_name#30, c_last_name#31]
-Arguments: hashpartitioning(c_customer_sk#29, 5), ENSURE_REQUIREMENTS, [id=#32]
+Input [3]: [c_customer_sk#25, c_first_name#26, c_last_name#27]
+Arguments: hashpartitioning(c_customer_sk#25, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (30) Sort [codegen id : 8]
-Input [3]: [c_customer_sk#29, c_first_name#30, c_last_name#31]
-Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0
+Input [3]: [c_customer_sk#25, c_first_name#26, c_last_name#27]
+Arguments: [c_customer_sk#25 ASC NULLS FIRST], false, 0
 
 (31) SortMergeJoin [codegen id : 9]
 Left keys [1]: [ss_customer_sk#1]
-Right keys [1]: [c_customer_sk#29]
+Right keys [1]: [c_customer_sk#25]
 Join condition: None
 
 (32) Project [codegen id : 9]
-Output [7]: [c_last_name#31, c_first_name#30, substr(s_city#17, 1, 30) AS substr(s_city, 1, 30)#33, ss_ticket_number#5, amt#26, profit#27, s_city#17]
-Input [8]: [ss_ticket_number#5, ss_customer_sk#1, s_city#17, amt#26, profit#27, c_customer_sk#29, c_first_name#30, c_last_name#31]
+Output [7]: [c_last_name#27, c_first_name#26, substr(s_city#16, 1, 30) AS substr(s_city, 1, 30)#28, ss_ticket_number#5, amt#23, profit#24, s_city#16]
+Input [8]: [ss_ticket_number#5, ss_customer_sk#1, s_city#16, amt#23, profit#24, c_customer_sk#25, c_first_name#26, c_last_name#27]
 
 (33) TakeOrderedAndProject
-Input [7]: [c_last_name#31, c_first_name#30, substr(s_city, 1, 30)#33, ss_ticket_number#5, amt#26, profit#27, s_city#17]
-Arguments: 100, [c_last_name#31 ASC NULLS FIRST, c_first_name#30 ASC NULLS FIRST, substr(s_city#17, 1, 30) ASC NULLS FIRST, profit#27 ASC NULLS FIRST], [c_last_name#31, c_first_name#30, substr(s_city, 1, 30)#33, ss_ticket_number#5, amt#26, profit#27]
+Input [7]: [c_last_name#27, c_first_name#26, substr(s_city, 1, 30)#28, ss_ticket_number#5, amt#23, profit#24, s_city#16]
+Arguments: 100, [c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, substr(s_city#16, 1, 30) ASC NULLS FIRST, profit#24 ASC NULLS FIRST], [c_last_name#27, c_first_name#26, substr(s_city, 1, 30)#28, ss_ticket_number#5, amt#23, profit#24]
 
 ===== Subqueries =====
 
@@ -195,25 +195,25 @@ BroadcastExchange (38)
 
 
 (34) Scan parquet default.date_dim
-Output [3]: [d_date_sk#10, d_year#34, d_dow#35]
+Output [3]: [d_date_sk#10, d_year#29, d_dow#30]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_dow), EqualTo(d_dow,1), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450819), LessThanOrEqual(d_date_sk,2451904), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_dow:int>
 
 (35) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#34, d_dow#35]
+Input [3]: [d_date_sk#10, d_year#29, d_dow#30]
 
 (36) Filter [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#34, d_dow#35]
-Condition : (((((isnotnull(d_dow#35) AND (d_dow#35 = 1)) AND d_year#34 IN (1998,1999,2000)) AND (d_date_sk#10 >= 2450819)) AND (d_date_sk#10 <= 2451904)) AND isnotnull(d_date_sk#10))
+Input [3]: [d_date_sk#10, d_year#29, d_dow#30]
+Condition : (((((isnotnull(d_dow#30) AND (d_dow#30 = 1)) AND d_year#29 IN (1998,1999,2000)) AND (d_date_sk#10 >= 2450819)) AND (d_date_sk#10 <= 2451904)) AND isnotnull(d_date_sk#10))
 
 (37) Project [codegen id : 1]
 Output [1]: [d_date_sk#10]
-Input [3]: [d_date_sk#10, d_year#34, d_dow#35]
+Input [3]: [d_date_sk#10, d_year#29, d_dow#30]
 
 (38) BroadcastExchange
 Input [1]: [d_date_sk#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#36]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79/explain.txt
index b00a5500d7c..eedd3e68fc2 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79/explain.txt
@@ -78,7 +78,7 @@ Input [3]: [s_store_sk#11, s_number_employees#12, s_city#13]
 
 (11) BroadcastExchange
 Input [2]: [s_store_sk#11, s_city#13]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=1]
 
 (12) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#4]
@@ -90,84 +90,84 @@ Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5,
 Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#11, s_city#13]
 
 (14) Scan parquet default.household_demographics
-Output [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
+Output [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/household_demographics]
 PushedFilters: [Or(EqualTo(hd_dep_count,8),GreaterThan(hd_vehicle_count,0)), IsNotNull(hd_demo_sk)]
 ReadSchema: struct<hd_demo_sk:int,hd_dep_count:int,hd_vehicle_count:int>
 
 (15) ColumnarToRow [codegen id : 3]
-Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
+Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
 
 (16) Filter [codegen id : 3]
-Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
-Condition : (((hd_dep_count#16 = 8) OR (hd_vehicle_count#17 > 0)) AND isnotnull(hd_demo_sk#15))
+Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
+Condition : (((hd_dep_count#15 = 8) OR (hd_vehicle_count#16 > 0)) AND isnotnull(hd_demo_sk#14))
 
 (17) Project [codegen id : 3]
-Output [1]: [hd_demo_sk#15]
-Input [3]: [hd_demo_sk#15, hd_dep_count#16, hd_vehicle_count#17]
+Output [1]: [hd_demo_sk#14]
+Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16]
 
 (18) BroadcastExchange
-Input [1]: [hd_demo_sk#15]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18]
+Input [1]: [hd_demo_sk#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=2]
 
 (19) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_hdemo_sk#2]
-Right keys [1]: [hd_demo_sk#15]
+Right keys [1]: [hd_demo_sk#14]
 Join condition: None
 
 (20) Project [codegen id : 4]
 Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#13]
-Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#13, hd_demo_sk#15]
+Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#13, hd_demo_sk#14]
 
 (21) HashAggregate [codegen id : 4]
 Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#13]
 Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#13]
 Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#6)), partial_sum(UnscaledValue(ss_net_profit#7))]
-Aggregate Attributes [2]: [sum#19, sum#20]
-Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#13, sum#21, sum#22]
+Aggregate Attributes [2]: [sum#17, sum#18]
+Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#13, sum#19, sum#20]
 
 (22) Exchange
-Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#13, sum#21, sum#22]
-Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#13, 5), ENSURE_REQUIREMENTS, [id=#23]
+Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#13, sum#19, sum#20]
+Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#13, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (23) HashAggregate [codegen id : 6]
-Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#13, sum#21, sum#22]
+Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#13, sum#19, sum#20]
 Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#13]
 Functions [2]: [sum(UnscaledValue(ss_coupon_amt#6)), sum(UnscaledValue(ss_net_profit#7))]
-Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#24, sum(UnscaledValue(ss_net_profit#7))#25]
-Results [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#13, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#24,17,2) AS amt#26, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#25,17,2) AS profit#27]
+Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#21, sum(UnscaledValue(ss_net_profit#7))#22]
+Results [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#13, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#21,17,2) AS amt#23, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#22,17,2) AS profit#24]
 
 (24) Scan parquet default.customer
-Output [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30]
+Output [3]: [c_customer_sk#25, c_first_name#26, c_last_name#27]
 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>
 
 (25) ColumnarToRow [codegen id : 5]
-Input [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30]
+Input [3]: [c_customer_sk#25, c_first_name#26, c_last_name#27]
 
 (26) Filter [codegen id : 5]
-Input [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30]
-Condition : isnotnull(c_customer_sk#28)
+Input [3]: [c_customer_sk#25, c_first_name#26, c_last_name#27]
+Condition : isnotnull(c_customer_sk#25)
 
 (27) BroadcastExchange
-Input [3]: [c_customer_sk#28, c_first_name#29, c_last_name#30]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31]
+Input [3]: [c_customer_sk#25, c_first_name#26, c_last_name#27]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=4]
 
 (28) BroadcastHashJoin [codegen id : 6]
 Left keys [1]: [ss_customer_sk#1]
-Right keys [1]: [c_customer_sk#28]
+Right keys [1]: [c_customer_sk#25]
 Join condition: None
 
 (29) Project [codegen id : 6]
-Output [7]: [c_last_name#30, c_first_name#29, substr(s_city#13, 1, 30) AS substr(s_city, 1, 30)#32, ss_ticket_number#5, amt#26, profit#27, s_city#13]
-Input [8]: [ss_ticket_number#5, ss_customer_sk#1, s_city#13, amt#26, profit#27, c_customer_sk#28, c_first_name#29, c_last_name#30]
+Output [7]: [c_last_name#27, c_first_name#26, substr(s_city#13, 1, 30) AS substr(s_city, 1, 30)#28, ss_ticket_number#5, amt#23, profit#24, s_city#13]
+Input [8]: [ss_ticket_number#5, ss_customer_sk#1, s_city#13, amt#23, profit#24, c_customer_sk#25, c_first_name#26, c_last_name#27]
 
 (30) TakeOrderedAndProject
-Input [7]: [c_last_name#30, c_first_name#29, substr(s_city, 1, 30)#32, ss_ticket_number#5, amt#26, profit#27, s_city#13]
-Arguments: 100, [c_last_name#30 ASC NULLS FIRST, c_first_name#29 ASC NULLS FIRST, substr(s_city#13, 1, 30) ASC NULLS FIRST, profit#27 ASC NULLS FIRST], [c_last_name#30, c_first_name#29, substr(s_city, 1, 30)#32, ss_ticket_number#5, amt#26, profit#27]
+Input [7]: [c_last_name#27, c_first_name#26, substr(s_city, 1, 30)#28, ss_ticket_number#5, amt#23, profit#24, s_city#13]
+Arguments: 100, [c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, substr(s_city#13, 1, 30) ASC NULLS FIRST, profit#24 ASC NULLS FIRST], [c_last_name#27, c_first_name#26, substr(s_city, 1, 30)#28, ss_ticket_number#5, amt#23, profit#24]
 
 ===== Subqueries =====
 
@@ -180,25 +180,25 @@ BroadcastExchange (35)
 
 
 (31) Scan parquet default.date_dim
-Output [3]: [d_date_sk#10, d_year#33, d_dow#34]
+Output [3]: [d_date_sk#10, d_year#29, d_dow#30]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_dow), EqualTo(d_dow,1), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450819), LessThanOrEqual(d_date_sk,2451904), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_dow:int>
 
 (32) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#33, d_dow#34]
+Input [3]: [d_date_sk#10, d_year#29, d_dow#30]
 
 (33) Filter [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#33, d_dow#34]
-Condition : (((((isnotnull(d_dow#34) AND (d_dow#34 = 1)) AND d_year#33 IN (1998,1999,2000)) AND (d_date_sk#10 >= 2450819)) AND (d_date_sk#10 <= 2451904)) AND isnotnull(d_date_sk#10))
+Input [3]: [d_date_sk#10, d_year#29, d_dow#30]
+Condition : (((((isnotnull(d_dow#30) AND (d_dow#30 = 1)) AND d_year#29 IN (1998,1999,2000)) AND (d_date_sk#10 >= 2450819)) AND (d_date_sk#10 <= 2451904)) AND isnotnull(d_date_sk#10))
 
 (34) Project [codegen id : 1]
 Output [1]: [d_date_sk#10]
-Input [3]: [d_date_sk#10, d_year#33, d_dow#34]
+Input [3]: [d_date_sk#10, d_year#29, d_dow#30]
 
 (35) BroadcastExchange
 Input [1]: [d_date_sk#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89.sf100/explain.txt
index e1b716bd218..b729963793e 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89.sf100/explain.txt
@@ -71,7 +71,7 @@ Condition : isnotnull(s_store_sk#8)
 
 (10) BroadcastExchange
 Input [3]: [s_store_sk#8, s_store_name#9, s_company_name#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
 
 (11) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#2]
@@ -83,73 +83,73 @@ Output [5]: [ss_item_sk#1, ss_sales_price#3, d_moy#7, s_store_name#9, s_company_
 Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, d_moy#7, s_store_sk#8, s_store_name#9, s_company_name#10]
 
 (13) Scan parquet default.item
-Output [4]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15]
+Output [4]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [Or(And(In(i_category, [Books                                             ,Electronics                                       ,Home                                              ]),In(i_class, [musical                                           ,parenting                                         ,wallpaper                                         ])),And(In(i_category, [Jewelry                                           ,Men                                               ,Shoes   [...]
 ReadSchema: struct<i_item_sk:int,i_brand:string,i_class:string,i_category:string>
 
 (14) ColumnarToRow [codegen id : 3]
-Input [4]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15]
+Input [4]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14]
 
 (15) Filter [codegen id : 3]
-Input [4]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15]
-Condition : (((i_category#15 IN (Home                                              ,Books                                             ,Electronics                                       ) AND i_class#14 IN (wallpaper                                         ,parenting                                         ,musical                                           )) OR (i_category#15 IN (Shoes                                             ,Jewelry                                           ,Men     [...]
+Input [4]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14]
+Condition : (((i_category#14 IN (Home                                              ,Books                                             ,Electronics                                       ) AND i_class#13 IN (wallpaper                                         ,parenting                                         ,musical                                           )) OR (i_category#14 IN (Shoes                                             ,Jewelry                                           ,Men     [...]
 
 (16) BroadcastExchange
-Input [4]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16]
+Input [4]: [i_item_sk#11, i_brand#12, i_class#13, i_category#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]
 
 (17) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_item_sk#1]
-Right keys [1]: [i_item_sk#12]
+Right keys [1]: [i_item_sk#11]
 Join condition: None
 
 (18) Project [codegen id : 4]
-Output [7]: [i_brand#13, i_class#14, i_category#15, ss_sales_price#3, d_moy#7, s_store_name#9, s_company_name#10]
-Input [9]: [ss_item_sk#1, ss_sales_price#3, d_moy#7, s_store_name#9, s_company_name#10, i_item_sk#12, i_brand#13, i_class#14, i_category#15]
+Output [7]: [i_brand#12, i_class#13, i_category#14, ss_sales_price#3, d_moy#7, s_store_name#9, s_company_name#10]
+Input [9]: [ss_item_sk#1, ss_sales_price#3, d_moy#7, s_store_name#9, s_company_name#10, i_item_sk#11, i_brand#12, i_class#13, i_category#14]
 
 (19) HashAggregate [codegen id : 4]
-Input [7]: [i_brand#13, i_class#14, i_category#15, ss_sales_price#3, d_moy#7, s_store_name#9, s_company_name#10]
-Keys [6]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7]
+Input [7]: [i_brand#12, i_class#13, i_category#14, ss_sales_price#3, d_moy#7, s_store_name#9, s_company_name#10]
+Keys [6]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7]
 Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#3))]
-Aggregate Attributes [1]: [sum#17]
-Results [7]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, sum#18]
+Aggregate Attributes [1]: [sum#15]
+Results [7]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, sum#16]
 
 (20) Exchange
-Input [7]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, sum#18]
-Arguments: hashpartitioning(i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, 5), ENSURE_REQUIREMENTS, [id=#19]
+Input [7]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, sum#16]
+Arguments: hashpartitioning(i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (21) HashAggregate [codegen id : 5]
-Input [7]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, sum#18]
-Keys [6]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7]
+Input [7]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, sum#16]
+Keys [6]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7]
 Functions [1]: [sum(UnscaledValue(ss_sales_price#3))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#3))#20]
-Results [8]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#20,17,2) AS _w0#22]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#3))#17]
+Results [8]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#17,17,2) AS sum_sales#18, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#17,17,2) AS _w0#19]
 
 (22) Exchange
-Input [8]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#21, _w0#22]
-Arguments: hashpartitioning(i_category#15, i_brand#13, s_store_name#9, s_company_name#10, 5), ENSURE_REQUIREMENTS, [id=#23]
+Input [8]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#18, _w0#19]
+Arguments: hashpartitioning(i_category#14, i_brand#12, s_store_name#9, s_company_name#10, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (23) Sort [codegen id : 6]
-Input [8]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#21, _w0#22]
-Arguments: [i_category#15 ASC NULLS FIRST, i_brand#13 ASC NULLS FIRST, s_store_name#9 ASC NULLS FIRST, s_company_name#10 ASC NULLS FIRST], false, 0
+Input [8]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#18, _w0#19]
+Arguments: [i_category#14 ASC NULLS FIRST, i_brand#12 ASC NULLS FIRST, s_store_name#9 ASC NULLS FIRST, s_company_name#10 ASC NULLS FIRST], false, 0
 
 (24) Window
-Input [8]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#21, _w0#22]
-Arguments: [avg(_w0#22) windowspecdefinition(i_category#15, i_brand#13, s_store_name#9, s_company_name#10, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#24], [i_category#15, i_brand#13, s_store_name#9, s_company_name#10]
+Input [8]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#18, _w0#19]
+Arguments: [avg(_w0#19) windowspecdefinition(i_category#14, i_brand#12, s_store_name#9, s_company_name#10, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#20], [i_category#14, i_brand#12, s_store_name#9, s_company_name#10]
 
 (25) Filter [codegen id : 7]
-Input [9]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#21, _w0#22, avg_monthly_sales#24]
-Condition : (isnotnull(avg_monthly_sales#24) AND (NOT (avg_monthly_sales#24 = 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
+Input [9]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#18, _w0#19, avg_monthly_sales#20]
+Condition : (isnotnull(avg_monthly_sales#20) AND (NOT (avg_monthly_sales#20 = 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#18 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#20 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#20 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
 
 (26) Project [codegen id : 7]
-Output [8]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#21, avg_monthly_sales#24]
-Input [9]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#21, _w0#22, avg_monthly_sales#24]
+Output [8]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#18, avg_monthly_sales#20]
+Input [9]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#18, _w0#19, avg_monthly_sales#20]
 
 (27) TakeOrderedAndProject
-Input [8]: [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#21, avg_monthly_sales#24]
-Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#9 ASC NULLS FIRST], [i_category#15, i_class#14, i_brand#13, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#21, avg_monthly_sales#24]
+Input [8]: [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#18, avg_monthly_sales#20]
+Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#18 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#20 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#9 ASC NULLS FIRST], [i_category#14, i_class#13, i_brand#12, s_store_name#9, s_company_name#10, d_moy#7, sum_sales#18, avg_monthly_sales#20]
 
 ===== Subqueries =====
 
@@ -162,25 +162,25 @@ BroadcastExchange (32)
 
 
 (28) Scan parquet default.date_dim
-Output [3]: [d_date_sk#6, d_year#25, d_moy#7]
+Output [3]: [d_date_sk#6, d_year#21, d_moy#7]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), GreaterThanOrEqual(d_date_sk,2451545), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
 
 (29) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#6, d_year#25, d_moy#7]
+Input [3]: [d_date_sk#6, d_year#21, d_moy#7]
 
 (30) Filter [codegen id : 1]
-Input [3]: [d_date_sk#6, d_year#25, d_moy#7]
-Condition : ((((isnotnull(d_year#25) AND (d_year#25 = 2000)) AND (d_date_sk#6 >= 2451545)) AND (d_date_sk#6 <= 2451910)) AND isnotnull(d_date_sk#6))
+Input [3]: [d_date_sk#6, d_year#21, d_moy#7]
+Condition : ((((isnotnull(d_year#21) AND (d_year#21 = 2000)) AND (d_date_sk#6 >= 2451545)) AND (d_date_sk#6 <= 2451910)) AND isnotnull(d_date_sk#6))
 
 (31) Project [codegen id : 1]
 Output [2]: [d_date_sk#6, d_moy#7]
-Input [3]: [d_date_sk#6, d_year#25, d_moy#7]
+Input [3]: [d_date_sk#6, d_year#21, d_moy#7]
 
 (32) BroadcastExchange
 Input [2]: [d_date_sk#6, d_moy#7]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89/explain.txt
index fe910f9157d..4471b2b86c6 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89/explain.txt
@@ -59,7 +59,7 @@ Condition : (isnotnull(ss_item_sk#5) AND isnotnull(ss_store_sk#6))
 
 (7) BroadcastExchange
 Input [4]: [ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
 
 (8) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [i_item_sk#1]
@@ -71,85 +71,85 @@ Output [6]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7
 Input [8]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8]
 
 (10) ReusedExchange [Reuses operator id: 32]
-Output [2]: [d_date_sk#11, d_moy#12]
+Output [2]: [d_date_sk#10, d_moy#11]
 
 (11) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_sold_date_sk#8]
-Right keys [1]: [d_date_sk#11]
+Right keys [1]: [d_date_sk#10]
 Join condition: None
 
 (12) Project [codegen id : 4]
-Output [6]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, d_moy#12]
-Input [8]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8, d_date_sk#11, d_moy#12]
+Output [6]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, d_moy#11]
+Input [8]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8, d_date_sk#10, d_moy#11]
 
 (13) Scan parquet default.store
-Output [3]: [s_store_sk#13, s_store_name#14, s_company_name#15]
+Output [3]: [s_store_sk#12, s_store_name#13, s_company_name#14]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/store]
 PushedFilters: [IsNotNull(s_store_sk)]
 ReadSchema: struct<s_store_sk:int,s_store_name:string,s_company_name:string>
 
 (14) ColumnarToRow [codegen id : 3]
-Input [3]: [s_store_sk#13, s_store_name#14, s_company_name#15]
+Input [3]: [s_store_sk#12, s_store_name#13, s_company_name#14]
 
 (15) Filter [codegen id : 3]
-Input [3]: [s_store_sk#13, s_store_name#14, s_company_name#15]
-Condition : isnotnull(s_store_sk#13)
+Input [3]: [s_store_sk#12, s_store_name#13, s_company_name#14]
+Condition : isnotnull(s_store_sk#12)
 
 (16) BroadcastExchange
-Input [3]: [s_store_sk#13, s_store_name#14, s_company_name#15]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16]
+Input [3]: [s_store_sk#12, s_store_name#13, s_company_name#14]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=2]
 
 (17) BroadcastHashJoin [codegen id : 4]
 Left keys [1]: [ss_store_sk#6]
-Right keys [1]: [s_store_sk#13]
+Right keys [1]: [s_store_sk#12]
 Join condition: None
 
 (18) Project [codegen id : 4]
-Output [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#7, d_moy#12, s_store_name#14, s_company_name#15]
-Input [9]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, d_moy#12, s_store_sk#13, s_store_name#14, s_company_name#15]
+Output [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#7, d_moy#11, s_store_name#13, s_company_name#14]
+Input [9]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, d_moy#11, s_store_sk#12, s_store_name#13, s_company_name#14]
 
 (19) HashAggregate [codegen id : 4]
-Input [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#7, d_moy#12, s_store_name#14, s_company_name#15]
-Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12]
+Input [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#7, d_moy#11, s_store_name#13, s_company_name#14]
+Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11]
 Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#7))]
-Aggregate Attributes [1]: [sum#17]
-Results [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, sum#18]
+Aggregate Attributes [1]: [sum#15]
+Results [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, sum#16]
 
 (20) Exchange
-Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, sum#18]
-Arguments: hashpartitioning(i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, 5), ENSURE_REQUIREMENTS, [id=#19]
+Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, sum#16]
+Arguments: hashpartitioning(i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (21) HashAggregate [codegen id : 5]
-Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, sum#18]
-Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12]
+Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, sum#16]
+Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11]
 Functions [1]: [sum(UnscaledValue(ss_sales_price#7))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#7))#20]
-Results [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#20,17,2) AS _w0#22]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#7))#17]
+Results [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#17,17,2) AS sum_sales#18, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#17,17,2) AS _w0#19]
 
 (22) Exchange
-Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, sum_sales#21, _w0#22]
-Arguments: hashpartitioning(i_category#4, i_brand#2, s_store_name#14, s_company_name#15, 5), ENSURE_REQUIREMENTS, [id=#23]
+Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, sum_sales#18, _w0#19]
+Arguments: hashpartitioning(i_category#4, i_brand#2, s_store_name#13, s_company_name#14, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (23) Sort [codegen id : 6]
-Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, sum_sales#21, _w0#22]
-Arguments: [i_category#4 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, s_store_name#14 ASC NULLS FIRST, s_company_name#15 ASC NULLS FIRST], false, 0
+Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, sum_sales#18, _w0#19]
+Arguments: [i_category#4 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, s_store_name#13 ASC NULLS FIRST, s_company_name#14 ASC NULLS FIRST], false, 0
 
 (24) Window
-Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, sum_sales#21, _w0#22]
-Arguments: [avg(_w0#22) windowspecdefinition(i_category#4, i_brand#2, s_store_name#14, s_company_name#15, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#24], [i_category#4, i_brand#2, s_store_name#14, s_company_name#15]
+Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, sum_sales#18, _w0#19]
+Arguments: [avg(_w0#19) windowspecdefinition(i_category#4, i_brand#2, s_store_name#13, s_company_name#14, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#20], [i_category#4, i_brand#2, s_store_name#13, s_company_name#14]
 
 (25) Filter [codegen id : 7]
-Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, sum_sales#21, _w0#22, avg_monthly_sales#24]
-Condition : (isnotnull(avg_monthly_sales#24) AND (NOT (avg_monthly_sales#24 = 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
+Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, sum_sales#18, _w0#19, avg_monthly_sales#20]
+Condition : (isnotnull(avg_monthly_sales#20) AND (NOT (avg_monthly_sales#20 = 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#18 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#20 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#20 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)))
 
 (26) Project [codegen id : 7]
-Output [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, sum_sales#21, avg_monthly_sales#24]
-Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, sum_sales#21, _w0#22, avg_monthly_sales#24]
+Output [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, sum_sales#18, avg_monthly_sales#20]
+Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, sum_sales#18, _w0#19, avg_monthly_sales#20]
 
 (27) TakeOrderedAndProject
-Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, sum_sales#21, avg_monthly_sales#24]
-Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#14 ASC NULLS FIRST], [i_category#4, i_class#3, i_brand#2, s_store_name#14, s_company_name#15, d_moy#12, sum_sales#21, avg_monthly_sales#24]
+Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, sum_sales#18, avg_monthly_sales#20]
+Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#18 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#20 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#13 ASC NULLS FIRST], [i_category#4, i_class#3, i_brand#2, s_store_name#13, s_company_name#14, d_moy#11, sum_sales#18, avg_monthly_sales#20]
 
 ===== Subqueries =====
 
@@ -162,25 +162,25 @@ BroadcastExchange (32)
 
 
 (28) Scan parquet default.date_dim
-Output [3]: [d_date_sk#11, d_year#25, d_moy#12]
+Output [3]: [d_date_sk#10, d_year#21, d_moy#11]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), GreaterThanOrEqual(d_date_sk,2451545), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_year:int,d_moy:int>
 
 (29) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#11, d_year#25, d_moy#12]
+Input [3]: [d_date_sk#10, d_year#21, d_moy#11]
 
 (30) Filter [codegen id : 1]
-Input [3]: [d_date_sk#11, d_year#25, d_moy#12]
-Condition : ((((isnotnull(d_year#25) AND (d_year#25 = 2000)) AND (d_date_sk#11 >= 2451545)) AND (d_date_sk#11 <= 2451910)) AND isnotnull(d_date_sk#11))
+Input [3]: [d_date_sk#10, d_year#21, d_moy#11]
+Condition : ((((isnotnull(d_year#21) AND (d_year#21 = 2000)) AND (d_date_sk#10 >= 2451545)) AND (d_date_sk#10 <= 2451910)) AND isnotnull(d_date_sk#10))
 
 (31) Project [codegen id : 1]
-Output [2]: [d_date_sk#11, d_moy#12]
-Input [3]: [d_date_sk#11, d_year#25, d_moy#12]
+Output [2]: [d_date_sk#10, d_moy#11]
+Input [3]: [d_date_sk#10, d_year#21, d_moy#11]
 
 (32) BroadcastExchange
-Input [2]: [d_date_sk#11, d_moy#12]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26]
+Input [2]: [d_date_sk#10, d_moy#11]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt
index 554005d706d..3adad06c542 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt
@@ -55,88 +55,88 @@ Input [4]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, d_date_sk#5]
 
 (7) Exchange
 Input [2]: [ss_item_sk#1, ss_ext_sales_price#2]
-Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#6]
+Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=1]
 
 (8) Sort [codegen id : 3]
 Input [2]: [ss_item_sk#1, ss_ext_sales_price#2]
 Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0
 
 (9) Scan parquet default.item
-Output [6]: [i_item_sk#7, i_item_id#8, i_item_desc#9, i_current_price#10, i_class#11, i_category#12]
+Output [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/item]
 PushedFilters: [In(i_category, [Books                                             ,Jewelry                                           ,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>
 
 (10) ColumnarToRow [codegen id : 4]
-Input [6]: [i_item_sk#7, i_item_id#8, i_item_desc#9, i_current_price#10, i_class#11, i_category#12]
+Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11]
 
 (11) Filter [codegen id : 4]
-Input [6]: [i_item_sk#7, i_item_id#8, i_item_desc#9, i_current_price#10, i_class#11, i_category#12]
-Condition : (i_category#12 IN (Jewelry                                           ,Sports                                            ,Books                                             ) AND isnotnull(i_item_sk#7))
+Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11]
+Condition : (i_category#11 IN (Jewelry                                           ,Sports                                            ,Books                                             ) AND isnotnull(i_item_sk#6))
 
 (12) Exchange
-Input [6]: [i_item_sk#7, i_item_id#8, i_item_desc#9, i_current_price#10, i_class#11, i_category#12]
-Arguments: hashpartitioning(i_item_sk#7, 5), ENSURE_REQUIREMENTS, [id=#13]
+Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11]
+Arguments: hashpartitioning(i_item_sk#6, 5), ENSURE_REQUIREMENTS, [plan_id=2]
 
 (13) Sort [codegen id : 5]
-Input [6]: [i_item_sk#7, i_item_id#8, i_item_desc#9, i_current_price#10, i_class#11, i_category#12]
-Arguments: [i_item_sk#7 ASC NULLS FIRST], false, 0
+Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11]
+Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0
 
 (14) SortMergeJoin [codegen id : 6]
 Left keys [1]: [ss_item_sk#1]
-Right keys [1]: [i_item_sk#7]
+Right keys [1]: [i_item_sk#6]
 Join condition: None
 
 (15) Project [codegen id : 6]
-Output [6]: [ss_ext_sales_price#2, i_item_id#8, i_item_desc#9, i_current_price#10, i_class#11, i_category#12]
-Input [8]: [ss_item_sk#1, ss_ext_sales_price#2, i_item_sk#7, i_item_id#8, i_item_desc#9, i_current_price#10, i_class#11, i_category#12]
+Output [6]: [ss_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11]
+Input [8]: [ss_item_sk#1, ss_ext_sales_price#2, i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11]
 
 (16) HashAggregate [codegen id : 6]
-Input [6]: [ss_ext_sales_price#2, i_item_id#8, i_item_desc#9, i_current_price#10, i_class#11, i_category#12]
-Keys [5]: [i_item_id#8, i_item_desc#9, i_category#12, i_class#11, i_current_price#10]
+Input [6]: [ss_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11]
+Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9]
 Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))]
-Aggregate Attributes [1]: [sum#14]
-Results [6]: [i_item_id#8, i_item_desc#9, i_category#12, i_class#11, i_current_price#10, sum#15]
+Aggregate Attributes [1]: [sum#12]
+Results [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#13]
 
 (17) Exchange
-Input [6]: [i_item_id#8, i_item_desc#9, i_category#12, i_class#11, i_current_price#10, sum#15]
-Arguments: hashpartitioning(i_item_id#8, i_item_desc#9, i_category#12, i_class#11, i_current_price#10, 5), ENSURE_REQUIREMENTS, [id=#16]
+Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#13]
+Arguments: hashpartitioning(i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (18) HashAggregate [codegen id : 7]
-Input [6]: [i_item_id#8, i_item_desc#9, i_category#12, i_class#11, i_current_price#10, sum#15]
-Keys [5]: [i_item_id#8, i_item_desc#9, i_category#12, i_class#11, i_current_price#10]
+Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#13]
+Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9]
 Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#17]
-Results [8]: [i_item_desc#9, i_category#12, i_class#11, i_current_price#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#17,17,2) AS itemrevenue#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#17,17,2) AS _w0#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#17,17,2) AS _w1#20, i_item_id#8]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#14]
+Results [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#14,17,2) AS itemrevenue#15, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#14,17,2) AS _w0#16, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#14,17,2) AS _w1#17, i_item_id#7]
 
 (19) Exchange
-Input [8]: [i_item_desc#9, i_category#12, i_class#11, i_current_price#10, itemrevenue#18, _w0#19, _w1#20, i_item_id#8]
-Arguments: hashpartitioning(i_class#11, 5), ENSURE_REQUIREMENTS, [id=#21]
+Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#15, _w0#16, _w1#17, i_item_id#7]
+Arguments: hashpartitioning(i_class#10, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (20) Sort [codegen id : 8]
-Input [8]: [i_item_desc#9, i_category#12, i_class#11, i_current_price#10, itemrevenue#18, _w0#19, _w1#20, i_item_id#8]
-Arguments: [i_class#11 ASC NULLS FIRST], false, 0
+Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#15, _w0#16, _w1#17, i_item_id#7]
+Arguments: [i_class#10 ASC NULLS FIRST], false, 0
 
 (21) Window
-Input [8]: [i_item_desc#9, i_category#12, i_class#11, i_current_price#10, itemrevenue#18, _w0#19, _w1#20, i_item_id#8]
-Arguments: [sum(_w1#20) windowspecdefinition(i_class#11, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#22], [i_class#11]
+Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#15, _w0#16, _w1#17, i_item_id#7]
+Arguments: [sum(_w1#17) windowspecdefinition(i_class#10, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#18], [i_class#10]
 
 (22) Project [codegen id : 9]
-Output [7]: [i_item_desc#9, i_category#12, i_class#11, i_current_price#10, itemrevenue#18, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#19) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#22)), DecimalType(38,17), true) AS revenueratio#23, i_item_id#8]
-Input [9]: [i_item_desc#9, i_category#12, i_class#11, i_current_price#10, itemrevenue#18, _w0#19, _w1#20, i_item_id#8, _we0#22]
+Output [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#15, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#16) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#18)), DecimalType(38,17), true) AS revenueratio#19, i_item_id#7]
+Input [9]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#15, _w0#16, _w1#17, i_item_id#7, _we0#18]
 
 (23) Exchange
-Input [7]: [i_item_desc#9, i_category#12, i_class#11, i_current_price#10, itemrevenue#18, revenueratio#23, i_item_id#8]
-Arguments: rangepartitioning(i_category#12 ASC NULLS FIRST, i_class#11 ASC NULLS FIRST, i_item_id#8 ASC NULLS FIRST, i_item_desc#9 ASC NULLS FIRST, revenueratio#23 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#24]
+Input [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#15, revenueratio#19, i_item_id#7]
+Arguments: rangepartitioning(i_category#11 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_item_id#7 ASC NULLS FIRST, i_item_desc#8 ASC NULLS FIRST, revenueratio#19 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (24) Sort [codegen id : 10]
-Input [7]: [i_item_desc#9, i_category#12, i_class#11, i_current_price#10, itemrevenue#18, revenueratio#23, i_item_id#8]
-Arguments: [i_category#12 ASC NULLS FIRST, i_class#11 ASC NULLS FIRST, i_item_id#8 ASC NULLS FIRST, i_item_desc#9 ASC NULLS FIRST, revenueratio#23 ASC NULLS FIRST], true, 0
+Input [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#15, revenueratio#19, i_item_id#7]
+Arguments: [i_category#11 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_item_id#7 ASC NULLS FIRST, i_item_desc#8 ASC NULLS FIRST, revenueratio#19 ASC NULLS FIRST], true, 0
 
 (25) Project [codegen id : 10]
-Output [6]: [i_item_desc#9, i_category#12, i_class#11, i_current_price#10, itemrevenue#18, revenueratio#23]
-Input [7]: [i_item_desc#9, i_category#12, i_class#11, i_current_price#10, itemrevenue#18, revenueratio#23, i_item_id#8]
+Output [6]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#15, revenueratio#19]
+Input [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#15, revenueratio#19, i_item_id#7]
 
 ===== Subqueries =====
 
@@ -149,25 +149,25 @@ BroadcastExchange (30)
 
 
 (26) Scan parquet default.date_dim
-Output [2]: [d_date_sk#5, d_date#25]
+Output [2]: [d_date_sk#5, d_date#20]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2001-01-01), LessThanOrEqual(d_date,2001-01-31), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2451941), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_date:date>
 
 (27) ColumnarToRow [codegen id : 1]
-Input [2]: [d_date_sk#5, d_date#25]
+Input [2]: [d_date_sk#5, d_date#20]
 
 (28) Filter [codegen id : 1]
-Input [2]: [d_date_sk#5, d_date#25]
-Condition : (((((isnotnull(d_date#25) AND (d_date#25 >= 2001-01-01)) AND (d_date#25 <= 2001-01-31)) AND (d_date_sk#5 >= 2451911)) AND (d_date_sk#5 <= 2451941)) AND isnotnull(d_date_sk#5))
+Input [2]: [d_date_sk#5, d_date#20]
+Condition : (((((isnotnull(d_date#20) AND (d_date#20 >= 2001-01-01)) AND (d_date#20 <= 2001-01-31)) AND (d_date_sk#5 >= 2451911)) AND (d_date_sk#5 <= 2451941)) AND isnotnull(d_date_sk#5))
 
 (29) Project [codegen id : 1]
 Output [1]: [d_date_sk#5]
-Input [2]: [d_date_sk#5, d_date#25]
+Input [2]: [d_date_sk#5, d_date#20]
 
 (30) BroadcastExchange
 Input [1]: [d_date_sk#5]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=6]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98/explain.txt
index 66206ac2653..fec914bdb3d 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98/explain.txt
@@ -54,7 +54,7 @@ Condition : (i_category#10 IN (Jewelry
 
 (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), [id=#11]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=1]
 
 (8) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [ss_item_sk#1]
@@ -66,62 +66,62 @@ Output [7]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#6, i_item_desc#7
 Input [9]: [ss_item_sk#1, ss_ext_sales_price#2, ss_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: 27]
-Output [1]: [d_date_sk#12]
+Output [1]: [d_date_sk#11]
 
 (11) BroadcastHashJoin [codegen id : 3]
 Left keys [1]: [ss_sold_date_sk#3]
-Right keys [1]: [d_date_sk#12]
+Right keys [1]: [d_date_sk#11]
 Join condition: None
 
 (12) Project [codegen id : 3]
 Output [6]: [ss_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10]
-Input [8]: [ss_ext_sales_price#2, ss_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#12]
+Input [8]: [ss_ext_sales_price#2, ss_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]: [ss_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(ss_ext_sales_price#2))]
-Aggregate Attributes [1]: [sum#13]
-Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#14]
+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#14]
-Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), ENSURE_REQUIREMENTS, [id=#15]
+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#14]
+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(ss_ext_sales_price#2))]
-Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#16]
-Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#16,17,2) AS itemrevenue#17, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#16,17,2) AS _w0#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#16,17,2) AS _w1#19, i_item_id#6]
+Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#14]
+Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#14,17,2) AS itemrevenue#15, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#14,17,2) AS _w0#16, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#14,17,2) AS _w1#17, i_item_id#6]
 
 (16) Exchange
-Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#17, _w0#18, _w1#19, i_item_id#6]
-Arguments: hashpartitioning(i_class#9, 5), ENSURE_REQUIREMENTS, [id=#20]
+Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, _w1#17, i_item_id#6]
+Arguments: hashpartitioning(i_class#9, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (17) Sort [codegen id : 5]
-Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#17, _w0#18, _w1#19, i_item_id#6]
+Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, _w1#17, i_item_id#6]
 Arguments: [i_class#9 ASC NULLS FIRST], false, 0
 
 (18) Window
-Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#17, _w0#18, _w1#19, i_item_id#6]
-Arguments: [sum(_w1#19) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#21], [i_class#9]
+Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, _w1#17, i_item_id#6]
+Arguments: [sum(_w1#17) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#18], [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#17, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#18) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#21)), DecimalType(38,17), true) AS revenueratio#22, i_item_id#6]
-Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#17, _w0#18, _w1#19, i_item_id#6, _we0#21]
+Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#16) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#18)), DecimalType(38,17), true) AS revenueratio#19, i_item_id#6]
+Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, _w0#16, _w1#17, i_item_id#6, _we0#18]
 
 (20) Exchange
-Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#17, revenueratio#22, i_item_id#6]
-Arguments: rangepartitioning(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#22 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#23]
+Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, revenueratio#19, i_item_id#6]
+Arguments: rangepartitioning(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#19 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (21) Sort [codegen id : 7]
-Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#17, revenueratio#22, i_item_id#6]
-Arguments: [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#22 ASC NULLS FIRST], true, 0
+Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, revenueratio#19, i_item_id#6]
+Arguments: [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#19 ASC NULLS FIRST], true, 0
 
 (22) Project [codegen id : 7]
-Output [6]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#17, revenueratio#22]
-Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#17, revenueratio#22, i_item_id#6]
+Output [6]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, revenueratio#19]
+Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#15, revenueratio#19, i_item_id#6]
 
 ===== Subqueries =====
 
@@ -134,25 +134,25 @@ BroadcastExchange (27)
 
 
 (23) Scan parquet default.date_dim
-Output [2]: [d_date_sk#12, d_date#24]
+Output [2]: [d_date_sk#11, d_date#20]
 Batched: true
 Location [not included in comparison]/{warehouse_dir}/date_dim]
 PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2001-01-01), LessThanOrEqual(d_date,2001-01-31), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2451941), IsNotNull(d_date_sk)]
 ReadSchema: struct<d_date_sk:int,d_date:date>
 
 (24) ColumnarToRow [codegen id : 1]
-Input [2]: [d_date_sk#12, d_date#24]
+Input [2]: [d_date_sk#11, d_date#20]
 
 (25) Filter [codegen id : 1]
-Input [2]: [d_date_sk#12, d_date#24]
-Condition : (((((isnotnull(d_date#24) AND (d_date#24 >= 2001-01-01)) AND (d_date#24 <= 2001-01-31)) AND (d_date_sk#12 >= 2451911)) AND (d_date_sk#12 <= 2451941)) AND isnotnull(d_date_sk#12))
+Input [2]: [d_date_sk#11, d_date#20]
+Condition : (((((isnotnull(d_date#20) AND (d_date#20 >= 2001-01-01)) AND (d_date#20 <= 2001-01-31)) AND (d_date_sk#11 >= 2451911)) AND (d_date_sk#11 <= 2451941)) AND isnotnull(d_date_sk#11))
 
 (26) Project [codegen id : 1]
-Output [1]: [d_date_sk#12]
-Input [2]: [d_date_sk#12, d_date#24]
+Output [1]: [d_date_sk#11]
+Input [2]: [d_date_sk#11, d_date#20]
 
 (27) BroadcastExchange
-Input [1]: [d_date_sk#12]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25]
+Input [1]: [d_date_sk#11]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max.sf100/explain.txt
index 1ebc9a69a38..073a29fd223 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max.sf100/explain.txt
@@ -27,7 +27,7 @@ Results [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, ma
 
 (4) Exchange
 Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31]
-Arguments: hashpartitioning(ss_sold_date_sk#9, 5), ENSURE_REQUIREMENTS, [id=#32]
+Arguments: hashpartitioning(ss_sold_date_sk#9, 5), ENSURE_REQUIREMENTS, [plan_id=1]
 
 (5) HashAggregate [codegen id : 2]
 Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31]
@@ -40,17 +40,17 @@ Results [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, ma
 Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31]
 Keys: []
 Functions [12]: [merge_count(1), merge_count(ss_sold_date_sk#9), merge_max(ss_sold_date_sk#9), merge_max(ss_sold_time_sk#1), merge_max(ss_item_sk#2), merge_max(ss_customer_sk#3), merge_max(ss_cdemo_sk#4), merge_max(ss_hdemo_sk#5), merge_max(ss_addr_sk#6), merge_max(ss_store_sk#7), merge_max(ss_promo_sk#8), partial_count(distinct ss_sold_date_sk#9)]
-Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#33]
-Results [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34]
+Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#32]
+Results [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#33]
 
 (7) Exchange
-Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#35]
+Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#33]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=2]
 
 (8) HashAggregate [codegen id : 3]
-Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34]
+Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#33]
 Keys: []
 Functions [12]: [count(1), count(ss_sold_date_sk#9), max(ss_sold_date_sk#9), max(ss_sold_time_sk#1), max(ss_item_sk#2), max(ss_customer_sk#3), max(ss_cdemo_sk#4), max(ss_hdemo_sk#5), max(ss_addr_sk#6), max(ss_store_sk#7), max(ss_promo_sk#8), count(distinct ss_sold_date_sk#9)]
-Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#33]
-Results [12]: [count(1)#10 AS total#36, count(ss_sold_date_sk#9)#11 AS not_null_total#37, count(ss_sold_date_sk#9)#33 AS unique_days#38, max(ss_sold_date_sk#9)#12 AS max_ss_sold_date_sk#39, max(ss_sold_time_sk#1)#13 AS max_ss_sold_time_sk#40, max(ss_item_sk#2)#14 AS max_ss_item_sk#41, max(ss_customer_sk#3)#15 AS max_ss_customer_sk#42, max(ss_cdemo_sk#4)#16 AS max_ss_cdemo_sk#43, max(ss_hdemo_sk#5)#17 AS max_ss_hdemo_sk#44, max(ss_addr_sk#6)#18 AS max_ss_addr_sk#45, max(ss_store_sk#7)#19  [...]
+Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#32]
+Results [12]: [count(1)#10 AS total#34, count(ss_sold_date_sk#9)#11 AS not_null_total#35, count(ss_sold_date_sk#9)#32 AS unique_days#36, max(ss_sold_date_sk#9)#12 AS max_ss_sold_date_sk#37, max(ss_sold_time_sk#1)#13 AS max_ss_sold_time_sk#38, max(ss_item_sk#2)#14 AS max_ss_item_sk#39, max(ss_customer_sk#3)#15 AS max_ss_customer_sk#40, max(ss_cdemo_sk#4)#16 AS max_ss_cdemo_sk#41, max(ss_hdemo_sk#5)#17 AS max_ss_hdemo_sk#42, max(ss_addr_sk#6)#18 AS max_ss_addr_sk#43, max(ss_store_sk#7)#19  [...]
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max/explain.txt
index 1ebc9a69a38..073a29fd223 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max/explain.txt
@@ -27,7 +27,7 @@ Results [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, ma
 
 (4) Exchange
 Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31]
-Arguments: hashpartitioning(ss_sold_date_sk#9, 5), ENSURE_REQUIREMENTS, [id=#32]
+Arguments: hashpartitioning(ss_sold_date_sk#9, 5), ENSURE_REQUIREMENTS, [plan_id=1]
 
 (5) HashAggregate [codegen id : 2]
 Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31]
@@ -40,17 +40,17 @@ Results [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, ma
 Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31]
 Keys: []
 Functions [12]: [merge_count(1), merge_count(ss_sold_date_sk#9), merge_max(ss_sold_date_sk#9), merge_max(ss_sold_time_sk#1), merge_max(ss_item_sk#2), merge_max(ss_customer_sk#3), merge_max(ss_cdemo_sk#4), merge_max(ss_hdemo_sk#5), merge_max(ss_addr_sk#6), merge_max(ss_store_sk#7), merge_max(ss_promo_sk#8), partial_count(distinct ss_sold_date_sk#9)]
-Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#33]
-Results [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34]
+Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#32]
+Results [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#33]
 
 (7) Exchange
-Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34]
-Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#35]
+Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#33]
+Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=2]
 
 (8) HashAggregate [codegen id : 3]
-Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34]
+Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#33]
 Keys: []
 Functions [12]: [count(1), count(ss_sold_date_sk#9), max(ss_sold_date_sk#9), max(ss_sold_time_sk#1), max(ss_item_sk#2), max(ss_customer_sk#3), max(ss_cdemo_sk#4), max(ss_hdemo_sk#5), max(ss_addr_sk#6), max(ss_store_sk#7), max(ss_promo_sk#8), count(distinct ss_sold_date_sk#9)]
-Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#33]
-Results [12]: [count(1)#10 AS total#36, count(ss_sold_date_sk#9)#11 AS not_null_total#37, count(ss_sold_date_sk#9)#33 AS unique_days#38, max(ss_sold_date_sk#9)#12 AS max_ss_sold_date_sk#39, max(ss_sold_time_sk#1)#13 AS max_ss_sold_time_sk#40, max(ss_item_sk#2)#14 AS max_ss_item_sk#41, max(ss_customer_sk#3)#15 AS max_ss_customer_sk#42, max(ss_cdemo_sk#4)#16 AS max_ss_cdemo_sk#43, max(ss_hdemo_sk#5)#17 AS max_ss_hdemo_sk#44, max(ss_addr_sk#6)#18 AS max_ss_addr_sk#45, max(ss_store_sk#7)#19  [...]
+Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#32]
+Results [12]: [count(1)#10 AS total#34, count(ss_sold_date_sk#9)#11 AS not_null_total#35, count(ss_sold_date_sk#9)#32 AS unique_days#36, max(ss_sold_date_sk#9)#12 AS max_ss_sold_date_sk#37, max(ss_sold_time_sk#1)#13 AS max_ss_sold_time_sk#38, max(ss_item_sk#2)#14 AS max_ss_item_sk#39, max(ss_customer_sk#3)#15 AS max_ss_customer_sk#40, max(ss_cdemo_sk#4)#16 AS max_ss_cdemo_sk#41, max(ss_hdemo_sk#5)#17 AS max_ss_hdemo_sk#42, max(ss_addr_sk#6)#18 AS max_ss_addr_sk#43, max(ss_store_sk#7)#19  [...]
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/explain.txt
index f071af10379..4c771300abb 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/explain.txt
@@ -80,18 +80,18 @@ 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, [id=#9]
+Arguments: hashpartitioning(sr_customer_sk#1, sr_store_sk#2, 5), ENSURE_REQUIREMENTS, [plan_id=1]
 
 (9) HashAggregate [codegen id : 8]
 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))#10]
-Results [3]: [sr_customer_sk#1 AS ctr_customer_sk#11, sr_store_sk#2 AS ctr_store_sk#12, MakeDecimal(sum(UnscaledValue(sr_return_amt#3))#10,17,2) AS ctr_total_return#13]
+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 : 8]
-Input [3]: [ctr_customer_sk#11, ctr_store_sk#12, ctr_total_return#13]
-Condition : isnotnull(ctr_total_return#13)
+Input [3]: [ctr_customer_sk#10, ctr_store_sk#11, ctr_total_return#12]
+Condition : isnotnull(ctr_total_return#12)
 
 (11) Scan parquet default.store_returns
 Output [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4]
@@ -124,128 +124,128 @@ Input [5]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_s
 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]
+Aggregate Attributes [1]: [sum#13]
+Results [3]: [sr_customer_sk#1, sr_store_sk#2, sum#14]
 
 (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, [id=#16]
+Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#14]
+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]
+Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#14]
 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))#10]
-Results [2]: [sr_store_sk#2 AS ctr_store_sk#12, MakeDecimal(sum(UnscaledValue(sr_return_amt#3))#10,17,2) AS ctr_total_return#13]
+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#12, ctr_total_return#13]
-Keys [1]: [ctr_store_sk#12]
-Functions [1]: [partial_avg(ctr_total_return#13)]
-Aggregate Attributes [2]: [sum#17, count#18]
-Results [3]: [ctr_store_sk#12, sum#19, count#20]
+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#15, count#16]
+Results [3]: [ctr_store_sk#11, sum#17, count#18]
 
 (21) Exchange
-Input [3]: [ctr_store_sk#12, sum#19, count#20]
-Arguments: hashpartitioning(ctr_store_sk#12, 5), ENSURE_REQUIREMENTS, [id=#21]
+Input [3]: [ctr_store_sk#11, sum#17, count#18]
+Arguments: hashpartitioning(ctr_store_sk#11, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (22) HashAggregate [codegen id : 6]
-Input [3]: [ctr_store_sk#12, sum#19, count#20]
-Keys [1]: [ctr_store_sk#12]
-Functions [1]: [avg(ctr_total_return#13)]
-Aggregate Attributes [1]: [avg(ctr_total_return#13)#22]
-Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#13)#22) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#23, ctr_store_sk#12 AS ctr_store_sk#12#24]
+Input [3]: [ctr_store_sk#11, sum#17, count#18]
+Keys [1]: [ctr_store_sk#11]
+Functions [1]: [avg(ctr_total_return#12)]
+Aggregate Attributes [1]: [avg(ctr_total_return#12)#19]
+Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#12)#19) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#20, ctr_store_sk#11 AS ctr_store_sk#11#21]
 
 (23) Filter [codegen id : 6]
-Input [2]: [(avg(ctr_total_return) * 1.2)#23, ctr_store_sk#12#24]
-Condition : isnotnull((avg(ctr_total_return) * 1.2)#23)
+Input [2]: [(avg(ctr_total_return) * 1.2)#20, ctr_store_sk#11#21]
+Condition : isnotnull((avg(ctr_total_return) * 1.2)#20)
 
 (24) BroadcastExchange
-Input [2]: [(avg(ctr_total_return) * 1.2)#23, ctr_store_sk#12#24]
-Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#25]
+Input [2]: [(avg(ctr_total_return) * 1.2)#20, ctr_store_sk#11#21]
+Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [plan_id=4]
 
 (25) BroadcastHashJoin [codegen id : 8]
-Left keys [1]: [ctr_store_sk#12]
-Right keys [1]: [ctr_store_sk#12#24]
-Join condition: (cast(ctr_total_return#13 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#23)
+Left keys [1]: [ctr_store_sk#11]
+Right keys [1]: [ctr_store_sk#11#21]
+Join condition: (cast(ctr_total_return#12 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#20)
 
 (26) Project [codegen id : 8]
-Output [2]: [ctr_customer_sk#11, ctr_store_sk#12]
-Input [5]: [ctr_customer_sk#11, ctr_store_sk#12, ctr_total_return#13, (avg(ctr_total_return) * 1.2)#23, ctr_store_sk#12#24]
+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)#20, ctr_store_sk#11#21]
 
 (27) Scan parquet default.store
-Output [2]: [s_store_sk#26, s_state#27]
+Output [2]: [s_store_sk#22, s_state#23]
 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) ColumnarToRow [codegen id : 7]
-Input [2]: [s_store_sk#26, s_state#27]
+Input [2]: [s_store_sk#22, s_state#23]
 
 (29) Filter [codegen id : 7]
-Input [2]: [s_store_sk#26, s_state#27]
-Condition : ((isnotnull(s_state#27) AND (s_state#27 = TN)) AND isnotnull(s_store_sk#26))
+Input [2]: [s_store_sk#22, s_state#23]
+Condition : ((isnotnull(s_state#23) AND (s_state#23 = TN)) AND isnotnull(s_store_sk#22))
 
 (30) Project [codegen id : 7]
-Output [1]: [s_store_sk#26]
-Input [2]: [s_store_sk#26, s_state#27]
+Output [1]: [s_store_sk#22]
+Input [2]: [s_store_sk#22, s_state#23]
 
 (31) BroadcastExchange
-Input [1]: [s_store_sk#26]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28]
+Input [1]: [s_store_sk#22]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 (32) BroadcastHashJoin [codegen id : 8]
-Left keys [1]: [ctr_store_sk#12]
-Right keys [1]: [s_store_sk#26]
+Left keys [1]: [ctr_store_sk#11]
+Right keys [1]: [s_store_sk#22]
 Join condition: None
 
 (33) Project [codegen id : 8]
-Output [1]: [ctr_customer_sk#11]
-Input [3]: [ctr_customer_sk#11, ctr_store_sk#12, s_store_sk#26]
+Output [1]: [ctr_customer_sk#10]
+Input [3]: [ctr_customer_sk#10, ctr_store_sk#11, s_store_sk#22]
 
 (34) Exchange
-Input [1]: [ctr_customer_sk#11]
-Arguments: hashpartitioning(ctr_customer_sk#11, 5), ENSURE_REQUIREMENTS, [id=#29]
+Input [1]: [ctr_customer_sk#10]
+Arguments: hashpartitioning(ctr_customer_sk#10, 5), ENSURE_REQUIREMENTS, [plan_id=6]
 
 (35) Sort [codegen id : 9]
-Input [1]: [ctr_customer_sk#11]
-Arguments: [ctr_customer_sk#11 ASC NULLS FIRST], false, 0
+Input [1]: [ctr_customer_sk#10]
+Arguments: [ctr_customer_sk#10 ASC NULLS FIRST], false, 0
 
 (36) Scan parquet default.customer
-Output [2]: [c_customer_sk#30, c_customer_id#31]
+Output [2]: [c_customer_sk#24, c_customer_id#25]
 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>
 
 (37) ColumnarToRow [codegen id : 10]
-Input [2]: [c_customer_sk#30, c_customer_id#31]
+Input [2]: [c_customer_sk#24, c_customer_id#25]
 
 (38) Filter [codegen id : 10]
-Input [2]: [c_customer_sk#30, c_customer_id#31]
-Condition : isnotnull(c_customer_sk#30)
+Input [2]: [c_customer_sk#24, c_customer_id#25]
+Condition : isnotnull(c_customer_sk#24)
 
 (39) Exchange
-Input [2]: [c_customer_sk#30, c_customer_id#31]
-Arguments: hashpartitioning(c_customer_sk#30, 5), ENSURE_REQUIREMENTS, [id=#32]
+Input [2]: [c_customer_sk#24, c_customer_id#25]
+Arguments: hashpartitioning(c_customer_sk#24, 5), ENSURE_REQUIREMENTS, [plan_id=7]
 
 (40) Sort [codegen id : 11]
-Input [2]: [c_customer_sk#30, c_customer_id#31]
-Arguments: [c_customer_sk#30 ASC NULLS FIRST], false, 0
+Input [2]: [c_customer_sk#24, c_customer_id#25]
+Arguments: [c_customer_sk#24 ASC NULLS FIRST], false, 0
 
 (41) SortMergeJoin [codegen id : 12]
-Left keys [1]: [ctr_customer_sk#11]
-Right keys [1]: [c_customer_sk#30]
+Left keys [1]: [ctr_customer_sk#10]
+Right keys [1]: [c_customer_sk#24]
 Join condition: None
 
 (42) Project [codegen id : 12]
-Output [1]: [c_customer_id#31]
-Input [3]: [ctr_customer_sk#11, c_customer_sk#30, c_customer_id#31]
+Output [1]: [c_customer_id#25]
+Input [3]: [ctr_customer_sk#10, c_customer_sk#24, c_customer_id#25]
 
 (43) TakeOrderedAndProject
-Input [1]: [c_customer_id#31]
-Arguments: 100, [c_customer_id#31 ASC NULLS FIRST], [c_customer_id#31]
+Input [1]: [c_customer_id#25]
+Arguments: 100, [c_customer_id#25 ASC NULLS FIRST], [c_customer_id#25]
 
 ===== Subqueries =====
 
@@ -258,26 +258,26 @@ BroadcastExchange (48)
 
 
 (44) Scan parquet default.date_dim
-Output [2]: [d_date_sk#6, d_year#33]
+Output [2]: [d_date_sk#6, d_year#26]
 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>
 
 (45) ColumnarToRow [codegen id : 1]
-Input [2]: [d_date_sk#6, d_year#33]
+Input [2]: [d_date_sk#6, d_year#26]
 
 (46) Filter [codegen id : 1]
-Input [2]: [d_date_sk#6, d_year#33]
-Condition : ((isnotnull(d_year#33) AND (d_year#33 = 2000)) AND isnotnull(d_date_sk#6))
+Input [2]: [d_date_sk#6, d_year#26]
+Condition : ((isnotnull(d_year#26) AND (d_year#26 = 2000)) AND isnotnull(d_date_sk#6))
 
 (47) Project [codegen id : 1]
 Output [1]: [d_date_sk#6]
-Input [2]: [d_date_sk#6, d_year#33]
+Input [2]: [d_date_sk#6, d_year#26]
 
 (48) BroadcastExchange
 Input [1]: [d_date_sk#6]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#34]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=8]
 
 Subquery:2 Hosting operator id = 11 Hosting Expression = sr_returned_date_sk#4 IN dynamicpruning#5
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt
index 33d072fb941..5cab26c85a2 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt
@@ -77,18 +77,18 @@ 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, [id=#9]
+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))#10]
-Results [3]: [sr_customer_sk#1 AS ctr_customer_sk#11, sr_store_sk#2 AS ctr_store_sk#12, MakeDecimal(sum(UnscaledValue(sr_return_amt#3))#10,17,2) AS ctr_total_return#13]
+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#11, ctr_store_sk#12, ctr_total_return#13]
-Condition : isnotnull(ctr_total_return#13)
+Input [3]: [ctr_customer_sk#10, ctr_store_sk#11, ctr_total_return#12]
+Condition : isnotnull(ctr_total_return#12)
 
 (11) Scan parquet default.store_returns
 Output [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4]
@@ -121,116 +121,116 @@ Input [5]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_s
 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]
+Aggregate Attributes [1]: [sum#13]
+Results [3]: [sr_customer_sk#1, sr_store_sk#2, sum#14]
 
 (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, [id=#16]
+Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#14]
+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]
+Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#14]
 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))#10]
-Results [2]: [sr_store_sk#2 AS ctr_store_sk#12, MakeDecimal(sum(UnscaledValue(sr_return_amt#3))#10,17,2) AS ctr_total_return#13]
+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#12, ctr_total_return#13]
-Keys [1]: [ctr_store_sk#12]
-Functions [1]: [partial_avg(ctr_total_return#13)]
-Aggregate Attributes [2]: [sum#17, count#18]
-Results [3]: [ctr_store_sk#12, sum#19, count#20]
+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#15, count#16]
+Results [3]: [ctr_store_sk#11, sum#17, count#18]
 
 (21) Exchange
-Input [3]: [ctr_store_sk#12, sum#19, count#20]
-Arguments: hashpartitioning(ctr_store_sk#12, 5), ENSURE_REQUIREMENTS, [id=#21]
+Input [3]: [ctr_store_sk#11, sum#17, count#18]
+Arguments: hashpartitioning(ctr_store_sk#11, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (22) HashAggregate [codegen id : 6]
-Input [3]: [ctr_store_sk#12, sum#19, count#20]
-Keys [1]: [ctr_store_sk#12]
-Functions [1]: [avg(ctr_total_return#13)]
-Aggregate Attributes [1]: [avg(ctr_total_return#13)#22]
-Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#13)#22) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#23, ctr_store_sk#12 AS ctr_store_sk#12#24]
+Input [3]: [ctr_store_sk#11, sum#17, count#18]
+Keys [1]: [ctr_store_sk#11]
+Functions [1]: [avg(ctr_total_return#12)]
+Aggregate Attributes [1]: [avg(ctr_total_return#12)#19]
+Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#12)#19) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#20, ctr_store_sk#11 AS ctr_store_sk#11#21]
 
 (23) Filter [codegen id : 6]
-Input [2]: [(avg(ctr_total_return) * 1.2)#23, ctr_store_sk#12#24]
-Condition : isnotnull((avg(ctr_total_return) * 1.2)#23)
+Input [2]: [(avg(ctr_total_return) * 1.2)#20, ctr_store_sk#11#21]
+Condition : isnotnull((avg(ctr_total_return) * 1.2)#20)
 
 (24) BroadcastExchange
-Input [2]: [(avg(ctr_total_return) * 1.2)#23, ctr_store_sk#12#24]
-Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#25]
+Input [2]: [(avg(ctr_total_return) * 1.2)#20, ctr_store_sk#11#21]
+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#12]
-Right keys [1]: [ctr_store_sk#12#24]
-Join condition: (cast(ctr_total_return#13 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#23)
+Left keys [1]: [ctr_store_sk#11]
+Right keys [1]: [ctr_store_sk#11#21]
+Join condition: (cast(ctr_total_return#12 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#20)
 
 (26) Project [codegen id : 9]
-Output [2]: [ctr_customer_sk#11, ctr_store_sk#12]
-Input [5]: [ctr_customer_sk#11, ctr_store_sk#12, ctr_total_return#13, (avg(ctr_total_return) * 1.2)#23, ctr_store_sk#12#24]
+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)#20, ctr_store_sk#11#21]
 
 (27) Scan parquet default.store
-Output [2]: [s_store_sk#26, s_state#27]
+Output [2]: [s_store_sk#22, s_state#23]
 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) ColumnarToRow [codegen id : 7]
-Input [2]: [s_store_sk#26, s_state#27]
+Input [2]: [s_store_sk#22, s_state#23]
 
 (29) Filter [codegen id : 7]
-Input [2]: [s_store_sk#26, s_state#27]
-Condition : ((isnotnull(s_state#27) AND (s_state#27 = TN)) AND isnotnull(s_store_sk#26))
+Input [2]: [s_store_sk#22, s_state#23]
+Condition : ((isnotnull(s_state#23) AND (s_state#23 = TN)) AND isnotnull(s_store_sk#22))
 
 (30) Project [codegen id : 7]
-Output [1]: [s_store_sk#26]
-Input [2]: [s_store_sk#26, s_state#27]
+Output [1]: [s_store_sk#22]
+Input [2]: [s_store_sk#22, s_state#23]
 
 (31) BroadcastExchange
-Input [1]: [s_store_sk#26]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28]
+Input [1]: [s_store_sk#22]
+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#12]
-Right keys [1]: [s_store_sk#26]
+Left keys [1]: [ctr_store_sk#11]
+Right keys [1]: [s_store_sk#22]
 Join condition: None
 
 (33) Project [codegen id : 9]
-Output [1]: [ctr_customer_sk#11]
-Input [3]: [ctr_customer_sk#11, ctr_store_sk#12, s_store_sk#26]
+Output [1]: [ctr_customer_sk#10]
+Input [3]: [ctr_customer_sk#10, ctr_store_sk#11, s_store_sk#22]
 
 (34) Scan parquet default.customer
-Output [2]: [c_customer_sk#29, c_customer_id#30]
+Output [2]: [c_customer_sk#24, c_customer_id#25]
 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) ColumnarToRow [codegen id : 8]
-Input [2]: [c_customer_sk#29, c_customer_id#30]
+Input [2]: [c_customer_sk#24, c_customer_id#25]
 
 (36) Filter [codegen id : 8]
-Input [2]: [c_customer_sk#29, c_customer_id#30]
-Condition : isnotnull(c_customer_sk#29)
+Input [2]: [c_customer_sk#24, c_customer_id#25]
+Condition : isnotnull(c_customer_sk#24)
 
 (37) BroadcastExchange
-Input [2]: [c_customer_sk#29, c_customer_id#30]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31]
+Input [2]: [c_customer_sk#24, c_customer_id#25]
+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#11]
-Right keys [1]: [c_customer_sk#29]
+Left keys [1]: [ctr_customer_sk#10]
+Right keys [1]: [c_customer_sk#24]
 Join condition: None
 
 (39) Project [codegen id : 9]
-Output [1]: [c_customer_id#30]
-Input [3]: [ctr_customer_sk#11, c_customer_sk#29, c_customer_id#30]
+Output [1]: [c_customer_id#25]
+Input [3]: [ctr_customer_sk#10, c_customer_sk#24, c_customer_id#25]
 
 (40) TakeOrderedAndProject
-Input [1]: [c_customer_id#30]
-Arguments: 100, [c_customer_id#30 ASC NULLS FIRST], [c_customer_id#30]
+Input [1]: [c_customer_id#25]
+Arguments: 100, [c_customer_id#25 ASC NULLS FIRST], [c_customer_id#25]
 
 ===== Subqueries =====
 
@@ -243,26 +243,26 @@ BroadcastExchange (45)
 
 
 (41) Scan parquet default.date_dim
-Output [2]: [d_date_sk#6, d_year#32]
+Output [2]: [d_date_sk#6, d_year#26]
 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) ColumnarToRow [codegen id : 1]
-Input [2]: [d_date_sk#6, d_year#32]
+Input [2]: [d_date_sk#6, d_year#26]
 
 (43) Filter [codegen id : 1]
-Input [2]: [d_date_sk#6, d_year#32]
-Condition : ((isnotnull(d_year#32) AND (d_year#32 = 2000)) AND isnotnull(d_date_sk#6))
+Input [2]: [d_date_sk#6, d_year#26]
+Condition : ((isnotnull(d_year#26) AND (d_year#26 = 2000)) AND isnotnull(d_date_sk#6))
 
 (44) Project [codegen id : 1]
 Output [1]: [d_date_sk#6]
-Input [2]: [d_date_sk#6, d_year#32]
+Input [2]: [d_date_sk#6, d_year#26]
 
 (45) BroadcastExchange
 Input [1]: [d_date_sk#6]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#33]
+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/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt
index 1337d5ed266..ee261753f1a 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt
@@ -68,115 +68,115 @@ Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4))
 
 (4) Exchange
 Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]
-Arguments: hashpartitioning(c_customer_sk#3, 5), ENSURE_REQUIREMENTS, [id=#6]
+Arguments: hashpartitioning(c_customer_sk#3, 5), ENSURE_REQUIREMENTS, [plan_id=1]
 
 (5) Sort [codegen id : 2]
 Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5]
 Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0
 
 (6) Scan parquet default.store_sales
-Output [2]: [ss_customer_sk#7, ss_sold_date_sk#8]
+Output [2]: [ss_customer_sk#6, ss_sold_date_sk#7]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)]
 ReadSchema: struct<ss_customer_sk:int>
 
 (7) ColumnarToRow [codegen id : 4]
-Input [2]: [ss_customer_sk#7, ss_sold_date_sk#8]
+Input [2]: [ss_customer_sk#6, ss_sold_date_sk#7]
 
 (8) ReusedExchange [Reuses operator id: 56]
-Output [1]: [d_date_sk#10]
+Output [1]: [d_date_sk#9]
 
 (9) BroadcastHashJoin [codegen id : 4]
-Left keys [1]: [ss_sold_date_sk#8]
-Right keys [1]: [d_date_sk#10]
+Left keys [1]: [ss_sold_date_sk#7]
+Right keys [1]: [d_date_sk#9]
 Join condition: None
 
 (10) Project [codegen id : 4]
-Output [1]: [ss_customer_sk#7]
-Input [3]: [ss_customer_sk#7, ss_sold_date_sk#8, d_date_sk#10]
+Output [1]: [ss_customer_sk#6]
+Input [3]: [ss_customer_sk#6, ss_sold_date_sk#7, d_date_sk#9]
 
 (11) Exchange
-Input [1]: [ss_customer_sk#7]
-Arguments: hashpartitioning(ss_customer_sk#7, 5), ENSURE_REQUIREMENTS, [id=#11]
+Input [1]: [ss_customer_sk#6]
+Arguments: hashpartitioning(ss_customer_sk#6, 5), ENSURE_REQUIREMENTS, [plan_id=2]
 
 (12) Sort [codegen id : 5]
-Input [1]: [ss_customer_sk#7]
-Arguments: [ss_customer_sk#7 ASC NULLS FIRST], false, 0
+Input [1]: [ss_customer_sk#6]
+Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0
 
 (13) SortMergeJoin [codegen id : 6]
 Left keys [1]: [c_customer_sk#3]
-Right keys [1]: [ss_customer_sk#7]
+Right keys [1]: [ss_customer_sk#6]
 Join condition: None
 
 (14) Scan parquet default.web_sales
-Output [2]: [ws_bill_customer_sk#12, ws_sold_date_sk#13]
+Output [2]: [ws_bill_customer_sk#10, ws_sold_date_sk#11]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ws_sold_date_sk#13), dynamicpruningexpression(ws_sold_date_sk#13 IN dynamicpruning#9)]
+PartitionFilters: [isnotnull(ws_sold_date_sk#11), dynamicpruningexpression(ws_sold_date_sk#11 IN dynamicpruning#8)]
 ReadSchema: struct<ws_bill_customer_sk:int>
 
 (15) ColumnarToRow [codegen id : 8]
-Input [2]: [ws_bill_customer_sk#12, ws_sold_date_sk#13]
+Input [2]: [ws_bill_customer_sk#10, ws_sold_date_sk#11]
 
 (16) ReusedExchange [Reuses operator id: 56]
-Output [1]: [d_date_sk#14]
+Output [1]: [d_date_sk#12]
 
 (17) BroadcastHashJoin [codegen id : 8]
-Left keys [1]: [ws_sold_date_sk#13]
-Right keys [1]: [d_date_sk#14]
+Left keys [1]: [ws_sold_date_sk#11]
+Right keys [1]: [d_date_sk#12]
 Join condition: None
 
 (18) Project [codegen id : 8]
-Output [1]: [ws_bill_customer_sk#12]
-Input [3]: [ws_bill_customer_sk#12, ws_sold_date_sk#13, d_date_sk#14]
+Output [1]: [ws_bill_customer_sk#10]
+Input [3]: [ws_bill_customer_sk#10, ws_sold_date_sk#11, d_date_sk#12]
 
 (19) Exchange
-Input [1]: [ws_bill_customer_sk#12]
-Arguments: hashpartitioning(ws_bill_customer_sk#12, 5), ENSURE_REQUIREMENTS, [id=#15]
+Input [1]: [ws_bill_customer_sk#10]
+Arguments: hashpartitioning(ws_bill_customer_sk#10, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (20) Sort [codegen id : 9]
-Input [1]: [ws_bill_customer_sk#12]
-Arguments: [ws_bill_customer_sk#12 ASC NULLS FIRST], false, 0
+Input [1]: [ws_bill_customer_sk#10]
+Arguments: [ws_bill_customer_sk#10 ASC NULLS FIRST], false, 0
 
 (21) SortMergeJoin
 Left keys [1]: [c_customer_sk#3]
-Right keys [1]: [ws_bill_customer_sk#12]
+Right keys [1]: [ws_bill_customer_sk#10]
 Join condition: None
 
 (22) Scan parquet default.catalog_sales
-Output [2]: [cs_ship_customer_sk#16, cs_sold_date_sk#17]
+Output [2]: [cs_ship_customer_sk#13, cs_sold_date_sk#14]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(cs_sold_date_sk#17), dynamicpruningexpression(cs_sold_date_sk#17 IN dynamicpruning#9)]
+PartitionFilters: [isnotnull(cs_sold_date_sk#14), dynamicpruningexpression(cs_sold_date_sk#14 IN dynamicpruning#8)]
 ReadSchema: struct<cs_ship_customer_sk:int>
 
 (23) ColumnarToRow [codegen id : 11]
-Input [2]: [cs_ship_customer_sk#16, cs_sold_date_sk#17]
+Input [2]: [cs_ship_customer_sk#13, cs_sold_date_sk#14]
 
 (24) ReusedExchange [Reuses operator id: 56]
-Output [1]: [d_date_sk#18]
+Output [1]: [d_date_sk#15]
 
 (25) BroadcastHashJoin [codegen id : 11]
-Left keys [1]: [cs_sold_date_sk#17]
-Right keys [1]: [d_date_sk#18]
+Left keys [1]: [cs_sold_date_sk#14]
+Right keys [1]: [d_date_sk#15]
 Join condition: None
 
 (26) Project [codegen id : 11]
-Output [1]: [cs_ship_customer_sk#16]
-Input [3]: [cs_ship_customer_sk#16, cs_sold_date_sk#17, d_date_sk#18]
+Output [1]: [cs_ship_customer_sk#13]
+Input [3]: [cs_ship_customer_sk#13, cs_sold_date_sk#14, d_date_sk#15]
 
 (27) Exchange
-Input [1]: [cs_ship_customer_sk#16]
-Arguments: hashpartitioning(cs_ship_customer_sk#16, 5), ENSURE_REQUIREMENTS, [id=#19]
+Input [1]: [cs_ship_customer_sk#13]
+Arguments: hashpartitioning(cs_ship_customer_sk#13, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (28) Sort [codegen id : 12]
-Input [1]: [cs_ship_customer_sk#16]
-Arguments: [cs_ship_customer_sk#16 ASC NULLS FIRST], false, 0
+Input [1]: [cs_ship_customer_sk#13]
+Arguments: [cs_ship_customer_sk#13 ASC NULLS FIRST], false, 0
 
 (29) SortMergeJoin
 Left keys [1]: [c_customer_sk#3]
-Right keys [1]: [cs_ship_customer_sk#16]
+Right keys [1]: [cs_ship_customer_sk#13]
 Join condition: None
 
 (30) Filter [codegen id : 14]
@@ -188,100 +188,100 @@ 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]
 
 (32) Scan parquet default.customer_address
-Output [2]: [ca_address_sk#20, ca_county#21]
+Output [2]: [ca_address_sk#16, ca_county#17]
 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>
 
 (33) ColumnarToRow [codegen id : 13]
-Input [2]: [ca_address_sk#20, ca_county#21]
+Input [2]: [ca_address_sk#16, ca_county#17]
 
 (34) Filter [codegen id : 13]
-Input [2]: [ca_address_sk#20, ca_county#21]
-Condition : (ca_county#21 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#20))
+Input [2]: [ca_address_sk#16, ca_county#17]
+Condition : (ca_county#17 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#16))
 
 (35) Project [codegen id : 13]
-Output [1]: [ca_address_sk#20]
-Input [2]: [ca_address_sk#20, ca_county#21]
+Output [1]: [ca_address_sk#16]
+Input [2]: [ca_address_sk#16, ca_county#17]
 
 (36) BroadcastExchange
-Input [1]: [ca_address_sk#20]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22]
+Input [1]: [ca_address_sk#16]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=5]
 
 (37) BroadcastHashJoin [codegen id : 14]
 Left keys [1]: [c_current_addr_sk#5]
-Right keys [1]: [ca_address_sk#20]
+Right keys [1]: [ca_address_sk#16]
 Join condition: None
 
 (38) Project [codegen id : 14]
 Output [1]: [c_current_cdemo_sk#4]
-Input [3]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#20]
+Input [3]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#16]
 
 (39) Exchange
 Input [1]: [c_current_cdemo_sk#4]
-Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), ENSURE_REQUIREMENTS, [id=#23]
+Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), ENSURE_REQUIREMENTS, [plan_id=6]
 
 (40) Sort [codegen id : 15]
 Input [1]: [c_current_cdemo_sk#4]
 Arguments: [c_current_cdemo_sk#4 ASC NULLS FIRST], false, 0
 
 (41) Scan parquet default.customer_demographics
-Output [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
+Output [9]: [cd_demo_sk#18, cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
 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>
 
 (42) ColumnarToRow [codegen id : 16]
-Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
+Input [9]: [cd_demo_sk#18, cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
 
 (43) Filter [codegen id : 16]
-Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
-Condition : isnotnull(cd_demo_sk#24)
+Input [9]: [cd_demo_sk#18, cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
+Condition : isnotnull(cd_demo_sk#18)
 
 (44) Exchange
-Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
-Arguments: hashpartitioning(cd_demo_sk#24, 5), ENSURE_REQUIREMENTS, [id=#33]
+Input [9]: [cd_demo_sk#18, cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
+Arguments: hashpartitioning(cd_demo_sk#18, 5), ENSURE_REQUIREMENTS, [plan_id=7]
 
 (45) Sort [codegen id : 17]
-Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
-Arguments: [cd_demo_sk#24 ASC NULLS FIRST], false, 0
+Input [9]: [cd_demo_sk#18, cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
+Arguments: [cd_demo_sk#18 ASC NULLS FIRST], false, 0
 
 (46) SortMergeJoin [codegen id : 18]
 Left keys [1]: [c_current_cdemo_sk#4]
-Right keys [1]: [cd_demo_sk#24]
+Right keys [1]: [cd_demo_sk#18]
 Join condition: None
 
 (47) Project [codegen id : 18]
-Output [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
-Input [10]: [c_current_cdemo_sk#4, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
+Output [8]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
+Input [10]: [c_current_cdemo_sk#4, cd_demo_sk#18, cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
 
 (48) HashAggregate [codegen id : 18]
-Input [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
-Keys [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
+Input [8]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
+Keys [8]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
 Functions [1]: [partial_count(1)]
-Aggregate Attributes [1]: [count#34]
-Results [9]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#35]
+Aggregate Attributes [1]: [count#27]
+Results [9]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#28]
 
 (49) Exchange
-Input [9]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#35]
-Arguments: hashpartitioning(cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, 5), ENSURE_REQUIREMENTS, [id=#36]
+Input [9]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#28]
+Arguments: hashpartitioning(cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, 5), ENSURE_REQUIREMENTS, [plan_id=8]
 
 (50) HashAggregate [codegen id : 19]
-Input [9]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#35]
-Keys [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32]
+Input [9]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#28]
+Keys [8]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
 Functions [1]: [count(1)]
-Aggregate Attributes [1]: [count(1)#37]
-Results [14]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, count(1)#37 AS cnt1#38, cd_purchase_estimate#28, count(1)#37 AS cnt2#39, cd_credit_rating#29, count(1)#37 AS cnt3#40, cd_dep_count#30, count(1)#37 AS cnt4#41, cd_dep_employed_count#31, count(1)#37 AS cnt5#42, cd_dep_college_count#32, count(1)#37 AS cnt6#43]
+Aggregate Attributes [1]: [count(1)#29]
+Results [14]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, count(1)#29 AS cnt1#30, cd_purchase_estimate#22, count(1)#29 AS cnt2#31, cd_credit_rating#23, count(1)#29 AS cnt3#32, cd_dep_count#24, count(1)#29 AS cnt4#33, cd_dep_employed_count#25, count(1)#29 AS cnt5#34, cd_dep_college_count#26, count(1)#29 AS cnt6#35]
 
 (51) TakeOrderedAndProject
-Input [14]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cnt1#38, cd_purchase_estimate#28, cnt2#39, cd_credit_rating#29, cnt3#40, cd_dep_count#30, cnt4#41, cd_dep_employed_count#31, cnt5#42, cd_dep_college_count#32, cnt6#43]
-Arguments: 100, [cd_gender#25 ASC NULLS FIRST, cd_marital_status#26 ASC NULLS FIRST, cd_education_status#27 ASC NULLS FIRST, cd_purchase_estimate#28 ASC NULLS FIRST, cd_credit_rating#29 ASC NULLS FIRST, cd_dep_count#30 ASC NULLS FIRST, cd_dep_employed_count#31 ASC NULLS FIRST, cd_dep_college_count#32 ASC NULLS FIRST], [cd_gender#25, cd_marital_status#26, cd_education_status#27, cnt1#38, cd_purchase_estimate#28, cnt2#39, cd_credit_rating#29, cnt3#40, cd_dep_count#30, cnt4#41, cd_dep_emplo [...]
+Input [14]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cnt1#30, cd_purchase_estimate#22, cnt2#31, cd_credit_rating#23, cnt3#32, cd_dep_count#24, cnt4#33, cd_dep_employed_count#25, cnt5#34, cd_dep_college_count#26, cnt6#35]
+Arguments: 100, [cd_gender#19 ASC NULLS FIRST, cd_marital_status#20 ASC NULLS FIRST, cd_education_status#21 ASC NULLS FIRST, cd_purchase_estimate#22 ASC NULLS FIRST, cd_credit_rating#23 ASC NULLS FIRST, cd_dep_count#24 ASC NULLS FIRST, cd_dep_employed_count#25 ASC NULLS FIRST, cd_dep_college_count#26 ASC NULLS FIRST], [cd_gender#19, cd_marital_status#20, cd_education_status#21, cnt1#30, cd_purchase_estimate#22, cnt2#31, cd_credit_rating#23, cnt3#32, cd_dep_count#24, cnt4#33, cd_dep_emplo [...]
 
 ===== Subqueries =====
 
-Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9
+Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8
 BroadcastExchange (56)
 +- * Project (55)
    +- * Filter (54)
@@ -290,29 +290,29 @@ BroadcastExchange (56)
 
 
 (52) Scan parquet default.date_dim
-Output [3]: [d_date_sk#10, d_year#44, d_moy#45]
+Output [3]: [d_date_sk#9, d_year#36, d_moy#37]
 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>
 
 (53) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#44, d_moy#45]
+Input [3]: [d_date_sk#9, d_year#36, d_moy#37]
 
 (54) Filter [codegen id : 1]
-Input [3]: [d_date_sk#10, d_year#44, d_moy#45]
-Condition : (((((isnotnull(d_year#44) AND isnotnull(d_moy#45)) AND (d_year#44 = 2002)) AND (d_moy#45 >= 1)) AND (d_moy#45 <= 4)) AND isnotnull(d_date_sk#10))
+Input [3]: [d_date_sk#9, d_year#36, d_moy#37]
+Condition : (((((isnotnull(d_year#36) AND isnotnull(d_moy#37)) AND (d_year#36 = 2002)) AND (d_moy#37 >= 1)) AND (d_moy#37 <= 4)) AND isnotnull(d_date_sk#9))
 
 (55) Project [codegen id : 1]
-Output [1]: [d_date_sk#10]
-Input [3]: [d_date_sk#10, d_year#44, d_moy#45]
+Output [1]: [d_date_sk#9]
+Input [3]: [d_date_sk#9, d_year#36, d_moy#37]
 
 (56) BroadcastExchange
-Input [1]: [d_date_sk#10]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#46]
+Input [1]: [d_date_sk#9]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [plan_id=9]
 
-Subquery:2 Hosting operator id = 14 Hosting Expression = ws_sold_date_sk#13 IN dynamicpruning#9
+Subquery:2 Hosting operator id = 14 Hosting Expression = ws_sold_date_sk#11 IN dynamicpruning#8
 
-Subquery:3 Hosting operator id = 22 Hosting Expression = cs_sold_date_sk#17 IN dynamicpruning#9
+Subquery:3 Hosting operator id = 22 Hosting Expression = cs_sold_date_sk#14 IN dynamicpruning#8
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/explain.txt
index 80c23b3f113..2496ee87e6c 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/explain.txt
@@ -82,7 +82,7 @@ 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), [id=#10]
+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]
@@ -90,65 +90,65 @@ Right keys [1]: [ss_customer_sk#6]
 Join condition: None
 
 (11) Scan parquet default.web_sales
-Output [2]: [ws_bill_customer_sk#11, ws_sold_date_sk#12]
+Output [2]: [ws_bill_customer_sk#10, ws_sold_date_sk#11]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ws_sold_date_sk#12), dynamicpruningexpression(ws_sold_date_sk#12 IN dynamicpruning#8)]
+PartitionFilters: [isnotnull(ws_sold_date_sk#11), dynamicpruningexpression(ws_sold_date_sk#11 IN dynamicpruning#8)]
 ReadSchema: struct<ws_bill_customer_sk:int>
 
 (12) ColumnarToRow [codegen id : 4]
-Input [2]: [ws_bill_customer_sk#11, ws_sold_date_sk#12]
+Input [2]: [ws_bill_customer_sk#10, ws_sold_date_sk#11]
 
 (13) ReusedExchange [Reuses operator id: 48]
-Output [1]: [d_date_sk#13]
+Output [1]: [d_date_sk#12]
 
 (14) BroadcastHashJoin [codegen id : 4]
-Left keys [1]: [ws_sold_date_sk#12]
-Right keys [1]: [d_date_sk#13]
+Left keys [1]: [ws_sold_date_sk#11]
+Right keys [1]: [d_date_sk#12]
 Join condition: None
 
 (15) Project [codegen id : 4]
-Output [1]: [ws_bill_customer_sk#11]
-Input [3]: [ws_bill_customer_sk#11, ws_sold_date_sk#12, d_date_sk#13]
+Output [1]: [ws_bill_customer_sk#10]
+Input [3]: [ws_bill_customer_sk#10, ws_sold_date_sk#11, d_date_sk#12]
 
 (16) BroadcastExchange
-Input [1]: [ws_bill_customer_sk#11]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14]
+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#11]
+Right keys [1]: [ws_bill_customer_sk#10]
 Join condition: None
 
 (18) Scan parquet default.catalog_sales
-Output [2]: [cs_ship_customer_sk#15, cs_sold_date_sk#16]
+Output [2]: [cs_ship_customer_sk#13, cs_sold_date_sk#14]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(cs_sold_date_sk#16), dynamicpruningexpression(cs_sold_date_sk#16 IN dynamicpruning#8)]
+PartitionFilters: [isnotnull(cs_sold_date_sk#14), dynamicpruningexpression(cs_sold_date_sk#14 IN dynamicpruning#8)]
 ReadSchema: struct<cs_ship_customer_sk:int>
 
 (19) ColumnarToRow [codegen id : 6]
-Input [2]: [cs_ship_customer_sk#15, cs_sold_date_sk#16]
+Input [2]: [cs_ship_customer_sk#13, cs_sold_date_sk#14]
 
 (20) ReusedExchange [Reuses operator id: 48]
-Output [1]: [d_date_sk#17]
+Output [1]: [d_date_sk#15]
 
 (21) BroadcastHashJoin [codegen id : 6]
-Left keys [1]: [cs_sold_date_sk#16]
-Right keys [1]: [d_date_sk#17]
+Left keys [1]: [cs_sold_date_sk#14]
+Right keys [1]: [d_date_sk#15]
 Join condition: None
 
 (22) Project [codegen id : 6]
-Output [1]: [cs_ship_customer_sk#15]
-Input [3]: [cs_ship_customer_sk#15, cs_sold_date_sk#16, d_date_sk#17]
+Output [1]: [cs_ship_customer_sk#13]
+Input [3]: [cs_ship_customer_sk#13, cs_sold_date_sk#14, d_date_sk#15]
 
 (23) BroadcastExchange
-Input [1]: [cs_ship_customer_sk#15]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18]
+Input [1]: [cs_ship_customer_sk#13]
+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#15]
+Right keys [1]: [cs_ship_customer_sk#13]
 Join condition: None
 
 (25) Filter [codegen id : 9]
@@ -160,84 +160,84 @@ 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]
 
 (27) Scan parquet default.customer_address
-Output [2]: [ca_address_sk#19, ca_county#20]
+Output [2]: [ca_address_sk#16, ca_county#17]
 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) ColumnarToRow [codegen id : 7]
-Input [2]: [ca_address_sk#19, ca_county#20]
+Input [2]: [ca_address_sk#16, ca_county#17]
 
 (29) Filter [codegen id : 7]
-Input [2]: [ca_address_sk#19, ca_county#20]
-Condition : (ca_county#20 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#19))
+Input [2]: [ca_address_sk#16, ca_county#17]
+Condition : (ca_county#17 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#16))
 
 (30) Project [codegen id : 7]
-Output [1]: [ca_address_sk#19]
-Input [2]: [ca_address_sk#19, ca_county#20]
+Output [1]: [ca_address_sk#16]
+Input [2]: [ca_address_sk#16, ca_county#17]
 
 (31) BroadcastExchange
-Input [1]: [ca_address_sk#19]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21]
+Input [1]: [ca_address_sk#16]
+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#19]
+Right keys [1]: [ca_address_sk#16]
 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#19]
+Input [3]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#16]
 
 (34) Scan parquet default.customer_demographics
-Output [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
+Output [9]: [cd_demo_sk#18, cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
 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) ColumnarToRow [codegen id : 8]
-Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
+Input [9]: [cd_demo_sk#18, cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
 
 (36) Filter [codegen id : 8]
-Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
-Condition : isnotnull(cd_demo_sk#22)
+Input [9]: [cd_demo_sk#18, cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
+Condition : isnotnull(cd_demo_sk#18)
 
 (37) BroadcastExchange
-Input [9]: [cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31]
+Input [9]: [cd_demo_sk#18, cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
+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#22]
+Right keys [1]: [cd_demo_sk#18]
 Join condition: None
 
 (39) Project [codegen id : 9]
-Output [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
-Input [10]: [c_current_cdemo_sk#4, cd_demo_sk#22, cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
+Output [8]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
+Input [10]: [c_current_cdemo_sk#4, cd_demo_sk#18, cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
 
 (40) HashAggregate [codegen id : 9]
-Input [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
-Keys [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
+Input [8]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
+Keys [8]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
 Functions [1]: [partial_count(1)]
-Aggregate Attributes [1]: [count#32]
-Results [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33]
+Aggregate Attributes [1]: [count#27]
+Results [9]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#28]
 
 (41) Exchange
-Input [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33]
-Arguments: hashpartitioning(cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), ENSURE_REQUIREMENTS, [id=#34]
+Input [9]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#28]
+Arguments: hashpartitioning(cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, 5), ENSURE_REQUIREMENTS, [plan_id=6]
 
 (42) HashAggregate [codegen id : 10]
-Input [9]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#33]
-Keys [8]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cd_purchase_estimate#26, cd_credit_rating#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30]
+Input [9]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26, count#28]
+Keys [8]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cd_purchase_estimate#22, cd_credit_rating#23, cd_dep_count#24, cd_dep_employed_count#25, cd_dep_college_count#26]
 Functions [1]: [count(1)]
-Aggregate Attributes [1]: [count(1)#35]
-Results [14]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, count(1)#35 AS cnt1#36, cd_purchase_estimate#26, count(1)#35 AS cnt2#37, cd_credit_rating#27, count(1)#35 AS cnt3#38, cd_dep_count#28, count(1)#35 AS cnt4#39, cd_dep_employed_count#29, count(1)#35 AS cnt5#40, cd_dep_college_count#30, count(1)#35 AS cnt6#41]
+Aggregate Attributes [1]: [count(1)#29]
+Results [14]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, count(1)#29 AS cnt1#30, cd_purchase_estimate#22, count(1)#29 AS cnt2#31, cd_credit_rating#23, count(1)#29 AS cnt3#32, cd_dep_count#24, count(1)#29 AS cnt4#33, cd_dep_employed_count#25, count(1)#29 AS cnt5#34, cd_dep_college_count#26, count(1)#29 AS cnt6#35]
 
 (43) TakeOrderedAndProject
-Input [14]: [cd_gender#23, cd_marital_status#24, cd_education_status#25, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#27, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_employed_count#29, cnt5#40, cd_dep_college_count#30, cnt6#41]
-Arguments: 100, [cd_gender#23 ASC NULLS FIRST, cd_marital_status#24 ASC NULLS FIRST, cd_education_status#25 ASC NULLS FIRST, cd_purchase_estimate#26 ASC NULLS FIRST, cd_credit_rating#27 ASC NULLS FIRST, cd_dep_count#28 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [cd_gender#23, cd_marital_status#24, cd_education_status#25, cnt1#36, cd_purchase_estimate#26, cnt2#37, cd_credit_rating#27, cnt3#38, cd_dep_count#28, cnt4#39, cd_dep_emplo [...]
+Input [14]: [cd_gender#19, cd_marital_status#20, cd_education_status#21, cnt1#30, cd_purchase_estimate#22, cnt2#31, cd_credit_rating#23, cnt3#32, cd_dep_count#24, cnt4#33, cd_dep_employed_count#25, cnt5#34, cd_dep_college_count#26, cnt6#35]
+Arguments: 100, [cd_gender#19 ASC NULLS FIRST, cd_marital_status#20 ASC NULLS FIRST, cd_education_status#21 ASC NULLS FIRST, cd_purchase_estimate#22 ASC NULLS FIRST, cd_credit_rating#23 ASC NULLS FIRST, cd_dep_count#24 ASC NULLS FIRST, cd_dep_employed_count#25 ASC NULLS FIRST, cd_dep_college_count#26 ASC NULLS FIRST], [cd_gender#19, cd_marital_status#20, cd_education_status#21, cnt1#30, cd_purchase_estimate#22, cnt2#31, cd_credit_rating#23, cnt3#32, cd_dep_count#24, cnt4#33, cd_dep_emplo [...]
 
 ===== Subqueries =====
 
@@ -250,29 +250,29 @@ BroadcastExchange (48)
 
 
 (44) Scan parquet default.date_dim
-Output [3]: [d_date_sk#9, d_year#42, d_moy#43]
+Output [3]: [d_date_sk#9, d_year#36, d_moy#37]
 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) ColumnarToRow [codegen id : 1]
-Input [3]: [d_date_sk#9, d_year#42, d_moy#43]
+Input [3]: [d_date_sk#9, d_year#36, d_moy#37]
 
 (46) Filter [codegen id : 1]
-Input [3]: [d_date_sk#9, d_year#42, d_moy#43]
-Condition : (((((isnotnull(d_year#42) AND isnotnull(d_moy#43)) AND (d_year#42 = 2002)) AND (d_moy#43 >= 1)) AND (d_moy#43 <= 4)) AND isnotnull(d_date_sk#9))
+Input [3]: [d_date_sk#9, d_year#36, d_moy#37]
+Condition : (((((isnotnull(d_year#36) AND isnotnull(d_moy#37)) AND (d_year#36 = 2002)) AND (d_moy#37 >= 1)) AND (d_moy#37 <= 4)) AND isnotnull(d_date_sk#9))
 
 (47) Project [codegen id : 1]
 Output [1]: [d_date_sk#9]
-Input [3]: [d_date_sk#9, d_year#42, d_moy#43]
+Input [3]: [d_date_sk#9, d_year#36, d_moy#37]
 
 (48) BroadcastExchange
 Input [1]: [d_date_sk#9]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44]
+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#12 IN dynamicpruning#8
+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#16 IN dynamicpruning#8
+Subquery:3 Hosting operator id = 18 Hosting Expression = cs_sold_date_sk#14 IN dynamicpruning#8
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt
index 26f60746e20..4ce4b54df53 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt
@@ -111,342 +111,342 @@ Input [6]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, ss_sol
 
 (7) Exchange
 Input [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7]
-Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#8]
+Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [plan_id=1]
 
 (8) Sort [codegen id : 3]
 Input [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7]
 Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0
 
 (9) Scan parquet default.customer
-Output [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
+Output [8]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15]
 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>
 
 (10) ColumnarToRow [codegen id : 4]
-Input [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
+Input [8]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15]
 
 (11) Filter [codegen id : 4]
-Input [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
-Condition : (isnotnull(c_customer_sk#9) AND isnotnull(c_customer_id#10))
+Input [8]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15]
+Condition : (isnotnull(c_customer_sk#8) AND isnotnull(c_customer_id#9))
 
 (12) Exchange
-Input [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
-Arguments: hashpartitioning(c_customer_sk#9, 5), ENSURE_REQUIREMENTS, [id=#17]
+Input [8]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15]
+Arguments: hashpartitioning(c_customer_sk#8, 5), ENSURE_REQUIREMENTS, [plan_id=2]
 
 (13) Sort [codegen id : 5]
-Input [8]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
-Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0
+Input [8]: [c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15]
+Arguments: [c_customer_sk#8 ASC NULLS FIRST], false, 0
 
 (14) SortMergeJoin [codegen id : 6]
 Left keys [1]: [ss_customer_sk#1]
-Right keys [1]: [c_customer_sk#9]
+Right keys [1]: [c_customer_sk#8]
 Join condition: None
 
 (15) Project [codegen id : 6]
-Output [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7]
-Input [12]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
+Output [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7]
+Input [12]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7, c_customer_sk#8, c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15]
 
 (16) HashAggregate [codegen id : 6]
-Input [10]: [c_customer_id#10, c_first_name#11, c_last_name#12, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7]
-Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#7, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
+Input [10]: [c_customer_id#9, c_first_name#10, c_last_name#11, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7]
+Keys [8]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#7, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15]
 Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))]
-Aggregate Attributes [1]: [sum#18]
-Results [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#7, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19]
+Aggregate Attributes [1]: [sum#16]
+Results [9]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#7, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15, sum#17]
 
 (17) Exchange
-Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#7, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19]
-Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#7, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, 5), ENSURE_REQUIREMENTS, [id=#20]
+Input [9]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#7, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15, sum#17]
+Arguments: hashpartitioning(c_customer_id#9, c_first_name#10, c_last_name#11, d_year#7, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15, 5), ENSURE_REQUIREMENTS, [plan_id=3]
 
 (18) HashAggregate [codegen id : 7]
-Input [9]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#7, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16, sum#19]
-Keys [8]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#7, c_preferred_cust_flag#13, c_birth_country#14, c_login#15, c_email_address#16]
+Input [9]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#7, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15, sum#17]
+Keys [8]: [c_customer_id#9, c_first_name#10, c_last_name#11, d_year#7, c_preferred_cust_flag#12, c_birth_country#13, c_login#14, c_email_address#15]
 Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))]
-Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))#21]
-Results [2]: [c_customer_id#10 AS customer_id#22, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))#21,18,2) AS year_total#23]
+Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))#18]
+Results [2]: [c_customer_id#9 AS customer_id#19, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))#18,18,2) AS year_total#20]
 
 (19) Filter [codegen id : 7]
-Input [2]: [customer_id#22, year_total#23]
-Condition : (isnotnull(year_total#23) AND (year_total#23 > 0.00))
+Input [2]: [customer_id#19, year_total#20]
+Condition : (isnotnull(year_total#20) AND (year_total#20 > 0.00))
 
 (20) Exchange
-Input [2]: [customer_id#22, year_total#23]
-Arguments: hashpartitioning(customer_id#22, 5), ENSURE_REQUIREMENTS, [id=#24]
+Input [2]: [customer_id#19, year_total#20]
+Arguments: hashpartitioning(customer_id#19, 5), ENSURE_REQUIREMENTS, [plan_id=4]
 
 (21) Sort [codegen id : 8]
-Input [2]: [customer_id#22, year_total#23]
-Arguments: [customer_id#22 ASC NULLS FIRST], false, 0
+Input [2]: [customer_id#19, year_total#20]
+Arguments: [customer_id#19 ASC NULLS FIRST], false, 0
 
 (22) Scan parquet default.store_sales
-Output [4]: [ss_customer_sk#25, ss_ext_discount_amt#26, ss_ext_list_price#27, ss_sold_date_sk#28]
+Output [4]: [ss_customer_sk#21, ss_ext_discount_amt#22, ss_ext_list_price#23, ss_sold_date_sk#24]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ss_sold_date_sk#28), dynamicpruningexpression(ss_sold_date_sk#28 IN dynamicpruning#29)]
+PartitionFilters: [isnotnull(ss_sold_date_sk#24), dynamicpruningexpression(ss_sold_date_sk#24 IN dynamicpruning#25)]
 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)>
 
 (23) ColumnarToRow [codegen id : 10]
-Input [4]: [ss_customer_sk#25, ss_ext_discount_amt#26, ss_ext_list_price#27, ss_sold_date_sk#28]
+Input [4]: [ss_customer_sk#21, ss_ext_discount_amt#22, ss_ext_list_price#23, ss_sold_date_sk#24]
 
 (24) Filter [codegen id : 10]
-Input [4]: [ss_customer_sk#25, ss_ext_discount_amt#26, ss_ext_list_price#27, ss_sold_date_sk#28]
-Condition : isnotnull(ss_customer_sk#25)
+Input [4]: [ss_customer_sk#21, ss_ext_discount_amt#22, ss_ext_list_price#23, ss_sold_date_sk#24]
+Condition : isnotnull(ss_customer_sk#21)
 
 (25) ReusedExchange [Reuses operator id: 89]
-Output [2]: [d_date_sk#30, d_year#31]
+Output [2]: [d_date_sk#26, d_year#27]
 
 (26) BroadcastHashJoin [codegen id : 10]
-Left keys [1]: [ss_sold_date_sk#28]
-Right keys [1]: [d_date_sk#30]
+Left keys [1]: [ss_sold_date_sk#24]
+Right keys [1]: [d_date_sk#26]
 Join condition: None
 
 (27) Project [codegen id : 10]
-Output [4]: [ss_customer_sk#25, ss_ext_discount_amt#26, ss_ext_list_price#27, d_year#31]
-Input [6]: [ss_customer_sk#25, ss_ext_discount_amt#26, ss_ext_list_price#27, ss_sold_date_sk#28, d_date_sk#30, d_year#31]
+Output [4]: [ss_customer_sk#21, ss_ext_discount_amt#22, ss_ext_list_price#23, d_year#27]
+Input [6]: [ss_customer_sk#21, ss_ext_discount_amt#22, ss_ext_list_price#23, ss_sold_date_sk#24, d_date_sk#26, d_year#27]
 
 (28) Exchange
-Input [4]: [ss_customer_sk#25, ss_ext_discount_amt#26, ss_ext_list_price#27, d_year#31]
-Arguments: hashpartitioning(ss_customer_sk#25, 5), ENSURE_REQUIREMENTS, [id=#32]
+Input [4]: [ss_customer_sk#21, ss_ext_discount_amt#22, ss_ext_list_price#23, d_year#27]
+Arguments: hashpartitioning(ss_customer_sk#21, 5), ENSURE_REQUIREMENTS, [plan_id=5]
 
 (29) Sort [codegen id : 11]
-Input [4]: [ss_customer_sk#25, ss_ext_discount_amt#26, ss_ext_list_price#27, d_year#31]
-Arguments: [ss_customer_sk#25 ASC NULLS FIRST], false, 0
+Input [4]: [ss_customer_sk#21, ss_ext_discount_amt#22, ss_ext_list_price#23, d_year#27]
+Arguments: [ss_customer_sk#21 ASC NULLS FIRST], false, 0
 
 (30) ReusedExchange [Reuses operator id: 12]
-Output [8]: [c_customer_sk#33, c_customer_id#34, c_first_name#35, c_last_name#36, c_preferred_cust_flag#37, c_birth_country#38, c_login#39, c_email_address#40]
+Output [8]: [c_customer_sk#28, c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35]
 
 (31) Sort [codegen id : 13]
-Input [8]: [c_customer_sk#33, c_customer_id#34, c_first_name#35, c_last_name#36, c_preferred_cust_flag#37, c_birth_country#38, c_login#39, c_email_address#40]
-Arguments: [c_customer_sk#33 ASC NULLS FIRST], false, 0
+Input [8]: [c_customer_sk#28, c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35]
+Arguments: [c_customer_sk#28 ASC NULLS FIRST], false, 0
 
 (32) SortMergeJoin [codegen id : 14]
-Left keys [1]: [ss_customer_sk#25]
-Right keys [1]: [c_customer_sk#33]
+Left keys [1]: [ss_customer_sk#21]
+Right keys [1]: [c_customer_sk#28]
 Join condition: None
 
 (33) Project [codegen id : 14]
-Output [10]: [c_customer_id#34, c_first_name#35, c_last_name#36, c_preferred_cust_flag#37, c_birth_country#38, c_login#39, c_email_address#40, ss_ext_discount_amt#26, ss_ext_list_price#27, d_year#31]
-Input [12]: [ss_customer_sk#25, ss_ext_discount_amt#26, ss_ext_list_price#27, d_year#31, c_customer_sk#33, c_customer_id#34, c_first_name#35, c_last_name#36, c_preferred_cust_flag#37, c_birth_country#38, c_login#39, c_email_address#40]
+Output [10]: [c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, ss_ext_discount_amt#22, ss_ext_list_price#23, d_year#27]
+Input [12]: [ss_customer_sk#21, ss_ext_discount_amt#22, ss_ext_list_price#23, d_year#27, c_customer_sk#28, c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35]
 
 (34) HashAggregate [codegen id : 14]
-Input [10]: [c_customer_id#34, c_first_name#35, c_last_name#36, c_preferred_cust_flag#37, c_birth_country#38, c_login#39, c_email_address#40, ss_ext_discount_amt#26, ss_ext_list_price#27, d_year#31]
-Keys [8]: [c_customer_id#34, c_first_name#35, c_last_name#36, d_year#31, c_preferred_cust_flag#37, c_birth_country#38, c_login#39, c_email_address#40]
-Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#27 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#26 as decimal(8,2)))), DecimalType(8,2), true)))]
-Aggregate Attributes [1]: [sum#41]
-Results [9]: [c_customer_id#34, c_first_name#35, c_last_name#36, d_year#31, c_preferred_cust_flag#37, c_birth_country#38, c_login#39, c_email_address#40, sum#42]
+Input [10]: [c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, ss_ext_discount_amt#22, ss_ext_list_price#23, d_year#27]
+Keys [8]: [c_customer_id#29, c_first_name#30, c_last_name#31, d_year#27, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35]
+Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#23 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#22 as decimal(8,2)))), DecimalType(8,2), true)))]
+Aggregate Attributes [1]: [sum#36]
+Results [9]: [c_customer_id#29, c_first_name#30, c_last_name#31, d_year#27, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, sum#37]
 
 (35) Exchange
-Input [9]: [c_customer_id#34, c_first_name#35, c_last_name#36, d_year#31, c_preferred_cust_flag#37, c_birth_country#38, c_login#39, c_email_address#40, sum#42]
-Arguments: hashpartitioning(c_customer_id#34, c_first_name#35, c_last_name#36, d_year#31, c_preferred_cust_flag#37, c_birth_country#38, c_login#39, c_email_address#40, 5), ENSURE_REQUIREMENTS, [id=#43]
+Input [9]: [c_customer_id#29, c_first_name#30, c_last_name#31, d_year#27, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, sum#37]
+Arguments: hashpartitioning(c_customer_id#29, c_first_name#30, c_last_name#31, d_year#27, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, 5), ENSURE_REQUIREMENTS, [plan_id=6]
 
 (36) HashAggregate [codegen id : 15]
-Input [9]: [c_customer_id#34, c_first_name#35, c_last_name#36, d_year#31, c_preferred_cust_flag#37, c_birth_country#38, c_login#39, c_email_address#40, sum#42]
-Keys [8]: [c_customer_id#34, c_first_name#35, c_last_name#36, d_year#31, c_preferred_cust_flag#37, c_birth_country#38, c_login#39, c_email_address#40]
-Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#27 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#26 as decimal(8,2)))), DecimalType(8,2), true)))]
-Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#27 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#26 as decimal(8,2)))), DecimalType(8,2), true)))#21]
-Results [3]: [c_customer_id#34 AS customer_id#44, c_preferred_cust_flag#37 AS customer_preferred_cust_flag#45, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#27 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#26 as decimal(8,2)))), DecimalType(8,2), true)))#21,18,2) AS year_total#46]
+Input [9]: [c_customer_id#29, c_first_name#30, c_last_name#31, d_year#27, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, sum#37]
+Keys [8]: [c_customer_id#29, c_first_name#30, c_last_name#31, d_year#27, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35]
+Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#23 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#22 as decimal(8,2)))), DecimalType(8,2), true)))]
+Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#23 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#22 as decimal(8,2)))), DecimalType(8,2), true)))#18]
+Results [3]: [c_customer_id#29 AS customer_id#38, c_preferred_cust_flag#32 AS customer_preferred_cust_flag#39, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#23 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#22 as decimal(8,2)))), DecimalType(8,2), true)))#18,18,2) AS year_total#40]
 
 (37) Exchange
-Input [3]: [customer_id#44, customer_preferred_cust_flag#45, year_total#46]
-Arguments: hashpartitioning(customer_id#44, 5), ENSURE_REQUIREMENTS, [id=#47]
+Input [3]: [customer_id#38, customer_preferred_cust_flag#39, year_total#40]
+Arguments: hashpartitioning(customer_id#38, 5), ENSURE_REQUIREMENTS, [plan_id=7]
 
 (38) Sort [codegen id : 16]
-Input [3]: [customer_id#44, customer_preferred_cust_flag#45, year_total#46]
-Arguments: [customer_id#44 ASC NULLS FIRST], false, 0
+Input [3]: [customer_id#38, customer_preferred_cust_flag#39, year_total#40]
+Arguments: [customer_id#38 ASC NULLS FIRST], false, 0
 
 (39) SortMergeJoin [codegen id : 17]
-Left keys [1]: [customer_id#22]
-Right keys [1]: [customer_id#44]
+Left keys [1]: [customer_id#19]
+Right keys [1]: [customer_id#38]
 Join condition: None
 
 (40) Project [codegen id : 17]
-Output [4]: [customer_id#22, year_total#23, customer_preferred_cust_flag#45, year_total#46]
-Input [5]: [customer_id#22, year_total#23, customer_id#44, customer_preferred_cust_flag#45, year_total#46]
+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]
 
 (41) Scan parquet default.web_sales
-Output [4]: [ws_bill_customer_sk#48, ws_ext_discount_amt#49, ws_ext_list_price#50, ws_sold_date_sk#51]
+Output [4]: [ws_bill_customer_sk#41, ws_ext_discount_amt#42, ws_ext_list_price#43, ws_sold_date_sk#44]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ws_sold_date_sk#51), dynamicpruningexpression(ws_sold_date_sk#51 IN dynamicpruning#5)]
+PartitionFilters: [isnotnull(ws_sold_date_sk#44), dynamicpruningexpression(ws_sold_date_sk#44 IN dynamicpruning#5)]
 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)>
 
 (42) ColumnarToRow [codegen id : 19]
-Input [4]: [ws_bill_customer_sk#48, ws_ext_discount_amt#49, ws_ext_list_price#50, ws_sold_date_sk#51]
+Input [4]: [ws_bill_customer_sk#41, ws_ext_discount_amt#42, ws_ext_list_price#43, ws_sold_date_sk#44]
 
 (43) Filter [codegen id : 19]
-Input [4]: [ws_bill_customer_sk#48, ws_ext_discount_amt#49, ws_ext_list_price#50, ws_sold_date_sk#51]
-Condition : isnotnull(ws_bill_customer_sk#48)
+Input [4]: [ws_bill_customer_sk#41, ws_ext_discount_amt#42, ws_ext_list_price#43, ws_sold_date_sk#44]
+Condition : isnotnull(ws_bill_customer_sk#41)
 
 (44) ReusedExchange [Reuses operator id: 85]
-Output [2]: [d_date_sk#52, d_year#53]
+Output [2]: [d_date_sk#45, d_year#46]
 
 (45) BroadcastHashJoin [codegen id : 19]
-Left keys [1]: [ws_sold_date_sk#51]
-Right keys [1]: [d_date_sk#52]
+Left keys [1]: [ws_sold_date_sk#44]
+Right keys [1]: [d_date_sk#45]
 Join condition: None
 
 (46) Project [codegen id : 19]
-Output [4]: [ws_bill_customer_sk#48, ws_ext_discount_amt#49, ws_ext_list_price#50, d_year#53]
-Input [6]: [ws_bill_customer_sk#48, ws_ext_discount_amt#49, ws_ext_list_price#50, ws_sold_date_sk#51, d_date_sk#52, d_year#53]
+Output [4]: [ws_bill_customer_sk#41, ws_ext_discount_amt#42, ws_ext_list_price#43, d_year#46]
+Input [6]: [ws_bill_customer_sk#41, ws_ext_discount_amt#42, ws_ext_list_price#43, ws_sold_date_sk#44, d_date_sk#45, d_year#46]
 
 (47) Exchange
-Input [4]: [ws_bill_customer_sk#48, ws_ext_discount_amt#49, ws_ext_list_price#50, d_year#53]
-Arguments: hashpartitioning(ws_bill_customer_sk#48, 5), ENSURE_REQUIREMENTS, [id=#54]
+Input [4]: [ws_bill_customer_sk#41, ws_ext_discount_amt#42, ws_ext_list_price#43, d_year#46]
+Arguments: hashpartitioning(ws_bill_customer_sk#41, 5), ENSURE_REQUIREMENTS, [plan_id=8]
 
 (48) Sort [codegen id : 20]
-Input [4]: [ws_bill_customer_sk#48, ws_ext_discount_amt#49, ws_ext_list_price#50, d_year#53]
-Arguments: [ws_bill_customer_sk#48 ASC NULLS FIRST], false, 0
+Input [4]: [ws_bill_customer_sk#41, ws_ext_discount_amt#42, ws_ext_list_price#43, d_year#46]
+Arguments: [ws_bill_customer_sk#41 ASC NULLS FIRST], false, 0
 
 (49) ReusedExchange [Reuses operator id: 12]
-Output [8]: [c_customer_sk#55, c_customer_id#56, c_first_name#57, c_last_name#58, c_preferred_cust_flag#59, c_birth_country#60, c_login#61, c_email_address#62]
+Output [8]: [c_customer_sk#47, c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54]
 
 (50) Sort [codegen id : 22]
-Input [8]: [c_customer_sk#55, c_customer_id#56, c_first_name#57, c_last_name#58, c_preferred_cust_flag#59, c_birth_country#60, c_login#61, c_email_address#62]
-Arguments: [c_customer_sk#55 ASC NULLS FIRST], false, 0
+Input [8]: [c_customer_sk#47, c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54]
+Arguments: [c_customer_sk#47 ASC NULLS FIRST], false, 0
 
 (51) SortMergeJoin [codegen id : 23]
-Left keys [1]: [ws_bill_customer_sk#48]
-Right keys [1]: [c_customer_sk#55]
+Left keys [1]: [ws_bill_customer_sk#41]
+Right keys [1]: [c_customer_sk#47]
 Join condition: None
 
 (52) Project [codegen id : 23]
-Output [10]: [c_customer_id#56, c_first_name#57, c_last_name#58, c_preferred_cust_flag#59, c_birth_country#60, c_login#61, c_email_address#62, ws_ext_discount_amt#49, ws_ext_list_price#50, d_year#53]
-Input [12]: [ws_bill_customer_sk#48, ws_ext_discount_amt#49, ws_ext_list_price#50, d_year#53, c_customer_sk#55, c_customer_id#56, c_first_name#57, c_last_name#58, c_preferred_cust_flag#59, c_birth_country#60, c_login#61, c_email_address#62]
+Output [10]: [c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54, ws_ext_discount_amt#42, ws_ext_list_price#43, d_year#46]
+Input [12]: [ws_bill_customer_sk#41, ws_ext_discount_amt#42, ws_ext_list_price#43, d_year#46, c_customer_sk#47, c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54]
 
 (53) HashAggregate [codegen id : 23]
-Input [10]: [c_customer_id#56, c_first_name#57, c_last_name#58, c_preferred_cust_flag#59, c_birth_country#60, c_login#61, c_email_address#62, ws_ext_discount_amt#49, ws_ext_list_price#50, d_year#53]
-Keys [8]: [c_customer_id#56, c_first_name#57, c_last_name#58, c_preferred_cust_flag#59, c_birth_country#60, c_login#61, c_email_address#62, d_year#53]
-Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#49 as decimal(8,2)))), DecimalType(8,2), true)))]
-Aggregate Attributes [1]: [sum#63]
-Results [9]: [c_customer_id#56, c_first_name#57, c_last_name#58, c_preferred_cust_flag#59, c_birth_country#60, c_login#61, c_email_address#62, d_year#53, sum#64]
+Input [10]: [c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54, ws_ext_discount_amt#42, ws_ext_list_price#43, d_year#46]
+Keys [8]: [c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54, d_year#46]
+Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#43 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#42 as decimal(8,2)))), DecimalType(8,2), true)))]
+Aggregate Attributes [1]: [sum#55]
+Results [9]: [c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54, d_year#46, sum#56]
 
 (54) Exchange
-Input [9]: [c_customer_id#56, c_first_name#57, c_last_name#58, c_preferred_cust_flag#59, c_birth_country#60, c_login#61, c_email_address#62, d_year#53, sum#64]
-Arguments: hashpartitioning(c_customer_id#56, c_first_name#57, c_last_name#58, c_preferred_cust_flag#59, c_birth_country#60, c_login#61, c_email_address#62, d_year#53, 5), ENSURE_REQUIREMENTS, [id=#65]
+Input [9]: [c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54, d_year#46, sum#56]
+Arguments: hashpartitioning(c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54, d_year#46, 5), ENSURE_REQUIREMENTS, [plan_id=9]
 
 (55) HashAggregate [codegen id : 24]
-Input [9]: [c_customer_id#56, c_first_name#57, c_last_name#58, c_preferred_cust_flag#59, c_birth_country#60, c_login#61, c_email_address#62, d_year#53, sum#64]
-Keys [8]: [c_customer_id#56, c_first_name#57, c_last_name#58, c_preferred_cust_flag#59, c_birth_country#60, c_login#61, c_email_address#62, d_year#53]
-Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#49 as decimal(8,2)))), DecimalType(8,2), true)))]
-Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#49 as decimal(8,2)))), DecimalType(8,2), true)))#66]
-Results [2]: [c_customer_id#56 AS customer_id#67, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#50 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#49 as decimal(8,2)))), DecimalType(8,2), true)))#66,18,2) AS year_total#68]
+Input [9]: [c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54, d_year#46, sum#56]
+Keys [8]: [c_customer_id#48, c_first_name#49, c_last_name#50, c_preferred_cust_flag#51, c_birth_country#52, c_login#53, c_email_address#54, d_year#46]
+Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#43 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#42 as decimal(8,2)))), DecimalType(8,2), true)))]
+Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#43 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#42 as decimal(8,2)))), DecimalType(8,2), true)))#57]
+Results [2]: [c_customer_id#48 AS customer_id#58, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#43 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#42 as decimal(8,2)))), DecimalType(8,2), true)))#57,18,2) AS year_total#59]
 
 (56) Filter [codegen id : 24]
-Input [2]: [customer_id#67, year_total#68]
-Condition : (isnotnull(year_total#68) AND (year_total#68 > 0.00))
+Input [2]: [customer_id#58, year_total#59]
+Condition : (isnotnull(year_total#59) AND (year_total#59 > 0.00))
 
 (57) Project [codegen id : 24]
-Output [2]: [customer_id#67 AS customer_id#69, year_total#68 AS year_total#70]
-Input [2]: [customer_id#67, year_total#68]
+Output [2]: [customer_id#58 AS customer_id#60, year_total#59 AS year_total#61]
+Input [2]: [customer_id#58, year_total#59]
 
 (58) Exchange
-Input [2]: [customer_id#69, year_total#70]
-Arguments: hashpartitioning(customer_id#69, 5), ENSURE_REQUIREMENTS, [id=#71]
+Input [2]: [customer_id#60, year_total#61]
+Arguments: hashpartitioning(customer_id#60, 5), ENSURE_REQUIREMENTS, [plan_id=10]
 
 (59) Sort [codegen id : 25]
-Input [2]: [customer_id#69, year_total#70]
-Arguments: [customer_id#69 ASC NULLS FIRST], false, 0
+Input [2]: [customer_id#60, year_total#61]
+Arguments: [customer_id#60 ASC NULLS FIRST], false, 0
 
 (60) SortMergeJoin [codegen id : 26]
-Left keys [1]: [customer_id#22]
-Right keys [1]: [customer_id#69]
+Left keys [1]: [customer_id#19]
+Right keys [1]: [customer_id#60]
 Join condition: None
 
 (61) Project [codegen id : 26]
-Output [5]: [customer_id#22, year_total#23, customer_preferred_cust_flag#45, year_total#46, year_total#70]
-Input [6]: [customer_id#22, year_total#23, customer_preferred_cust_flag#45, year_total#46, customer_id#69, year_total#70]
+Output [5]: [customer_id#19, year_total#20, customer_preferred_cust_flag#39, year_total#40, year_total#61]
+Input [6]: [customer_id#19, year_total#20, customer_preferred_cust_flag#39, year_total#40, customer_id#60, year_total#61]
 
 (62) Scan parquet default.web_sales
-Output [4]: [ws_bill_customer_sk#72, ws_ext_discount_amt#73, ws_ext_list_price#74, ws_sold_date_sk#75]
+Output [4]: [ws_bill_customer_sk#62, ws_ext_discount_amt#63, ws_ext_list_price#64, ws_sold_date_sk#65]
 Batched: true
 Location: InMemoryFileIndex []
-PartitionFilters: [isnotnull(ws_sold_date_sk#75), dynamicpruningexpression(ws_sold_date_sk#75 IN dynamicpruning#29)]
+PartitionFilters: [isnotnull(ws_sold_date_sk#65), dynamicpruningexpression(ws_sold_date_sk#65 IN dynamicpruning#25)]
 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)>
 
 (63) ColumnarToRow [codegen id : 28]
-Input [4]: [ws_bill_customer_sk#72, ws_ext_discount_amt#73, ws_ext_list_price#74, ws_sold_date_sk#75]
+Input [4]: [ws_bill_customer_sk#62, ws_ext_discount_amt#63, ws_ext_list_price#64, ws_sold_date_sk#65]
 
 (64) Filter [codegen id : 28]
-Input [4]: [ws_bill_customer_sk#72, ws_ext_discount_amt#73, ws_ext_list_price#74, ws_sold_date_sk#75]
-Condition : isnotnull(ws_bill_customer_sk#72)
+Input [4]: [ws_bill_customer_sk#62, ws_ext_discount_amt#63, ws_ext_list_price#64, ws_sold_date_sk#65]
+Condition : isnotnull(ws_bill_customer_sk#62)
 
 (65) ReusedExchange [Reuses operator id: 89]
-Output [2]: [d_date_sk#76, d_year#77]
+Output [2]: [d_date_sk#66, d_year#67]
 
 (66) BroadcastHashJoin [codegen id : 28]
-Left keys [1]: [ws_sold_date_sk#75]
-Right keys [1]: [d_date_sk#76]
+Left keys [1]: [ws_sold_date_sk#65]
+Right keys [1]: [d_date_sk#66]
 Join condition: None
 
 (67) Project [codegen id : 28]
-Output [4]: [ws_bill_customer_sk#72, ws_ext_discount_amt#73, ws_ext_list_price#74, d_year#77]
-Input [6]: [ws_bill_customer_sk#72, ws_ext_discount_amt#73, ws_ext_list_price#74, ws_sold_date_sk#75, d_date_sk#76, d_year#77]
+Output [4]: [ws_bill_customer_sk#62, ws_ext_discount_amt#63, ws_ext_list_price#64, d_year#67]
+Input [6]: [ws_bill_customer_sk#62, ws_ext_discount_amt#63, ws_ext_list_price#64, ws_sold_date_sk#65, d_date_sk#66, d_year#67]
 
 (68) Exchange
-Input [4]: [ws_bill_customer_sk#72, ws_ext_discount_amt#73, ws_ext_list_price#74, d_year#77]
-Arguments: hashpartitioning(ws_bill_customer_sk#72, 5), ENSURE_REQUIREMENTS, [id=#78]
+Input [4]: [ws_bill_customer_sk#62, ws_ext_discount_amt#63, ws_ext_list_price#64, d_year#67]
+Arguments: hashpartitioning(ws_bill_customer_sk#62, 5), ENSURE_REQUIREMENTS, [plan_id=11]
 
 (69) Sort [codegen id : 29]
-Input [4]: [ws_bill_customer_sk#72, ws_ext_discount_amt#73, ws_ext_list_price#74, d_year#77]
-Arguments: [ws_bill_customer_sk#72 ASC NULLS FIRST], false, 0
+Input [4]: [ws_bill_customer_sk#62, ws_ext_discount_amt#63, ws_ext_list_price#64, d_year#67]
+Arguments: [ws_bill_customer_sk#62 ASC NULLS FIRST], false, 0
 
 (70) ReusedExchange [Reuses operator id: 12]
-Output [8]: [c_customer_sk#79, c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86]
+Output [8]: [c_customer_sk#68, c_customer_id#69, c_first_name#70, c_last_name#71, c_preferred_cust_flag#72, c_birth_country#73, c_login#74, c_email_address#75]
 
 (71) Sort [codegen id : 31]
-Input [8]: [c_customer_sk#79, c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86]
-Arguments: [c_customer_sk#79 ASC NULLS FIRST], false, 0
+Input [8]: [c_customer_sk#68, c_customer_id#69, c_first_name#70, c_last_name#71, c_preferred_cust_flag#72, c_birth_country#73, c_login#74, c_email_address#75]
+Arguments: [c_customer_sk#68 ASC NULLS FIRST], false, 0
 
 (72) SortMergeJoin [codegen id : 32]
-Left keys [1]: [ws_bill_customer_sk#72]
-Right keys [1]: [c_customer_sk#79]
+Left keys [1]: [ws_bill_customer_sk#62]
+Right keys [1]: [c_customer_sk#68]
 Join condition: None
 
 (73) Project [codegen id : 32]
-Output [10]: [c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86, ws_ext_discount_amt#73, ws_ext_list_price#74, d_year#77]
-Input [12]: [ws_bill_customer_sk#72, ws_ext_discount_amt#73, ws_ext_list_price#74, d_year#77, c_customer_sk#79, c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86]
+Output [10]: [c_customer_id#69, c_first_name#70, c_last_name#71, c_preferred_cust_flag#72, c_birth_country#73, c_login#74, c_email_address#75, ws_ext_discount_amt#63, ws_ext_list_price#64, d_year#67]
+Input [12]: [ws_bill_customer_sk#62, ws_ext_discount_amt#63, ws_ext_list_price#64, d_year#67, c_customer_sk#68, c_customer_id#69, c_first_name#70, c_last_name#71, c_preferred_cust_flag#72, c_birth_country#73, c_login#74, c_email_address#75]
 
 (74) HashAggregate [codegen id : 32]
-Input [10]: [c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86, ws_ext_discount_amt#73, ws_ext_list_price#74, d_year#77]
-Keys [8]: [c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86, d_year#77]
-Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#74 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#73 as decimal(8,2)))), DecimalType(8,2), true)))]
-Aggregate Attributes [1]: [sum#87]
-Results [9]: [c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86, d_year#77, sum#88]
+Input [10]: [c_customer_id#69, c_first_name#70, c_last_name#71, c_preferred_cust_flag#72, c_birth_country#73, c_login#74, c_email_address#75, ws_ext_discount_amt#63, ws_ext_list_price#64, d_year#67]
+Keys [8]: [c_customer_id#69, c_first_name#70, c_last_name#71, c_preferred_cust_flag#72, c_birth_country#73, c_login#74, c_email_address#75, d_year#67]
+Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#64 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#63 as decimal(8,2)))), DecimalType(8,2), true)))]
+Aggregate Attributes [1]: [sum#76]
+Results [9]: [c_customer_id#69, c_first_name#70, c_last_name#71, c_preferred_cust_flag#72, c_birth_country#73, c_login#74, c_email_address#75, d_year#67, sum#77]
 
 (75) Exchange
-Input [9]: [c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86, d_year#77, sum#88]
-Arguments: hashpartitioning(c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86, d_year#77, 5), ENSURE_REQUIREMENTS, [id=#89]
+Input [9]: [c_customer_id#69, c_first_name#70, c_last_name#71, c_preferred_cust_flag#72, c_birth_country#73, c_login#74, c_email_address#75, d_year#67, sum#77]
+Arguments: hashpartitioning(c_customer_id#69, c_first_name#70, c_last_name#71, c_preferred_cust_flag#72, c_birth_country#73, c_login#74, c_email_address#75, d_year#67, 5), ENSURE_REQUIREMENTS, [plan_id=12]
 
 (76) HashAggregate [codegen id : 33]
-Input [9]: [c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86, d_year#77, sum#88]
-Keys [8]: [c_customer_id#80, c_first_name#81, c_last_name#82, c_preferred_cust_flag#83, c_birth_country#84, c_login#85, c_email_address#86, d_year#77]
-Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#74 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#73 as decimal(8,2)))), DecimalType(8,2), true)))]
-Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#74 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#73 as decimal(8,2)))), DecimalType(8,2), true)))#66]
-Results [2]: [c_customer_id#80 AS customer_id#90, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#74 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#73 as decimal(8,2)))), DecimalType(8,2), true)))#66,18,2) AS year_total#91]
+Input [9]: [c_customer_id#69, c_first_name#70, c_last_name#71, c_preferred_cust_flag#72, c_birth_country#73, c_login#74, c_email_address#75, d_year#67, sum#77]
+Keys [8]: [c_customer_id#69, c_first_name#70, c_last_name#71, c_preferred_cust_flag#72, c_birth_country#73, c_login#74, c_email_address#75, d_year#67]
+Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#64 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#63 as decimal(8,2)))), DecimalType(8,2), true)))]
+Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#64 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#63 as decimal(8,2)))), DecimalType(8,2), true)))#57]
+Results [2]: [c_customer_id#69 AS customer_id#78, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#64 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#63 as decimal(8,2)))), DecimalType(8,2), true)))#57,18,2) AS year_total#79]
 
 (77) Exchange
-Input [2]: [customer_id#90, year_total#91]
-Arguments: hashpartitioning(customer_id#90, 5), ENSURE_REQUIREMENTS, [id=#92]
+Input [2]: [customer_id#78, year_total#79]
+Arguments: hashpartitioning(customer_id#78, 5), ENSURE_REQUIREMENTS, [plan_id=13]
 
 (78) Sort [codegen id : 34]
-Input [2]: [customer_id#90, year_total#91]
-Arguments: [customer_id#90 ASC NULLS FIRST], false, 0
+Input [2]: [customer_id#78, year_total#79]
+Arguments: [customer_id#78 ASC NULLS FIRST], false, 0
 
 (79) SortMergeJoin [codegen id : 35]
-Left keys [1]: [customer_id#22]
-Right keys [1]: [customer_id#90]
-Join condition: (CASE WHEN (year_total#70 > 0.00) THEN CheckOverflow((promote_precision(year_total#91) / promote_precision(year_total#70)), DecimalType(38,20), true) END > CASE WHEN (year_total#23 > 0.00) THEN CheckOverflow((promote_precision(year_total#46) / promote_precision(year_total#23)), DecimalType(38,20), true) END)
+Left keys [1]: [customer_id#19]
+Right keys [1]: [customer_id#78]
+Join condition: (CASE WHEN (year_total#61 > 0.00) THEN CheckOverflow((promote_precision(year_total#79) / promote_precision(year_total#61)), DecimalType(38,20), true) END > CASE WHEN (year_total#20 > 0.00) THEN CheckOverflow((promote_precision(year_total#40) / promote_precision(year_total#20)), DecimalType(38,20), true) END)
 
 (80) Project [codegen id : 35]
-Output [1]: [customer_preferred_cust_flag#45]
-Input [7]: [customer_id#22, year_total#23, customer_preferred_cust_flag#45, year_total#46, year_total#70, customer_id#90, year_total#91]
+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#61, customer_id#78, year_total#79]
 
 (81) TakeOrderedAndProject
-Input [1]: [customer_preferred_cust_flag#45]
-Arguments: 100, [customer_preferred_cust_flag#45 ASC NULLS FIRST], [customer_preferred_cust_flag#45]
+Input [1]: [customer_preferred_cust_flag#39]
+Arguments: 100, [customer_preferred_cust_flag#39 ASC NULLS FIRST], [customer_preferred_cust_flag#39]
 
 ===== Subqueries =====
 
@@ -473,9 +473,9 @@ Condition : ((isnotnull(d_year#7) AND (d_year#7 = 2001)) AND isnotnull(d_date_sk
 
 (85) BroadcastExchange
 Input [2]: [d_date_sk#6, d_year#7]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#93]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=14]
 
-Subquery:2 Hosting operator id = 22 Hosting Expression = ss_sold_date_sk#28 IN dynamicpruning#29
+Subquery:2 Hosting operator id = 22 Hosting Expression = ss_sold_date_sk#24 IN dynamicpruning#25
 BroadcastExchange (89)
 +- * Filter (88)
    +- * ColumnarToRow (87)
@@ -483,25 +483,25 @@ BroadcastExchange (89)
 
 
 (86) Scan parquet default.date_dim
-Output [2]: [d_date_sk#30, d_year#31]
+Output [2]: [d_date_sk#26, d_year#27]
 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>
 
 (87) ColumnarToRow [codegen id : 1]
-Input [2]: [d_date_sk#30, d_year#31]
+Input [2]: [d_date_sk#26, d_year#27]
 
 (88) Filter [codegen id : 1]
-Input [2]: [d_date_sk#30, d_year#31]
-Condition : ((isnotnull(d_year#31) AND (d_year#31 = 2002)) AND isnotnull(d_date_sk#30))
+Input [2]: [d_date_sk#26, d_year#27]
+Condition : ((isnotnull(d_year#27) AND (d_year#27 = 2002)) AND isnotnull(d_date_sk#26))
 
 (89) BroadcastExchange
-Input [2]: [d_date_sk#30, d_year#31]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#94]
+Input [2]: [d_date_sk#26, d_year#27]
+Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [plan_id=15]
 
-Subquery:3 Hosting operator id = 41 Hosting Expression = ws_sold_date_sk#51 IN dynamicpruning#5
+Subquery:3 Hosting operator id = 41 Hosting Expression = ws_sold_date_sk#44 IN dynamicpruning#5
 
-Subquery:4 Hosting operator id = 62 Hosting Expression = ws_sold_date_sk#75 IN dynamicpruning#29
+Subquery:4 Hosting operator id = 62 Hosting Expression = ws_sold_date_sk#65 IN dynamicpruning#25
 
 
diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt
index 6a4ddd1fcbf..1f3153b6f05 100644
--- a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt
+++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt
@@ -105,7 +105,7 @@ Condition : isnotnull(ss_customer_sk#9)
 
 (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), [id=#14]
+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]
@@ -117,305 +117,305 @@ Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_f
 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: 77]
-Output [2]: [d_date_sk#15, d_year#16]
+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#15]
+Right keys [1]: [d_date_sk#14]
 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#16]
-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#15, d_year#16]
+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#16]
-Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
+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(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))]
-Aggregate Attributes [1]: [sum#17]
-Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#18]
+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#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#18]
-Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), ENSURE_REQUIREMENTS, [id=#19]
+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#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#18]
-Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8]
+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(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))]
-Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))#20]
-Results [2]: [c_customer_id#2 AS customer_id#21, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))#20,18,2) AS year_total#22]
+Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))#18]
+Results [2]: [c_customer_id#2 AS customer_id#19, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))#18,18,2) AS year_total#20]
 
 (16) Filter [codegen id : 16]
-Input [2]: [customer_id#21, year_total#22]
-Condition : (isnotnull(year_total#22) AND (year_total#22 > 0.00))
+Input [2]: [customer_id#19, year_total#20]
+Condition : (isnotnull(year_total#20) AND (year_total#20 > 0.00))
 
 (17) Scan parquet default.customer
-Output [8]: [c_customer_sk#23, c_customer_id#24, c_first_name#25, c_last_name#26, c_preferred_cust_flag#27, c_birth_country#28, c_login#29, c_email_address#30]
+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) ColumnarToRow [codegen id : 6]
-Input [8]: [c_customer_sk#23, c_customer_id#24, c_first_name#25, c_last_name#26, c_preferred_cust_flag#27, c_birth_country#28, c_login#29, c_email_address#30]
+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]
 
 (19) Filter [codegen id : 6]
-Input [8]: [c_customer_sk#23, c_customer_id#24, c_first_name#25, c_last_name#26, c_preferred_cust_flag#27, c_birth_country#28, c_login#29, c_email_address#30]
-Condition : (isnotnull(c_customer_sk#23) AND isnotnull(c_customer_id#24))
+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))
 
 (20) Scan parquet default.store_sales
-Output [4]: [ss_customer_sk#31, ss_ext_discount_amt#32, ss_ext_list_price#33, ss_sold_date_sk#34]
+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#34), dynamicpruningexpression(ss_sold_date_sk#34 IN dynamicpruning#35)]
+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) ColumnarToRow [codegen id : 4]
-Input [4]: [ss_customer_sk#31, ss_ext_discount_amt#32, ss_ext_list_price#33, ss_sold_date_sk#34]
+Input [4]: [ss_customer_sk#29, ss_ext_discount_amt#30, ss_ext_list_price#31, ss_sold_date_sk#32]
 
 (22) Filter [codegen id : 4]
-Input [4]: [ss_customer_sk#31, ss_ext_discount_amt#32, ss_ext_list_price#33, ss_sold_date_sk#34]
-Condition : isnotnull(ss_customer_sk#31)
+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)
 
 (23) BroadcastExchange
-Input [4]: [ss_customer_sk#31, ss_ext_discount_amt#32, ss_ext_list_price#33, ss_sold_date_sk#34]
-Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#36]
+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#23]
-Right keys [1]: [ss_customer_sk#31]
+Left keys [1]: [c_customer_sk#21]
+Right keys [1]: [ss_customer_sk#29]
 Join condition: None
 
 (25) Project [codegen id : 6]
-Output [10]: [c_customer_id#24, c_first_name#25, c_last_name#26, c_preferred_cust_flag#27, c_birth_country#28, c_login#29, c_email_address#30, ss_ext_discount_amt#32, ss_ext_list_price#33, ss_sold_date_sk#34]
-Input [12]: [c_customer_sk#23, c_customer_id#24, c_first_name#25, c_last_name#26, c_preferred_cust_flag#27, c_birth_country#28, c_login#29, c_email_address#30, ss_customer_sk#31, ss_ext_discount_amt#32, ss_ext_list_price#33, ss_sold_date_sk#34]
+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: 81]
-Output [2]: [d_date_sk#37, d_year#38]
+Output [2]: [d_date_sk#34, d_year#35]
... 88136 lines suppressed ...


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org