-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-36452][SQL]: Add the support in Spark for having group by map datatype column for the scenario that works in Hive #33679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,13 +97,18 @@ object InterpretedOrdering { | |
| object RowOrdering extends CodeGeneratorWithInterpretedFallback[Seq[SortOrder], BaseOrdering] { | ||
|
|
||
| /** | ||
| * Returns true iff the data type can be ordered (i.e. can be sorted). | ||
| * Returns true if the data type can be ordered (i.e. can be sorted). | ||
| */ | ||
| def isOrderable(dataType: DataType): Boolean = dataType match { | ||
| def isOrderable(dataType: DataType, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we fix #31967 first?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @HyukjinKwon - Thanks for checking this PR. Yes we can wait for this PR #32552. The fix in this will work with group by, order by , partition by in window. |
||
| isGroupingExpr: Boolean = false): Boolean = dataType match { | ||
| case NullType => true | ||
| case dt: AtomicType => true | ||
| case struct: StructType => struct.fields.forall(f => isOrderable(f.dataType)) | ||
| case array: ArrayType => isOrderable(array.elementType) | ||
| // Support MapType when the request comes from check | ||
| // analysis for the grouping expression | ||
| case map: MapType if isGroupingExpr => | ||
| isOrderable(map.keyType) && isOrderable(map.valueType) | ||
| case udt: UserDefinedType[_] => isOrderable(udt.sqlType) | ||
| case _ => false | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iff is an abbreviation of if and only if