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

Support LITERAL_AGG in Interpreter

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.36.0
    • None
    • None

    Description

      In CALCITE-4334 we added LITERAL_AGG, an internal aggregate function that returns a constant, but we did not extend Interpreter to execute queries containing LITERAL_AGG. This change fixes that.

      Without that change, Interpreter throws a NullPointerException during construction:

      java.lang.NullPointerException: agg.state
      	at java.base/java.util.Objects.requireNonNull(Objects.java:233)
      	at org.apache.calcite.interpreter.AggregateNode.getAccumulator(AggregateNode.java:206)
      	at org.apache.calcite.interpreter.AggregateNode.<init>(AggregateNode.java:95)
      	at org.apache.calcite.interpreter.Nodes$CoreCompiler.visit(Nodes.java:54)
      	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
      	at org.apache.calcite.util.ReflectUtil.invokeVisitorInternal(ReflectUtil.java:263)
      	at org.apache.calcite.util.ReflectUtil.invokeVisitor(ReflectUtil.java:220)
      	at org.apache.calcite.util.ReflectUtil$1.invokeVisitor(ReflectUtil.java:470)
      	at org.apache.calcite.interpreter.Interpreter$CompilerImpl.visit(Interpreter.java:358)
      	at org.apache.calcite.interpreter.Nodes$CoreCompiler.visit(Nodes.java:48)
      	at org.apache.calcite.interpreter.Interpreter$CompilerImpl.visitRoot(Interpreter.java:312)
      	at org.apache.calcite.interpreter.Interpreter.<init>(Interpreter.java:88)
      

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: