Kouhei Sutou
null+****@clear*****
Wed Apr 22 15:57:43 JST 2015
Kouhei Sutou 2015-04-22 15:57:43 +0900 (Wed, 22 Apr 2015) New Revision: b3e49e721eecd1ba69e00438a881a569e4b18ce7 https://github.com/groonga/groonga/commit/b3e49e721eecd1ba69e00438a881a569e4b18ce7 Message: test sharding: add tests for positive limit Added files: test/command/suite/sharding/logical_range_filter/limit/positive/no_offset.expected test/command/suite/sharding/logical_range_filter/limit/positive/no_offset.test test/command/suite/sharding/logical_range_filter/limit/positive/offset.expected test/command/suite/sharding/logical_range_filter/limit/positive/offset.test Added: test/command/suite/sharding/logical_range_filter/limit/positive/no_offset.expected (+70 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/limit/positive/no_offset.expected 2015-04-22 15:57:43 +0900 (270bcfa) @@ -0,0 +1,70 @@ +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 4 +[ + [ + 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 + ] + ] +] Added: test/command/suite/sharding/logical_range_filter/limit/positive/no_offset.test (+36 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/limit/positive/no_offset.test 2015-04-22 15:57:43 +0900 (fac9757) @@ -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 4 + Added: test/command/suite/sharding/logical_range_filter/limit/positive/offset.expected (+55 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/limit/positive/offset.expected 2015-04-22 15:57:43 +0900 (5b3638d) @@ -0,0 +1,55 @@ +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 + ] + ] +] Added: test/command/suite/sharding/logical_range_filter/limit/positive/offset.test (+37 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/limit/positive/offset.test 2015-04-22 15:57:43 +0900 (7da80cc) @@ -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 + -------------- next part -------------- HTML����������������������������... Télécharger