cfmcgrady commented on a change in pull request #32488: URL: https://github.com/apache/spark/pull/32488#discussion_r630089007
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/UnwrapCastInBinaryComparison.scala ########## @@ -121,6 +122,17 @@ object UnwrapCastInBinaryComparison extends Rule[LogicalPlan] { if canImplicitlyCast(fromExp, toType, literalType) => simplifyNumericComparison(be, fromExp, toType, value) + case in @ In(Cast(fromExp, toType: NumericType, _), list) + if list.forall(v => + canImplicitlyCast(fromExp, toType, v.dataType) && v.isInstanceOf[Literal] + ) => + val newValueList = + list.map(lit => unwrapCast(EqualTo(in.value, lit))) + .collect { + case EqualTo(_, lit: Literal) => lit Review comment: updated. -- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org