maropu commented on a change in pull request #26943: [SPARK-30298][SQL] Bucket
join should work for self-join with views
URL: https://github.com/apache/spark/pull/26943#discussion_r364191609
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala
##########
@@ -604,6 +604,25 @@ abstract class BucketedReadSuite extends QueryTest with
SQLTestUtils {
}
}
+ test("bucket join should work with SubqueryAlias plan") {
+ withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "0") {
+ withTable("t") {
+ withView("v") {
+ val df = (0 until 20).map(i => (i, i)).toDF("i", "j").as("df")
+ df.write.format("parquet").bucketBy(8, "i").saveAsTable("t")
+
+ sql("CREATE VIEW v AS SELECT * FROM t").collect()
+
+ val plan1 = sql("SELECT * FROM t a JOIN t b ON a.i =
b.i").queryExecution.executedPlan
+ assert(plan1.collect { case exchange: ShuffleExchangeExec =>
exchange }.isEmpty)
+
+ val plan2 = sql("SELECT * FROM t a JOIN v b ON a.i =
b.i").queryExecution.executedPlan
Review comment:
What does this test means? This test can improve the test coverage?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]