forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[improvement](nereids) Support where, group by, having, order by clau…
…se without from clause in query statement
- Loading branch information
Showing
14 changed files
with
85 additions
and
27 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
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
10 changes: 10 additions & 0 deletions
10
regression-test/data/nereids_p0/select_no_from/sql/withGroupOrderHaving.out
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 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !withGroupOrderHaving -- | ||
0 | ||
|
||
-- !withGroupOrderHaving_2 -- | ||
10 3 | ||
|
||
-- !withGroupOrderHaving_3 -- | ||
1 1 2 1.0 1 | ||
|
7 changes: 7 additions & 0 deletions
7
regression-test/data/nereids_p0/select_no_from/sql/withWhereClause.out
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,7 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !withWhereClause -- | ||
0 | ||
|
||
-- !withWhereClause_2 -- | ||
1 | ||
|
7 changes: 7 additions & 0 deletions
7
regression-test/data/nereids_p0/select_no_from/sql/withWhereFalse.out
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,7 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !withWhereFalse -- | ||
0 | ||
|
||
-- !withWhereFalse_2 -- | ||
0 1 | ||
|
10 changes: 10 additions & 0 deletions
10
regression-test/data/query_p0/select_no_from/sql/withGroupOrderHaving.out
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 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !withGroupOrderHaving -- | ||
0 | ||
|
||
-- !withGroupOrderHaving_2 -- | ||
10 3 | ||
|
||
-- !withGroupOrderHaving_3 -- | ||
1 1 2 1.0 1 | ||
|
7 changes: 7 additions & 0 deletions
7
regression-test/data/query_p0/select_no_from/sql/withWhereClause.out
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,7 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !withWhereClause -- | ||
0 | ||
|
||
-- !withWhereClause_2 -- | ||
1 | ||
|
7 changes: 7 additions & 0 deletions
7
regression-test/data/query_p0/select_no_from/sql/withWhereFalse.out
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,7 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !withWhereFalse -- | ||
0 | ||
|
||
-- !withWhereFalse_2 -- | ||
0 1 | ||
|
10 changes: 7 additions & 3 deletions
10
regression-test/suites/nereids_p0/select_no_from/sql/withGroupOrderHaving.sql
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
/* | ||
-- database: presto; groups: no_from | ||
SELECT MIN(10), 3 as col1 GROUP BY 2 HAVING 6 > 5 ORDER BY 1 | ||
*/ | ||
SET enable_nereids_planner = TRUE; | ||
SELECT MIN(10), 3 as col1 GROUP BY 2 HAVING 6 > 5 ORDER BY 1; | ||
SELECT 1 AS a, COUNT(*), SUM(2), AVG(1), RANK() OVER() AS w_rank | ||
WHERE 1 = 1 | ||
GROUP BY a, w_rank | ||
HAVING COUNT(*) IN (1, 2) AND w_rank = 1 | ||
ORDER BY a; |
5 changes: 2 additions & 3 deletions
5
regression-test/suites/nereids_p0/select_no_from/sql/withWhereClause.sql
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* | ||
-- database: presto; groups: no_from | ||
SELECT 1 WHERE TRUE AND 2=2 | ||
*/ | ||
SET enable_nereids_planner = TRUE; | ||
SELECT 1 WHERE TRUE AND 2=2; |
5 changes: 2 additions & 3 deletions
5
regression-test/suites/nereids_p0/select_no_from/sql/withWhereFalse.sql
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* | ||
-- database: presto; groups: no_from | ||
SELECT COUNT(*), 1 WHERE FALSE | ||
*/ | ||
SET enable_nereids_planner = TRUE; | ||
SELECT COUNT(*), 1 WHERE FALSE; |
10 changes: 7 additions & 3 deletions
10
regression-test/suites/query_p0/select_no_from/sql/withGroupOrderHaving.sql
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
/* | ||
-- database: presto; groups: no_from | ||
SELECT MIN(10), 3 as col1 GROUP BY 2 HAVING 6 > 5 ORDER BY 1 | ||
*/ | ||
SET enable_nereids_planner = TRUE; | ||
SELECT MIN(10), 3 as col1 GROUP BY 2 HAVING 6 > 5 ORDER BY 1; | ||
SELECT 1 AS a, COUNT(*), SUM(2), AVG(1), RANK() OVER() AS w_rank | ||
WHERE 1 = 1 | ||
GROUP BY a, w_rank | ||
HAVING COUNT(*) IN (1, 2) AND w_rank = 1 | ||
ORDER BY a; |
5 changes: 2 additions & 3 deletions
5
regression-test/suites/query_p0/select_no_from/sql/withWhereClause.sql
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* | ||
-- database: presto; groups: no_from | ||
SELECT 1 WHERE TRUE AND 2=2 | ||
*/ | ||
SET enable_nereids_planner = TRUE; | ||
SELECT 1 WHERE TRUE AND 2=2; |
5 changes: 2 additions & 3 deletions
5
regression-test/suites/query_p0/select_no_from/sql/withWhereFalse.sql
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
/* | ||
-- database: presto; groups: no_from | ||
SELECT COUNT(*), 1 WHERE FALSE | ||
*/ | ||
SET enable_nereids_planner = TRUE; | ||
SELECT COUNT(*), 1 WHERE FALSE; |