wangyum commented on code in PR #40360:
URL: https://github.com/apache/spark/pull/40360#discussion_r1133032223
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/UnwrapCastInBinaryComparison.scala:
##########
@@ -141,14 +141,14 @@ object UnwrapCastInBinaryComparison extends
Rule[LogicalPlan] {
// 2. this rule only handles the case when both `fromExp` and value in
`in.list` are of numeric
// type.
// 3. this rule doesn't optimize In when `in.list` contains an expression
that is not literal.
- case in @ In(Cast(fromExp, toType: NumericType, _, _), list @
Seq(firstLit, _*))
+ case in @ In(Cast(fromExp, toType: NumericType, tz, mode), list @
Seq(firstLit, _*))
if canImplicitlyCast(fromExp, toType, firstLit.dataType) &&
in.inSetConvertible =>
val buildIn = {
(nullList: ArrayBuffer[Literal], canCastList: ArrayBuffer[Literal]) =>
// cast null value to fromExp.dataType, to make sure the new return
list is in the same
// data type.
- val newList = nullList.map(lit => Cast(lit, fromExp.dataType)) ++
canCastList
+ val newList = nullList.map(lit => Cast(lit, fromExp.dataType, tz,
mode)) ++ canCastList
Review Comment:
Add `tz`, `mode` makes the test pass.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]