Skip to content

Commit 2a92383

Browse files
committed
added some keywords for alias name that allowed by ClickHouse
1 parent 3b2b05b commit 2a92383

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

jdbc-v2/src/main/antlr4/com/clickhouse/jdbc/internal/ClickHouseParser.g4

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,15 @@ keywordForAlias
976976
| ID
977977
| KEY
978978
| SOURCE
979+
| AFTER
980+
| CASE
981+
| CLUSTER
982+
| CURRENT
983+
| INDEX
984+
| TABLES
985+
| TEST
986+
| VIEW
987+
| PRIMARY
979988
;
980989

981990
alias

jdbc-v2/src/test/java/com/clickhouse/jdbc/internal/SqlParserTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,16 @@ public Object[][] testMiscStmtDp() {
283283
{"SELECT INTERVAL 1 day", 0},
284284
{"SELECT * FROM table key WHERE ts = ?", 1},
285285
{"SELECT * FROM table source WHERE ts = ?", 1},
286+
{"SELECT * FROM table after WHERE ts = ?", 1},
287+
{"SELECT * FROM table before WHERE ts = ?", 1},
288+
{"SELECT * FROM table case WHERE ts = ?", 1},
289+
{"SELECT * FROM table cluster WHERE ts = ?", 1},
290+
{"SELECT * FROM table current WHERE ts = ?", 1},
291+
{"SELECT * FROM table index WHERE ts = ?", 1},
292+
{"SELECT * FROM table tables WHERE ts = ?", 1},
293+
{"SELECT * FROM table test WHERE ts = ?", 1},
294+
{"SELECT * FROM table view WHERE ts = ?", 1},
295+
{"SELECT * FROM table primary WHERE ts = ?", 1},
286296
};
287297
}
288298
}

0 commit comments

Comments
 (0)