Github user jinxing64 commented on a diff in the pull request:
https://github.com/apache/spark/pull/22712#discussion_r225628985
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/ordering.scala
---
@@ -53,6 +53,10 @@ class InterpretedOrdering(ordering: Seq[SortOrder])
extends Ordering[InternalRow
a.interpretedOrdering.asInstanceOf[Ordering[Any]].compare(left, right)
case a: ArrayType if order.direction == Descending =>
a.interpretedOrdering.asInstanceOf[Ordering[Any]].reverse.compare(left, right)
+ case m: MapType if m.isOrdered && order.direction == Ascending =>
+
m.interpretedOrdering.asInstanceOf[Ordering[Any]].compare(left, right)
+ case m: MapType if m.isOrdered && order.direction == Descending
=>
+
m.interpretedOrdering.asInstanceOf[Ordering[Any]].reverse.compare(left, right)
--- End diff --
Actually, this is not necessary, but just to make the logic complete.
https://github.com/apache/spark/pull/9718 did the same thing.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]