Hi Mans,
This statement in the Javadoc sums it up for me:
Generally a Table will implement this interface to create a particular
subclass of RelNode,
and also register rules that act on that particular subclass of RelNode.
The Table instances in the Schema must be implemented in some way. You can
implement something like ScannableTable to directly implement Enumerable
convention. But TranslatableTable allows you to use your own convention
which facilitates pushing other operations. If you look at CassandraTable
for instance, it's toRel() method will create an instance of
CassandraTableScan. All Cassandra rules look for Cassandra convention
inputs. If you look at CassandraFilterRule, it will only match a
CassandraTableScan input. If you convert to an EnumerableTableScan, then
the filter would have to be evaluated by Calcite which requires
transferring all the underlying data to the node evaluating the query.
Jess
On Sun, Jan 9, 2022 at 4:46 PM M Singh <[email protected]> wrote:
> Hi:
> I am trying to understand what is the role of Translatable table and
> when/how it should be used.
> According to the docs (
> https://calcite.apache.org/javadocAggregate/org/apache/calcite/schema/TranslatableTable.html)
> it is not required but I am not sure the procs/cons.
> If there are any pointers which has a good explanation of it's use vs
> other tables, please let me know.
> Thanks
> Mans
>
>
>