Github user tejasapatil commented on a diff in the pull request: https://github.com/apache/spark/pull/14864#discussion_r78207613 --- Diff: sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala --- @@ -61,6 +62,51 @@ class JoinSuite extends QueryTest with SharedSQLContext { } } + test("SPARK-15453 : Sort Merge join on bucketed + sorted tables should not add `sort` step " + + "if the join predicates are subset of the sorted columns of the tables") { + withTable("SPARK_15453_table_a", "SPARK_15453_table_b") { + withSQLConf("spark.sql.autoBroadcastJoinThreshold" -> "0") { + val df = + (0 until 8) + .map(i => (i, i * 2, i.toString)) + .toDF("i", "j", "k") + .coalesce(1) + df.write.bucketBy(4, "j", "k").sortBy("j", "k").saveAsTable("SPARK_15453_table_a") --- End diff -- For SMB to happen, bucketing columns == sort columns == join keys. My naming for the test case was wrong. I have deleted this test as I found a better place to add this test.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org