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 2019/05/09 14:04:48 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #24567: [SPARK-27638][SQL]: date format 'yyyy-M-dd' string comparison not handled properly

HyukjinKwon commented on a change in pull request #24567: [SPARK-27638][SQL]: date format 'yyyy-M-dd' string comparison not handled properly
URL: https://github.com/apache/spark/pull/24567#discussion_r282500625
 
 

 ##########
 File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
 ##########
 @@ -123,8 +123,8 @@ object TypeCoercion {
     // We should cast all relative timestamp/date/string comparison into string comparisons
     // This behaves as a user would expect because timestamp strings sort lexicographically.
     // i.e. TimeStamp(2013-01-01 00:00 ...) < "2014" = true
-    case (StringType, DateType) => Some(StringType)
-    case (DateType, StringType) => Some(StringType)
+    case (StringType, DateType) => Some(DateType)
+    case (DateType, StringType) => Some(DateType)
 
 Review comment:
   Doesn't this mean we always find the common type as date when any arbitrary strings are compared to any dates?

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


With regards,
Apache Git Services

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