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

    https://github.com/apache/spark/pull/2084#discussion_r16828221
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/HiveTypeCoercion.scala
 ---
    @@ -218,11 +218,18 @@ trait HiveTypeCoercion {
           case a: BinaryArithmetic if a.right.dataType == StringType =>
             a.makeCopy(Array(a.left, Cast(a.right, DoubleType)))
     
    +      case p: BinaryPredicate if p.left.dataType == TimestampType
    +        && p.right.dataType == StringType =>
    +        p.makeCopy(Array(p.left, Cast(p.right, TimestampType)))
    +
           case p: BinaryPredicate if p.left.dataType == StringType && 
p.right.dataType != StringType =>
             p.makeCopy(Array(Cast(p.left, DoubleType), p.right))
           case p: BinaryPredicate if p.left.dataType != StringType && 
p.right.dataType == StringType =>
             p.makeCopy(Array(p.left, Cast(p.right, DoubleType)))
     
    +      case i@In(a,b) if a.dataType == TimestampType && 
b.forall(_.dataType==StringType) =>
    --- End diff --
    
    That's what the `forall` condition does, doesn't it. If the left expression 
is Timestamp and all the right expression elements are String, only then 
promote the strings into timestamps.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to