-
Notifications
You must be signed in to change notification settings - Fork 28.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-8972] [SQL] Incorrect result for rollup
We don't support the complex expression keys in the rollup/cube, and we even will not report it if we have the complex group by keys, that will cause very confusing/incorrect result. e.g. `SELECT key%100 FROM src GROUP BY key %100 with ROLLUP` This PR adds an additional project during the analyzing for the complex GROUP BY keys, and that projection will be the child of `Expand`, so to `Expand`, the GROUP BY KEY are always the simple key(attribute names). Author: Cheng Hao <hao.cheng@intel.com> Closes #7343 from chenghao-intel/expand and squashes the following commits: 1ebbb59 [Cheng Hao] update the comment 827873f [Cheng Hao] update as feedback 34def69 [Cheng Hao] Add more unit test and comments c695760 [Cheng Hao] fix bug of incorrect result for rollup
- Loading branch information
1 parent
ba33096
commit e272123
Showing
8 changed files
with
145 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...t/resources/golden/SPARK-8976 Wrong Result for CUBE #1-0-63b61fb3f0e74226001ad279be440864
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
500 NULL 0 | ||
91 0 1 | ||
84 1 1 | ||
105 2 1 | ||
113 3 1 | ||
107 4 1 |
10 changes: 10 additions & 0 deletions
10
...t/resources/golden/SPARK-8976 Wrong Result for CUBE #2-0-7a511f02a16f0af4f810b1666cfcd896
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1 NULL -3 2 | ||
1 NULL -1 2 | ||
1 NULL 3 2 | ||
1 NULL 4 2 | ||
1 NULL 5 2 | ||
1 NULL 6 2 | ||
1 NULL 12 2 | ||
1 NULL 14 2 | ||
1 NULL 15 2 | ||
1 NULL 22 2 |
10 changes: 10 additions & 0 deletions
10
...sources/golden/SPARK-8976 Wrong Result for GroupingSet-0-8c14c24670a4b06c440346277ce9cf1c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1 NULL -3 2 | ||
1 NULL -1 2 | ||
1 NULL 3 2 | ||
1 NULL 4 2 | ||
1 NULL 5 2 | ||
1 NULL 6 2 | ||
1 NULL 12 2 | ||
1 NULL 14 2 | ||
1 NULL 15 2 | ||
1 NULL 22 2 |
6 changes: 6 additions & 0 deletions
6
...resources/golden/SPARK-8976 Wrong Result for Rollup #1-0-a78e3dbf242f240249e36b3d3fd0926a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
500 NULL 0 | ||
91 0 1 | ||
84 1 1 | ||
105 2 1 | ||
113 3 1 | ||
107 4 1 |
10 changes: 10 additions & 0 deletions
10
...resources/golden/SPARK-8976 Wrong Result for Rollup #2-0-bf180c9d1a18f61b9d9f31bb0115cf89
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1 0 5 3 | ||
1 0 15 3 | ||
1 0 25 3 | ||
1 0 60 3 | ||
1 0 75 3 | ||
1 0 80 3 | ||
1 0 100 3 | ||
1 0 140 3 | ||
1 0 145 3 | ||
1 0 150 3 |
10 changes: 10 additions & 0 deletions
10
...resources/golden/SPARK-8976 Wrong Result for Rollup #3-0-9257085d123728730be96b6d9fbb84ce
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
1 0 5 3 | ||
1 0 15 3 | ||
1 0 25 3 | ||
1 0 60 3 | ||
1 0 75 3 | ||
1 0 80 3 | ||
1 0 100 3 | ||
1 0 140 3 | ||
1 0 145 3 | ||
1 0 150 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters