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

    https://github.com/apache/spark/pull/8049#discussion_r36937531
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
 ---
    @@ -343,31 +343,57 @@ private[sql] object DataSourceStrategy extends 
Strategy with Logging {
        * and convert them.
        */
       protected[sql] def selectFilters(filters: Seq[Expression]) = {
    +    import CatalystTypeConverters._
    +
         def translate(predicate: Expression): Option[Filter] = predicate match 
{
           case expressions.EqualTo(a: Attribute, Literal(v, _)) =>
             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, _), l: Literal) =>
    +        Some(sources.EqualTo(a.name, convertToScala(Cast(l, 
a.dataType).eval(), a.dataType)))
    +      case expressions.EqualTo(l: Literal, Cast(a: Attribute, _)) =>
    +        Some(sources.EqualTo(a.name, convertToScala(Cast(l, 
a.dataType).eval(), a.dataType)))
    --- End diff --
    
    Its okay.  I'm glad we caught it.  Please do and open a blocker JIRA 
targeted at 1.5 so we don't miss merging it.


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