sunchao commented on a change in pull request #35243:
URL: https://github.com/apache/spark/pull/35243#discussion_r798249107



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
##########
@@ -248,7 +250,8 @@ case class StaticInvoke(
     arguments: Seq[Expression] = Nil,
     inputTypes: Seq[AbstractDataType] = Nil,
     propagateNull: Boolean = true,
-    returnNullable: Boolean = true) extends InvokeLike {
+    returnNullable: Boolean = true,
+    isDeterministic: Boolean = true) extends InvokeLike {

Review comment:
       I think this is a bug fix. A V2 catalog can return a function that's 
non-deterministic, while without the fix Spark can treat it as deterministic 
and apply related optimization rules (e.g., constant folding), which could 
cause correctness issues. 
   
   Since this is already in Spark 3.2.1, I don't see much benefit of reverting 
it and re-introduce the correctness issue. 




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