You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/08 17:07:59 UTC
[GitHub] [spark] gengliangwang commented on a change in pull request #32098: [SPARK-34881][SQL][FOLLOWUP] Implement toString() and sql() methods for TRY_CAST
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:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org