If you are changing the semantics of the query I’m not sure that a planner rule is the right route. Planner rules need to preserve semantics.
However, you will be working with the relational algebra. Probably adding a Filter to the root RelNode of your query. You might find the algebra builder[1] useful. Or you might not. The cleanest way to add a WHERE clause is to define a view with the WHERE clause, write your query on that view, and the WHERE clause will be added during view expansion. Then you don’t need to change Calcite code at all. Julian [1] https://calcite.apache.org/news/2015/06/05/algebra-builder/ <https://calcite.apache.org/news/2015/06/05/algebra-builder/> > On May 13, 2016, at 10:38 AM, Kiril Menshikov <[email protected]> wrote: > > Hi, > > How to modify query and add one where condition? > > I suppose my queries can already contain where statement and might not > contain. > > So as I understand, I should use HepPlanner? > > Thanks, > -Kiril
