Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/6519#discussion_r35723805
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/TypeUtils.scala
---
@@ -33,11 +33,18 @@ object TypeUtils {
}
def checkForOrderingExpr(t: DataType, caller: String): TypeCheckResult =
{
- if (t.isInstanceOf[AtomicType] || t == NullType) {
- TypeCheckResult.TypeCheckSuccess
- } else {
- TypeCheckResult.TypeCheckFailure(s"$caller accepts non-complex
types, not $t")
+ t match {
+ case i: AtomicType => TypeCheckResult.TypeCheckSuccess
+ case n: NullType => TypeCheckResult.TypeCheckSuccess
+ case s: StructType =>
+ if (s.fields.exists(_.dataType.isInstanceOf[AtomicType])) {
--- End diff --
Should we do recursive check? Looks like in `RowOrdering`, we only compare
the fields if they are `AtomicType`. So I think we can't compare fields of
complex type currently.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]