GitHub user cloud-fan opened a pull request: https://github.com/apache/spark/pull/16143
[SPARK-18711][SQL] should disable subexpression elimination for LambdaVariable ## What changes were proposed in this pull request? This is kind of a long-standing bug, it's hidden until https://github.com/apache/spark/pull/15780 , which may add `AssertNotNull` on top of `LambdaVariable` and thus enables subexpression elimination. However, subexpression elimination will evaluate the common expressions at the beginning, which is invalid for `LambdaVariable`. `LambdaVariable` usually represents loop variable, which can't be evaluated ahead of the loop. This PR skips expressions containing `LambdaVariable` when doing subexpression elimination. ## How was this patch tested? updated test in `DatasetAggregatorSuite` You can merge this pull request into a Git repository by running: $ git pull https://github.com/cloud-fan/spark aggregator Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/16143.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #16143 ---- commit 3c1f20dadbce835771f8cd5fd4425ba6c2d8de45 Author: Wenchen Fan <wenc...@databricks.com> Date: 2016-12-05T09:40:48Z should disable subexpression elimination for LambdaVariable ---- --- 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