Re: [Question] How to test the correctness of an optimization rule in quidem?

2023-08-30 Thread Julian Hyde
How about creating a RelOptRules#EXTENDED_RULES (or using some existing collection) and provide a means within a Quidem test to turn on that set of rules. > On Aug 28, 2023, at 9:56 PM, LakeShen wrote: > > Hi Julian, thanks for you reply.I have got some information from previous > commits, a n

Re: Filter push-down below join not occurring for custom UDF

2023-08-30 Thread Julian Hyde
I wanted to figure out whether the transformation that you want is valid. Let’s convert your query select T1.id, T2.id from T1 left join T2 on T1.id = T2.C201 where test(T1.id) into one of the same shape: select d.deptno, e.empno from dept as d left join emp as e on d.deptno = e.deptn

RE: Re: Filter push-down below join not occurring for custom UDF

2023-08-30 Thread Ian Bertolacci
Hi Benchao, Looking at this closer, I think I see what you mean. The distinguishing factor here is that the Policy [1] for the EQUALS operator is ANY, which is used in Strong.isNull to check if any of the operands can be null (which is true when above an outer join), which allows RelOptUtil.simp

RE: Re: Filter push-down below join not occurring for custom UDF

2023-08-30 Thread Ian Bertolacci
Hi Benchao, If that’s the case, then why are filters with non-custom operators pushed down? For example: https://pastebin.com/raw/aPLnHMaS Here I use `table.id = 1`,where `table` comes from the null-generating side of the join. Filter push down occurs, but only when FILTER_INTO_JOIN is enabled. -

Re: Filter push-down below join not occurring for custom UDF

2023-08-30 Thread Benchao Li
Hi Ian, FilterJoinRule[1] is designed to not push filters to null-generating side of Join, it has nothing to do with your custom UDF. [1] https://github.com/apache/calcite/blob/2bf1e7b2e8596a61b5ac19aa7bebb9910c4eea94/core/src/main/java/org/apache/calcite/rel/rules/FilterJoinRule.java#L111-L125

[jira] [Created] (CALCITE-5968) Provide an interface class for RexExecutable to decouple janino runtime binding

2023-08-30 Thread Wenzhuang Zhu (Jira)
Wenzhuang Zhu created CALCITE-5968: -- Summary: Provide an interface class for RexExecutable to decouple janino runtime binding Key: CALCITE-5968 URL: https://issues.apache.org/jira/browse/CALCITE-5968