GitHub user cloud-fan opened a pull request:
https://github.com/apache/spark/pull/16659
[SPARK-19309][SQL] disable common subexpression elimination for conditional
expressions
## What changes were proposed in this pull request?
As I pointed out in
https://github.com/apache/spark/pull/15807#issuecomment-259143655 , the current
subexpression elimination framework has a problem, it always evaluates all
common subexpressions at the beginning, even they are inside conditional
expressions and may not be accessed.
Ideally we should implement it like scala lazy val, so we only evaluate it
when it gets accessed at lease once.
https://github.com/apache/spark/issues/15837 tries this approach, but it seems
too complicated and may introduce performance regression.
This PR simply stops common subexpression elimination for conditional
expressions, with some cleanup.
## How was this patch tested?
regression test
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/cloud-fan/spark codegen
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/16659.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 #16659
----
commit 45608b12452632ece51051ef4e90132f73aebaf8
Author: Wenchen Fan <[email protected]>
Date: 2017-01-20T11:55:32Z
disable common subexpression elimination for conditional expressions
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]