Hi, Durid sql parse can not support sql like 'add jar xxx' in Hive.
@Test
public void parseTest() {
String a = "add jar hdfs:///lib/hive.jar";
List<SQLStatement> sqlStatements = SQLUtils.parseStatements(a, JdbcConstants.HIVE);
System.out.println(sqlStatements.get(0));
}
com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'add jar hdfs:///lib/hive.jar', expect IDENTIFIER, actual IDENTIFIER pos 3, line 1, column 1, token IDENTIFIER add
at com.alibaba.druid.sql.parser.SQLParser.printError(SQLParser.java:284)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:433)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:72)
at com.alibaba.druid.sql.SQLUtils.parseStatements(SQLUtils.java:464)
at com.alibaba.druid.MyTest.parseTest(MyTest.java:15)
1条答案
按热度按时间vxbzzdmp1#
Whether this feature is needed, I can try to develop if needed.