asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ASTERIXDB-2400) Bad compilation of CASE statement
Date Mon, 11 Jun 2018 22:41:00 GMT

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

ASF subversion and git services commented on ASTERIXDB-2400:
------------------------------------------------------------

Commit 63a63fd72bb47cb651ee19db0ed528a588db402e in asterixdb's branch refs/heads/master from
Steven Glenn Jacobs
[ https://git-wip-us.apache.org/repos/asf?p=asterixdb.git;h=63a63fd ]

[COMP][ASTERIXDB-2400] Fix UNION handling in InlineAllNtsInSubplanVisitor

Makes the visitor correctly allow substitution of the input ops
for the output op in future operators
Added test

Change-Id: I8b7e3e24749ed88e27d6cd38be5584ea748f39fc
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2703
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Dmitry Lychagin <dmitry.lychagin@couchbase.com>


> Bad compilation of CASE statement 
> ----------------------------------
>
>                 Key: ASTERIXDB-2400
>                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-2400
>             Project: Apache AsterixDB
>          Issue Type: Improvement
>            Reporter: Steven Jacobs
>            Priority: Major
>
> The following valid syntax will throw an internal error:
> drop dataverse channels if exists;
> create dataverse channels;
> use channels;
> create type sub as {
>  subscriptionId: uuid
> };
> create dataset subscriptions(sub) primary key subscriptionId;
> upsert into subscriptions (
> (let v = (select value s from subscriptions s where param0 = "HenryGale")
> select value (CASE (array_count(v) > 0)
> WHEN true THEN
> {"subscriptionId":v[0].subscriptionId, "param0": v[0].param0,"brokerSubscriptions":(select
value sub from v[0].brokerSubscriptions sub UNION ALL select value val from [\{"brokerSubscriptionId":create_uuid()}]
val)}
> ELSE
> {"subscriptionId":create_uuid(),"param0": "HenryGale","brokerSubscriptions":[\{"brokerSubscriptionId":create_uuid()}]}
> END
> ))
> );
>  
>  
> The stack trace is:
> java.lang.NullPointerException: null
>  at org.apache.asterix.om.typecomputer.impl.ListConstructorTypeComputer.computeTypeFromItems(ListConstructorTypeComputer.java:63)
~[classes/:?]
>  at org.apache.asterix.om.typecomputer.impl.ListConstructorTypeComputer.computeType(ListConstructorTypeComputer.java:50)
~[classes/:?]
>  at org.apache.asterix.dataflow.data.common.ExpressionTypeComputer.getTypeForFunction(ExpressionTypeComputer.java:84)
~[classes/:?]
>  at org.apache.asterix.dataflow.data.common.ExpressionTypeComputer.getType(ExpressionTypeComputer.java:55)
~[classes/:?]
>  at org.apache.hyracks.algebricks.core.algebra.operators.logical.AggregateOperator.computeOutputTypeEnvironment(AggregateOperator.java:106)
~[classes/:?]
>  at org.apache.hyracks.algebricks.core.rewriter.base.AlgebricksOptimizationContext.computeAndSetTypeEnvironmentForOperator(AlgebricksOptimizationContext.java:298)
~[classes/:?]
>  at org.apache.hyracks.algebricks.core.algebra.util.OperatorManipulationUtil.computeTypeEnvironmentBottomUp(OperatorManipulationUtil.java:296)
~[classes/:?]
>  at org.apache.hyracks.algebricks.core.algebra.util.OperatorManipulationUtil.computeTypeEnvironmentBottomUp(OperatorManipulationUtil.java:286)
~[classes/:?]
>  at org.apache.hyracks.algebricks.core.algebra.util.OperatorManipulationUtil.computeTypeEnvironmentBottomUp(OperatorManipulationUtil.java:286)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.applyGeneralFlattening(InlineSubplanInputForNestedTupleSourceRule.java:422)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.rewriteSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:304)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.traverseNonSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:332)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.rewriteSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:290)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.traverseNonSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:332)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.rewriteSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:290)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.traverseNonSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:332)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.rewriteSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:290)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.traverseNonSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:332)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.rewriteSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:290)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.traverseNonSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:332)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.rewriteSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:290)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.traverseNonSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:332)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.rewriteSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:290)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.traverseNonSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:332)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.rewriteSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:290)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.traverseNonSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:332)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.rewriteSubplanOperator(InlineSubplanInputForNestedTupleSourceRule.java:290)
~[classes/:?]
>  at org.apache.asterix.optimizer.rules.subplan.InlineSubplanInputForNestedTupleSourceRule.rewritePre(InlineSubplanInputForNestedTupleSourceRule.java:280)
~[classes/:?]
>  at org.apache.hyracks.algebricks.core.rewriter.base.AbstractRuleController.rewriteOperatorRef(AbstractRuleController.java:91)
~[classes/:?]
>  at org.apache.hyracks.algebricks.compiler.rewriter.rulecontrollers.SequentialFixpointRuleController.rewriteWithRuleCollection(SequentialFixpointRuleController.java:53)
~[classes/:?]
>  at org.apache.hyracks.algebricks.core.rewriter.base.HeuristicOptimizer.runOptimizationSets(HeuristicOptimizer.java:102)
~[classes/:?]
>  at org.apache.hyracks.algebricks.core.rewriter.base.HeuristicOptimizer.optimize(HeuristicOptimizer.java:82)
~[classes/:?]
>  at org.apache.hyracks.algebricks.compiler.api.HeuristicCompilerFactoryBuilder$1$1.optimize(HeuristicCompilerFactoryBuilder.java:90)
~[classes/:?]
>  at org.apache.asterix.api.common.APIFramework.compileQuery(APIFramework.java:241) ~[classes/:?]
>  at org.apache.asterix.app.translator.QueryTranslator.rewriteCompileInsertUpsert(QueryTranslator.java:1973)
~[classes/:?]
>  at org.apache.asterix.app.translator.QueryTranslator.lambda$handleInsertUpsertStatement$0(QueryTranslator.java:1853)
~[classes/:?]
>  at org.apache.asterix.app.translator.QueryTranslator.handleInsertUpsertStatement(QueryTranslator.java:1879)
~[classes/:?]
>  at org.apache.asterix.app.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:349)
~[classes/:?]
>  at org.apache.asterix.api.http.server.ApiServlet.post(ApiServlet.java:168) [classes/:?]
>  at org.apache.hyracks.http.server.AbstractServlet.handle(AbstractServlet.java:92) [classes/:?]
>  at org.apache.hyracks.http.server.HttpRequestHandler.handle(HttpRequestHandler.java:71)
[classes/:?]
>  at org.apache.hyracks.http.server.HttpRequestHandler.call(HttpRequestHandler.java:56)
[classes/:?]
>  at org.apache.hyracks.http.server.HttpRequestHandler.call(HttpRequestHandler.java:37)
[classes/:?]
>  at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_65]
>  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_65]
>  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_65]
>  at java.lang.Thread.run(Thread.java:745) [?:1.8.0_65]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message