calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "‘-常心-’" <1269223...@qq.com>
Subject 回复:Can’t seem to parse DDL staements
Date Mon, 17 Dec 2018 02:14:07 GMT
Can use calcite-server parse DDLs, code :


SqlParser.Config sqlParserConfig = SqlParser.configBuilder()
        .setConformance(SqlConformanceEnum.MYSQL_5)
        .setLex(Lex.MYSQL)
        .build(); 
InputStream  inputStream = new ByteArrayInputStream(query.getBytes());
SqlDdlParserImpl parser = new SqlDdlParserImpl(inputStream);
parser.setConformance(parserConfig.conformance());
parser.setIdentifierMaxLength(parserConfig.identifierMaxLength());
parser.setQuotedCasing(parserConfig.quotedCasing());
parser.setUnquotedCasing(parserConfig.unquotedCasing());
SqlNode  sqlNode = parser.parseSqlStmtEof();






------------------ 原始邮件 ------------------
发件人: "Dilip Raj Baral"<dilip@diliprajbaral.com>;
发送时间: 2018年12月16日(星期天) 晚上6:19
收件人: "dev"<dev@calcite.apache.org>;
抄送: "Dilip Raj Baral"<rajb.dilip@gmail.com>; 
主题: Can’t seem to parse DDL staements



Hi, team.

I have been using Apache Calcite for about two weeks now for one of the projects at my company.
I have found it fun and pretty useful so far. I have been able to parse DMLs very smoothly.
However, when I tried to parse DDLs like CREATE TABLE, ALTER TABLE, etc., the SqlParser.parseStmt()
or SqlParser.parseQuery() failed.

I have detailed the specifics in the following SO question.

https://stackoverflow.com/questions/53801005/apache-calcite-cant-seem-to-parse-ddl-statements

Looking forward to a suggestion.

Best regards,
Dilip Raj Baral
https://diliprajbaral.com
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message