From 1bde6ea56114507a2aa2526f22530c881288356e Mon Sep 17 00:00:00 2001 From: Kazuyuki Tanimura Date: Thu, 16 May 2024 10:25:55 -0700 Subject: [PATCH] address review comments --- .../comet/shims/ShimCometSparkSessionExtensions.scala | 7 +++++-- .../test/scala/org/apache/spark/sql/CometTestBase.scala | 4 +--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/spark/src/main/spark-3.x/org/apache/comet/shims/ShimCometSparkSessionExtensions.scala b/spark/src/main/spark-3.x/org/apache/comet/shims/ShimCometSparkSessionExtensions.scala index 22c567bb4..eb04c68ab 100644 --- a/spark/src/main/spark-3.x/org/apache/comet/shims/ShimCometSparkSessionExtensions.scala +++ b/spark/src/main/spark-3.x/org/apache/comet/shims/ShimCometSparkSessionExtensions.scala @@ -40,6 +40,11 @@ trait ShimCometSparkSessionExtensions { */ def getOffset(limit: LimitExec): Int = getOffsetOpt(limit).getOrElse(0) + /** + * TODO: delete after dropping Spark 3.x support and directly call + * SQLConf.EXTENDED_EXPLAIN_PROVIDERS.key + */ + protected val EXTENDED_EXPLAIN_PROVIDERS_KEY = "spark.sql.extendedExplainProviders" } object ShimCometSparkSessionExtensions { @@ -64,6 +69,4 @@ object ShimCometSparkSessionExtensions { } true } - - protected val EXTENDED_EXPLAIN_PROVIDERS_KEY = "spark.sql.extendedExplainProviders" } diff --git a/spark/src/test/scala/org/apache/spark/sql/CometTestBase.scala b/spark/src/test/scala/org/apache/spark/sql/CometTestBase.scala index 68905ac34..112d35b13 100644 --- a/spark/src/test/scala/org/apache/spark/sql/CometTestBase.scala +++ b/spark/src/test/scala/org/apache/spark/sql/CometTestBase.scala @@ -247,9 +247,7 @@ abstract class CometTestBase expectedInfo: Set[String]): Unit = { var expected: Array[Row] = Array.empty var dfSpark: Dataset[Row] = null - withSQLConf( - CometConf.COMET_ENABLED.key -> "false", - EXTENDED_EXPLAIN_PROVIDERS_KEY -> "") { + withSQLConf(CometConf.COMET_ENABLED.key -> "false", EXTENDED_EXPLAIN_PROVIDERS_KEY -> "") { dfSpark = Dataset.ofRows(spark, df.logicalPlan) expected = dfSpark.collect() }