Re: Trivial query simplification

2019-09-25 Thread Enrico Olivelli
Il mer 25 set 2019, 23:38 Stamatis Zampetakis ha scritto: > Hi Enrico, > > The ReduceExpressionsRule.FILTER_INSTANCE is using the simplifier so if it > works > correctly I don't think there is anything more to be done. > Fine. Cheers Enrico > > Best, > Stamatis > > On Wed, Sep 25, 2019 at

Re: Trivial query simplification

2019-09-25 Thread Stamatis Zampetakis
Hi Enrico, The ReduceExpressionsRule.FILTER_INSTANCE is using the simplifier so if it works correctly I don't think there is anything more to be done. Best, Stamatis On Wed, Sep 25, 2019 at 5:31 PM Enrico Olivelli wrote: > Thank you for your feedback. > > Actually

Re: Trivial query simplification

2019-09-25 Thread Enrico Olivelli
Thank you for your feedback. Actually ReduceExpressionsRule.FILTER_INSTANCE fixes the problem. RelOptPlanner optPlanner = cluster.getPlanner(); optPlanner.addRule(ReduceExpressionsRule.FILTER_INSTANCE); This code I had was wrong: final FrameworkConfig config = Frameworks.newConfigBuilder()

Re: Trivial query simplification

2019-09-24 Thread Julian Hyde
A few thoughts on this. 0. I am surprised that this simplification does not happen, and I think we should do it. Specifically, "filter(x = 0 and x is not null)" should simplify to “filter(x = 0)”. 1. Enrico, please log a JIRA case now, and transcribe the key points of this discussion into

Re: Trivial query simplification

2019-09-24 Thread Enrico Olivelli
Il giorno mar 24 set 2019 alle ore 13:45 XING JIN ha scritto: > "v = 1 and v is null" > cannot be simplified to "v = 1" not matter v is nullable or not nullable > > If you really mean that "v is not null", I made below test case in > RelOptRulesTest.java for illustration: > > > // mgr is

Re: Trivial query simplification

2019-09-24 Thread XING JIN
"v = 1 and v is null" cannot be simplified to "v = 1" not matter v is nullable or not nullable If you really mean that "v is not null", I made below test case in RelOptRulesTest.java for illustration: // mgr is nullable @Test public void testDEV() throws Exception { HepProgram program =

Re: Trivial query simplification

2019-09-24 Thread Enrico Olivelli
Il mar 24 set 2019, 11:50 Feng Zhu ha scritto: > Hi, Enrico, > I'm a little confused about your expectations. Could you clarify it? > Moreover, is it right for the below simplification (do you mean v is not > null)? > (v=1 and v is null) -> v=1 > (do you mean v is not null?) > Yes, sorry

Re: Trivial query simplification

2019-09-24 Thread Feng Zhu
Hi, Enrico, I'm a little confused about your expectations. Could you clarify it? Moreover, is it right for the below simplification (do you mean v is not null)? (v=1 and v is null) -> v=1 (do you mean v is not null?) Best regards Enrico Olivelli 于2019年9月24日周二 下午5:41写道: > Hi, > I have a query

Trivial query simplification

2019-09-24 Thread Enrico Olivelli
Hi, I have a query like SELECT * FROM MYTABLE WHERE v = 1 and v is null I am expecting Calcite to simplify it to SELECT * FROM MYTABLE WHERE v = 1 but this does not happen. Is any rule I should enable in order to make it happen ? This is the configuration of my Volcano planner: final