calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "刘东明" <>
Subject Calcite how to push down project/filter/aggregation to TableScan.
Date Tue, 25 Oct 2016 03:20:07 GMT
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
   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? 

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