HyukjinKwon commented on a change in pull request #27648: [SPARK-24994][SQL] : 
Support filter pushdown for short and byte without explicit casting
URL: https://github.com/apache/spark/pull/27648#discussion_r382487108
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/DataSourceStrategy.scala
 ##########
 @@ -443,31 +443,63 @@ object DataSourceStrategy {
     case expressions.EqualTo(Literal(v, t), a: Attribute) =>
       Some(sources.EqualTo(a.name, convertToScala(v, t)))
 
+    case expressions.EqualTo(Cast(c, dt, tz), Literal(v, t)) if 
c.isInstanceOf[Attribute] =>
+      Some(sources.EqualTo(c.asInstanceOf[Attribute].name, convertToScala(v, 
t)))
+    case expressions.EqualTo(Literal(v, t), Cast(c, dt, tz)) if 
c.isInstanceOf[Attribute] =>
+      Some(sources.EqualTo(c.asInstanceOf[Attribute].name, convertToScala(v, 
t)))
 
 Review comment:
   I don't think this is correct. It can potentially end up with a filter with 
having a different type of the value in the pushed filter.
   
   If you want to handle the cast, it will end up with the same fix as 
https://github.com/apache/spark/pull/8718 which was virtually rejected.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to