Github user cloud-fan commented on the issue: https://github.com/apache/spark/pull/15807 +1 on @kiszk 's idea, the next problem is, the sub expr eval method may need local variables instead of input row `i`, but we can inline it at every place which need the result of subexpression, e.g. ``` if () { ... if (!isInitialized) { ... // code to eval subExpr1 isInitialized = true } ... } else { if (!isInitialized) { ... // code to eval subExpr1 isInitialized = true } } ``` but doing this may lead to a lot of duplicated java codes, I think a better approach is to detect the local variables needed in the sub expr eval method and add them to parameters.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org