stefankandic commented on code in PR #48436:
URL: https://github.com/apache/spark/pull/48436#discussion_r1803552210
##########
sql/api/src/main/scala/org/apache/spark/sql/types/StringType.scala:
##########
@@ -106,3 +109,20 @@ case object StringType extends StringType(0) {
new StringType(collationId)
}
}
+
+/**
+ * The result type of literals, column definitions without explicit collation,
casts to string
+ * and some expressions that produce strings but whose output type is not
based on the types of its
+ * children.
+ * Idea is to have this behave like a string with the default collation of the
session, but that
+ * we can still differentiate it from a regular string type, because in some
places default string
+ * is not the one with the session collation (e.g. in DDL commands).
+ */
+private[spark] class DefaultStringType extends StringType(0) {
Review Comment:
Exactly, it should be replaced in the analyzer for DDL operations; for
others it should just behave as the underlying session collation. I spent some
time thinking about it and haven't been able to figure out a better solution
for this, but let me know if you think something else might work better.
I added the special id as requested.
--
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]