Uploaded image for project: 'Tajo'
  1. Tajo
  2. TAJO-674

ExplainLogicalPlan can cause NPE when a query includes derived tables

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: 0.8.0, 0.9.0
    • Component/s: Planner/Optimizer
    • Labels:
      None

      Description

      The reproduction query is as follows:

      SELECT distinct col1 FROM (SELECT * FROM col2 WHERE col3='2014-02-27') a
      

      Addition information is that col3 is a partition key.

      This query causes NPE as follows:

      HTTP ERROR: 500
      INTERNAL_SERVER_ERROR
      RequestURI=/querydetail.jsp
      Caused by:
      java.lang.NullPointerException
      at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visitTableSubQuery(BasicLogicalPlanVisitor.java:230)
      at org.apache.tajo.engine.planner.ExplainLogicalPlanVisitor.visitTableSubQuery(ExplainLogicalPlanVisitor.java:169)
      at org.apache.tajo.engine.planner.ExplainLogicalPlanVisitor.visitTableSubQuery(ExplainLogicalPlanVisitor.java:29)
      at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:93)
      at org.apache.tajo.engine.planner.ExplainLogicalPlanVisitor.visitUnaryNode(ExplainLogicalPlanVisitor.java:115)
      at org.apache.tajo.engine.planner.ExplainLogicalPlanVisitor.visitGroupBy(ExplainLogicalPlanVisitor.java:108)
      at org.apache.tajo.engine.planner.ExplainLogicalPlanVisitor.visitGroupBy(ExplainLogicalPlanVisitor.java:29)
      at org.apache.tajo.engine.planner.BasicLogicalPlanVisitor.visit(BasicLogicalPlanVisitor.java:75)
      at org.apache.tajo.engine.planner.ExplainLogicalPlanVisitor.getBlockPlanStrings(ExplainLogicalPlanVisitor.java:71)
      at org.apache.tajo.engine.planner.PlannerUtil.buildExplainString(PlannerUtil.java:701)
      at org.apache.tajo.engine.planner.global.MasterPlan.toString(MasterPlan.java:263)
      at org.apache.jsp.querydetail_jsp._jspService(org.apache.jsp.querydetail_jsp:231)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:109)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:389)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:486)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:380)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
      at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
      at org.mortbay.jetty.Server.handle(Server.java:324)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:533)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:207)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
      at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
      

        Activity

        Hide
        alvinhenrick Alvin Henrick added a comment -

        Hi Guys ,
        Do we have the sample DDL statements to create those tables ? Just want to recreate the issue to fix it.

        Any help is appreciated ?

        Thanks!
        Warm Regards,
        Alvin.

        Show
        alvinhenrick Alvin Henrick added a comment - Hi Guys , Do we have the sample DDL statements to create those tables ? Just want to recreate the issue to fix it. Any help is appreciated ? Thanks! Warm Regards, Alvin.
        Hide
        hyunsik Hyunsik Choi added a comment -

        Hi Alvin Henrick,

        I'm very sorry for late response and not closing this issue. Actually, I fixed this bug in TAJO-353 because I couldn't try to debug the codes due to this bug. It can be fixed as 'not a problem'. I'm sorry again.

        Regards,
        Hyunsik Choi

        Show
        hyunsik Hyunsik Choi added a comment - Hi Alvin Henrick , I'm very sorry for late response and not closing this issue. Actually, I fixed this bug in TAJO-353 because I couldn't try to debug the codes due to this bug. It can be fixed as 'not a problem'. I'm sorry again. Regards, Hyunsik Choi

          People

          • Assignee:
            alvinhenrick Alvin Henrick
            Reporter:
            hyunsik Hyunsik Choi
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development