cloud-fan commented on a change in pull request #30440:
URL: https://github.com/apache/spark/pull/30440#discussion_r530075609



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
##########
@@ -98,6 +98,19 @@ object Cast {
     case _ => false
   }
 
+  def typeCheckFailureMessage(from: DataType, to: DataType): String = (from, 
to) match {
+    case (_: NumericType, TimestampType) =>
+      // scalastyle:off line.size.limit
+      s"""
+         | cannot cast ${from.catalogString} to ${to.catalogString},
+         | you can enable the casting by setting 
${SQLConf.LEGACY_ALLOW_CAST_NUMERIC_TO_TIMESTAMP.key}

Review comment:
       Can we do it first? then we don't need to change this part again.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to