You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by gengliangwang <gi...@git.apache.org> on 2017/09/16 13:59:31 UTC
[GitHub] spark pull request #19253: [SPARK-22037][SQL] Collapse Project if it is the ...
GitHub user gengliangwang opened a pull request:
https://github.com/apache/spark/pull/19253
[SPARK-22037][SQL] Collapse Project if it is the child of Aggregate
## What changes were proposed in this pull request?
If Aggregate's child is Project, collapse the Project into the Aggregate.
This rule is to make query plans simpler.
## How was this patch tested?
Unit test
Please review http://spark.apache.org/contributing.html before opening a pull request.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gengliangwang/spark CollapseProjectIntoAggregate
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/19253.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 #19253
----
commit 525d6546b06173feda4c5806176ebb98c825dcaa
Author: Wang Gengliang <lt...@gmail.com>
Date: 2017-09-16T13:45:10Z
Collapse Project if it is the child of Aggregate
----
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19253: [SPARK-22037][SQL] Collapse Project if it is the ...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19253#discussion_r139297437
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala ---
@@ -541,6 +541,25 @@ object CollapseProject extends Rule[LogicalPlan] {
agg.copy(aggregateExpressions = buildCleanedProjectList(
p.projectList, agg.aggregateExpressions))
}
+ case agg @ Aggregate(groupingExpressions, aggregateExpressions, p: Project) =>
+ if (haveCommonNonDeterministicOutput(groupingExpressions, p.projectList) ||
+ haveCommonNonDeterministicOutput(aggregateExpressions, p.projectList)) {
--- End diff --
This condition is not right
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19253: [SPARK-22037][SQL] Collapse Project if it is the child o...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/19253
Merged build finished. Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19253: [SPARK-22037][SQL] Collapse Project if it is the ...
Posted by gengliangwang <gi...@git.apache.org>.
Github user gengliangwang closed the pull request at:
https://github.com/apache/spark/pull/19253
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19253: [SPARK-22037][SQL] Collapse Project if it is the child o...
Posted by gengliangwang <gi...@git.apache.org>.
Github user gengliangwang commented on the issue:
https://github.com/apache/spark/pull/19253
@gatorsmile @viirya Thanks. I should close this PR.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19253: [SPARK-22037][SQL] Collapse Project if it is the child o...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on the issue:
https://github.com/apache/spark/pull/19253
In whole-stage codegen, this will not gain any perf gain if we can remove the useless Project.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19253: [SPARK-22037][SQL] Collapse Project if it is the child o...
Posted by viirya <gi...@git.apache.org>.
Github user viirya commented on the issue:
https://github.com/apache/spark/pull/19253
The removed `Project` might affect the rule `PhysicalOperation` and reduce the chance to prune columns when reading relations.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19253: [SPARK-22037][SQL] Collapse Project if it is the child o...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/19253
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/81844/
Test FAILed.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19253: [SPARK-22037][SQL] Collapse Project if it is the child o...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/19253
**[Test build #81844 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/81844/testReport)** for PR 19253 at commit [`525d654`](https://github.com/apache/spark/commit/525d6546b06173feda4c5806176ebb98c825dcaa).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #19253: [SPARK-22037][SQL] Collapse Project if it is the child o...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/19253
**[Test build #81844 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/81844/testReport)** for PR 19253 at commit [`525d654`](https://github.com/apache/spark/commit/525d6546b06173feda4c5806176ebb98c825dcaa).
* This patch **fails Spark unit tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #19253: [SPARK-22037][SQL] Collapse Project if it is the ...
Posted by gatorsmile <gi...@git.apache.org>.
Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/19253#discussion_r139297406
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala ---
@@ -541,6 +541,25 @@ object CollapseProject extends Rule[LogicalPlan] {
agg.copy(aggregateExpressions = buildCleanedProjectList(
p.projectList, agg.aggregateExpressions))
}
+ case agg @ Aggregate(groupingExpressions, aggregateExpressions, p: Project) =>
+ if (haveCommonNonDeterministicOutput(groupingExpressions, p.projectList) ||
+ haveCommonNonDeterministicOutput(aggregateExpressions, p.projectList)) {
--- End diff --
This condition is not right.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org