Skip to content

Commit 3684ae7

Browse files
authored
fix(postgresql): #432 remove error rule
* test: #432 validate unComplete sql * fix: #432 remove error rule
1 parent 9dc6cfc commit 3684ae7

File tree

10 files changed

+2392
-2375
lines changed

10 files changed

+2392
-2375
lines changed

src/grammar/postgresql/PostgreSqlParser.g4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,6 @@ primaryExpression
23782378
| OPEN_PAREN expression COMMA exprList CLOSE_PAREN
23792379
| row KW_OVERLAPS row
23802380
| columnNamePath
2381-
| qualifiedName
23822381
| primaryExpression TYPECAST typename
23832382
| (PLUS | MINUS) primaryExpression
23842383
| primaryExpression qualOp primaryExpression?

src/lib/postgresql/PostgreSqlParser.interp

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/lib/postgresql/PostgreSqlParser.ts

Lines changed: 2359 additions & 2369 deletions
Large diffs are not rendered by default.

test/parser/flink/syntax/fixtures/select.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,8 @@ SELECT
5050
TIMESTAMP '2019-12-23 09:00:00' as time2,
5151
INTERVAL '10 00:00:00.004' DAY TO SECOND as time3
5252
from
53-
MyTable;
53+
MyTable;
54+
55+
56+
SELECT COALESCE(SUM(c.amount), 0) AS total_amount FROM cust c;
57+
SELECT SUM(c.amount) AS total_amount FROM cust c;

test/parser/hive/syntax/fixtures/select.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,4 +243,8 @@ EXPLAIN select sum(hash(key)), sum(hash(value)) from src_orc_merge_test_part whe
243243
-- FROM xx SELECT
244244
FROM table_name_1 SELECT col1, col2;
245245

246-
FROM a JOIN b ON (a.id = b.id AND a.department = b.department) SELECT a.*;
246+
FROM a JOIN b ON (a.id = b.id AND a.department = b.department) SELECT a.*;
247+
248+
249+
SELECT COALESCE(SUM(c.amount), 0) AS total_amount FROM cust c;
250+
SELECT SUM(c.amount) AS total_amount FROM cust c;

test/parser/impala/syntax/fixtures/select.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,8 @@ select true and null;
213213

214214
select c_first_name, c_last_name from customer where lower(trim(c_last_name)) regexp '^de.*';
215215

216-
select c_first_name, c_last_name from customer where lower(trim(c_last_name)) rlike '^de.*';
216+
select c_first_name, c_last_name from customer where lower(trim(c_last_name)) rlike '^de.*';
217+
218+
219+
SELECT COALESCE(SUM(c.amount), 0) AS total_amount FROM cust c;
220+
SELECT SUM(c.amount) AS total_amount FROM cust c;

test/parser/mysql/syntax/fixtures/select.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,7 @@ SELECT ID ,SUM(COL_1) AS SUM_COL_1 FROM (
7878
UNION ALL
7979
(SELECT ID ,COL_1 FROM TEST_AUTO_INC TAI)
8080
)SS GROUP BY 1 ORDER BY 1;
81+
82+
83+
SELECT COALESCE(SUM(c.amount), 0) AS total_amount FROM cust c;
84+
SELECT SUM(c.amount) AS total_amount FROM cust c;

test/parser/postgresql/syntax/fixtures/select.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,4 +195,8 @@ SELECT f1[1][-2][3] AS e1, f1[1][-1][5] AS e2
195195
SELECT int4range(10, 20) @> 3;
196196

197197
-- Object Identifier Types
198-
SELECT * FROM pg_attribute WHERE attrelid = 'mytable'::regclass;
198+
SELECT * FROM pg_attribute WHERE attrelid = 'mytable'::regclass;
199+
200+
201+
SELECT COALESCE(SUM(c.amount), 0) AS total_amount FROM cust c;
202+
SELECT SUM(c.amount) AS total_amount FROM cust c;

test/parser/spark/syntax/fixtures/selectClusterBy.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ SELECT name, age FROM person;
2525
-- persons with age 16 are in the second partition. The rows are sorted based
2626
-- on age within each partition.
2727
SELECT age, name FROM person CLUSTER BY age;
28+
29+
30+
SELECT COALESCE(SUM(c.amount), 0) AS total_amount FROM cust c;
31+
SELECT SUM(c.amount) AS total_amount FROM cust c;

test/parser/trino/syntax/fixtures/select.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,7 @@ SELECT 123 INTERSECT DISTINCT SELECT 123 INTERSECT ALL SELECT 123;
115115
-- substring_built_in_function
116116
SELECT substring('string' FROM 2);
117117
SELECT substring('string' FROM 2 FOR 3);
118+
119+
120+
SELECT COALESCE(SUM(c.amount), 0) AS total_amount FROM cust c;
121+
SELECT SUM(c.amount) AS total_amount FROM cust c;

0 commit comments

Comments
 (0)