yuqi1129 / calcite-test Goto Github PK
View Code? Open in Web Editor NEWTest code for apache calcite
Test code for apache calcite
您好,请教下下面的这个代码转换后的Insert语句存在row关键词,而当前大多数的oracle/mysql/postgresql数据库都不支持,请指教:
public static void main(String[] args) {
String sql="insert into dept (name, deptno) values ('a', 123) ,('b',345) ";
SqlParser.Config config =SqlParser.configBuilder().setCaseSensitive(true).build();
SqlParser parser = SqlParser.create(sql, config);
SqlNode sqlNode =null;
try {
sqlNode=parser.parseStmt();
}catch(SqlParseException e) {
e.printStackTrace();
}
System.out.println(sqlNode.toSqlString(OracleSqlDialect.DEFAULT));
System.out.println("========================");
System.out.println(sqlNode.toSqlString(PostgresqlSqlDialect.DEFAULT));
System.out.println("========================");
System.out.println(sqlNode.toSqlString(MysqlSqlDialect.DEFAULT));
}
结果输出为:
INSERT INTO "DEPT" ("NAME", "DEPTNO")
VALUES ROW('a', 123),
ROW('b', 345)
========================
INSERT INTO "DEPT" ("NAME", "DEPTNO")
VALUES ROW('a', 123),
ROW('b', 345)
========================
INSERT INTO `DEPT` (`NAME`, `DEPTNO`)
VALUES ROW('a', 123),
ROW('b', 345)
但我期望的是:
INSERT INTO "DEPT" ("NAME", "DEPTNO")
VALUES ('a', 123),('b', 345)
========================
INSERT INTO "DEPT" ("NAME", "DEPTNO")
VALUES ('a', 123),('b', 345)
========================
INSERT INTO `DEPT` (`NAME`, `DEPTNO`)
VALUES ('a', 123),('b', 345)
Syntax error in template "Parser.jj" in line 3645, column 10:
Unknown directive: #sep. Help (latest version): http://freemarker.org/docs/ref_directive_alphaidx.html; you're using FreeMarker 2.3.21
com.netease.yuqi.aux
windows 下不能建立 “aux” 这样名字的文件,系统预留导致代码无法拉取
出现两个错误:
Plugin 'org.codehaus.mojo:javacc-maven-plugin:' not found
以及
Plugin 'org.apache.drill.tools:drill-fmpp-maven-plugin:' not found
求指教,谢谢!
org.apache.calcite.sql.parser.impl.YuqiSqlParserImpl该类找不到
calcite 1.26版增加了codegen/default_config.fmpp文件 , Parser.jj里面有一些变量会判断并使用default_config.fmpp文件里面的变量, 当前pom中drill-fmpp-maven-plugin插件只引入codegen/config.fmpp , 想问一下怎么配置
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.