Hi followers. When I learned how to simplify the Rexnode in Calcite. I meet a problem and need some help. For example: When we simplify "a <> 1 or a = 1 [a is nullable]", (the result is different according to how to treat the UNKNOW value) :
checkSimplify3_( or(ne(vInt(0), literal(1)), eq(vInt(0), literal(1))), "OR(IS NOT NULL(?0.int0), null)", "IS NOT NULL(?0.int0)", "true"); But when I try to simplify "a<>1 and a = 2 [a is nullable]": checkSimplify3_( and(ne(vInt(0), literal(1)), eq(vInt(0), literal(2))), "=(?0.int0, 2)", "=(?0.int0, 2)", "=(?0.int0, 2)"); And I think this result should be: "a<>1 and a = 2 [a is nullable]": UNKNOW AS TRUE: a IS NULL or a = 2 UNKNOW AS FALSE: a is NOT NULL and a =2 UNKNOW AS UNKNOW: CASE(IS NULL(a), null, a = 2) So What did I misunderstand? It is a bug or intentional? Any feedback would be appreciated.