Kouhei Sutou
null+****@clear*****
Thu Jul 9 23:04:09 JST 2015
Kouhei Sutou 2015-07-09 23:04:09 +0900 (Thu, 09 Jul 2015) New Revision: 7d86b87e7536bd677de30cabf3a4b06590e96bac https://github.com/groonga/groonga/commit/7d86b87e7536bd677de30cabf3a4b06590e96bac Message: logical_range_filter: add tests for "X == a || X == b" by range-index/select Added files: test/command/suite/sharding/logical_range_filter/filter/or_equals/range_index.actual test/command/suite/sharding/logical_range_filter/filter/or_equals/range_index.expected test/command/suite/sharding/logical_range_filter/filter/or_equals/range_index.test test/command/suite/sharding/logical_range_filter/filter/or_equals/select.expected test/command/suite/sharding/logical_range_filter/filter/or_equals/select.test Added: test/command/suite/sharding/logical_range_filter/filter/or_equals/range_index.actual (+81 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/or_equals/range_index.actual 2015-07-09 23:04:09 +0900 (73e74c0) @@ -0,0 +1,81 @@ +register sharding +[[0,0.0,0.0],true] +table_create Actions TABLE_PAT_KEY 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] +column_create Logs_20150205 action COLUMN_SCALAR Actions +[[0,0.0,0.0],true] +table_create Timestamp_20150205 TABLE_PAT_KEY Time +[[0,0.0,0.0],true] +column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp +[[0,0.0,0.0],true] +column_create Actions index_20150205 COLUMN_INDEX Logs_20150205 action +[[0,0.0,0.0],true] +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "action": "Start" +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "action": "Running" +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "action": "Running" +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:5:00", + "action": "Shutdown" +} +] +[[0,0.0,0.0],4] +log_level --level debug +[[0,0.0,0.0],true] +logical_range_filter Logs timestamp --limit 2 --filter 'action == "Running" || action == "Start"' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "action", + "Actions" + ], + [ + "memo", + "ShortText" + ], + [ + "timestamp", + "Time" + ] + ], + [ + "Start", + "2015-02-05 13:49:00", + 1423111740.0 + ], + [ + "Running", + "2015-02-05 13:50:00", + 1423111800.0 + ] + ] +] +#|d| [logical_range_filter][range-index] <Logs_20150205>: hit ratio (1=4/4)>= threshold (0.2) +log_level --level notice +[[0,0.0,0.0],true] Added: test/command/suite/sharding/logical_range_filter/filter/or_equals/range_index.expected (+81 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/or_equals/range_index.expected 2015-07-09 23:04:09 +0900 (73e74c0) @@ -0,0 +1,81 @@ +register sharding +[[0,0.0,0.0],true] +table_create Actions TABLE_PAT_KEY 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] +column_create Logs_20150205 action COLUMN_SCALAR Actions +[[0,0.0,0.0],true] +table_create Timestamp_20150205 TABLE_PAT_KEY Time +[[0,0.0,0.0],true] +column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp +[[0,0.0,0.0],true] +column_create Actions index_20150205 COLUMN_INDEX Logs_20150205 action +[[0,0.0,0.0],true] +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "action": "Start" +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "action": "Running" +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "action": "Running" +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:5:00", + "action": "Shutdown" +} +] +[[0,0.0,0.0],4] +log_level --level debug +[[0,0.0,0.0],true] +logical_range_filter Logs timestamp --limit 2 --filter 'action == "Running" || action == "Start"' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "action", + "Actions" + ], + [ + "memo", + "ShortText" + ], + [ + "timestamp", + "Time" + ] + ], + [ + "Start", + "2015-02-05 13:49:00", + 1423111740.0 + ], + [ + "Running", + "2015-02-05 13:50:00", + 1423111800.0 + ] + ] +] +#|d| [logical_range_filter][range-index] <Logs_20150205>: hit ratio (1=4/4)>= threshold (0.2) +log_level --level notice +[[0,0.0,0.0],true] Added: test/command/suite/sharding/logical_range_filter/filter/or_equals/range_index.test (+48 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/or_equals/range_index.test 2015-07-09 23:04:09 +0900 (1d34c40) @@ -0,0 +1,48 @@ +#@on-error omit +register sharding +#@on-error default + +table_create Actions TABLE_PAT_KEY ShortText + +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 action COLUMN_SCALAR Actions + +table_create Timestamp_20150205 TABLE_PAT_KEY Time +column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp + +column_create Actions index_20150205 COLUMN_INDEX Logs_20150205 action + + +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "action": "Start" +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "action": "Running" +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "action": "Running" +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:5:00", + "action": "Shutdown" +} +] + +#@add-important-log-levels debug +log_level --level debug +logical_range_filter Logs timestamp \ + --limit 2 \ + --filter 'action == "Running" || action == "Start"' +log_level --level notice +#@remove-important-log-levels debug Added: test/command/suite/sharding/logical_range_filter/filter/or_equals/select.expected (+86 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/or_equals/select.expected 2015-07-09 23:04:09 +0900 (786bc3a) @@ -0,0 +1,86 @@ +register sharding +[[0,0.0,0.0],true] +table_create Actions TABLE_PAT_KEY 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] +column_create Logs_20150205 action COLUMN_SCALAR Actions +[[0,0.0,0.0],true] +table_create Timestamp_20150205 TABLE_PAT_KEY Time +[[0,0.0,0.0],true] +column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp +[[0,0.0,0.0],true] +column_create Actions index_20150205 COLUMN_INDEX Logs_20150205 action +[[0,0.0,0.0],true] +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "action": "Start" +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "action": "Running" +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "action": "Running" +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:5:00", + "action": "Shutdown" +} +] +[[0,0.0,0.0],4] +log_level --level debug +[[0,0.0,0.0],true] +logical_range_filter Logs timestamp --limit 4 --filter 'action == "Running" || action == "Start"' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "action", + "Actions" + ], + [ + "memo", + "ShortText" + ], + [ + "timestamp", + "Time" + ] + ], + [ + "Start", + "2015-02-05 13:49:00", + 1423111740.0 + ], + [ + "Running", + "2015-02-05 13:50:00", + 1423111800.0 + ], + [ + "Running", + "2015-02-05 13:51:00", + 1423111860.0 + ] + ] +] +#|d| [logical_range_filter][select] <Logs_20150205>: the number of required records (4) >= the number of records in shard (4) +log_level --level notice +[[0,0.0,0.0],true] Added: test/command/suite/sharding/logical_range_filter/filter/or_equals/select.test (+48 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/or_equals/select.test 2015-07-09 23:04:09 +0900 (54b1674) @@ -0,0 +1,48 @@ +#@on-error omit +register sharding +#@on-error default + +table_create Actions TABLE_PAT_KEY ShortText + +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 action COLUMN_SCALAR Actions + +table_create Timestamp_20150205 TABLE_PAT_KEY Time +column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp + +column_create Actions index_20150205 COLUMN_INDEX Logs_20150205 action + + +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "action": "Start" +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "action": "Running" +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "action": "Running" +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:5:00", + "action": "Shutdown" +} +] + +#@add-important-log-levels debug +log_level --level debug +logical_range_filter Logs timestamp \ + --limit 4 \ + --filter 'action == "Running" || action == "Start"' +log_level --level notice +#@remove-important-log-levels debug -------------- next part -------------- HTML����������������������������...Download