Skip to content
Snippets Groups Projects
Unverified Commit 9a39a505 authored by kyle.cao's avatar kyle.cao Committed by GitHub
Browse files

fix limit/offset (#542)


* fix limit/offset

small change

* fix

* small change

* small change

Co-authored-by: default avatarYee <2520865+yixinglu@users.noreply.github.com>
parent f235e779
No related branches found
No related tags found
No related merge requests found
......@@ -1772,6 +1772,9 @@ limit_sentence
$$ = new LimitSentence($2, $4);
}
| KW_LIMIT legal_integer KW_OFFSET legal_integer {
$$ = new LimitSentence($4, $2);
}
| KW_OFFSET legal_integer KW_LIMIT legal_integer {
$$ = new LimitSentence($2, $4);
}
;
......
......@@ -1584,6 +1584,28 @@ Feature: Go Sentence
| "Tony Parker" | "LaMarcus Aldridge" | "Manu Ginobili" | "Tim Duncan" |
| "Tony Parker" | "LaMarcus Aldridge" | "LaMarcus Aldridge" | "Tim Duncan" |
Scenario: Go and Limit
When executing query:
"""
$a = GO FROM 'Tony Parker' OVER like YIELD like._src as src, like._dst as dst;
GO 2 STEPS FROM $a.src OVER like YIELD $a.src, $a.dst, like._src, like._dst |
OFFSET 1 LIMIT 2
"""
Then the result should be, in any order, with relax comparison:
| $a.src | $a.dst | like._src | like._dst |
| "Tony Parker" | "Manu Ginobili" | "Manu Ginobili" | "Tim Duncan" |
| "Tony Parker" | "Tim Duncan" | "Manu Ginobili" | "Tim Duncan" |
When executing query:
"""
$a = GO FROM 'Tony Parker' OVER like YIELD like._src as src, like._dst as dst;
GO 2 STEPS FROM $a.src OVER like YIELD $a.src, $a.dst, like._src, like._dst |
LIMIT 2 OFFSET 1
"""
Then the result should be, in any order, with relax comparison:
| $a.src | $a.dst | like._src | like._dst |
| "Tony Parker" | "Manu Ginobili" | "Manu Ginobili" | "Tim Duncan" |
| "Tony Parker" | "Tim Duncan" | "Manu Ginobili" | "Tim Duncan" |
Scenario: GroupBy and Count
When executing query:
"""
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment