stefankandic commented on code in PR #46083:
URL: https://github.com/apache/spark/pull/46083#discussion_r1568655624
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/util/SchemaUtils.scala:
##########
@@ -303,4 +303,35 @@ private[spark] object SchemaUtils {
case _ => false
}
}
+
+ /**
+ * Replaces any collated string type with non collated StringType
+ * recursively in the given schema.
+ */
+ def replaceCollatedStringWithStringInSchema(schema: StructType): StructType
= {
+ StructType(schema.map { field =>
+ if (hasNonBinarySortableCollatedString(field.dataType)) {
Review Comment:
when a wrote this method a while back it was called
`hasNonDefaultCollatedString` and the logic was `collationId != 0`. However
the name and logic were changed a while back by @mihailom-db when he introduced
a concept of default collation (session collation).
All in all, method here should be used for exactly this use-case but we
revisit naming/logic of it separately
--
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]