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

    https://github.com/apache/spark/pull/8049#discussion_r36710695
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
 ---
    @@ -348,26 +348,76 @@ private[sql] object DataSourceStrategy extends 
Strategy with Logging {
             Some(sources.EqualTo(a.name, v))
           case expressions.EqualTo(Literal(v, _), a: Attribute) =>
             Some(sources.EqualTo(a.name, v))
    +      case expressions.EqualTo(Cast(a: Attribute, _), Literal(v, _))
    +        if a.dataType == DateType || a.dataType == TimestampType =>
    +          Some(sources.EqualTo(a.name, v))
    --- End diff --
    
    when we are comparing DateType column with a String literal, we could not 
cast the String literal value to DateType since it would `eval` to the inner 
representation of `DateType`, i.e. int, which means nothing for JDBC source.


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