druid Hive SQL Parse,SQL : "ADD JAR HDFS://xxxx" can not parse

ao218c7q  于 2022-10-27  发布在  Druid
关注(0)|答案(1)|浏览(200)

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)
vxbzzdmp

vxbzzdmp1#

Whether this feature is needed, I can try to develop if needed.

相关问题