gengliangwang commented on a change in pull request #32098:
URL: https://github.com/apache/spark/pull/32098#discussion_r609914997
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/TryCast.scala
##########
@@ -84,4 +84,14 @@ case class TryCast(child: Expression, dataType: DataType,
timeZoneId: Option[Str
override def typeCheckFailureMessage: String =
AnsiCast.typeCheckFailureMessage(child.dataType, dataType, None, None)
+
+ override def toString: String = {
+ s"try_cast($child as ${dataType.simpleString})"
+ }
+
+ override def sql: String = dataType match {
+ case _: ArrayType | _: MapType | _: StructType => child.sql
Review comment:
Talked to @cloud-fan offline. Actually, we don't need this legacy
special handling.
--
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]