Uh oh!
There was an error while loading. Please reload this page.
[SPARK-14830][SQL] Add RemoveRepetitionFromGroupExpressions optimizer. - #12590
[SPARK-14830][SQL] Add RemoveRepetitionFromGroupExpressions optimizer.#12590dongjoon-hyun wants to merge 3 commits into
Conversation
SparkQA
commented
Apr 22, 2016
Test build #56613 has finished for PR 12590 at commit
|
dongjoon-hyun
commented
Apr 23, 2016
Rebased. |
SparkQA
commented
Apr 23, 2016
Test build #56772 has finished for PR 12590 at commit
|
dongjoon-hyun
commented
Apr 24, 2016
Hi, @rxin . |
dongjoon-hyun
commented
Apr 25, 2016
Rebased. |
SparkQA
commented
Apr 25, 2016
Test build #56891 has finished for PR 12590 at commit
|
dongjoon-hyun
commented
Apr 25, 2016
Hi, @rxin . |
SparkQA
commented
Apr 26, 2016
Test build #56970 has finished for PR 12590 at commit
|
dongjoon-hyun
commented
Apr 26, 2016
Hi, @marmbrus . |
SparkQA
commented
Apr 28, 2016
Test build #57274 has finished for PR 12590 at commit
|
SparkQA
commented
Apr 30, 2016
Test build #57411 has finished for PR 12590 at commit
|
There was a problem hiding this comment.
This is going to miss cases like GROUP BY A, a. I think you want to use an ExpressionSet instead of normal .distinct
There was a problem hiding this comment.
Oh, thank you for review. @marmbrus .
I'll fix that.
SparkQA
commented
May 2, 2016
Test build #57540 has finished for PR 12590 at commit
|
dongjoon-hyun
commented
May 2, 2016
@marmbrus . Now, it's ready for review again. |
marmbrus
commented
May 2, 2016
Thanks, merging to master and 2.0 |
## What changes were proposed in this pull request?
This PR aims to optimize GroupExpressions by removing repeating expressions. `RemoveRepetitionFromGroupExpressions` is added.
**Before**
```scala
scala> sql("select a+1 from values 1,2 T(a) group by a+1, 1+a, A+1, 1+A").explain()
== Physical Plan ==
WholeStageCodegen
: +- TungstenAggregate(key=[(a#0 + 1)#6,(1 + a#0)#7,(A#0 + 1)#8,(1 + A#0)#9], functions=[], output=[(a + 1)#5])
: +- INPUT
+- Exchange hashpartitioning((a#0 + 1)#6, (1 + a#0)#7, (A#0 + 1)#8, (1 + A#0)#9, 200), None
+- WholeStageCodegen
: +- TungstenAggregate(key=[(a#0 + 1) AS (a#0 + 1)#6,(1 + a#0) AS (1 + a#0)#7,(A#0 + 1) AS (A#0 + 1)#8,(1 + A#0) AS (1 + A#0)#9], functions=[], output=[(a#0 + 1)#6,(1 + a#0)#7,(A#0 + 1)#8,(1 + A#0)#9])
: +- INPUT
+- LocalTableScan [a#0], [[1],[2]]
```
**After**
```scala
scala> sql("select a+1 from values 1,2 T(a) group by a+1, 1+a, A+1, 1+A").explain()
== Physical Plan ==
WholeStageCodegen
: +- TungstenAggregate(key=[(a#0 + 1)#6], functions=[], output=[(a + 1)#5])
: +- INPUT
+- Exchange hashpartitioning((a#0 + 1)#6, 200), None
+- WholeStageCodegen
: +- TungstenAggregate(key=[(a#0 + 1) AS (a#0 + 1)#6], functions=[], output=[(a#0 + 1)#6])
: +- INPUT
+- LocalTableScan [a#0], [[1],[2]]
```
## How was this patch tested?
Pass the Jenkins tests (with a new testcase)
Author: Dongjoon Hyun <dongjoon@apache.org>
Closes#12590 from dongjoon-hyun/SPARK-14830.
(cherry picked from commit 6e63201)
Signed-off-by: Michael Armbrust <michael@databricks.com>dongjoon-hyun
commented
May 2, 2016
Thank you, @marmbrus ! |
What changes were proposed in this pull request?
This PR aims to optimize GroupExpressions by removing repeating expressions.
RemoveRepetitionFromGroupExpressionsis added.Before
After
How was this patch tested?
Pass the Jenkins tests (with a new testcase)