[SPARK-12018][SQL] Refactor common subexpression elimination code#10009
[SPARK-12018][SQL] Refactor common subexpression elimination code#10009viirya wants to merge 4 commits intoapache:masterfrom
Conversation
There was a problem hiding this comment.
Actually, the above variables are not unnecessary. I will remove them later if the test is passed.
|
Test build #46783 has finished for PR 10009 at commit
|
|
cc @nongli |
There was a problem hiding this comment.
can we make this method return void? we can just assign values to isNull and value as they are both member variables.
There was a problem hiding this comment.
how about The collection of sub-exression result reset method that need to be called on each row.?
|
LGTM overall, cc @nongli to take another look. |
|
Test build #46795 has finished for PR 10009 at commit
|
|
Test build #46799 has finished for PR 10009 at commit
|
|
Test build #46803 has finished for PR 10009 at commit
|
|
ping @rxin @cloud-fan @nongli |
There was a problem hiding this comment.
Am I right in saying you've picked a different approach to do this? You removed isLoaded and just load it every time. I think this is scary because it does not allow shortcircuiting. This can be bad if it is expr1 AND expr2 and expr1 is selective or expr2 is expensive.
There was a problem hiding this comment.
I don't understand your point. $fnName will be called only once for each row. This patch doesn't change that.
There was a problem hiding this comment.
Nvm, what I said doesn't apply for this operator.
I was thinking for Filter you wouldn't want to call fnName once for each row. It can be called less than once.
LGTM
|
Thanks, merging to master and 1.6 |
JIRA: https://issues.apache.org/jira/browse/SPARK-12018 The code of common subexpression elimination can be factored and simplified. Some unnecessary variables can be removed. Author: Liang-Chi Hsieh <viirya@appier.com> Closes #10009 from viirya/refactor-subexpr-eliminate. (cherry picked from commit 9693b0d) Signed-off-by: Michael Armbrust <michael@databricks.com>
JIRA: https://issues.apache.org/jira/browse/SPARK-12018
The code of common subexpression elimination can be factored and simplified. Some unnecessary variables can be removed.