steven-aerts commented on a change in pull request #35426:
URL: https://github.com/apache/spark/pull/35426#discussion_r801304946
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala
##########
@@ -388,18 +388,13 @@ case class ArraySort(
checkArgumentDataTypes() match {
case TypeCheckResult.TypeCheckSuccess =>
argument.dataType match {
- case ArrayType(dt, _) if RowOrdering.isOrderable(dt) =>
Review comment:
This is not working, as a map is (currently) not orderable.
With and without this patch this will fail with the following error:
```
> Seq((Array[Map[String, Int]](Map("a" -> 1), Map()), "x")).toDF("a",
"b").selectExpr("array_sort(a)")
org.apache.spark.sql.AnalysisException: cannot resolve
'(namedlambdavariable() < namedlambdavariable())' due to data type mismatch:
LessThan does not support ordering on type map<string,int>; line 1 pos 0;
```
Because this error message is emitted before the code flow can reach the
logic which is removed in this patch.
So as far as I can see, the removed logic can currently only be hit in cases
where it should work, hence the removal.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]