Uh oh!
There was an error while loading. Please reload this page.
[SPARK-23214][SQL] cached data should not carry extra hint info - #20394
[SPARK-23214][SQL] cached data should not carry extra hint info#20394cloud-fan wants to merge 2 commits into
Conversation
| // However, we also want to keep the hint info after cache lookup. Here we skip the hint | ||
| // node, so that the returned caching plan won't replace the hint node and drop the hint info | ||
| // from the original plan. | ||
| case hint: ResolvedHint => hint |
| tableName: Option[String])( | ||
| @transient var _cachedColumnBuffers: RDD[CachedBatch] = null, | ||
| val batchStats: LongAccumulator = child.sqlContext.sparkContext.longAccumulator, | ||
| val sizeInBytesStats: LongAccumulator = child.sqlContext.sparkContext.longAccumulator, |
There was a problem hiding this comment.
unrelated but this name is more accurate.
| val df1 = spark.createDataFrame(Seq((1, "4"), (2, "2"))).toDF("key", "value") | ||
| val df2 = spark.createDataFrame(Seq((1, "1"), (2, "2"))).toDF("key", "value") | ||
| val df1 = Seq((1, "4"), (2, "2")).toDF("key", "value") | ||
| val df2 = Seq((1, "1"), (2, "2")).toDF("key", "value") |
There was a problem hiding this comment.
some code style fixing
cloud-fan
commented
Jan 25, 2018
SparkQA
commented
Jan 25, 2018
Test build #86637 has finished for PR 20394 at commit
|
| @transient var _cachedColumnBuffers: RDD[CachedBatch] = null, | ||
| val batchStats: LongAccumulator = child.sqlContext.sparkContext.longAccumulator, | ||
| val sizeInBytesStats: LongAccumulator = child.sqlContext.sparkContext.longAccumulator, | ||
| statsOfPlanToCache: Statistics = null) |
CodingCat
commented
Jan 25, 2018
LGTM |
| }.getOrElse(currentFragment) | ||
| lookupCachedData(currentFragment) | ||
| .map(_.cachedRepresentation.withOutput(currentFragment.output)) | ||
| .getOrElse(currentFragment) |
| // returned by cache lookup should not have hint info. If we lookup the cache with a | ||
| // semantically same plan with a different hint info, `CacheManager.useCachedData` will take | ||
| // care of it and retain the hint info in the lookup input plan. | ||
| statsOfPlanToCache.copy(hints = HintInfo()) |
There was a problem hiding this comment.
I am not sure I agree with this. If we cache a plan with a hint, then it is reasonable to expect that the hint is still in the plan. We do the same with temporary views.
There was a problem hiding this comment.
This is a new behavior we introduced in 2.3. I will first keep the behavior unchanged and merge it to 2.3.
We can have more discussion in the next release.
SparkQA
commented
Jan 25, 2018
Test build #86643 has finished for PR 20394 at commit
|
gatorsmile
commented
Jan 27, 2018
LGTM Thanks! Merged to master/2.3 |
## What changes were proposed in this pull request? This is a regression introduced by #19864 When we lookup cache, we should not carry the hint info, as this cache entry might be added by a plan having hint info, while the input plan for this lookup may not have hint info, or have different hint info. ## How was this patch tested? a new test. Author: Wenchen Fan <wenchen@databricks.com> Closes#20394 from cloud-fan/cache. (cherry picked from commit 5b5447c) Signed-off-by: gatorsmile <gatorsmile@gmail.com>
What changes were proposed in this pull request?
This is a regression introduced by #19864
When we lookup cache, we should not carry the hint info, as this cache entry might be added by a plan having hint info, while the input plan for this lookup may not have hint info, or have different hint info.
How was this patch tested?
a new test.