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 <gi...@git.apache.org> on 2017/11/17 15:38:47 UTC
[GitHub] spark pull request #19257: [SPARK-22042] [SQL] ReorderJoinPredicates can bre...
Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/19257#discussion_r151714611
--- Diff: sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala ---
@@ -602,6 +602,28 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils {
)
}
+ test("SPARK-22042 ReorderJoinPredicates can break when child's partitioning is not decided") {
+ withTable("bucketed_table", "table1", "table2") {
+ df.write.format("parquet").saveAsTable("table1")
+ df.write.format("parquet").saveAsTable("table2")
+ df.write.format("parquet").bucketBy(8, "j", "k").saveAsTable("bucketed_table")
+
+ withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "0") {
+ sql("""
+ |SELECT *
+ |FROM (
+ | SELECT a.i, a.j, a.k
+ | FROM bucketed_table a
+ | JOIN table1 b
+ | ON a.i = b.i
+ |) c
+ |JOIN table2
+ |ON c.i = table2.i
+ |""".stripMargin).explain()
--- End diff --
use checkAnswer instead of explain in the test
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org