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

    https://github.com/apache/spark/pull/8049#discussion_r36942767
  
    --- 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 --
    
    It's reverted by #8157. I think we can add casts over literals only when 
the casts don't introduce truncation?
    
    I reopened SPARK-9182. It's not a regression introduced in 1.5, do we need 
a blocker JIRA for 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