cloud-fan commented on issue #27648: [SPARK-24994][SQL] : Support filter pushdown for short and byte without explicit casting URL: https://github.com/apache/spark/pull/27648#issuecomment-589567927 So the goal is to push down `cast(short_col as int) = int_literal`? I agree this can be a common case, but I think we should optimize this filter before data source filter push down. If the `int_literal` is beyond short range, then this predicate is either null (if the column is null) or false. So we can rewrite it to `If(IsNull(short_col), null, false)`. If the `int_literal` is within short range, we can rewrite it to `short_col = short_literal` by casting the int literal to short first. When we push down filters to data source, the predicates already get rid of the cast at the column side.
---------------------------------------------------------------- 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]
