guimingyue opened a new pull request #9934: URL: https://github.com/apache/shardingsphere/pull/9934
Add a new module `shardingsphere-infra-optimizer`, and this module is based on Apache Calcite framework. The main packages are as follows: 0. `org.apache.shardingsphere.infra.optimizer.converter`, the converter of converting ShardingSphere ast to Calcite ast, or SqlNode in Calcite world, and the Converter of converting SqlNode to RelNode of Calcite. 1. `org.apache.shardingsphere.infra.optimizer.planner`, the core of the optimizer based on Calcite Planner framework. It contains the planner rules(`org.apache.shardingsphere.infra.optimizer.planner.rule`) and the planner process which is response for converting logical plan to physical plan, also be known as execution plan, please refer to `DefaultPlanner` for this process. 2. `org.apache.shardingsphere.infra.optimizer.rel`, definition and operation of the `RelNode`. 3. `org.apache.shardingsphere.infra.optimizer.schema`, the bridge of ShardingSphere and Calcite metadata. For the whole execution process, method `org.apache.shardingsphere.infra.optimize.planner.Compiler#compileQuery` is the entrance of converting ast and optimizing relnode, and this method also return the physical `RelNode`(execution plan). This module is different from the existing module`shardingsphere-infra-optimize` which can be regraded as an adaptor of calcite, and cannot optimize the join operator which can be pushdown to the sharding database. The new module does not denpend on the `shardingsphere-infra-executor` which is different from `shardingsphere-infra-optimize` too. This module has not been finished yet, there still many `TODO` be left in some classes of this module, `org.apache.shardingsphere.infra.optimizer.converter.SqlNodeConverter` for example. If you have any problems about this module, let me know. In the next PR, I will commit the executor of the execution plan, which is based on the volcano execution model, after this PR is merged. Fixes #8284. Changes proposed in this pull request: - Add a new module `shardingsphere-infra-optimizer`, and the optimizer is base on the Apache Calcite framework. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
