daniilgrbic commented on code in PR #59227:
URL: https://github.com/apache/spark/pull/59227#discussion_r4228175660
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
@@ -238,15 +245,11 @@ class V2ExpressionBuilder(e: Expression, isPredicate:
Boolean = false) extends L
} else {
None
}
- case Not(child) => generateExpression(child, true) // NOT expects predicate
- .map { v =>
- assert(v.isInstanceOf[V2Predicate])
- new V2Not(v.asInstanceOf[V2Predicate])
- }
+ case Not(child) => generatePredicate(child).map(new V2Not(_))
case UnaryMinus(_, true) => generateExpressionWithName("-", expr,
isPredicate)
case _: BitwiseNot => generateExpressionWithName("~", expr, isPredicate)
case caseWhen @ CaseWhen(branches, elseValue) =>
- val conditions = branches.map(_._1).flatMap(generateExpression(_, true))
+ val conditions = branches.map(_._1).flatMap(generatePredicate)
Review Comment:
@uros-b Thanks for the review. I have reverted the change for case...when in
the interest of keeping the scope as small as possible.
--
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]