You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "cloud-fan (via GitHub)" <gi...@apache.org> on 2023/09/18 16:01:45 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #42983: [SPARK-45203][SQL][TEST] Join tests in KeyGroupedPartitioningSuite should use merge join hint

cloud-fan commented on code in PR #42983:
URL: https://github.com/apache/spark/pull/42983#discussion_r1328953373


##########
sql/core/src/test/scala/org/apache/spark/sql/connector/KeyGroupedPartitioningSuite.scala:
##########
@@ -44,25 +45,9 @@ class KeyGroupedPartitioningSuite extends DistributionAndOrderingSuiteBase {
     UnboundBucketFunction,
     UnboundTruncateFunction)
 
-  private var originalV2BucketingEnabled: Boolean = false
-  private var originalAutoBroadcastJoinThreshold: Long = -1
-
-  override def beforeAll(): Unit = {
-    super.beforeAll()
-    originalV2BucketingEnabled = conf.getConf(V2_BUCKETING_ENABLED)
-    conf.setConf(V2_BUCKETING_ENABLED, true)
-    originalAutoBroadcastJoinThreshold = conf.getConf(AUTO_BROADCASTJOIN_THRESHOLD)
-    conf.setConf(AUTO_BROADCASTJOIN_THRESHOLD, -1L)
-  }
-
-  override def afterAll(): Unit = {
-    try {
-      super.afterAll()
-    } finally {
-      conf.setConf(V2_BUCKETING_ENABLED, originalV2BucketingEnabled)
-      conf.setConf(AUTO_BROADCASTJOIN_THRESHOLD, originalAutoBroadcastJoinThreshold)
-    }
-  }
+  override def sparkConf: SparkConf = super.sparkConf
+    .set(V2_BUCKETING_ENABLED, true)

Review Comment:
   not quite related, but this is a much simpler way to set per-suite configs.



-- 
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