Skip to content

Commit

Permalink
Doris support drop if exists table
Browse files Browse the repository at this point in the history
  • Loading branch information
woyumen4597 authored and wenshao committed Nov 22, 2024
1 parent 7752ee5 commit 64c4e70
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,21 @@ protected Keywords loadKeywords() {
map.put("REPEATABLE", Token.REPEATABLE);
map.put("TABLESAMPLE", Token.TABLESAMPLE);
map.put("USING", Token.USING);
// map.put("DISTRIBUTED", Token.DISTRIBUTE);
map.put("IF", Token.IF);

map.put("ADD", Token.ADD);
map.put("BOTH", Token.BOTH);
map.put("DUAL", Token.DUAL);
map.put("FALSE", Token.FALSE);
map.put("FORCE", Token.FORCE);
map.put("KILL", Token.KILL);

map.put("TRUE", Token.TRUE);
map.put("SHOW", Token.SHOW);
map.put("ANALYZE", Token.ANALYZE);
map.put("ROW", Token.ROW);
map.put("MOD", Token.MOD);
map.put("RLIKE", Token.RLIKE);

return new Keywords(map);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,24 @@ protected Keywords loadKeywords() {

map.putAll(Keywords.DEFAULT_KEYWORDS.getKeywords());

// map.put("BITMAP", Token.BITMAP);
map.put("USING", Token.USING);
map.put("ADD", Token.ADD);
map.put("BOTH", Token.BOTH);
map.put("DUAL", Token.DUAL);
map.put("FALSE", Token.FALSE);
map.put("FORCE", Token.FORCE);
map.put("IF", Token.IF);
map.put("KILL", Token.KILL);

map.put("TRUE", Token.TRUE);
map.put("SHOW", Token.SHOW);
map.put("ANALYZE", Token.ANALYZE);
map.put("ROW", Token.ROW);

map.put("PARTITION", Token.PARTITION);

map.put("MOD", Token.MOD);
map.put("RLIKE", Token.RLIKE);
map.put("USING", Token.USING);
return new Keywords(map);
}

Expand Down
5 changes: 3 additions & 2 deletions core/src/main/java/com/alibaba/druid/sql/parser/Token.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,9 @@ public enum Token {
UPSERT("UPSERT"), // Phoenix

// StarRocks
BIGINT("BIGINT"),
// BITMAP("BITMAP"),
ADD("ADD"),
BOTH("BOTH"),
FORCE("FORCE"),
// Redshift
ENCODE("ENCODE"),
DISTSTYLE("DISTSTYLE"),
Expand Down
3 changes: 3 additions & 0 deletions core/src/test/resources/bvt/parser/doris/2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP TABLE IF EXISTS `biz_jxfw_class_attend_data_v1`;
--------------------
DROP TABLE IF EXISTS `biz_jxfw_class_attend_data_v1`;
2 changes: 1 addition & 1 deletion druid-demo-petclinic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.24_preview89</version>
<version>1.2.24-SNAPSHOT</version>
</dependency>
<!-- Spring and Spring Boot dependencies -->
<dependency>
Expand Down

0 comments on commit 64c4e70

Please sign in to comment.