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

Compilation Error: Algebricks cannot compute type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None

    Description

      DDL:

      create dataverse wosDataverse
      use dataverse wosDataverse
      
      create type wosType as open {
      UID:string
      }
      
      create dataset wos(wosType)
      primary key UID
      

      AQL:

      use dataverse wosDataverse
      
      for $record in dataset wos
      let $summary :=  $record.static_data.summary
      let $names := $summary.names
      let $titles := $summary.titles
      
      where $names.count = "1" and string-length($names.name.first_name) = 1
      limit 10
      return {"firstName":$names.name.first_name,"lastName":$names.name.last_name,"titles":$titles.title, "type": $summary.pub_info.pubtype}
      

      Log:

      org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Cannot compute type
      	at org.apache.asterix.om.typecomputer.impl.UnaryStringInt64OrNullTypeComputer.computeType(UnaryStringInt64OrNullTypeComputer.java:74)
      	at org.apache.asterix.dataflow.data.common.AqlExpressionTypeComputer.getTypeForFunction(AqlExpressionTypeComputer.java:86)
      	at org.apache.asterix.dataflow.data.common.AqlExpressionTypeComputer.getType(AqlExpressionTypeComputer.java:57)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.hasClosedType(SetClosedRecordConstructorsRule.java:180)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:164)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:1)
      	at org.apache.hyracks.algebricks.core.algebra.visitors.AbstractConstVarFunVisitor.visitScalarFunctionCallExpression(AbstractConstVarFunVisitor.java:39)
      	at org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression.accept(ScalarFunctionCallExpression.java:55)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:153)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:1)
      	at org.apache.hyracks.algebricks.core.algebra.visitors.AbstractConstVarFunVisitor.visitScalarFunctionCallExpression(AbstractConstVarFunVisitor.java:39)
      	at org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression.accept(ScalarFunctionCallExpression.java:55)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:153)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:1)
      	at org.apache.hyracks.algebricks.core.algebra.visitors.AbstractConstVarFunVisitor.visitScalarFunctionCallExpression(AbstractConstVarFunVisitor.java:39)
      	at org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression.accept(ScalarFunctionCallExpression.java:55)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.transform(SetClosedRecordConstructorsRule.java:93)
      	at org.apache.hyracks.algebricks.core.algebra.operators.logical.SelectOperator.acceptExpressionTransform(SelectOperator.java:83)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule.rewritePost(SetClosedRecordConstructorsRule.java:72)
      	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.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:291)
      	at org.apache.asterix.aql.translator.QueryTranslator.rewriteCompileQuery(QueryTranslator.java:1900)
      	at org.apache.asterix.aql.translator.QueryTranslator.handleQuery(QueryTranslator.java:2474)
      	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:388)
      	at org.apache.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:168)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	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:228)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:956)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:411)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:188)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:891)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
      	at org.eclipse.jetty.server.Server.handle(Server.java:353)
      	at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:598)
      	at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1076)
      	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805)
      	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
      	at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:427)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:510)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:450)
      	at java.lang.Thread.run(Thread.java:745)
      Mar 08, 2016 11:44:50 PM org.apache.asterix.api.http.servlet.APIServlet doPost
      SEVERE: Cannot compute type
      org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Cannot compute type
      	at org.apache.asterix.om.typecomputer.impl.UnaryStringInt64OrNullTypeComputer.computeType(UnaryStringInt64OrNullTypeComputer.java:74)
      	at org.apache.asterix.dataflow.data.common.AqlExpressionTypeComputer.getTypeForFunction(AqlExpressionTypeComputer.java:86)
      	at org.apache.asterix.dataflow.data.common.AqlExpressionTypeComputer.getType(AqlExpressionTypeComputer.java:57)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.hasClosedType(SetClosedRecordConstructorsRule.java:180)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:164)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:1)
      	at org.apache.hyracks.algebricks.core.algebra.visitors.AbstractConstVarFunVisitor.visitScalarFunctionCallExpression(AbstractConstVarFunVisitor.java:39)
      	at org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression.accept(ScalarFunctionCallExpression.java:55)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:153)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:1)
      	at org.apache.hyracks.algebricks.core.algebra.visitors.AbstractConstVarFunVisitor.visitScalarFunctionCallExpression(AbstractConstVarFunVisitor.java:39)
      	at org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression.accept(ScalarFunctionCallExpression.java:55)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:153)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.visitFunctionCallExpression(SetClosedRecordConstructorsRule.java:1)
      	at org.apache.hyracks.algebricks.core.algebra.visitors.AbstractConstVarFunVisitor.visitScalarFunctionCallExpression(AbstractConstVarFunVisitor.java:39)
      	at org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression.accept(ScalarFunctionCallExpression.java:55)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule$SettingClosedRecordVisitor.transform(SetClosedRecordConstructorsRule.java:93)
      	at org.apache.hyracks.algebricks.core.algebra.operators.logical.SelectOperator.acceptExpressionTransform(SelectOperator.java:83)
      	at org.apache.asterix.optimizer.rules.SetClosedRecordConstructorsRule.rewritePost(SetClosedRecordConstructorsRule.java:72)
      	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.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:291)
      	at org.apache.asterix.aql.translator.QueryTranslator.rewriteCompileQuery(QueryTranslator.java:1900)
      	at org.apache.asterix.aql.translator.QueryTranslator.handleQuery(QueryTranslator.java:2474)
      	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:388)
      	at org.apache.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:168)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	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:228)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:956)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:411)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:188)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:891)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114)
      	at org.eclipse.jetty.server.Server.handle(Server.java:353)
      	at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:598)
      	at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1076)
      	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805)
      	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)
      	at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:427)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:510)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34)
      	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:450)
      	at java.lang.Thread.run(Thread.java:745)
      

      Attachments

        Issue Links

          Activity

            People

              buyingyi Yingyi Bu
              wyk Wail Y. Alkowaileet
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: