odps sql parser support drop table purge. issue #1496

This commit is contained in:
wenshao
2016-11-18 21:02:36 +08:00
parent db8434dc10
commit c2ca764d9f
2 changed files with 15 additions and 1 deletions
@@ -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));
}
}