Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-2526

Add test for OR with nullable comparisons

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.17.0
    • Fix Version/s: 1.18.0
    • Component/s: core
    • Labels:

      Description

          checkSimplify2(
              or(lt(vInt(), nullInt), ne(literal(0), vInt())),
              "...", "...");
      
      java.lang.NullPointerException
      	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:212)
      	at com.google.common.collect.Cut$BelowValue.<init>(Cut.java:293)
      	at com.google.common.collect.Cut.belowValue(Cut.java:288)
      	at com.google.common.collect.Range.atLeast(Range.java:272)
      	at org.apache.calcite.rex.RexSimplify.range(RexSimplify.java:1561)
      	at org.apache.calcite.rex.RexSimplify.residue(RexSimplify.java:1093)
      	at org.apache.calcite.rex.RexSimplify.simplifyUsingPredicates(RexSimplify.java:1036)
      	at org.apache.calcite.rex.RexSimplify.simplifyComparison(RexSimplify.java:288)
      	at org.apache.calcite.rex.RexSimplify.simplifyComparison(RexSimplify.java:218)
      	at org.apache.calcite.rex.RexSimplify.simplify_(RexSimplify.java:209)
      	at org.apache.calcite.rex.RexSimplify.simplifyNot(RexSimplify.java:378)
      	at org.apache.calcite.rex.RexSimplify.simplify_(RexSimplify.java:185)
      	at org.apache.calcite.rex.RexSimplify.lambda$simplify$0(RexSimplify.java:175)
      	at org.apache.calcite.rex.RexSimplify.verify(RexSimplify.java:1154)
      	at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:175)
      	at org.apache.calcite.rex.RexSimplify.simplifyOrTerms(RexSimplify.java:349)
      	at org.apache.calcite.rex.RexSimplify.simplifyOr(RexSimplify.java:1115)
      	at org.apache.calcite.rex.RexSimplify.simplify_(RexSimplify.java:183)
      	at org.apache.calcite.rex.RexSimplify.lambda$simplify$0(RexSimplify.java:175)
      	at org.apache.calcite.rex.RexSimplify.verify(RexSimplify.java:1154)
      	at org.apache.calcite.rex.RexSimplify.simplify(RexSimplify.java:175)
      	at org.apache.calcite.test.RexProgramTest.checkSimplify2(RexProgramTest.java:150)
      

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              vladimirsitnikov Vladimir Sitnikov
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: