-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-23614][SQL] Fix incorrect reuse exchange when caching is used #20831
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
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 | ||
|---|---|---|---|---|
|
|
@@ -24,6 +24,7 @@ import org.apache.spark.rdd.RDD | |||
| import org.apache.spark.sql.catalyst.InternalRow | ||||
| import org.apache.spark.sql.catalyst.analysis.MultiInstanceRelation | ||||
| import org.apache.spark.sql.catalyst.expressions._ | ||||
| import org.apache.spark.sql.catalyst.plans.QueryPlan | ||||
| import org.apache.spark.sql.catalyst.plans.logical | ||||
| import org.apache.spark.sql.catalyst.plans.logical.{HintInfo, Statistics} | ||||
| import org.apache.spark.sql.execution.SparkPlan | ||||
|
|
@@ -68,6 +69,15 @@ case class InMemoryRelation( | |||
|
|
||||
| override protected def innerChildren: Seq[SparkPlan] = Seq(child) | ||||
|
|
||||
| override def doCanonicalize(): logical.LogicalPlan = | ||||
| copy(output = output.map(QueryPlan.normalizeExprId(_, child.output)), | ||||
| storageLevel = StorageLevel.NONE, | ||||
| child = child.canonicalized, | ||||
| tableName = None)( | ||||
| _cachedColumnBuffers, | ||||
| sizeInBytesStats, | ||||
| statsOfPlanToCache) | ||||
|
Member
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. We need to copy these cached data?
Member
Author
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.
Member
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.
spark/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/hints.scala Line 44 in 3675af7
Member
Author
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.
Member
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. aha, ok. Thanks! |
||||
|
|
||||
| override def producedAttributes: AttributeSet = outputSet | ||||
|
|
||||
| @transient val partitionStatistics = new PartitionStatistics(output) | ||||
|
|
||||
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.
can we follow the parameter order in the constructor?
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.
It is followed. I just ignored
useCompression,batchSizeas they are just primitives and don't need to be canonicalized here.