[
https://issues.apache.org/jira/browse/ASTERIXDB-2700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ali Alsuliman resolved ASTERIXDB-2700.
--------------------------------------
Resolution: Fixed
> Fix invalid plan caused by order by operator in a subquery
> ----------------------------------------------------------
>
> Key: ASTERIXDB-2700
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-2700
> Project: Apache AsterixDB
> Issue Type: Bug
> Components: *DB - AsterixDB, RT - Runtime
> Affects Versions: 0.9.4
> Reporter: Ali Alsuliman
> Assignee: Ali Alsuliman
> Priority: Major
> Fix For: 0.9.5
>
>
> The below query produces an invalid plan where two connectors are connected
> to each other. This happens when the optimizer optimizes the order-by
> operator by replacing it with a local order-by operator + sort-merge
> connector. If the parent operator of the original order-by operator
> introduces a connector, the plan ends up having two connectors. Here is an
> example query where there is an index on "user_since" and index on
> "author_id":
> {code:java}
> SET `compiler.sort.parallel` "false";
>
> FROM (SELECT VALUE u FROM GleambookUsersCompositeRandom u WHERE u.user_since
> >= '2008-07-22T00:00:00' ORDER BY u.id) AS user,
> GleambookMessagesCompositeRandom AS msg
> WHERE msg.author_id /*+ indexnl */ = user.id
> SELECT user.name AS uname, msg.message AS message;
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)