File tree Expand file tree Collapse file tree
spark/src/main/spark-4.0/org/apache/comet/shims Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020package org .apache .comet .shims
2121
2222import org .apache .spark .sql .catalyst .expressions ._
23+ // Import MapSort for Spark 4.0 support
24+ import org .apache .spark .sql .catalyst .expressions .MapSort
2325import org .apache .spark .sql .catalyst .expressions .objects .StaticInvoke
2426import org .apache .spark .sql .internal .SQLConf
2527import 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 ] &&
You can’t perform that action at this time.
0 commit comments