Re: [Discuss] The RexSimplify about "a <> 1 and a = 2"

2022-04-02 Thread xiong duan
Hi, Followers. Thanks for the feedback. Yes, I have a misunderstanding about this. 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)", "=(

Re: [Discuss] The RexSimplify about "a <> 1 and a = 2"

2022-03-03 Thread Julian Hyde
Note that https://issues.apache.org/jira/browse/CALCITE-1794 deals with very similar expressions (albeit with CAST, and optimized using SARGs rather than RexSimplify) and was just fixed today. > On Mar 2, 2022, at 4:52 PM, Benchao Li wrote:

Re: [Discuss] The RexSimplify about "a <> 1 and a = 2"

2022-03-02 Thread Benchao Li
Hi xiong, For the simplification result below: # "a <> 1 or a = 1 [a is nullable]" 1. UNKNOWN AS UNKNOWN: OR(IS NOT NULL(a), null) 2. UNKNOWN AS TRUE: TRUE 3. UNKNOWN AS FALSE: IS NOT NULL(a) # "a<>1 and a = 2 [a is nullable]" 1. UNKNOWN AS UNKNOWN: =(a, '2') 2. UNKNOWN AS TRUE: =(a, '2') 3. UNKN

[Discuss] The RexSimplify about "a <> 1 and a = 2"

2022-02-27 Thread xiong duan
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)),