sunchao commented on code in PR #57443:
URL: https://github.com/apache/spark/pull/57443#discussion_r3661733091
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryRelation.scala:
##########
@@ -257,10 +265,14 @@ case class CachedRDDBuilder(
storageLevel: StorageLevel,
@transient cachedPlan: SparkPlan,
tableName: Option[String],
- @transient logicalPlan: LogicalPlan) {
+ @transient logicalPlan: LogicalPlan,
+ isCachedLogicalPlanRepeatable: Boolean = false,
+ hasSelectivePredicate: Boolean = false,
+ fileSourceOptions: Seq[Map[String, String]] = Seq.empty) {
@transient @volatile private var _cachedColumnBuffers: RDD[CachedBatch] =
null
- @transient @volatile private var _cachedColumnBuffersAreLoaded: Boolean =
false
+ @volatile private var isCachedRDDRepeatable = false
+ private var hasStrictFileSourceReads = true
Review Comment:
Good catch. This was not intentional. Commit `e783e16ff6a` resets
`hasStrictFileSourceReads` in `clearCache`, so each `CachedRDDBuilder`
generation re-derives strictness. I also added a same-builder regression that
keeps the physical `FileScanRDD` strict, taints one generation with
`ignoreMissingFiles=true`, clears it, and verifies that the next strict
generation regains `isOutputRepeatable` and `statsAvailable`.
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/columnar/InMemoryRelation.scala:
##########
@@ -296,35 +312,34 @@ case class CachedRDDBuilder(
if (_cachedColumnBuffers != null) {
_cachedColumnBuffers.unpersist(blocking)
_cachedColumnBuffers = null
- // The buffers no longer back a live RDD. Reset the one-way "loaded"
latch and the keyed
- // bookkeeping so a rebuild on this builder does not inherit a stale
"loaded" state or stale
- // statistics. Safe to reset in place: every read of the accumulator is
under this monitor.
- _cachedColumnBuffersAreLoaded = false
- partitionStats.reset()
+ partitionStats = newPartitionStats()
}
+ isCachedRDDRepeatable = false
Review Comment:
Applied in `e783e16ff6a`. The reset is also covered by the same-builder
generation regression described in the other thread.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]