Skip to content

Commit 89b81ff

Browse files
committed
format
1 parent d4f5c04 commit 89b81ff

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

spark/src/main/spark-4.0/org/apache/comet/shims/CometExprShim.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
package org.apache.comet.shims
2121

2222
import org.apache.spark.sql.catalyst.expressions._
23+
// Import MapSort for Spark 4.0 support
24+
import org.apache.spark.sql.catalyst.expressions.MapSort
2325
import org.apache.spark.sql.catalyst.expressions.objects.StaticInvoke
2426
import org.apache.spark.sql.internal.SQLConf
2527
import org.apache.spark.sql.internal.types.StringTypeWithCollation
@@ -55,6 +57,11 @@ trait CometExprShim extends CommonStringExprs {
5557
inputs: Seq[Attribute],
5658
binding: Boolean): Option[Expr] = {
5759
expr match {
60+
// MapSort is used by Spark 4.0+ to make maps comparable for partitioning.
61+
// For hash partitioning, we can just use the underlying map expression.
62+
case MapSort(child) =>
63+
exprToProtoInternal(child, inputs, binding)
64+
5865
case s: StaticInvoke
5966
if s.staticObject == classOf[StringDecode] &&
6067
s.dataType.isInstanceOf[StringType] &&

0 commit comments

Comments
 (0)