From 427fd741e95ff716d92c409423445b063d67dc71 Mon Sep 17 00:00:00 2001 From: brijrajk <22271048+brijrajk@users.noreply.github.com> Date: Fri, 26 Jun 2026 09:21:42 +0530 Subject: [PATCH] [UT][VL] Refresh TPC-H q19 plan stability golden file The ExprId normalizer in GlutenPlanStabilitySuite uses regex `#\d+` which inadvertently matches TPC-H string literals such as Brand#11, Brand#12, Brand#13 (p_brand values in q19's filter). Over the 264 commits since the golden file was added in #11805, new optimizer rules shifted the ExprId counter so Brand#12 now normalizes to Brand#6 and _pre_1#14 to _pre_1#13, causing a spurious plan mismatch. Regenerated by running GlutenTPCHPlanStabilitySuite with SPARK_GENERATE_GOLDEN_FILES=1. Only q19/explain.txt changes; simplified.txt and all other queries are unaffected. Verified: q19 fails on main without this fix (21/22); passes with it (22/22). Co-Authored-By: Claude Sonnet 4.6 --- .../q19/explain.txt | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/gluten-ut/spark40/src/test/resources/backends-velox/gluten-tpch-plan-stability/q19/explain.txt b/gluten-ut/spark40/src/test/resources/backends-velox/gluten-tpch-plan-stability/q19/explain.txt index f2bb8c87b15..094a217e4ea 100644 --- a/gluten-ut/spark40/src/test/resources/backends-velox/gluten-tpch-plan-stability/q19/explain.txt +++ b/gluten-ut/spark40/src/test/resources/backends-velox/gluten-tpch-plan-stability/q19/explain.txt @@ -35,12 +35,12 @@ Input [6]: [l_partkey#1, l_quantity#2, l_extendedprice#3, l_discount#4, l_shipin Output [4]: [p_partkey#7, p_brand#8, p_size#9, p_container#10] Batched: true Location: InMemoryFileIndex [{warehouse_dir}/part] -PushedFilters: [IsNotNull(p_size), GreaterThanOrEqual(p_size,1), IsNotNull(p_partkey), Or(Or(And(And(EqualTo(p_brand,Brand#11),In(p_container, [SM BOX,SM CASE,SM PACK,SM PKG])),LessThanOrEqual(p_size,5)),And(And(EqualTo(p_brand,Brand#12),In(p_container, [MED BAG,MED BOX,MED PACK,MED PKG])),LessThanOrEqual(p_size,10))),And(And(EqualTo(p_brand,Brand#13),In(p_container, [LG BOX,LG CASE,LG PACK,LG PKG])),LessThanOrEqual(p_size,15)))] +PushedFilters: [IsNotNull(p_size), GreaterThanOrEqual(p_size,1), IsNotNull(p_partkey), Or(Or(And(And(EqualTo(p_brand,Brand#11),In(p_container, [SM BOX,SM CASE,SM PACK,SM PKG])),LessThanOrEqual(p_size,5)),And(And(EqualTo(p_brand,Brand#6),In(p_container, [MED BAG,MED BOX,MED PACK,MED PKG])),LessThanOrEqual(p_size,10))),And(And(EqualTo(p_brand,Brand#12),In(p_container, [LG BOX,LG CASE,LG PACK,LG PKG])),LessThanOrEqual(p_size,15)))] ReadSchema: struct (5) FilterExecTransformer Input [4]: [p_partkey#7, p_brand#8, p_size#9, p_container#10] -Arguments: (((isnotnull(p_size#9) AND (p_size#9 >= 1)) AND isnotnull(p_partkey#7)) AND (((((p_brand#8 = Brand#11) AND p_container#10 IN (SM CASE,SM BOX,SM PACK,SM PKG)) AND (p_size#9 <= 5)) OR (((p_brand#8 = Brand#12) AND p_container#10 IN (MED BAG,MED BOX,MED PKG,MED PACK)) AND (p_size#9 <= 10))) OR (((p_brand#8 = Brand#13) AND p_container#10 IN (LG CASE,LG BOX,LG PACK,LG PKG)) AND (p_size#9 <= 15)))) +Arguments: (((isnotnull(p_size#9) AND (p_size#9 >= 1)) AND isnotnull(p_partkey#7)) AND (((((p_brand#8 = Brand#11) AND p_container#10 IN (SM CASE,SM BOX,SM PACK,SM PKG)) AND (p_size#9 <= 5)) OR (((p_brand#8 = Brand#6) AND p_container#10 IN (MED BAG,MED BOX,MED PKG,MED PACK)) AND (p_size#9 <= 10))) OR (((p_brand#8 = Brand#12) AND p_container#10 IN (LG CASE,LG BOX,LG PACK,LG PKG)) AND (p_size#9 <= 15)))) (6) WholeStageCodegenTransformer (1) Input [4]: [p_partkey#7, p_brand#8, p_size#9, p_container#10] @@ -60,48 +60,48 @@ Input [4]: [p_partkey#7, p_brand#8, p_size#9, p_container#10] Left keys [1]: [l_partkey#1] Right keys [1]: [p_partkey#7] Join type: Inner -Join condition: (((((((p_brand#8 = Brand#11) AND p_container#10 IN (SM CASE,SM BOX,SM PACK,SM PKG)) AND (l_quantity#2 >= 1)) AND (l_quantity#2 <= 11)) AND (p_size#9 <= 5)) OR (((((p_brand#8 = Brand#12) AND p_container#10 IN (MED BAG,MED BOX,MED PKG,MED PACK)) AND (l_quantity#2 >= 10)) AND (l_quantity#2 <= 20)) AND (p_size#9 <= 10))) OR (((((p_brand#8 = Brand#13) AND p_container#10 IN (LG CASE,LG BOX,LG PACK,LG PKG)) AND (l_quantity#2 >= 20)) AND (l_quantity#2 <= 30)) AND (p_size#9 <= 15))) +Join condition: (((((((p_brand#8 = Brand#11) AND p_container#10 IN (SM CASE,SM BOX,SM PACK,SM PKG)) AND (l_quantity#2 >= 1)) AND (l_quantity#2 <= 11)) AND (p_size#9 <= 5)) OR (((((p_brand#8 = Brand#6) AND p_container#10 IN (MED BAG,MED BOX,MED PKG,MED PACK)) AND (l_quantity#2 >= 10)) AND (l_quantity#2 <= 20)) AND (p_size#9 <= 10))) OR (((((p_brand#8 = Brand#12) AND p_container#10 IN (LG CASE,LG BOX,LG PACK,LG PKG)) AND (l_quantity#2 >= 20)) AND (l_quantity#2 <= 30)) AND (p_size#9 <= 15))) (11) ProjectExecTransformer -Output [1]: [(l_extendedprice#3 * (1 - l_discount#4)) AS _pre_1#14] +Output [1]: [(l_extendedprice#3 * (1 - l_discount#4)) AS _pre_1#13] Input [8]: [l_partkey#1, l_quantity#2, l_extendedprice#3, l_discount#4, p_partkey#7, p_brand#8, p_size#9, p_container#10] (12) FlushableHashAggregateExecTransformer -Input [1]: [_pre_1#14] +Input [1]: [_pre_1#13] Keys: [] -Functions [1]: [partial_sum(_pre_1#14)] -Aggregate Attributes [2]: [sum#15, isEmpty#16] -Results [2]: [sum#17, isEmpty#18] +Functions [1]: [partial_sum(_pre_1#13)] +Aggregate Attributes [2]: [sum#14, isEmpty#15] +Results [2]: [sum#16, isEmpty#17] (13) WholeStageCodegenTransformer (2) -Input [2]: [sum#17, isEmpty#18] +Input [2]: [sum#16, isEmpty#17] Arguments: false (14) VeloxResizeBatches -Input [2]: [sum#17, isEmpty#18] +Input [2]: [sum#16, isEmpty#17] Arguments: 1024, 2147483647, 10485760 (15) ColumnarExchange -Input [2]: [sum#17, isEmpty#18] +Input [2]: [sum#16, isEmpty#17] Arguments: SinglePartition, ENSURE_REQUIREMENTS, [plan_id=2], [shuffle_writer_type=hash] (16) InputAdapter -Input [2]: [sum#17, isEmpty#18] +Input [2]: [sum#16, isEmpty#17] (17) InputIteratorTransformer -Input [2]: [sum#17, isEmpty#18] +Input [2]: [sum#16, isEmpty#17] (18) RegularHashAggregateExecTransformer -Input [2]: [sum#17, isEmpty#18] +Input [2]: [sum#16, isEmpty#17] Keys: [] Functions [1]: [sum((l_extendedprice#3 * (1 - l_discount#4)))] -Aggregate Attributes [1]: [sum((l_extendedprice#3 * (1 - l_discount#4)))#19] -Results [1]: [sum((l_extendedprice#3 * (1 - l_discount#4)))#19 AS revenue#20] +Aggregate Attributes [1]: [sum((l_extendedprice#3 * (1 - l_discount#4)))#18] +Results [1]: [sum((l_extendedprice#3 * (1 - l_discount#4)))#18 AS revenue#19] (19) WholeStageCodegenTransformer (3) -Input [1]: [revenue#20] +Input [1]: [revenue#19] Arguments: false (20) VeloxColumnarToRow -Input [1]: [revenue#20] +Input [1]: [revenue#19]