[
https://issues.apache.org/jira/browse/ASTERIXDB-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16560076#comment-16560076
]
ASF subversion and git services commented on ASTERIXDB-2428:
------------------------------------------------------------
Commit 0e70ad65b6d6404ac863be1f14629f3a7b6615d1 in asterixdb's branch
refs/heads/master from [~dlychagin-cb]
[ https://git-wip-us.apache.org/repos/asf?p=asterixdb.git;h=0e70ad6 ]
[ASTERIXDB-2428][COMP] Incorrect result with limit if offset is negative
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
- Guarantee non negative limit and offset value during plan generation,
so it is correct to add them in CopyLimitDownRule
Change-Id: I2238cc5d8f48e14aa2b74d120248a4848dd35691
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2821
Sonar-Qube: Jenkins <[email protected]>
Integration-Tests: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>
Contrib: Jenkins <[email protected]>
Reviewed-by: Taewoo Kim <[email protected]>
> Incorrect result with limit if offset is negative
> --------------------------------------------------
>
> Key: ASTERIXDB-2428
> URL: https://issues.apache.org/jira/browse/ASTERIXDB-2428
> Project: Apache AsterixDB
> Issue Type: Bug
> Components: COMP - Compiler
> Reporter: Dmitry Lychagin
> Assignee: Dmitry Lychagin
> Priority: Minor
>
> The following query should return two items, but it currently returns an
> empty result:
> select value paper
> from DBLP1 as paper
> order by dblpid
> limit 2 offset -get_year(current_date());
> When an offset is negative its considered to be 0.
> The problem is caused by CopyLimitDownRule which simply adds offset to the
> limit when copying the limit clause. So in this particular case the newly
> created limit clause will have a negative limit which equivalent to 0, hence
> no results.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)