chenhao-db commented on code in PR #45730:
URL: https://github.com/apache/spark/pull/45730#discussion_r1544103456


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala:
##########
@@ -537,6 +537,18 @@ trait CheckAnalysis extends PredicateHelper with 
LookupCatalog with QueryErrorsB
               }
             }
 
+          case Window(_, partitionSpec, _, _) =>
+            // Both `partitionSpec` and `orderSpec` must be orderable. We only 
need an extra check
+            // for `partitionSpec` here because `orderSpec` has the type check 
itself.
+            partitionSpec.foreach { p =>
+              if (!RowOrdering.isOrderable(p.dataType)) {
+                p.dataTypeMismatch(p, TypeCheckResult.DataTypeMismatch(
+                  errorSubClass = "INVALID_ORDERING_TYPE",

Review Comment:
   I cannot really tell the difference between these two error classes, so I 
just randomly picked one. Now I changed it into 
`EXPRESSION_TYPE_IS_NOT_ORDERABLE` instead.



-- 
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]

Reply via email to