File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -98,9 +98,14 @@ trait CheckAnalysis {
9898
9999 aggregateExprs.foreach(checkValidAggregateExpression)
100100
101- case Sort (order, _, _) if ! order.forall(_.dataType.isInstanceOf [AtomicType ]) =>
102- val c = order.filterNot(_.dataType.isInstanceOf [AtomicType ]).head
103- failAnalysis(s " Sorting is not supported for columns of type ${c.dataType.simpleString}" )
101+ case Sort (orders, _, _) =>
102+ def checkValidSortOrder (order : SortOrder ): Unit = order.dataType match {
103+ case t : AtomicType => // OK
104+ case NullType => // OK
105+ case t =>
106+ failAnalysis(s " Sorting is not supported for columns of type ${t.simpleString}" )
107+ }
108+ orders.foreach(checkValidSortOrder)
104109
105110 case _ => // Fallbacks to the following checks
106111 }
You can’t perform that action at this time.
0 commit comments