viirya commented on a change in pull request #25068: 
[SPARK-28156][SQL][BACKPORT-2.4] Self-join should not miss cached view
URL: https://github.com/apache/spark/pull/25068#discussion_r301146705
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala
 ##########
 @@ -148,6 +148,40 @@ object Cast {
     case _ => false
   }
 
+  /**
+   * Returns true iff we can safely up-cast the `from` type to `to` type 
without any truncating or
+   * precision lose or possible runtime failures. For example, long -> int, 
string -> int are not
+   * up-cast.
+   */
+  def canUpCast(from: DataType, to: DataType): Boolean = (from, to) match {
 
 Review comment:
   I think this should have some tests in the original PR. Should we backport 
them together? @cloud-fan @dongjoon-hyun 

----------------------------------------------------------------
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]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to