cloud-fan commented on a change in pull request #33698:
URL: https://github.com/apache/spark/pull/33698#discussion_r686580428
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ExplainSuite.scala
##########
@@ -677,6 +677,33 @@ class ExplainSuiteAE extends ExplainSuiteHelper with EnableAdaptiveExecutionSuit
}
}
}
+
+ test("SPARK-32986: Bucketed scan info should be a part of explain string") {
+ withTable("t1", "t2") {
+ Seq((1, 2), (2, 3)).toDF("i", "j").write.bucketBy(8, "i").saveAsTable("t1")
+ Seq(2, 3).toDF("i").write.bucketBy(8, "i").saveAsTable("t2")
+ val df1 = spark.table("t1")
+ val df2 = spark.table("t2")
+
+ withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "0") {
+ checkKeywordsExistsInExplain(
+ df1.join(df2, df1("i") === df2("i")),
+ "Bucketed: true" :: Nil: _*)
Review comment:
nit: `"Bucketed: true" :: Nil: _*` -> `"Bucketed: true"`?
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ExplainSuite.scala
##########
@@ -677,6 +677,33 @@ class ExplainSuiteAE extends ExplainSuiteHelper with EnableAdaptiveExecutionSuit
}
}
}
+
+ test("SPARK-32986: Bucketed scan info should be a part of explain string") {
+ withTable("t1", "t2") {
+ Seq((1, 2), (2, 3)).toDF("i", "j").write.bucketBy(8, "i").saveAsTable("t1")
+ Seq(2, 3).toDF("i").write.bucketBy(8, "i").saveAsTable("t2")
+ val df1 = spark.table("t1")
+ val df2 = spark.table("t2")
+
+ withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "0") {
+ checkKeywordsExistsInExplain(
+ df1.join(df2, df1("i") === df2("i")),
+ "Bucketed: true" :: Nil: _*)
+ }
+
+ withSQLConf(SQLConf.BUCKETING_ENABLED.key -> "false") {
+ checkKeywordsExistsInExplain(
+ df1.join(df2, df1("i") === df2("i")),
+ "Bucketed: false (disabled by configuration)" :: Nil: _*)
Review comment:
ditto
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/ExplainSuite.scala
##########
@@ -677,6 +677,33 @@ class ExplainSuiteAE extends ExplainSuiteHelper with EnableAdaptiveExecutionSuit
}
}
}
+
+ test("SPARK-32986: Bucketed scan info should be a part of explain string") {
+ withTable("t1", "t2") {
+ Seq((1, 2), (2, 3)).toDF("i", "j").write.bucketBy(8, "i").saveAsTable("t1")
+ Seq(2, 3).toDF("i").write.bucketBy(8, "i").saveAsTable("t2")
+ val df1 = spark.table("t1")
+ val df2 = spark.table("t2")
+
+ withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "0") {
+ checkKeywordsExistsInExplain(
+ df1.join(df2, df1("i") === df2("i")),
+ "Bucketed: true" :: Nil: _*)
+ }
+
+ withSQLConf(SQLConf.BUCKETING_ENABLED.key -> "false") {
+ checkKeywordsExistsInExplain(
+ df1.join(df2, df1("i") === df2("i")),
+ "Bucketed: false (disabled by configuration)" :: Nil: _*)
+ }
+
+ checkKeywordsExistsInExplain(df1, "Bucketed: false (disabled by query planner)" :: Nil: _*)
Review comment:
ditto
--
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