Skip to content

Commit 144acc1

Browse files
committed
refactor: change all union all in join
1 parent 40e7e51 commit 144acc1

15 files changed

Lines changed: 19 additions & 19 deletions

pegjs/athena.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ table_join
11581158
t.on = expr;
11591159
return t;
11601160
}
1161-
/ op:join_op __ LPAREN __ stmt:union_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
1161+
/ op:(join_op / set_op) __ LPAREN __ stmt:union_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
11621162
stmt.parentheses = true;
11631163
return {
11641164
expr: stmt,

pegjs/bigquery.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,7 @@ table_join
18171817
t.on = expr;
18181818
return t;
18191819
}
1820-
/ op:join_op __ LPAREN __ stmt:union_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
1820+
/ op:(join_op / set_op) __ LPAREN __ stmt:union_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
18211821
stmt.parentheses = true;
18221822
return {
18231823
expr: stmt,

pegjs/db2.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ table_join
11981198
t.on = expr;
11991199
return t;
12001200
}
1201-
/ op:join_op __ LPAREN __ stmt:union_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
1201+
/ op:(join_op / set_op) __ LPAREN __ stmt:union_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
12021202
stmt.parentheses = true;
12031203
return {
12041204
expr: stmt,

pegjs/flinksql.pegjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,11 +1871,11 @@ table_join
18711871
t.on = expr;
18721872
return t;
18731873
}
1874-
/ op:join_op __ LPAREN __ stmt:union_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
1874+
/ op:(join_op / set_op) __ LPAREN __ stmt:union_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
18751875
/* => {
18761876
expr: union_stmt & { parentheses: true; };
18771877
as?: alias_clause;
1878-
join: join_op;
1878+
join: join_op | set_op;
18791879
on?: on_clause;
18801880
}*/
18811881
stmt.parentheses = true;

pegjs/hive.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ table_join
11581158
t.on = expr;
11591159
return t;
11601160
}
1161-
/ op:join_op __ LPAREN __ stmt:union_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
1161+
/ op:(join_op / set_op) __ LPAREN __ stmt:union_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
11621162
stmt.parentheses = true;
11631163
return {
11641164
expr: stmt,

pegjs/mariadb.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2112,7 +2112,7 @@ table_join
21122112
t.on = expr;
21132113
return t;
21142114
}
2115-
/ op:join_op __ LPAREN __ stmt:set_op_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
2115+
/ op:(join_op / set_op) __ LPAREN __ stmt:set_op_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
21162116
stmt.parentheses = true;
21172117
return {
21182118
expr: stmt,

pegjs/mysql.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2366,7 +2366,7 @@ table_join
23662366
t.on = expr;
23672367
return t;
23682368
}
2369-
/ op:join_op __ LPAREN __ stmt:set_op_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
2369+
/ op:(join_op / set_op) __ LPAREN __ stmt:set_op_stmt __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
23702370
stmt.parentheses = true;
23712371
return {
23722372
expr: stmt,

pegjs/noql.pegjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3010,7 +3010,7 @@ table_join
30103010
t.on = expr;
30113011
return t;
30123012
}
3013-
/ op:join_op __ LPAREN __ stmt:(union_stmt / table_ref_list) __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
3013+
/ op:(join_op / set_op) __ LPAREN __ stmt:(union_stmt / table_ref_list) __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
30143014
/* => {
30153015
expr: (union_stmt || table_ref_list) & { parentheses: true; };
30163016
as?: alias_clause;

pegjs/postgresql.pegjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3211,11 +3211,11 @@ table_join
32113211
t.on = expr;
32123212
return t;
32133213
}
3214-
/ op:join_op __ LPAREN __ stmt:(union_stmt / table_ref_list) __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
3214+
/ op:(join_op / set_op) __ LPAREN __ stmt:(union_stmt / table_ref_list) __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
32153215
/* => {
32163216
expr: (union_stmt | table_ref_list) & { parentheses: true; };
32173217
as?: alias_clause;
3218-
join: join_op;
3218+
join: join_op | set_op;
32193219
on?: on_clause;
32203220
}*/
32213221
if (Array.isArray(stmt)) stmt = { type: 'tables', expr: stmt }

pegjs/redshift.pegjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3044,11 +3044,11 @@ table_join
30443044
t.on = expr;
30453045
return t;
30463046
}
3047-
/ op:join_op __ LPAREN __ stmt:(union_stmt / table_ref_list) __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
3047+
/ op:(join_op / set_op) __ LPAREN __ stmt:(union_stmt / table_ref_list) __ RPAREN __ alias:alias_clause? __ expr:on_clause? {
30483048
/* => {
30493049
expr: (union_stmt || table_ref_list) & { parentheses: true; };
30503050
as?: alias_clause;
3051-
join: join_op;
3051+
join: join_op | set_op;
30523052
on?: on_clause;
30533053
}*/
30543054
if (Array.isArray(stmt)) stmt = { type: 'tables', expr: stmt }

0 commit comments

Comments
 (0)