junwen12221 commented on issue #8284:
URL: https://github.com/apache/shardingsphere/issues/8284#issuecomment-734675267


   @tristaZero 
   
   I'm glad that more open source projects use calcite to do data sharding 
based on SQL language. I don't care which project or community. This technology 
already exists in closed source software.
   
   Calcite converts  SQL  to `LogicalTableScan ` , before  `LogicalTableScan ` 
applys other table interfaces.
   
   `ProjectableFilterableTable `(`FilterableTable`,`ScannableTable`) has 
built-in rules in calcite, so you can use it to achieve pushdown projection and 
filtering, and correspondingly you can generate about ```
   select
   ... from... Where... 
   ```, but if you want to define more relnode (your own SQL generating rules), 
you can use `TranslatableTable`(or perform conversion in other stages). It can 
use relnode of your defined table instead of using `LogicalTableScan `. 
Relatively, you need to write your own rules to optimize it. In fact, a table 
can be `ProjectableFilterableTable `, `TranslatableTable`, `FilterableTable`, 
`ScannableTable `or **custom interface**.
   
   When the result of `TranslatableTable `is `LogicalTableScan `, it is 
trivial.The result also can be anther `ProjectableFilterableTable `  RelNode.
   
   A conservative approach is to distinguish multiple converters or optimizers. 
In the first stage, when SQL generates relnode, use the built-in table 
interface and rules of calculate, and then try your own rules or do the next 
transformation in the second stage.
   
   If you know all the rules, you can perform all transformations in one phase.
   
   


----------------------------------------------------------------
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]


Reply via email to