Github user dilipbiswal commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16954#discussion_r103359052
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala
 ---
    @@ -109,6 +109,26 @@ object TypeCoercion {
       }
     
       /**
    +   * This function determines the target type of a comparison operator 
when one operand
    +   * is a String and the other is not. It also handles when one op is a 
Date and the
    +   * other is a Timestamp by making the target type to be String. 
Currently this is used
    +   * to coerce types between LHS and RHS of the IN expression.
    +   */
    +  val findCommonTypeForBinaryComparison: (DataType, DataType) => 
Option[DataType] = {
    +    case (StringType, DateType) => Some(StringType)
    +    case (DateType, StringType) => Some(StringType)
    +    case (StringType, TimestampType) => Some(StringType)
    +    case (TimestampType, StringType) => Some(StringType)
    +    case (TimestampType, DateType) => Some(StringType)
    --- End diff --
    
    @hvanhovell Here is where i saw the code that handles the promotion between 
date and timestamp types.
    
https://github.com/dilipbiswal/spark/blob/33844bb8c6e72c35e12a7ea9f124ad3c6b8bd43c/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala#L347:L360
    Please let me know if i missed something here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to