asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Till Westmann (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ASTERIXDB-1203) QuantifiedExpressions in IfThenElse throws NPE
Date Mon, 28 Dec 2015 20:32:49 GMT

     [ https://issues.apache.org/jira/browse/ASTERIXDB-1203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Till Westmann updated ASTERIXDB-1203:
-------------------------------------
    Component/s: Optimizer
                 AsterixDB

> QuantifiedExpressions in IfThenElse throws NPE
> ----------------------------------------------
>
>                 Key: ASTERIXDB-1203
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1203
>             Project: Apache AsterixDB
>          Issue Type: Bug
>          Components: AsterixDB, Optimizer
>            Reporter: Wail Alkowaileet
>            Assignee: Yingyi Bu
>
> I found another bug in the typeComputer: 
> - Input:
> {noformat}
> {
> 	"id":0,
> 	"names":{
> 		"count": "1",
> 		"name" :{
> 			"firstName" : "wail",
> 			"lastName" : "Alkowaileet"
> 		}
> 	}
> }
> {
> 	"id":1,
> 	"names":{
> 		"count": "2",
> 		"name" :[
> 		{
> 			"firstName" : "wail",
> 			"lastName" : "Alkowaileet"
> 		},
> 		{
> 			"firstName" : "Sattam",
> 			"lastName" : "Alsubaiee"
> 		}
> 		]
> 	}
> }
> {noformat}
> - DDL:
> {noformat}
> create dataverse ifVerse
> use dataverse ifVerse
> create type ifType as open
> {
>     id: int32
> }
> create dataset ifds(ifType)
> primary key id
> {noformat}
> - DML:
> {noformat}
> use dataverse ifVerse
> insert into dataset ifds(
> {
> 	"id":0,
> 	"names":{
> 		"count": "1",
> 		"name" :{
> 			"firstName" : "wail",
> 			"lastName" : "Alkowaileet"
> 		}
> 	}
> }
> )
> insert into dataset ifds(
> {
> 	"id":1,
> 	"names":{
> 		"count": "2",
> 		"name" :[
> 		{
> 			"firstName" : "wail",
> 			"lastName" : "Alkowaileet"
> 		},
> 		{
> 			"firstName" : "Sattam",
> 			"lastName" : "Alsubaiee"
> 		}
> 		]
> 	}
> }
> )
> {noformat}
> - FLWOR:
> {noformat}
> use dataverse ifVerse
> for $x in dataset ifds
> where ( 
> if ($x.names.count = "1") then
>    $x.names.name.firstName = "wail"
> else
>    (some $v in $x.names.name satisfies $v.firstName = "wail")
> )
> return $x
> {noformat}
> - Exception:
> SEVERE: null
> java.lang.NullPointerException
> 	at org.apache.asterix.om.typecomputer.impl.UnaryBooleanOrNullFunctionTypeComputer.computeType(UnaryBooleanOrNullFunctionTypeComputer.java:51)
> 	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.hyracks.algebricks.core.algebra.typing.AbstractTypeEnvironment.getType(AbstractTypeEnvironment.java:45)
> 	at org.apache.asterix.optimizer.rules.CheckFilterExpressionTypeRule.rewritePost(CheckFilterExpressionTypeRule.java:62)
> 	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: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.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:87)
> 	at org.apache.asterix.api.common.APIFramework.compileQuery(APIFramework.java:289)
> 	at org.apache.asterix.aql.translator.QueryTranslator.rewriteCompileQuery(QueryTranslator.java:1907)
> 	at org.apache.asterix.aql.translator.QueryTranslator.handleQuery(QueryTranslator.java:2482)
> 	at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:394)
> 	at org.apache.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:148)
> 	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)



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

Mime
View raw message