Uploaded image for project: 'Apache AsterixDB'
  1. Apache AsterixDB
  2. ASTERIXDB-1231

Self join fails with index-out-of-bound exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The following query can reproduce the issue:

      for $m in dataset Metadata.Dataset
      for $n in dataset Metadata.Dataset
      where $m=$n
      return {
      "dv1": $m.DataverseName,
      "dv2": $n.DataverseName
      };

      Here is the stack trace:
      java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
      at java.util.ArrayList.rangeCheck(ArrayList.java:653)
      at java.util.ArrayList.get(ArrayList.java:429)
      at org.apache.asterix.optimizer.rules.am.AbstractIntroduceAccessMethodRule.matchVarsFromOptFuncExprToDataSourceScan(AbstractIntroduceAccessMethodRule.java:568)
      at org.apache.asterix.optimizer.rules.am.AbstractIntroduceAccessMethodRule.fillAllIndexExprs(AbstractIntroduceAccessMethodRule.java:531)
      at org.apache.asterix.optimizer.rules.am.AbstractIntroduceAccessMethodRule.fillSubTreeIndexExprs(AbstractIntroduceAccessMethodRule.java:108)
      at org.apache.asterix.optimizer.rules.am.IntroduceJoinAccessMethodRule.rewritePost(IntroduceJoinAccessMethodRule.java:136)
      at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:125)
      at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:99)
      at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:99)
      at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:99)
      at org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialFixpointRuleController.rewriteWithRuleCollection(SequentialFixpointRuleController.java:53)
      at org.apache.hyracks.algebricks.core.rewriter.base.HeuristicOptimizer.runOptimizationSets(HeuristicOptimizer.java:95)
      at org.apache.hyracks.algebricks.core.rewriter.base.HeuristicOptimizer.optimize(HeuristicOptimizer.java:82)
      at org.apache.hyracks.algebricks.compiler.api.HeuristicCompilerFactoryBuilder$1$1.optimize(HeuristicCompilerFactoryBuilder.java:87)
      at org.apache.asterix.api.common.APIFramework.compileQuery(APIFramework.java:289)
      at org.apache.asterix.aql.translator.QueryTranslator.rewriteCompileQuery(QueryTranslator.java:1896)
      at org.apache.asterix.aql.translator.QueryTranslator.handleQuery(QueryTranslator.java:2470)
      at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:384)
      at org.apache.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:148)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:546)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:483)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:970)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:411)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:904)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
      at org.eclipse.jetty.server.Server.handle(Server.java:347)
      at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:439)
      at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:924)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:781)
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:220)
      at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:43)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
      at java.lang.Thread.run(Thread.java:745)

        Attachments

          Activity

            People

            • Assignee:
              wangsaeu Taewoo Kim
              Reporter:
              buyingyi Yingyi Bu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: