yhuang-db commented on code in PR #51505:
URL: https://github.com/apache/spark/pull/51505#discussion_r2430764055
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/aggregate/ApproxTopKAggregates.scala:
##########
@@ -317,8 +322,51 @@ object ApproxTopK {
def getSketchStateDataType(itemDataType: DataType): StructType =
StructType(
StructField("sketch", BinaryType, nullable = false) ::
+ StructField("maxItemsTracked", IntegerType, nullable = false) ::
StructField("itemDataType", itemDataType) ::
- StructField("maxItemsTracked", IntegerType, nullable = false) :: Nil)
+ StructField("itemDataTypeDDL", StringType, nullable = false) :: Nil)
+
+ def dataTypeToDDL(dataType: DataType): String = dataType match {
+ case _: StringType =>
+ // Hide collation information in DDL format
Review Comment:
It fails with the following error in
[CollationExpressionWalkerSuite.scala:674](https://github.com/apache/spark/blob/master/sql/core/src/test/scala/org/apache/spark/sql/collation/CollationExpressionWalkerSuite.scala#L674),
where it asserts the utf8BinaryResult should match with utf8LcaseResult.
> [info] - SPARK-48280: Expression Walker for codeGen generation *** FAILED
*** (38 seconds, 60 milliseconds)
> [info] ArraySeq("{[04 01 0a 03 03 00 00 00 01 00 00 00 00 00 00 00 01 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 0c 00 00 00
64 75 6d 6d 79 20 73 74 72 69 6e 67], 5, null, item string collate utf8_binary
not null}") did not equal ArraySeq("{[04 01 0a 03 03 00 00 00 01 00 00 00 00 00
00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00
0c 00 00 00 64 75 6d 6d 79 20 73 74 72 69 6e 67], 5, null, item string collate
utf8_lcase not null}") (CollationExpressionWalkerSuite.scala:674)
--
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]