calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "刘东明" <l.dongm...@foxmail.com>
Subject 回复:Calcite how to push down project/filter/aggregation to TableScan.
Date Tue, 25 Oct 2016 04:00:02 GMT
Or I do not use the RelBuiler in TableScan (This design has a history reason, but now can change
it). 


Add a special node (exchange?) in original tree, push the relnode under the special node.
At last, convert the relnode subtree under the special node to query for datasource(RDBMS).


Any idea?


------------------ 原始邮件 ------------------
发件人: "刘东明";<l.dongming@foxmail.com>;
发送时间: 2016年10月25日(星期二) 中午11:20
收件人: "dev"<dev@calcite.apache.org>; 

主题: Calcite how to push down project/filter/aggregation to TableScan.



Hi, all

    I am using Apache Calcite to implement a distributed OLAP system, which datasource is
RDBMS. So I want to push down the project/filter/aggregation in RelNode tree to MyTableScan
extends TableScan. In MyTableScan, a RelBuilder to get the pushed RelNode. At last, RelBuilder
to genatate the Query to the source database. At the same time, the project/filter/aggregation
in original RelNode tree should be moved or modified.


    I am using RelOptRule and HepPlanner to implement this feature. I create a rule that match
some operands, when onmatch(), I will use one tableScan to replace the matched subtree.


   There are some case:
   1) filter->tableScan  Use transformTo method in RelOptRule I can easily push the filter
into tableScan and remove the filter in original tree.
   2) project->tableScan Can not use transformTo method, because the areRowTypesEqual is
false. 
   3) push and change aggregation node. In original RelNode tree, count change to sum, avg
change to sum/count, at the same time, the agg function be pushed to tableScan.


   for 2) and 3), any idea to implement? 


Thanks.
Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message