mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
odps sql parser support drop table purge. issue #1496
This commit is contained in:
@@ -1182,7 +1182,7 @@ public class SQLStatementParser extends SQLParser {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.PURGE) {
|
||||
if (lexer.token() == Token.PURGE || identifierEquals("PURGE")) {
|
||||
lexer.nextToken();
|
||||
stmt.setPurge(true);
|
||||
continue;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.alibaba.druid.bvt.sql.odps;
|
||||
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* Created by wenshao on 2016/11/18.
|
||||
*/
|
||||
public class OdpsDropTableTest extends TestCase {
|
||||
public void test_drop_table() throws Exception {
|
||||
String sql = "DROP TABLE a PURGE ;";
|
||||
assertEquals("DROP TABLE a PURGE;", SQLUtils.formatOdps(sql));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user