Many thanks for moving this forward Julian, much appreciated. At the moment the main blocker is the Avatica release ([1,2]) that in turn waits for CALCITE-4503 [3]. It would be great if somebody has some cycles to review and merge the respective PR [4].
Best, Stamatis [1] https://issues.apache.org/jira/browse/CALCITE-4528 [2] https://issues.apache.org/jira/browse/CALCITE-4488 [3] https://issues.apache.org/jira/browse/CALCITE-4503 [4] https://github.com/apache/calcite-avatica/pull/138 On Sun, Feb 28, 2021 at 2:22 AM Julian Hyde <[email protected]> wrote: > Vladimir, > > Thanks for finding this bug. Please log it. > > I don't intend to fix any more bugs in this area before 1.27. It has > been a huge effort on my part, and I have not received any help from > anyone. > > Julian > > On Wed, Feb 24, 2021 at 3:57 PM Vladimir Sitnikov > <[email protected]> wrote: > > > > Thanks for pushing this forward. > > > > Would you please add search/sarg shrinking to RexShrinker? > > > > There are failures though: > > > > @Test void singleFuzzyTest() { > > Random r = new Random(); > > r.setSeed(6321443803263498676L); > > RexFuzzer fuzzer = new RexFuzzer(rexBuilder, typeFactory); > > generateRexAndCheckTrueFalse(fuzzer, r); > > } > > > > yields > > > > $node isAlwaysTrue, so it should simplify to TRUE unknownAsFalse > > > > SEARCH(-(COALESCE(?0.int0, CASE(=(CASE(false, SEARCH(?0.notNullInt0, > > Sarg[(0..2]; NULL AS FALSE]), true), NOT(IS NOT TRUE(false))), > -(+(100500), > > -(CASE(true, 1, 100500), CASE(=(?0.notNullBool0, ?0.notNullBool0), > > null:INTEGER, ?0.notNullInt1))), CASE(=(COALESCE(0, ?0.int1), 1), 1, > > =(COALESCE(0, ?0.int1), -(null, ?0.int1)), CASE(?0.notNullBool0, > > COALESCE(?0.int0, ?0.int1), -(null:INTEGER, null:INTEGER)), > null:INTEGER)), > > +(*(COALESCE(COALESCE(1, -2038957448, 0), CASE(false, ?0.int0, > > null:INTEGER), COALESCE(?0.notNullInt0, null:INTEGER, null:INTEGER, -1), > > COALESCE(0, 933814882, ?0.int0)), COALESCE(+(100500), CASE(?0.bool1, > > ?0.notNullInt0, null:INTEGER))))), CASE(=(-(null:INTEGER), 100500), > > COALESCE(-(-(CASE(=(?0.bool0, ?0.notNullBool1), ?0.notNullInt1, > > null:INTEGER), ?0.notNullInt0)), +(COALESCE(-(-1), ?0.notNullInt1, > > -(null:INTEGER, null:INTEGER))), CASE(=(OR(?0.bool0, ?0.bool1, false), > > <(true, ?0.notNullBool0)), -(+(null:INTEGER)), =(OR(?0.bool0, ?0.bool1, > > false), SEARCH(null:INTEGER, Sarg[TRUE])), CASE(=(-1, null), > > CASE(=(?0.notNullBool1, ?0.bool0), 1135316986, null:INTEGER), =(-1, 1), > > +(null:INTEGER), =(-1, 100500), -(1), +(?0.notNullInt1, ?0.notNullInt0)), > > COALESCE(-(null:INTEGER), CASE(true, 100500, null:INTEGER), *(1994412942, > > null))), CASE(=(IS UNKNOWN(?0.notNullBool0), IS NOT > > UNKNOWN(?0.notNullBool1)), +(?0.notNullInt1), =(IS > > UNKNOWN(?0.notNullBool0), IS DISTINCT FROM(?0.notNullInt1, 1)), -(null, > > +(-1)), =(IS UNKNOWN(?0.notNullBool0), >(false, true)), +(-(null, > ?0.int1), > > *(100500, ?0.int0)), CASE(=(?0.bool0, false), +(-1, 100500), > *(-1236110720, > > ?0.int0)))), =(-(null:INTEGER), +(+(COALESCE(?0.int0, null:INTEGER, > > null:INTEGER, ?0.notNullInt0)))), ?0.notNullInt1, 100500)), Sarg[=]) > > > > Actual :IS NOT NULL(-(COALESCE(?0.int0, CASE(=(CASE(false, > > SEARCH(?0.notNullInt0, Sarg[(0..2]; NULL AS FALSE]), true), NOT(IS NOT > > TRUE(false))), -(+(100500), -(CASE(true, 1, 100500), > > CASE(=(?0.notNullBool0, ?0.notNullBool0), null:INTEGER, > ?0.notNullInt1))), > > CASE(=(COALESCE(0, ?0.int1), 1), 1, =(COALESCE(0, ?0.int1), -(null, > > ?0.int1)), CASE(?0.notNullBool0, COALESCE(?0.int0, ?0.int1), > > -(null:INTEGER, null:INTEGER)), null:INTEGER)), +(*(COALESCE(COALESCE(1, > > -2038957448, 0), CASE(false, ?0.int0, null:INTEGER), > > COALESCE(?0.notNullInt0, null:INTEGER, null:INTEGER, -1), COALESCE(0, > > 933814882, ?0.int0)), COALESCE(+(100500), CASE(?0.bool1, ?0.notNullInt0, > > null:INTEGER))))), CASE(=(-(null:INTEGER), 100500), > > COALESCE(-(-(CASE(=(?0.bool0, ?0.notNullBool1), ?0.notNullInt1, > > null:INTEGER), ?0.notNullInt0)), +(COALESCE(-(-1), ?0.notNullInt1, > > -(null:INTEGER, null:INTEGER))), CASE(=(OR(?0.bool0, ?0.bool1, false), > > <(true, ?0.notNullBool0)), -(+(null:INTEGER)), =(OR(?0.bool0, ?0.bool1, > > false), SEARCH(null:INTEGER, Sarg[TRUE])), CASE(=(-1, null), > > CASE(=(?0.notNullBool1, ?0.bool0), 1135316986, null:INTEGER), =(-1, 1), > > +(null:INTEGER), =(-1, 100500), -(1), +(?0.notNullInt1, ?0.notNullInt0)), > > COALESCE(-(null:INTEGER), CASE(true, 100500, null:INTEGER), *(1994412942, > > null))), CASE(=(IS UNKNOWN(?0.notNullBool0), IS NOT > > UNKNOWN(?0.notNullBool1)), +(?0.notNullInt1), =(IS > > UNKNOWN(?0.notNullBool0), IS DISTINCT FROM(?0.notNullInt1, 1)), -(null, > > +(-1)), =(IS UNKNOWN(?0.notNullBool0), >(false, true)), +(-(null, > ?0.int1), > > *(100500, ?0.int0)), CASE(=(?0.bool0, false), +(-1, 100500), > *(-1236110720, > > ?0.int0)))), =(-(null:INTEGER), +(+(COALESCE(?0.int0, null:INTEGER, > > null:INTEGER, ?0.notNullInt0)))), ?0.notNullInt1, 100500))) > > > > at > > > org.apache.calcite.test.fuzzer.RexProgramFuzzyTest.checkUnknownAs(RexProgramFuzzyTest.java:251) > > > > Vladimir >
