Kouhei Sutou
null+****@clear*****
Mon Feb 23 18:17:51 JST 2015
Kouhei Sutou 2015-02-23 18:17:51 +0900 (Mon, 23 Feb 2015) New Revision: 5b29986982be669548dd5a2ca7fba571141bc36b https://github.com/groonga/groonga/commit/5b29986982be669548dd5a2ca7fba571141bc36b Message: mrb logical_range_filter: support cursor based filter TODO: * Reduce needless sort * Stop cursor loop when enough records are collected Added files: test/command/fixture/sharding/logical_range_filter/index/schema.grn test/command/suite/sharding/logical_range_filter/index/condition/no_range.expected test/command/suite/sharding/logical_range_filter/index/condition/no_range.test test/command/suite/sharding/logical_range_filter/index/condition/range/max_exclude.expected test/command/suite/sharding/logical_range_filter/index/condition/range/max_exclude.test test/command/suite/sharding/logical_range_filter/index/condition/range/max_include.expected test/command/suite/sharding/logical_range_filter/index/condition/range/max_include.test test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude.expected test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude.test test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_exclude.expected test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_exclude.test test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_include.expected test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_include.test test/command/suite/sharding/logical_range_filter/index/condition/range/min_include.expected test/command/suite/sharding/logical_range_filter/index/condition/range/min_include.test test/command/suite/sharding/logical_range_filter/index/condition/range/min_include_max_exclude.expected test/command/suite/sharding/logical_range_filter/index/condition/range/min_include_max_exclude.test test/command/suite/sharding/logical_range_filter/index/condition/range/min_include_max_include.expected test/command/suite/sharding/logical_range_filter/index/condition/range/min_include_max_include.test test/command/suite/sharding/logical_range_filter/index/no_condition/multiple_physical_tables.expected test/command/suite/sharding/logical_range_filter/index/no_condition/multiple_physical_tables.test Modified files: plugins/sharding/logical_range_filter.rb Modified: plugins/sharding/logical_range_filter.rb (+62 -25) =================================================================== --- plugins/sharding/logical_range_filter.rb 2015-02-23 18:17:28 +0900 (7e765f7) +++ plugins/sharding/logical_range_filter.rb 2015-02-23 18:17:51 +0900 (c9c25de) @@ -94,22 +94,19 @@ module Groonga use_range_index = false range_index = nil - # TODO - # if filter.nil? - # index_info = shard_key.find_index(Operator::LESS) - # if index_info - # range_index = index_info.index - # use_range_index = true - # end - # end + index_info = shard_key.find_index(Operator::LESS) + if index_info + range_index = index_info.index + # TODO: Determine whether range index is used by estimated size. + use_range_index = true + end case cover_type when :partial_min if use_range_index - # TODO - # count_n_records_in_range(range_index, - # target_range.min, target_range.min_border, - # nil, nil) + filter_by_range(range_index, filter, + target_range.min, target_range.min_border, + nil, nil) else filter_table(table, filter) do |expression| expression.append_object(shard_key, Operator::PUSH, 1) @@ -124,10 +121,9 @@ module Groonga end when :partial_max if use_range_index - # TODO - # count_n_records_in_range(range_index, - # nil, nil, - # target_range.max, target_range.max_border) + filter_by_range(range_index, filter, + nil, nil, + target_range.max, target_range.max_border) else filter_table(table, filter) do |expression| expression.append_object(shard_key, Operator::PUSH, 1) @@ -142,10 +138,9 @@ module Groonga end when :partial_min_and_max if use_range_index - # TODO - # count_n_records_in_range(range_index, - # target_range.min, target_range.min_border, - # target_range.max, target_range.max_border) + filter_by_range(range_index, filter, + target_range.min, target_range.min_border, + target_range.max, target_range.max_border) else filter_table(table, filter) do |expression| expression.append_object(context["between"], Operator::PUSH, 1) @@ -163,10 +158,54 @@ module Groonga end end - def filter_table(table, filter) - expression = nil + def create_expression(table) + expression = Expression.create(table) begin - expression = Expression.create(table) + yield(expression) + ensure + expression.close + end + end + + def filter_by_range(range_index, filter, + min, min_border, max, max_border) + lexicon = range_index.domain + data_table = range_index.range + flags = TableCursorFlags::BY_KEY + case min_border + when :include + flags |= TableCursorFlags::GE + when :exclude + flags |= TableCursorFlags::GT + end + case max_border + when :include + flags |= TableCursorFlags::LE + when :exclude + flags |= TableCursorFlags::LT + end + + TableCursor.open(lexicon, + :min => min, + :max => max, + :flags => flags) do |table_cursor| + if filter + create_expression(data_table) do |expression| + expression.parse(filter) + IndexCursor.open(table_cursor, range_index) do |index_cursor| + index_cursor.select(expression) + end + end + else + IndexCursor.open(table_cursor, range_index) do |index_cursor| + index_cursor.select(nil) + end + end + end + end + + def filter_table(table, filter) + create_expression(table) do |expression| if block_given? yield(expression) if filter @@ -177,8 +216,6 @@ module Groonga expression.parse(filter) end table.select(expression) - ensure - expression.close if expression end end end Added: test/command/fixture/sharding/logical_range_filter/index/schema.grn (+47 -0) 100644 =================================================================== --- /dev/null +++ test/command/fixture/sharding/logical_range_filter/index/schema.grn 2015-02-23 18:17:51 +0900 (c6b0097) @@ -0,0 +1,47 @@ +#@disable-logging + +#@on-error omit +register sharding +#@on-error default + +table_create Terms TABLE_PAT_KEY ShortText \ + --default_tokenizer TokenizerBigram \ + --normalizer NormalizserAuto + +table_create Logs_20150203 TABLE_NO_KEY +column_create Logs_20150203 timestamp COLUMN_SCALAR Time +column_create Logs_20150203 memo COLUMN_SCALAR ShortText +column_create Logs_20150203 message COLUMN_SCALAR Text + +table_create Timestamp_20150203 TABLE_PAT_KEY Time +column_create Timestamp_20150203 index COLUMN_INDEX Logs_20150203 timestamp + +column_create Terms index_20150203 COLUMN_INDEX|WITH_POSITION|WITH_SECTION \ + Logs_20150203 memo,message + + +table_create Logs_20150204 TABLE_NO_KEY +column_create Logs_20150204 timestamp COLUMN_SCALAR Time +column_create Logs_20150204 memo COLUMN_SCALAR ShortText +column_create Logs_20150204 message COLUMN_SCALAR Text + +table_create Timestamp_20150204 TABLE_PAT_KEY Time +column_create Timestamp_20150204 index COLUMN_INDEX Logs_20150204 timestamp + +column_create Terms index_20150204 COLUMN_INDEX|WITH_POSITION|WITH_SECTION \ + Logs_20150204 memo,message + + +table_create Logs_20150205 TABLE_NO_KEY +column_create Logs_20150205 timestamp COLUMN_SCALAR Time +column_create Logs_20150205 memo COLUMN_SCALAR ShortText +column_create Logs_20150205 message COLUMN_SCALAR Text + +table_create Timestamp_20150205 TABLE_PAT_KEY Time +column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp + +column_create Terms index_20150205 COLUMN_INDEX|WITH_POSITION|WITH_SECTION \ + Logs_20150205 memo,message + + +#@enable-logging Added: test/command/suite/sharding/logical_range_filter/index/condition/no_range.expected (+76 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/no_range.expected 2015-02-23 18:17:51 +0900 (6be0500) @@ -0,0 +1,76 @@ +load --table Logs_20150203 +[ +{ + "timestamp": "2015-02-03 12:49:00", + "memo": "2015-02-03 12:49:00", + "message": "Start" +} +] +[[0,0.0,0.0],1] +load --table Logs_20150204 +[ +{ + "timestamp": "2015-02-04 13:49:00", + "memo": "2015-02-04 13:49:00", + "message": "Start" +}, +{ + "timestamp": "2015-02-04 13:50:00", + "memo": "2015-02-04 13:50:00", + "message": "Shutdown" +} +] +[[0,0.0,0.0],2] +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "message": "Start" +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "message": "Running" +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "message": "Shutdown" +} +] +[[0,0.0,0.0],3] +logical_range_filter Logs timestamp --filter 'message == "Shutdown"' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "memo", + "ShortText" + ], + [ + "message", + "Text" + ], + [ + "timestamp", + "Time" + ] + ], + [ + "2015-02-04 13:50:00", + "Shutdown", + 1423025400.0 + ], + [ + "2015-02-05 13:51:00", + "Shutdown", + 1423111860.0 + ] + ] +] Added: test/command/suite/sharding/logical_range_filter/index/condition/no_range.test (+45 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/no_range.test 2015-02-23 18:17:51 +0900 (9467334) @@ -0,0 +1,45 @@ +#@include fixture/sharding/logical_range_filter/index/schema.grn + +load --table Logs_20150203 +[ +{ + "timestamp": "2015-02-03 12:49:00", + "memo": "2015-02-03 12:49:00", + "message": "Start" +} +] + +load --table Logs_20150204 +[ +{ + "timestamp": "2015-02-04 13:49:00", + "memo": "2015-02-04 13:49:00", + "message": "Start" +}, +{ + "timestamp": "2015-02-04 13:50:00", + "memo": "2015-02-04 13:50:00", + "message": "Shutdown" +} +] + +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "message": "Start" +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "message": "Running" +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "message": "Shutdown" +} +] + +logical_range_filter Logs timestamp --filter 'message == "Shutdown"' Added: test/command/suite/sharding/logical_range_filter/index/condition/range/max_exclude.expected (+75 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/max_exclude.expected 2015-02-23 18:17:51 +0900 (cf1a97b) @@ -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"' --max "2015-02-05 00:00:00" --max_border "exclude" +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "memo", + "ShortText" + ], + [ + "message", + "Text" + ], + [ + "timestamp", + "Time" + ] + ], + [ + "2015-02-03 23:59:58", + "Shutdown", + 1422975598.0 + ], + [ + "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/index/condition/range/max_exclude.test (+33 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/max_exclude.test 2015-02-23 18:17:51 +0900 (e55b141) @@ -0,0 +1,33 @@ +#@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"' \ + --max "2015-02-05 00:00:00" \ + --max_border "exclude" + Added: test/command/suite/sharding/logical_range_filter/index/condition/range/max_include.expected (+80 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/max_include.expected 2015-02-23 18:17:51 +0900 (1641b1a) @@ -0,0 +1,80 @@ +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"' --max "2015-02-05 00:00:00" --max_border "include" +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "memo", + "ShortText" + ], + [ + "message", + "Text" + ], + [ + "timestamp", + "Time" + ] + ], + [ + "2015-02-03 23:59:58", + "Shutdown", + 1422975598.0 + ], + [ + "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 + ] + ] +] Added: test/command/suite/sharding/logical_range_filter/index/condition/range/max_include.test (+33 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/max_include.test 2015-02-23 18:17:51 +0900 (1acf5cb) @@ -0,0 +1,33 @@ +#@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"' \ + --max "2015-02-05 00:00:00" \ + --max_border "include" + Added: test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude.expected (+70 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude.expected 2015-02-23 18:17:51 +0900 (ab42784) @@ -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-04 00:00:00" --min_border "exclude" +[ + [ + 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 + ], + [ + "2015-02-05 00:00:01", + "Shutdown", + 1423062001.0 + ] + ] +] Added: test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude.test (+33 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude.test 2015-02-23 18:17:51 +0900 (8cc6639) @@ -0,0 +1,33 @@ +#@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-04 00:00:00" \ + --min_border "exclude" + Added: test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_exclude.expected (+60 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_exclude.expected 2015-02-23 18:17:51 +0900 (c1ec0c1) @@ -0,0 +1,60 @@ +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-04 00:00:00" --min_border "exclude" --max "2015-02-05 00:00:00" --max_border "exclude" +[ + [ + 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 + ] + ] +] Added: test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_exclude.test (+35 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_exclude.test 2015-02-23 18:17:51 +0900 (cfbe886) @@ -0,0 +1,35 @@ +#@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-04 00:00:00" \ + --min_border "exclude" \ + --max "2015-02-05 00:00:00" \ + --max_border "exclude" + Added: test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_include.expected (+65 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_include.expected 2015-02-23 18:17:51 +0900 (25e2eeb) @@ -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-04 00:00:00" --min_border "exclude" --max "2015-02-05 00:00:00" --max_border "include" +[ + [ + 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 + ] + ] +] Added: test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_include.test (+35 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_exclude_max_include.test 2015-02-23 18:17:51 +0900 (98328ca) @@ -0,0 +1,35 @@ +#@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-04 00:00:00" \ + --min_border "exclude" \ + --max "2015-02-05 00:00:00" \ + --max_border "include" + Added: test/command/suite/sharding/logical_range_filter/index/condition/range/min_include.expected (+75 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_include.expected 2015-02-23 18:17:51 +0900 (28d84e8) @@ -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-04 00:00:00" --min_border "include" +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "memo", + "ShortText" + ], + [ + "message", + "Text" + ], + [ + "timestamp", + "Time" + ] + ], + [ + "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 + ], + [ + "2015-02-05 00:00:01", + "Shutdown", + 1423062001.0 + ] + ] +] Added: test/command/suite/sharding/logical_range_filter/index/condition/range/min_include.test (+33 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_include.test 2015-02-23 18:17:51 +0900 (77ba090) @@ -0,0 +1,33 @@ +#@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-04 00:00:00" \ + --min_border "include" + Added: test/command/suite/sharding/logical_range_filter/index/condition/range/min_include_max_exclude.expected (+65 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_include_max_exclude.expected 2015-02-23 18:17:51 +0900 (cd03368) @@ -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-04 00:00:00" --min_border "include" --max "2015-02-05 00:00:00" --max_border "exclude" +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "memo", + "ShortText" + ], + [ + "message", + "Text" + ], + [ + "timestamp", + "Time" + ] + ], + [ + "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/index/condition/range/min_include_max_exclude.test (+35 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_include_max_exclude.test 2015-02-23 18:17:51 +0900 (89dff44) @@ -0,0 +1,35 @@ +#@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-04 00:00:00" \ + --min_border "include" \ + --max "2015-02-05 00:00:00" \ + --max_border "exclude" + Added: test/command/suite/sharding/logical_range_filter/index/condition/range/min_include_max_include.expected (+70 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_include_max_include.expected 2015-02-23 18:17:51 +0900 (f7f5f93) @@ -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-04 00:00:00" --min_border "include" --max "2015-02-05 00:00:00" --max_border "include" +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "memo", + "ShortText" + ], + [ + "message", + "Text" + ], + [ + "timestamp", + "Time" + ] + ], + [ + "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 + ] + ] +] Added: test/command/suite/sharding/logical_range_filter/index/condition/range/min_include_max_include.test (+35 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/condition/range/min_include_max_include.test 2015-02-23 18:17:51 +0900 (bbdd7c8) @@ -0,0 +1,35 @@ +#@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-04 00:00:00" \ + --min_border "include" \ + --max "2015-02-05 00:00:00" \ + --max_border "include" + Added: test/command/suite/sharding/logical_range_filter/index/no_condition/multiple_physical_tables.expected (+82 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/no_condition/multiple_physical_tables.expected 2015-02-23 18:17:51 +0900 (430167f) @@ -0,0 +1,82 @@ +register sharding +[[0,0.0,0.0],true] +table_create Logs_20150203 TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Logs_20150203 timestamp COLUMN_SCALAR Time +[[0,0.0,0.0],true] +column_create Logs_20150203 memo COLUMN_SCALAR ShortText +[[0,0.0,0.0],true] +table_create Logs_20150204 TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Logs_20150204 timestamp COLUMN_SCALAR Time +[[0,0.0,0.0],true] +column_create Logs_20150204 memo COLUMN_SCALAR ShortText +[[0,0.0,0.0],true] +table_create Logs_20150205 TABLE_NO_KEY +[[0,0.0,0.0],true] +column_create Logs_20150205 timestamp COLUMN_SCALAR Time +[[0,0.0,0.0],true] +column_create Logs_20150205 memo COLUMN_SCALAR ShortText +[[0,0.0,0.0],true] +load --table Logs_20150203 +[ +{"timestamp": "2015-02-03 12:49:00", "memo": "2015-02-03 12:49:00"} +] +[[0,0.0,0.0],1] +load --table Logs_20150204 +[ +{"timestamp": "2015-02-04 13:49:00", "memo": "2015-02-04 13:49:00"}, +{"timestamp": "2015-02-04 13:50:00", "memo": "2015-02-04 13:50:00"} +] +[[0,0.0,0.0],2] +load --table Logs_20150205 +[ +{"timestamp": "2015-02-05 13:49:00", "memo": "2015-02-05 13:49:00"}, +{"timestamp": "2015-02-05 13:50:00", "memo": "2015-02-05 13:50:00"}, +{"timestamp": "2015-02-05 13:51:00", "memo": "2015-02-05 13:51:00"} +] +[[0,0.0,0.0],3] +logical_range_filter Logs timestamp +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "memo", + "ShortText" + ], + [ + "timestamp", + "Time" + ] + ], + [ + "2015-02-03 12:49:00", + 1422935340.0 + ], + [ + "2015-02-04 13:49:00", + 1423025340.0 + ], + [ + "2015-02-04 13:50:00", + 1423025400.0 + ], + [ + "2015-02-05 13:49:00", + 1423111740.0 + ], + [ + "2015-02-05 13:50:00", + 1423111800.0 + ], + [ + "2015-02-05 13:51:00", + 1423111860.0 + ] + ] +] Added: test/command/suite/sharding/logical_range_filter/index/no_condition/multiple_physical_tables.test (+35 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/index/no_condition/multiple_physical_tables.test 2015-02-23 18:17:51 +0900 (9aa627e) @@ -0,0 +1,35 @@ +#@on-error omit +register sharding +#@on-error default + +table_create Logs_20150203 TABLE_NO_KEY +column_create Logs_20150203 timestamp COLUMN_SCALAR Time +column_create Logs_20150203 memo COLUMN_SCALAR ShortText + +table_create Logs_20150204 TABLE_NO_KEY +column_create Logs_20150204 timestamp COLUMN_SCALAR Time +column_create Logs_20150204 memo COLUMN_SCALAR ShortText + +table_create Logs_20150205 TABLE_NO_KEY +column_create Logs_20150205 timestamp COLUMN_SCALAR Time +column_create Logs_20150205 memo COLUMN_SCALAR ShortText + +load --table Logs_20150203 +[ +{"timestamp": "2015-02-03 12:49:00", "memo": "2015-02-03 12:49:00"} +] + +load --table Logs_20150204 +[ +{"timestamp": "2015-02-04 13:49:00", "memo": "2015-02-04 13:49:00"}, +{"timestamp": "2015-02-04 13:50:00", "memo": "2015-02-04 13:50:00"} +] + +load --table Logs_20150205 +[ +{"timestamp": "2015-02-05 13:49:00", "memo": "2015-02-05 13:49:00"}, +{"timestamp": "2015-02-05 13:50:00", "memo": "2015-02-05 13:50:00"}, +{"timestamp": "2015-02-05 13:51:00", "memo": "2015-02-05 13:51:00"} +] + +logical_range_filter Logs timestamp -------------- next part -------------- HTML����������������������������... 다운로드