andrej-db commented on code in PR #48621:
URL: https://github.com/apache/spark/pull/48621#discussion_r1816932019
##########
sql/core/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
@@ -221,8 +221,18 @@ class V2ExpressionBuilder(e: Expression, isPredicate:
Boolean = false) extends L
case _: BitwiseNot => generateExpressionWithName("~", expr, isPredicate)
case caseWhen @ CaseWhen(branches, elseValue) =>
val conditions = branches.map(_._1).flatMap(generateExpression(_, true))
- val values = branches.map(_._2).flatMap(generateExpression(_))
- val elseExprOpt = elseValue.flatMap(generateExpression(_))
+ val values = branches.map(_._2).flatMap(child =>
+ generateExpression(
+ child,
+ isPredicate && child.dataType.isInstanceOf[BooleanType]
Review Comment:
to ensure predicates are booleans always and that only predicates are
booleans?
--
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]