cloud-fan commented on a change in pull request #30586:
URL: https://github.com/apache/spark/pull/30586#discussion_r535915809
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/CharVarcharUtils.scala
##########
@@ -69,6 +80,21 @@ object CharVarcharUtils {
case _ => dt
}
+ /**
+ * Replaces CharType/VarcharType with StringType recursively in the given
data type, with a
+ * warning message if it has char or varchar types
+ */
+ def logWarningAndReplaceCharVarcharWithString(dt: DataType): DataType = {
+ if (hasCharVarchar(dt)) {
+ logWarning("In Spark 3.0 and earlier, char/varchar is as same as string
type, since" +
Review comment:
`The Spark cast operator does not support char/varchar type and simply
treat them as string type. Please use string type directly to avoid confusion.`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]