quxiucheng / apache-calcite-tutorial Goto Github PK
View Code? Open in Web Editor NEWhttps://blog.csdn.net/QXC1281/article/details/89070285
https://blog.csdn.net/QXC1281/article/details/89070285
有什么底层实现的案例吗?
从自定义Driver到底层sql逻辑的翻译?
我把parse vaildate 等都实现了,但是卡在了FilterableTable 和TranslatableTable这两个接口上。sql的翻译没看懂。
您好,请教下下面的这个代码转换后的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)
parser-4-calcite-custom-tutorial模块编译过不了
哥们,我最近想基于Flink1.8 SQL上扩展一些维表JOIN的功能,看了Flink SQL底层解析是通过Calcite的,然后发现哥们你的学习案例和笔记写的非常好和详细,所以想问你留个联系方式,想像您学习请教些Calcite相关的问题。
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.