Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logical_range_filter: support negative limit and offset
- Loading branch information
Showing
9 changed files
with
448 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
test/command/suite/sharding/logical_range_filter/limit/negative/all.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| load --table Logs_20150203 | ||
| [ | ||
| {"timestamp": "2015-02-03 23:59:58", "memo": "2015-02-03 23:59:58", "message": "Start"}, | ||
| {"timestamp": "2015-02-03 23:59:58", "memo": "2015-02-03 23:59:58", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-03 23:59:59", "memo": "2015-02-03 23:59:59", "message": "Start"}, | ||
| {"timestamp": "2015-02-03 23:59:59", "memo": "2015-02-03 23:59:59", "message": "Shutdown"} | ||
| ] | ||
| [[0,0.0,0.0],4] | ||
| load --table Logs_20150204 | ||
| [ | ||
| {"timestamp": "2015-02-04 00:00:00", "memo": "2015-02-04 00:00:00", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 00:00:00", "memo": "2015-02-04 00:00:00", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-04 00:00:01", "memo": "2015-02-04 00:00:01", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 00:00:01", "memo": "2015-02-04 00:00:01", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-04 23:59:59", "memo": "2015-02-04 23:59:59", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 23:59:59", "memo": "2015-02-04 23:59:59", "message": "Shutdown"} | ||
| ] | ||
| [[0,0.0,0.0],6] | ||
| load --table Logs_20150205 | ||
| [ | ||
| {"timestamp": "2015-02-05 00:00:00", "memo": "2015-02-05 00:00:00", "message": "Start"}, | ||
| {"timestamp": "2015-02-05 00:00:00", "memo": "2015-02-05 00:00:00", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-05 00:00:01", "memo": "2015-02-05 00:00:01", "message": "Start"}, | ||
| {"timestamp": "2015-02-05 00:00:01", "memo": "2015-02-05 00:00:01", "message": "Shutdown"} | ||
| ] | ||
| [[0,0.0,0.0],4] | ||
| logical_range_filter Logs timestamp --filter 'message == "Shutdown"' --min "2015-02-03 23:59:59" --min_border "include" --max "2015-02-05 00:00:00" --max_border "include" --limit -1 | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| "memo", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "message", | ||
| "Text" | ||
| ], | ||
| [ | ||
| "timestamp", | ||
| "Time" | ||
| ] | ||
| ], | ||
| [ | ||
| "2015-02-03 23:59:59", | ||
| "Shutdown", | ||
| 1422975599.0 | ||
| ], | ||
| [ | ||
| "2015-02-04 00:00:00", | ||
| "Shutdown", | ||
| 1422975600.0 | ||
| ], | ||
| [ | ||
| "2015-02-04 00:00:01", | ||
| "Shutdown", | ||
| 1422975601.0 | ||
| ], | ||
| [ | ||
| "2015-02-04 23:59:59", | ||
| "Shutdown", | ||
| 1423061999.0 | ||
| ], | ||
| [ | ||
| "2015-02-05 00:00:00", | ||
| "Shutdown", | ||
| 1423062000.0 | ||
| ] | ||
| ] | ||
| ] |
36 changes: 36 additions & 0 deletions
36
test/command/suite/sharding/logical_range_filter/limit/negative/all.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #@include fixture/sharding/logical_range_filter/index/schema.grn | ||
|
|
||
| load --table Logs_20150203 | ||
| [ | ||
| {"timestamp": "2015-02-03 23:59:58", "memo": "2015-02-03 23:59:58", "message": "Start"}, | ||
| {"timestamp": "2015-02-03 23:59:58", "memo": "2015-02-03 23:59:58", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-03 23:59:59", "memo": "2015-02-03 23:59:59", "message": "Start"}, | ||
| {"timestamp": "2015-02-03 23:59:59", "memo": "2015-02-03 23:59:59", "message": "Shutdown"} | ||
| ] | ||
|
|
||
| load --table Logs_20150204 | ||
| [ | ||
| {"timestamp": "2015-02-04 00:00:00", "memo": "2015-02-04 00:00:00", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 00:00:00", "memo": "2015-02-04 00:00:00", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-04 00:00:01", "memo": "2015-02-04 00:00:01", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 00:00:01", "memo": "2015-02-04 00:00:01", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-04 23:59:59", "memo": "2015-02-04 23:59:59", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 23:59:59", "memo": "2015-02-04 23:59:59", "message": "Shutdown"} | ||
| ] | ||
|
|
||
| load --table Logs_20150205 | ||
| [ | ||
| {"timestamp": "2015-02-05 00:00:00", "memo": "2015-02-05 00:00:00", "message": "Start"}, | ||
| {"timestamp": "2015-02-05 00:00:00", "memo": "2015-02-05 00:00:00", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-05 00:00:01", "memo": "2015-02-05 00:00:01", "message": "Start"}, | ||
| {"timestamp": "2015-02-05 00:00:01", "memo": "2015-02-05 00:00:01", "message": "Shutdown"} | ||
| ] | ||
|
|
||
| logical_range_filter Logs timestamp \ | ||
| --filter 'message == "Shutdown"' \ | ||
| --min "2015-02-03 23:59:59" \ | ||
| --min_border "include" \ | ||
| --max "2015-02-05 00:00:00" \ | ||
| --max_border "include" \ | ||
| --limit -1 | ||
|
|
65 changes: 65 additions & 0 deletions
65
test/command/suite/sharding/logical_range_filter/limit/negative/all_offset.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| load --table Logs_20150203 | ||
| [ | ||
| {"timestamp": "2015-02-03 23:59:58", "memo": "2015-02-03 23:59:58", "message": "Start"}, | ||
| {"timestamp": "2015-02-03 23:59:58", "memo": "2015-02-03 23:59:58", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-03 23:59:59", "memo": "2015-02-03 23:59:59", "message": "Start"}, | ||
| {"timestamp": "2015-02-03 23:59:59", "memo": "2015-02-03 23:59:59", "message": "Shutdown"} | ||
| ] | ||
| [[0,0.0,0.0],4] | ||
| load --table Logs_20150204 | ||
| [ | ||
| {"timestamp": "2015-02-04 00:00:00", "memo": "2015-02-04 00:00:00", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 00:00:00", "memo": "2015-02-04 00:00:00", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-04 00:00:01", "memo": "2015-02-04 00:00:01", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 00:00:01", "memo": "2015-02-04 00:00:01", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-04 23:59:59", "memo": "2015-02-04 23:59:59", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 23:59:59", "memo": "2015-02-04 23:59:59", "message": "Shutdown"} | ||
| ] | ||
| [[0,0.0,0.0],6] | ||
| load --table Logs_20150205 | ||
| [ | ||
| {"timestamp": "2015-02-05 00:00:00", "memo": "2015-02-05 00:00:00", "message": "Start"}, | ||
| {"timestamp": "2015-02-05 00:00:00", "memo": "2015-02-05 00:00:00", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-05 00:00:01", "memo": "2015-02-05 00:00:01", "message": "Start"}, | ||
| {"timestamp": "2015-02-05 00:00:01", "memo": "2015-02-05 00:00:01", "message": "Shutdown"} | ||
| ] | ||
| [[0,0.0,0.0],4] | ||
| logical_range_filter Logs timestamp --filter 'message == "Shutdown"' --min "2015-02-03 23:59:59" --min_border "include" --max "2015-02-05 00:00:00" --max_border "include" --offset 2 --limit -1 | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| "memo", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "message", | ||
| "Text" | ||
| ], | ||
| [ | ||
| "timestamp", | ||
| "Time" | ||
| ] | ||
| ], | ||
| [ | ||
| "2015-02-04 00:00:01", | ||
| "Shutdown", | ||
| 1422975601.0 | ||
| ], | ||
| [ | ||
| "2015-02-04 23:59:59", | ||
| "Shutdown", | ||
| 1423061999.0 | ||
| ], | ||
| [ | ||
| "2015-02-05 00:00:00", | ||
| "Shutdown", | ||
| 1423062000.0 | ||
| ] | ||
| ] | ||
| ] |
37 changes: 37 additions & 0 deletions
37
test/command/suite/sharding/logical_range_filter/limit/negative/all_offset.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #@include fixture/sharding/logical_range_filter/index/schema.grn | ||
|
|
||
| load --table Logs_20150203 | ||
| [ | ||
| {"timestamp": "2015-02-03 23:59:58", "memo": "2015-02-03 23:59:58", "message": "Start"}, | ||
| {"timestamp": "2015-02-03 23:59:58", "memo": "2015-02-03 23:59:58", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-03 23:59:59", "memo": "2015-02-03 23:59:59", "message": "Start"}, | ||
| {"timestamp": "2015-02-03 23:59:59", "memo": "2015-02-03 23:59:59", "message": "Shutdown"} | ||
| ] | ||
|
|
||
| load --table Logs_20150204 | ||
| [ | ||
| {"timestamp": "2015-02-04 00:00:00", "memo": "2015-02-04 00:00:00", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 00:00:00", "memo": "2015-02-04 00:00:00", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-04 00:00:01", "memo": "2015-02-04 00:00:01", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 00:00:01", "memo": "2015-02-04 00:00:01", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-04 23:59:59", "memo": "2015-02-04 23:59:59", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 23:59:59", "memo": "2015-02-04 23:59:59", "message": "Shutdown"} | ||
| ] | ||
|
|
||
| load --table Logs_20150205 | ||
| [ | ||
| {"timestamp": "2015-02-05 00:00:00", "memo": "2015-02-05 00:00:00", "message": "Start"}, | ||
| {"timestamp": "2015-02-05 00:00:00", "memo": "2015-02-05 00:00:00", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-05 00:00:01", "memo": "2015-02-05 00:00:01", "message": "Start"}, | ||
| {"timestamp": "2015-02-05 00:00:01", "memo": "2015-02-05 00:00:01", "message": "Shutdown"} | ||
| ] | ||
|
|
||
| logical_range_filter Logs timestamp \ | ||
| --filter 'message == "Shutdown"' \ | ||
| --min "2015-02-03 23:59:59" \ | ||
| --min_border "include" \ | ||
| --max "2015-02-05 00:00:00" \ | ||
| --max_border "include" \ | ||
| --offset 2 \ | ||
| --limit -1 | ||
|
|
65 changes: 65 additions & 0 deletions
65
test/command/suite/sharding/logical_range_filter/limit/negative/partial.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| load --table Logs_20150203 | ||
| [ | ||
| {"timestamp": "2015-02-03 23:59:58", "memo": "2015-02-03 23:59:58", "message": "Start"}, | ||
| {"timestamp": "2015-02-03 23:59:58", "memo": "2015-02-03 23:59:58", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-03 23:59:59", "memo": "2015-02-03 23:59:59", "message": "Start"}, | ||
| {"timestamp": "2015-02-03 23:59:59", "memo": "2015-02-03 23:59:59", "message": "Shutdown"} | ||
| ] | ||
| [[0,0.0,0.0],4] | ||
| load --table Logs_20150204 | ||
| [ | ||
| {"timestamp": "2015-02-04 00:00:00", "memo": "2015-02-04 00:00:00", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 00:00:00", "memo": "2015-02-04 00:00:00", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-04 00:00:01", "memo": "2015-02-04 00:00:01", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 00:00:01", "memo": "2015-02-04 00:00:01", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-04 23:59:59", "memo": "2015-02-04 23:59:59", "message": "Start"}, | ||
| {"timestamp": "2015-02-04 23:59:59", "memo": "2015-02-04 23:59:59", "message": "Shutdown"} | ||
| ] | ||
| [[0,0.0,0.0],6] | ||
| load --table Logs_20150205 | ||
| [ | ||
| {"timestamp": "2015-02-05 00:00:00", "memo": "2015-02-05 00:00:00", "message": "Start"}, | ||
| {"timestamp": "2015-02-05 00:00:00", "memo": "2015-02-05 00:00:00", "message": "Shutdown"}, | ||
| {"timestamp": "2015-02-05 00:00:01", "memo": "2015-02-05 00:00:01", "message": "Start"}, | ||
| {"timestamp": "2015-02-05 00:00:01", "memo": "2015-02-05 00:00:01", "message": "Shutdown"} | ||
| ] | ||
| [[0,0.0,0.0],4] | ||
| logical_range_filter Logs timestamp --filter 'message == "Shutdown"' --min "2015-02-03 23:59:59" --min_border "include" --max "2015-02-05 00:00:00" --max_border "include" --limit -3 | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| "memo", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "message", | ||
| "Text" | ||
| ], | ||
| [ | ||
| "timestamp", | ||
| "Time" | ||
| ] | ||
| ], | ||
| [ | ||
| "2015-02-03 23:59:59", | ||
| "Shutdown", | ||
| 1422975599.0 | ||
| ], | ||
| [ | ||
| "2015-02-04 00:00:00", | ||
| "Shutdown", | ||
| 1422975600.0 | ||
| ], | ||
| [ | ||
| "2015-02-04 00:00:01", | ||
| "Shutdown", | ||
| 1422975601.0 | ||
| ] | ||
| ] | ||
| ] |
Oops, something went wrong.