Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13729

Calcite bug. "Not a boolean expression" on nested expression.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • sql

    Description

      Nested sql failure:

      "SELECT name FROM Orders o WHERE NOT EXISTS ("SELECT 1 FROM Account a WHERE o.name = a.name)"
      
      	Caused by: org.codehaus.commons.compiler.CompileException: Line 3, Column 23: Not a boolean expression
      		at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:12211)
      		at org.codehaus.janino.UnitCompiler.compileBoolean2(UnitCompiler.java:3994)
      		at org.codehaus.janino.UnitCompiler.access$6300(UnitCompiler.java:215)
      		at org.codehaus.janino.UnitCompiler$14$1.visitAmbiguousName(UnitCompiler.java:3942)
      		at org.codehaus.janino.UnitCompiler$14$1.visitAmbiguousName(UnitCompiler.java:3939)
      		at org.codehaus.janino.Java$AmbiguousName.accept(Java.java:4224)
      		at org.codehaus.janino.UnitCompiler$14.visitLvalue(UnitCompiler.java:3939)
      		at org.codehaus.janino.UnitCompiler$14.visitLvalue(UnitCompiler.java:3935)
      		at org.codehaus.janino.Java$Lvalue.accept(Java.java:4148)
      		at org.codehaus.janino.UnitCompiler.compileBoolean(UnitCompiler.java:3935)
      		at org.codehaus.janino.UnitCompiler.compileBoolean2(UnitCompiler.java:4075)
      		at org.codehaus.janino.UnitCompiler.access$6600(UnitCompiler.java:215)
      		at org.codehaus.janino.UnitCompiler$14.visitBinaryOperation(UnitCompiler.java:3957)
      		at org.codehaus.janino.UnitCompiler$14.visitBinaryOperation(UnitCompiler.java:3935)
      		at org.codehaus.janino.Java$BinaryOperation.accept(Java.java:4864)
      		at org.codehaus.janino.UnitCompiler.compileBoolean(UnitCompiler.java:3935)
      		at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:2464)
      		at org.codehaus.janino.UnitCompiler.access$1900(UnitCompiler.java:215)
      		at org.codehaus.janino.UnitCompiler$6.visitIfStatement(UnitCompiler.java:1495)
      		at org.codehaus.janino.UnitCompiler$6.visitIfStatement(UnitCompiler.java:1487)
      		at org.codehaus.janino.Java$IfStatement.accept(Java.java:2950)
      		at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:1487)
      		at org.codehaus.janino.UnitCompiler.compileStatements(UnitCompiler.java:1567)
      		at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:3388)
      		at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1357)
      		at org.codehaus.janino.UnitCompiler.compileDeclaredMethods(UnitCompiler.java:1330)
      		at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:822)
      		at org.codehaus.janino.UnitCompiler.compile2(UnitCompiler.java:432)
      		at org.codehaus.janino.UnitCompiler.access$400(UnitCompiler.java:215)
      		at org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:411)
      		at org.codehaus.janino.UnitCompiler$2.visitPackageMemberClassDeclaration(UnitCompiler.java:406)
      		at org.codehaus.janino.Java$PackageMemberClassDeclaration.accept(Java.java:1414)
      		at org.codehaus.janino.UnitCompiler.compile(UnitCompiler.java:406)
      		at org.codehaus.janino.UnitCompiler.compileUnit(UnitCompiler.java:378)
      		at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:237)
      		at org.codehaus.janino.SimpleCompiler.compileToClassLoader(SimpleCompiler.java:465)
      		at org.codehaus.janino.ClassBodyEvaluator.compileToClass(ClassBodyEvaluator.java:313)
      		at org.codehaus.janino.ClassBodyEvaluator.cook(ClassBodyEvaluator.java:235)
      		at org.codehaus.janino.SimpleCompiler.cook(SimpleCompiler.java:207)
      		at org.codehaus.commons.compiler.Cookable.cook(Cookable.java:50)
      		at org.codehaus.janino.ClassBodyEvaluator.createInstance(ClassBodyEvaluator.java:347)
      		at org.apache.ignite.internal.processors.query.calcite.util.Commons.compile(Commons.java:294)
      		... 31 more
      	Suppressed: org.apache.ignite.internal.processors.query.calcite.metadata.RemoteException: Remote query execution
      		... 14 more
      	Caused by: java.lang.NullPointerException
      		at org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.push(ScanNode.java:115)
      		at org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.doPush(ScanNode.java:75)
      		... 3 more
      Caused by: java.lang.NullPointerException
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.push(ScanNode.java:115)
      	at org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.doPush(ScanNode.java:75)
      	... 3 more
      

      appropriate plan:

      IgniteProject(NAME=[$0]): rowcount = 253.375, cumulative cost = 20395.125, id = 961
        IgniteFilter(condition=[IS NULL($2)]): rowcount = 253.375, cumulative cost = 20140.75, id = 960
          IgniteNestedLoopJoin(condition=[=($0, $1)], joinType=[left], variablesSet=[[]]): rowcount = 1013.5, cumulative cost = 19126.25, id = 959
            IgniteExchange(distribution=[single]): rowcount = 1000.0, cumulative cost = 5000.0, id = 955
              IgniteTableScan(table=[[PUBLIC, ORDERS]], requiredColunms=[{2}]): rowcount = 1000.0, cumulative cost = 1000.0, id = 188
            IgniteReduceAggregate(rowType=[RecordType(JavaType(class java.lang.String) NAME, BOOLEAN $f1)], group=[{0}], agg#0=[MIN($1)]): rowcount = 90.0, cumulative cost = 3971.25, id = 958
              IgniteExchange(distribution=[single]): rowcount = 90.0, cumulative cost = 3881.25, id = 957
                IgniteMapAggregate(group=[{0}], agg#0=[MIN($1)]): rowcount = 90.0, cumulative cost = 2801.25, id = 956
                  IgniteTableScan(table=[[PUBLIC, ACCOUNT]], filters=[IS NOT NULL($t0)], projects=[[$t0, true]], requiredColunms=[{2}]): rowcount = 900.0, cumulative cost = 2700.0, id = 211
      

      Attachments

        Issue Links

          Activity

            People

              korlov Konstantin Orlov
              zstan Evgeny Stanilovsky
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m