cloud-fan commented on code in PR #42450:
URL: https://github.com/apache/spark/pull/42450#discussion_r1300862257


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Expression.scala:
##########
@@ -368,6 +368,15 @@ abstract class Expression extends TreeNode[Expression] {
     } else {
       ""
     }
+
+
+  def supportWholeStageCodegen(): Boolean = {
+    this.getClass.getDeclaredMethods.exists(_.getName == "nullSafeEval") &&

Review Comment:
   I said this works. `nullsafeEval` is not designed for this purpose and I 
think it's fair to say this solution is hacky. You happened to find a way to 
use `nullsafeEval` for codegen. A cleaner solution is to use `Invoke` or 
`StaticInvoke`, to explicitly define the java method with input values for 
evaluating the expressions.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to