asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taewoo Kim (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ASTERIXDB-1154) left-outer-index-nested-loop-join with LIMIT doesn't work
Date Mon, 26 Oct 2015 00:12:27 GMT
Taewoo Kim created ASTERIXDB-1154:
-------------------------------------

             Summary: left-outer-index-nested-loop-join with LIMIT doesn't work
                 Key: ASTERIXDB-1154
                 URL: https://issues.apache.org/jira/browse/ASTERIXDB-1154
             Project: Apache AsterixDB
          Issue Type: Bug
            Reporter: Taewoo Kim


If you specify limit in the left side of left-outer-index-nested-loop join, an exception will
be thrown. For example, in the following query, if you remove "limit 5" from the left (outer)
side, it will work.

AQL
====
drop dataverse test if exists;
create dataverse test;
use dataverse test;

create type TwitterUserType as closed {
    screen-name: string,
    lang: string,
    friends-count: int64,
    statuses-count: int64,
    name: string,
    followers-count: int64
}

create type TweetMessageType as closed {
    tweetid: int64,
        user: TwitterUserType,
        sender-location: point,
    send-time: datetime,
        referred-topics: {{ string }},
    message-text: string,
    countA: int64,
    countB: int64
}

create dataset TweetMessages(TweetMessageType)
primary key tweetid;

create index twmSndLocIx on TweetMessages(sender-location) type rtree;
create index msgCountAIx on TweetMessages(countA) type btree;
create index msgCountBIx on TweetMessages(countB) type btree;
create index msgTextIx on TweetMessages(message-text) type keyword;

for $t1 in dataset('TweetMessages')
where $t1.tweetid < int64("10")
order by $t1.tweetid
limit 5
return {
"tweetid1": $t1.tweetid,
"count1":$t1.countA,
"t2info": for $t2 in dataset('TweetMessages') 
          where $t1.countA /* +indexnl */= $t2.countB
          order by $t2.tweetid 
          return {"tweetid2": $t2.tweetid,
                  "count2":$t2.countB}
};

// Exception:
java.lang.NullPointerException
	at org.apache.asterix.om.util.NonTaggedFormatUtil.isOptional(NonTaggedFormatUtil.java:94)
	at org.apache.asterix.metadata.entities.Index.getNonNullableType(Index.java:137)
	at org.apache.asterix.optimizer.rules.am.AbstractIntroduceAccessMethodRule.isMatched(AbstractIntroduceAccessMethodRule.java:323)
	at org.apache.asterix.optimizer.rules.am.AbstractIntroduceAccessMethodRule.pruneIndexCandidates(AbstractIntroduceAccessMethodRule.java:275)
	at org.apache.asterix.optimizer.rules.am.AbstractIntroduceAccessMethodRule.pruneIndexCandidates(AbstractIntroduceAccessMethodRule.java:119)
	at org.apache.asterix.optimizer.rules.am.IntroduceJoinAccessMethodRule.rewritePost(IntroduceJoinAccessMethodRule.java:140)
	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.compiler.rewriter.rulecontrollers.SequentialFixpointRuleController.rewriteWithRuleCollection(SequentialFixpointRuleController.java:53)
	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:279)
	at org.apache.asterix.aql.translator.AqlTranslator.rewriteCompileQuery(AqlTranslator.java:1900)
	at org.apache.asterix.aql.translator.AqlTranslator.handleQuery(AqlTranslator.java:2480)
	at org.apache.asterix.aql.translator.AqlTranslator.compileAndExecute(AqlTranslator.java:385)
	at org.apache.asterix.api.http.servlet.APIServlet.doPost(APIServlet.java:114)
	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:212)
	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