You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2016/02/23 03:00:21 UTC
[jira] [Commented] (ASTERIXDB-1205) Union should also work for the
temporary list variables.
[ https://issues.apache.org/jira/browse/ASTERIXDB-1205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15158139#comment-15158139 ]
ASF subversion and git services commented on ASTERIXDB-1205:
------------------------------------------------------------
Commit ce6b3669281e46145c734c160e97e9dd01bb80bb in incubator-asterixdb-hyracks's branch refs/heads/master from [~buyingyi]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-asterixdb-hyracks.git;h=ce6b366 ]
Fix ASTERIXDB-1205: cleanup union related rules.
-fixed EliminateSubplanWithInputCardinalityOneRule for general cases;
-fixed the type inference invocation in PushAssignBelowUnionAllRule;
-factored out ITypingContext and IVariableContext so that the operator deep copy
visitor can also be used in the language translator without types;
-added a rule to remove Cartesian product with an ETS input.
Change-Id: I7ad982108a4dc119249222c8ebb9e5897d93783c
Reviewed-on: https://asterix-gerrit.ics.uci.edu/628
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <ti...@apache.org>
> Union should also work for the temporary list variables.
> ---------------------------------------------------------
>
> Key: ASTERIXDB-1205
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-1205
> Project: Apache AsterixDB
> Issue Type: Bug
> Components: Operators, Optimizer
> Reporter: Jianfeng Jia
> Assignee: Yingyi Bu
>
> This issue is from a discussion in the dev mail list.
> The following query union two temporary list, but ends up a exception:
> {code}
> let $aa := [{"fa":1, "fb":1}, {"fa":2, "fb":1}]
> let $bb := [{"fa":1, "fb":1}, {"fa":2, "fb":1}]
> let $ccc := $aa union $bb
> for $tt in $ccc return $tt;
> {code}
> The execption:
> {code}
> org.apache.hyracks.algebricks.common.exceptions.AlgebricksException: Inappropriate use of function 'union'
> at org.apache.asterix.runtime.evaluators.common.FunctionManagerImpl.lookupFunction(FunctionManagerImpl.java:46)
> at org.apache.asterix.runtime.formats.NonTaggedDataFormat.resolveFunction(NonTaggedDataFormat.java:894)
> at org.apache.asterix.jobgen.QueryLogicalExpressionJobGen.createScalarFunctionEvaluatorFactory(QueryLogicalExpressionJobGen.java:148)
> at org.apache.asterix.jobgen.QueryLogicalExpressionJobGen.createEvaluatorFactory(QueryLogicalExpressionJobGen.java:113)
> at org.apache.hyracks.algebricks.core.algebra.expressions.LogicalExpressionJobGenToExpressionRuntimeProviderAdapter.createEvaluatorFactory(LogicalExpressionJobGenToExpressionRuntimeProviderAdapter.java:57)
> at org.apache.hyracks.algebricks.core.algebra.operators.physical.AssignPOperator.contributeRuntimeOperator(AssignPOperator.java:84)
> at org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator.contributeRuntimeOperator(AbstractLogicalOperator.java:162)
> at org.apache.hyracks.algebricks.core.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:98)
> at org.apache.hyracks.algebricks.core.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:85)
> at org.apache.hyracks.algebricks.core.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:85)
> at org.apache.hyracks.algebricks.core.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:85)
> at org.apache.hyracks.algebricks.core.jobgen.impl.PlanCompiler.compileOpRef(PlanCompiler.java:85)
> at org.apache.hyracks.algebricks.core.jobgen.impl.PlanCompiler.compilePlan(PlanCompiler.java:61)
> at org.apache.hyracks.algebricks.compiler.api.HeuristicCompilerFactoryBuilder$1$1.createJob(HeuristicCompilerFactoryBuilder.java:104)
> at org.apache.asterix.api.common.APIFramework.compileQuery(APIFramework.java:359)
> at org.apache.asterix.aql.translator.QueryTranslator.rewriteCompileQuery(QueryTranslator.java:1896)
> at org.apache.asterix.aql.translator.QueryTranslator.handleQuery(QueryTranslator.java:2470)
> at org.apache.asterix.aql.translator.QueryTranslator.compileAndExecute(QueryTranslator.java:384)
> 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)
> {code}
> The query plan is following:
> {code}
> -- DISTRIBUTE_RESULT |UNPARTITIONED|
> exchange
> -- ONE_TO_ONE_EXCHANGE |UNPARTITIONED|
> project ([$$9])
> -- STREAM_PROJECT |UNPARTITIONED|
> unnest $$9 <- function-call: asterix:scan-collection, Args:[%0->$$8]
> -- UNNEST |UNPARTITIONED|
> assign [$$8] <- [function-call: asterix:union, Args:[function-call: asterix:ordered-list-constructor, Args:[function-call: asterix:open-record-constructor, Args:[AString: {fa}, AInt64: {1}, AString: {fb}, AInt64: {1}], function-call: asterix:open-record-constructor, Args:[AString: {fa}, AInt64: {2}, AString: {fb}, AInt64: {1}]], function-call: asterix:ordered-list-constructor, Args:[function-call: asterix:open-record-constructor, Args:[AString: {fa}, AInt64: {1}, AString: {fb}, AInt64: {1}], function-call: asterix:open-record-constructor, Args:[AString: {fa}, AInt64: {2}, AString: {fb}, AInt64: {1}]]]]
> -- ASSIGN |UNPARTITIONED|
> empty-tuple-source
> -- EMPTY_TUPLE_SOURCE |UNPARTITIONED|
> {code}
> If the data are coming from the datasets in storage, then it will work fine. Though, it gives a different query plan:
> {code}
> -- DISTRIBUTE_RESULT |PARTITIONED|
> exchange
> -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
> union ($$0, $$2, $$5)
> -- UNION_ALL |PARTITIONED|
> exchange
> -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
> project ([$$0])
> -- STREAM_PROJECT |PARTITIONED|
> exchange
> -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
> data-scan []<-[$$13, $$0] <- test:ds_1
> -- DATASOURCE_SCAN |PARTITIONED|
> exchange
> -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
> empty-tuple-source
> -- EMPTY_TUPLE_SOURCE |PARTITIONED|
> exchange
> -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
> project ([$$2])
> -- STREAM_PROJECT |PARTITIONED|
> exchange
> -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
> data-scan []<-[$$14, $$2] <- test:ds_2
> -- DATASOURCE_SCAN |PARTITIONED|
> exchange
> -- ONE_TO_ONE_EXCHANGE |PARTITIONED|
> empty-tuple-source
> -- EMPTY_TUPLE_SOURCE |PARTITIONED|
> {code}
> So there should be two different union functions, or we should update the query plan to use the same union operator?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)