asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Jacobs (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ASTERIXDB-2089) Bad return type error for valid SQL++ query
Date Thu, 14 Sep 2017 16:53:02 GMT

    [ https://issues.apache.org/jira/browse/ASTERIXDB-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16166589#comment-16166589
] 

Steven Jacobs commented on ASTERIXDB-2089:
------------------------------------------

I think the problem starts during the below optimization. It creates the 
select (not(is-missing($$30))) -- |UNPARTITIONED|
which seems to be troublesome later.
[~dlychagin-cb] when you have the chance to look at this let me know. It's blocking me currently
so I'm trying to investigate it as well (my Skype is sjaco002)



Sep 14, 2017 9:44:25 AM org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController
printRuleApplication
FINE: >>>> Rule class org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule
fired.
Sep 14, 2017 9:44:25 AM org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController
printRuleApplication
FINE: >>>> Before plan
distribute result [$$21] -- |UNPARTITIONED|
  commit -- |UNPARTITIONED|
    insert into channels.roomRecordsResults from record: $$22 partitioned by [$$19] -- |UNPARTITIONED|
      assign [$$19] <- [$$22.getField(0)] -- |UNPARTITIONED|
        assign [$$22] <- [cast($$21)] -- |UNPARTITIONED|
          assign [$$21] <- [check-unknown(object-merge($$17, {"id": create-uuid()}))] --
|UNPARTITIONED|
            project ([$$17]) -- |UNPARTITIONED|
              assign [$$17] <- [{"result": $$result, "channelExecutionTime": $$channelExecutionTime,
"subscriptionId": $$23, "deliveryTime": current-datetime()}] -- |UNPARTITIONED|
                unnest $$result <- scan-collection($$13) -- |UNPARTITIONED|
                  subplan {
                            aggregate [$$13] <- [listify($$12)] -- |UNPARTITIONED|
                              assign [$$12] <- [{"userId": $$24}] -- |UNPARTITIONED|
                                join (eq($$25, $$26)) -- |UNPARTITIONED|
                                  nested tuple source -- |UNPARTITIONED|
                                  assign [$$25] <- [$$location.getField(1)] -- |UNPARTITIONED|
                                    data-scan []<-[$$24, $$location] <- channels.UserLocations
-- |UNPARTITIONED|
                                      empty-tuple-source -- |UNPARTITIONED|
                         } -- |UNPARTITIONED|
                    assign [$$26] <- [$$sub.getField(1)] -- |UNPARTITIONED|
                      data-scan []<-[$$23, $$sub] <- channels.roomRecordsSubscriptions
-- |UNPARTITIONED|
                        assign [$$channelExecutionTime] <- [current-datetime()] -- |UNPARTITIONED|
                          empty-tuple-source -- |UNPARTITIONED|


Sep 14, 2017 9:44:25 AM org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController
printRuleApplication
FINE: >>>> After plan
distribute result [$$21] -- |UNPARTITIONED|
  commit -- |UNPARTITIONED|
    insert into channels.roomRecordsResults from record: $$22 partitioned by [$$19] -- |UNPARTITIONED|
      assign [$$19] <- [$$22.getField(0)] -- |UNPARTITIONED|
        assign [$$22] <- [cast($$21)] -- |UNPARTITIONED|
          assign [$$21] <- [check-unknown(object-merge($$17, {"id": create-uuid()}))] --
|UNPARTITIONED|
            project ([$$17]) -- |UNPARTITIONED|
              assign [$$17] <- [{"result": $$result, "channelExecutionTime": $$channelExecutionTime,
"subscriptionId": $$23, "deliveryTime": current-datetime()}] -- |UNPARTITIONED|
                unnest $$result <- scan-collection($$13) -- |UNPARTITIONED|
                  group by ([$$31 := $$29]) decor ([$$channelExecutionTime; $$sub; $$23; $$26])
{
                            aggregate [$$13] <- [listify($$12)] -- |UNPARTITIONED|
                              assign [$$12] <- [{"userId": $$24}] -- |UNPARTITIONED|
                                select (not(is-missing($$30))) -- |UNPARTITIONED|
                                  nested tuple source -- |UNPARTITIONED|
                         } -- |UNPARTITIONED|
                    left outer join (eq($$25, $$26)) -- |UNPARTITIONED|
                      assign [$$29] <- [create-query-uid()] -- |UNPARTITIONED|
                        assign [$$26] <- [$$sub.getField(1)] -- |UNPARTITIONED|
                          data-scan []<-[$$23, $$sub] <- channels.roomRecordsSubscriptions
-- |UNPARTITIONED|
                            assign [$$channelExecutionTime] <- [current-datetime()] --
|UNPARTITIONED|
                              empty-tuple-source -- |UNPARTITIONED|
                      assign [$$30] <- [TRUE] -- |UNPARTITIONED|
                        assign [$$25] <- [$$location.getField(1)] -- |UNPARTITIONED|
                          data-scan []<-[$$24, $$location] <- channels.UserLocations
-- |UNPARTITIONED|
                            empty-tuple-source -- |UNPARTITIONED|


> Bad return type error for valid SQL++ query
> -------------------------------------------
>
>                 Key: ASTERIXDB-2089
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2089
>             Project: Apache AsterixDB
>          Issue Type: Bug
>            Reporter: Steven Jacobs
>            Assignee: Dmitry Lychagin
>
> The following will produce a "Bad return type" error:
> drop dataverse channels if exists;
> create dataverse channels;
> use channels;
> create type userLocation as {
>   userId: int,
>   roomNumber: int
> };
> create type result as {
> 	id:uuid
> };
> create type subscriptionType as {
> 	subscriptionId:uuid,
> 	param0:int
> };
> create dataset roomRecordsResults(result)
> primary key id autogenerated;
> create dataset roomRecordsSubscriptions(subscriptionType)
> primary key subscriptionId autogenerated;
> create dataset UserLocations(userLocation)
> primary key userId;
> create function RoomOccupants(room) {
>   (select location.userId
>   from UserLocations location
>   where location.roomNumber = room)
> };
> use channels;
> SET inline_with "false";
> insert into channels.roomRecordsResults as a (
> 	with channelExecutionTime as current_datetime() 
> 	select result, channelExecutionTime, sub.subscriptionId as subscriptionId,current_datetime()
as deliveryTime
> 	from channels.roomRecordsSubscriptions sub,
> 	channels.RoomOccupants(sub.param0) result 
> ) returning a;
> Here is the top of the stack trace:
> WARNING: Unhandled throwable
> java.lang.VerifyError: Bad return type
> Exception Details:
>   Location:
>     org/apache/asterix/runtime/evaluators/functions/NotDescriptor$_EvaluatorFactoryGen.access$0(Lorg/apache/asterix/runtime/evaluators/functions/NotDescriptor$_EvaluatorFactoryGen;)Lorg/apache/asterix/runtime/evaluators/functions/NotDescriptor;
@4: areturn
>   Reason:
>     Type 'org/apache/asterix/runtime/evaluators/functions/NotDescriptor$_Gen' (current
frame, stack[0]) is not assignable to 'org/apache/asterix/runtime/evaluators/functions/NotDescriptor'
(from method signature)
>   Current Frame:
>     bci: @4
>     flags: { }
>     locals: { 'org/apache/asterix/runtime/evaluators/functions/NotDescriptor$_EvaluatorFactoryGen'
}
>     stack: { 'org/apache/asterix/runtime/evaluators/functions/NotDescriptor$_Gen' }
>   Bytecode:
>     0x0000000: 2ab4 003a b0                           
> 	at org.apache.asterix.runtime.evaluators.functions.NotDescriptor$_Gen.createEvaluatorFactory(NotDescriptor.java:60)
> 	at org.apache.asterix.jobgen.QueryLogicalExpressionJobGen.createScalarFunctionEvaluatorFactory(QueryLogicalExpressionJobGen.java:144)
> 	at org.apache.asterix.jobgen.QueryLogicalExpressionJobGen.createEvaluatorFactory(QueryLogicalExpressionJobGen.java:109)
> 	at org.apache.hyracks.algebricks.core.algebra.expressions.ExpressionRuntimeProvider.createEvaluatorFactory(ExpressionRuntimeProvider.java:41)
> 	at org.apache.asterix.optimizer.rules.ConstantFoldingRule$ConstantFoldingVisitor.visitScalarFunctionCallExpression(ConstantFoldingRule.java:217)
> 	at org.apache.asterix.optimizer.rules.ConstantFoldingRule$ConstantFoldingVisitor.visitScalarFunctionCallExpression(ConstantFoldingRule.java:1)
> 	at org.apache.hyracks.algebricks.core.algebra.expressions.ScalarFunctionCallExpression.accept(ScalarFunctionCallExpression.java:55)
> 	at org.apache.asterix.optimizer.rules.ConstantFoldingRule$ConstantFoldingVisitor.transform(ConstantFoldingRule.java:163)
> 	at org.apache.hyracks.algebricks.core.algebra.operators.logical.SelectOperator.acceptExpressionTransform(SelectOperator.java:83)
> 	at org.apache.asterix.optimizer.rules.ConstantFoldingRule.rewritePost(ConstantFoldingRule.java:150)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:126)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:100)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:100)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:100)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:100)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:100)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:100)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:100)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:100)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:100)
> 	at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:100)
> 	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:102)
> 	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:90)
> 	at org.apache.asterix.api.common.APIFramework.compileQuery(APIFramework.java:267)
> 	at org.apache.asterix.app.translator.QueryTranslator.rewriteCompileInsertUpsert(QueryTranslator.java:1867)
> 	at org.apache.asterix.app.translator.QueryTranslator.lambda$0(QueryTranslator.java:1755)
> 	at org.apache.asterix.app.translator.QueryTranslator.createAndRunJob(QueryTranslator.java:2412)
> 	at org.apache.asterix.app.translator.QueryTranslator.deliverResult(QueryTranslator.java:2345)
> 	at org.apache.asterix.app.translator.QueryTranslator.handleInsertUpsertStatement(QueryTranslator.java:1776)
> 	at org.apache.asterix.app.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:337)
> 	at org.apache.asterix.app.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:254)
> 	at org.apache.asterix.api.http.server.ApiServlet.post(ApiServlet.java:157)
> 	at org.apache.hyracks.http.server.AbstractServlet.handle(AbstractServlet.java:78)
> 	at org.apache.hyracks.http.server.HttpRequestHandler.handle(HttpRequestHandler.java:70)
> 	at org.apache.hyracks.http.server.HttpRequestHandler.call(HttpRequestHandler.java:55)
> 	at org.apache.hyracks.http.server.HttpRequestHandler.call(HttpRequestHandler.java:36)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:745)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message