pengbo commented on a change in pull request #24567: [SPARK-27638][SQL]: Cast 
string to date/timestamp in binary comparisons with dates/timestamps
URL: https://github.com/apache/spark/pull/24567#discussion_r283140489
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
 ##########
 @@ -120,11 +120,11 @@ object TypeCoercion {
    */
   private def findCommonTypeForBinaryComparison(
       dt1: DataType, dt2: DataType, conf: SQLConf): Option[DataType] = (dt1, 
dt2) match {
-    // We should cast all relative timestamp/date/string comparison into 
string comparisons
+    case (StringType, DateType) => Some(DateType)
 
 Review comment:
   Done. 
   Thanks for pointing it out. It simplifies the code a lot.

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


With regards,
Apache Git Services

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

Reply via email to