asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yingyi Bu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ASTERIXDB-1490) NPE for negative expression
Date Tue, 21 Jun 2016 21:46:57 GMT
Yingyi Bu created ASTERIXDB-1490:
------------------------------------

             Summary: NPE for negative expression
                 Key: ASTERIXDB-1490
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1490
             Project: Apache AsterixDB
          Issue Type: Bug
          Components: Optimizer
            Reporter: Yingyi Bu
            Assignee: Yingyi Bu


Query:

{noformat}
SELECT VALUE COUNT(1)
FROM (
   SELECT DISTINCT VALUE -n.foo
   FROM Bar n 
) tmp;
{noformat}

Exception trace:
{noformat}
java.lang.NullPointerException
	at org.apache.asterix.om.typecomputer.impl.ListConstructorTypeComputer.computeTypeFromItems(ListConstructorTypeComputer.java:59)
	at org.apache.asterix.om.typecomputer.impl.ListConstructorTypeComputer.computeType(ListConstructorTypeComputer.java:50)
	at org.apache.asterix.dataflow.data.common.AqlExpressionTypeComputer.getTypeForFunction(AqlExpressionTypeComputer.java:75)
	at org.apache.asterix.dataflow.data.common.AqlExpressionTypeComputer.getType(AqlExpressionTypeComputer.java:53)
	at org.apache.hyracks.algebricks.core.algebra.operators.logical.AggregateOperator.computeOutputTypeEnvironment(AggregateOperator.java:106)
	at org.apache.hyracks.algebricks.core.rewriter.base.AlgebricksOptimizationContext.computeAndSetTypeEnvironmentForOperator(AlgebricksOptimizationContext.java:295)
	at org.apache.hyracks.algebricks.rewriter.rules.InferTypesRule.rewritePost(InferTypesRule.java:42)
	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:111)
	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.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.SequentialOnceRuleController.rewriteWithRuleCollection(SequentialOnceRuleController.java:44)
	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:88)
	at org.apache.asterix.api.common.APIFramework.compileQuery(APIFramework.java:263)
	at org.apache.asterix.aql.translator.QueryTranslator.rewriteCompileQuery(QueryTranslator.java:1959)
	at org.apache.asterix.aql.translator.QueryTranslator.handleQuery(QueryTranslator.java:2521)
	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:389)
	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:253)
	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)
{noformat}

But the following equivalent query works:
{noformat}
SELECT VALUE COUNT(1)
FROM (
   SELECT DISTINCT VALUE 0-n.foo
   FROM NBALife n 
) tmp;
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message