Skip to content

[SPARK-39437][SQL][TEST][3.3] Normalize plan id separately in PlanStabilitySuite #36854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -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]")
}

/**
Expand Down
42 changes: 21 additions & 21 deletions sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
38 changes: 19 additions & 19 deletions sql/core/src/test/resources/sql-tests/results/explain.sql.out
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
Loading