aokolnychyi commented on code in PR #51146:
URL: https://github.com/apache/spark/pull/51146#discussion_r2159761711


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/V2ExpressionBuilder.scala:
##########
@@ -78,6 +78,7 @@ class V2ExpressionBuilder(e: Expression, isPredicate: Boolean 
= false) extends L
       expr: Expression, isPredicate: Boolean = false): Option[V2Expression] = 
expr match {
     case Literal(true, BooleanType) => Some(new AlwaysTrue())
     case Literal(false, BooleanType) => Some(new AlwaysFalse())
+    case Cast(Literal(null, NullType), BooleanType, _, _) if isPredicate => 
Some(new AlwaysNull())

Review Comment:
   This is actually quite problematic, the same applies to default values. We 
should optimize/fold some of these expressions in the optimizer before 
converting to DSv2.



-- 
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]

Reply via email to