diff --git a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/execution/adaptive/DisableUnnecessaryPaimonBucketedScan.scala b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/execution/adaptive/DisableUnnecessaryPaimonBucketedScan.scala index db3c8fc692c21..a917e551906b1 100644 --- a/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/execution/adaptive/DisableUnnecessaryPaimonBucketedScan.scala +++ b/paimon-spark/paimon-spark-common/src/main/scala/org/apache/paimon/spark/execution/adaptive/DisableUnnecessaryPaimonBucketedScan.scala @@ -166,10 +166,7 @@ object DisableUnnecessaryPaimonBucketedScan extends Rule[SparkPlan] { case _ => false } - // TODO: replace it with `conf.v2BucketingEnabled` after dropping Spark3.1 - val v2BucketingEnabled = - conf.getConfString("spark.sql.sources.v2.bucketing.enabled", "false").toBoolean - if (!v2BucketingEnabled || !conf.autoBucketedScanEnabled || !hasBucketedScan) { + if (!conf.v2BucketingEnabled || !conf.autoBucketedScanEnabled || !hasBucketedScan) { plan } else { disableBucketScan(plan, hashInterestingPartitionOrOrder = false, hasExchange = false)