Shuyi,

That's great that you're looking to improve the Cassandra adapter. You're
right that right now it will only push down the filter if the entire set of
predicates is supported. To perform a partial pushdown, you would have to
modify CassandraFilterRule to identify which predicates can be pushed down.
(You might find this easier if you convert the condition into CNF -- see
RexUtil.toCnf). Inside the convert method of CassandraFilterRule, you would
then construct a LogicalFilter which filters on the remaining predicates
and use that as input to the generated CassandraFilter RelNode.

Unfortunately I likely won't have the time to implement this myself until
September at the earliest, but let me know i you decide to try this and I'm
happy to help with suggestions and code review.

Cheers,
--
Michael Mior
[email protected]

2016-08-03 13:57 GMT-04:00 Shuyi Chen <[email protected]>:

> Hi,
>
> I am working on improving the cassandra adapter. Right now, I found that if
> my filter contains non-primary keys, calcite will just reject the filter
> and just execute a no-filter cql query  which is bad. I am wondering how I
> can split the filter into cassandra supported part and
> cassandra-non-supported part, and push down the cassandra supported part to
> cql. Below is an example.
>
> Assuming the cassandra table contains field: a, b, c, and a is the only
> primary key.
>
> calcite sql is:  select a, b, c from table1 where a = 'xxx' and b < 3223;
>
> I want to push down cql: select a, b, c from table1 where a = 'xxx' to
> cassandra,
>
> But right now, the cassandra adapter will only push down: select a, b, c
> from table1, which is bad for cassandra.
>
> Thanks a lot.
> Shuyi
>
> --
> "So you have to trust that the dots will somehow connect in your future."
>

Reply via email to