-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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
[SPARK-29375][SQL] Exchange reuse across all subquery levels #26044
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ case class ShuffleExchangeExec( | |
|
||
override def nodeName: String = "Exchange" | ||
|
||
private val serializer: Serializer = | ||
private lazy val serializer: Serializer = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar reasons for this change as above. This time the stacktrace is:
And if |
||
new UnsafeRowSerializer(child.output.size, longMetric("dataSize")) | ||
|
||
@transient lazy val inputRDD: RDD[InternalRow] = child.execute() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -470,7 +470,7 @@ class PlannerSuite extends SharedSparkSession { | |
Inner, | ||
None, | ||
shuffle, | ||
shuffle) | ||
shuffle.copy()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a plan contains the exact same instance of Exchange multiple times then it makes no sense to replace one of the instances to a ReusedExchange. |
||
|
||
val outputPlan = ReuseExchange(spark.sessionState.conf).apply(inputPlan) | ||
if (outputPlan.collect { case e: ReusedExchangeExec => true }.size != 1) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was required because this UT error:
where the stacktrace of the executor is:
Because this PR adds
lazy val canonicalized
toScalarSubquery
,EvalPythonExec
invoked canonicalization ofHashAggregateExec
on an executor where SparkSession is not available.Honestly I'm not sure how many other
SparkPlan
nodes exist that can't be canonocalized on an executor for similar reasons.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InSubqueryExec
already haslazy val canonicalized
defined so maybe this issue could come up without this PR in some DPP usecases.