Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Druid 解析Hive建表语句解析报错 #4056

Closed
chaplinthink opened this issue Nov 22, 2020 · 1 comment
Closed

Druid 解析Hive建表语句解析报错 #4056

chaplinthink opened this issue Nov 22, 2020 · 1 comment
Labels
Milestone

Comments

@chaplinthink
Copy link

Druid 版本:

<dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid-spring-boot-starter</artifactId>
            <version>1.2.3</version>
        </dependency>

Hive 建表SQL

create table ads_data.sale_detail_one23 like  ads_data.sale_detail_one1 STORED AS parquet

该语句在hive引擎执行是正常的

解析代码

  String hivesql = SQLUtils.format("create table ads_data.sale_detail_one23 like  ads_data.sale_detail_one1 STORED AS parquet", "hive");

        String s1 = hivesql.replaceAll("`", "");

        List<SQLStatement> sqlStatements = SQLUtils.parseStatements(s1, "hive"); // 在该行执行报错

报错信息

22:23:24.044 [main] WARN com.alibaba.druid.sql.SQLUtils - rowFormat error
com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'one1 STORED AS parquet, pos 78, line 1, column 73, token IDENTIFIER STORED
	at com.alibaba.druid.sql.parser.SQLParser.printError(SQLParser.java:558)
	at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:602)
	at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:113)
	at com.alibaba.druid.sql.SQLUtils.format(SQLUtils.java:341)
	at com.alibaba.druid.sql.SQLUtils.format(SQLUtils.java:334)
	at com.alibaba.druid.sql.SQLUtils.format(SQLUtils.java:322)
	at com.alibaba.druid.sql.SQLUtils.format(SQLUtils.java:318)
@wenshao wenshao added the Bug label Dec 12, 2020
@wenshao wenshao added this to the 1.2.4 milestone Dec 12, 2020
@wenshao
Copy link
Member

wenshao commented Dec 12, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants