Skip to content

Commit f99ba23

Browse files
committed
test: fall back to Spark for map array element shuffle on Spark 4.0
Spark 4.0 normalizes shuffle keys containing array<map> via transform(arr, x -> mapsort(x)), which Comet does not yet support because ArrayTransform with a lambda body has no serde. Mark the columnar shuffle on map array element test as expecting the fallback on Spark 4.0+ while still verifying answer correctness.
1 parent ae6237f commit f99ba23

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

spark/src/test/scala/org/apache/comet/exec/CometColumnarShuffleSuite.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import org.apache.spark.sql.internal.SQLConf
3939
import org.apache.spark.sql.types._
4040

4141
import org.apache.comet.CometConf
42+
import org.apache.comet.CometSparkSessionExtensions.isSpark40Plus
4243

4344
abstract class CometColumnarShuffleSuite extends CometTestBase with AdaptiveSparkPlanHelper {
4445
protected val adaptiveExecutionEnabled: Boolean
@@ -213,7 +214,11 @@ abstract class CometColumnarShuffleSuite extends CometTestBase with AdaptiveSpar
213214
.repartition(numPartitions, $"_1", $"_2")
214215
.sortWithinPartitions($"_2")
215216

216-
checkShuffleAnswer(df, 1)
217+
// Spark 4.0 normalizes shuffle keys containing array<map> via
218+
// transform(arr, x -> mapsort(x)), which Comet doesn't yet
219+
// support, so the shuffle falls back to Spark.
220+
val expectedShuffles = if (isSpark40Plus) 0 else 1
221+
checkShuffleAnswer(df, expectedShuffles)
217222
}
218223
}
219224
}

0 commit comments

Comments
 (0)