Re: FilterableTable query planner question

2024-01-08 Thread Eric Berryman
Perfect! Thank you so much! On Mon, Jan 8, 2024 at 12:41 Alessandro Solimando < alessandro.solima...@gmail.com> wrote: > Hey Eric, > that's correct and it's FilterSetOpTransposeRule > < >

Re: FilterableTable query planner question

2024-01-08 Thread Alessandro Solimando
Hey Eric, that's correct and it's FilterSetOpTransposeRule that performs such transformations for set operators (including UNION ALL).

Re: FilterableTable query planner question

2024-01-08 Thread Ruben Q L
Hi Eric, If I am not mistaken, in order to achieve that you need to use FilterSetOpTransposeRule [1], see CoreRules#FILTER_SET_OP_TRANSPOSE. Best regards, Ruben [1] https://github.com/apache/calcite/blob/main/core/src/main/java/org/apache/calcite/rel/rules/FilterSetOpTransposeRule.java On Mon,

Re: FilterableTable query planner question

2024-01-08 Thread Eric Berryman
Thank you, That makes sense. But it seems I should see a filter pushed below for a where on a union, no? ie. SELECT t2.field FROM ( SELECT id, field FROM table1 UNION ALL SELECT id, field FROM table2 UNION ALL SELECT id, field FROM table3) as t2 WHERE t2.field = 'test' Thank you again! Eric On

Re: FilterableTable query planner question

2024-01-03 Thread Stamatis Zampetakis
Hey Eric, When you have a disjunction in the WHERE clause it may not be safe to push the condition below a join especially when it comes to outer joins. I suppose that the FilterJoinRule [1] is the place that you want to check to see if the filter can be pushed below the join and into the scan.