select id, cast(score as int), 'hello' from T where id < ?
SqlNode子类
- SqlIdentifier
- SqlCall
- SqlDataTypeSpec
- SqlLiteral
- SqlDynamicParam
- id, score, T 等为SqlIdentifier
- cast()为SqlCall
- int 为SqlDataTypeSpec
- ‘hello’ 为SqlLiteral
- ‘?’ 为SqlDynamicParam
SqlNode常见的的类型
- SELECT
- FROM
- AS
- UNION
- JOIN
优化器
参考资料
https://www.querifylabs.com/blog/assembling-a-query-optimizer-with-apache-calcite
参考资料
https://www.jianshu.com/p/1b7e7aaeb19f