You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "ulysses-you (via GitHub)" <gi...@apache.org> on 2023/08/22 01:21:56 UTC

[GitHub] [spark] ulysses-you commented on a diff in pull request #40390: [SPARK-42768][SQL] Enable cached plan apply AQE by default

ulysses-you commented on code in PR #40390:
URL: https://github.com/apache/spark/pull/40390#discussion_r1300804182


##########
sql/core/src/test/scala/org/apache/spark/sql/sources/DisableUnnecessaryBucketedScanSuite.scala:
##########
@@ -244,7 +244,8 @@ abstract class DisableUnnecessaryBucketedScanSuite
 
   test("SPARK-33075: not disable bucketed table scan for cached query") {

Review Comment:
   addressed



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala:
##########
@@ -395,7 +395,10 @@ class CacheManager extends Logging with AdaptiveSparkPlanHelper {
    */
   private def getOrCloneSessionWithConfigsOff(session: SparkSession): SparkSession = {
     if (session.conf.get(SQLConf.CAN_CHANGE_CACHED_PLAN_OUTPUT_PARTITIONING)) {
-      session
+      // Bucketed scan only has one time overhead but can have multi-times benefits in cache,
+      // so we always do bucketed scan in a cached plan.
+      SparkSession.getOrCloneSessionWithConfigsOff(
+        session, SQLConf.AUTO_BUCKETED_SCAN_ENABLED :: Nil)

Review Comment:
   addressed



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org