ammarchalifah commented on code in PR #60334:
URL: https://github.com/apache/spark/pull/60334#discussion_r4539795406


##########
sql/core/src/test/scala/org/apache/spark/sql/connector/KeyGroupedPartitioningSuite.scala:
##########
@@ -4581,6 +4581,36 @@ class KeyGroupedPartitioningSuite extends 
DistributionAndOrderingSuiteBase {
     }
   }
 
+  test("SPARK-60460: nested SPJ shuffles when compatible transforms share 
partition values") {
+    val idCol = Array(Column.create("id", LongType))
+    createTable("pa12", idCol, Array(bucket(12, "id")))
+    createTable("pd", idCol, Array.empty)
+    createTable("pb8", idCol, Array(bucket(8, "id")))
+    // 12 is bucket 0 on pa12 and bucket 4 on pb8. The other ids make both 
scans report 0-7.
+    val ids = (0L to 7L) :+ 12L
+    Seq("pa12", "pd", "pb8").foreach { t =>
+      sql(s"INSERT INTO testcat.ns.$t VALUES ${ids.map(i => 
s"($i)").mkString(", ")}")
+    }
+
+    Seq(true, false).foreach { aqe =>
+      withSQLConf(
+        SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1",
+        SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> aqe.toString,
+        SQLConf.V2_BUCKETING_SHUFFLE_ENABLED.key -> "true",
+        SQLConf.V2_BUCKETING_ALLOW_COMPATIBLE_TRANSFORMS.key -> "true") {
+        val df = sql(
+          """
+            |SELECT /*+ MERGE(pa12, pd, pb8) */ pa12.id, pd.id, pb8.id

Review Comment:
   Addressed, pushed a commit



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to