Kouhei Sutou
null+****@clear*****
Thu Jul 9 23:00:15 JST 2015
Kouhei Sutou 2015-07-09 23:00:15 +0900 (Thu, 09 Jul 2015) New Revision: 5e0e8539b50cafa1332abf924fdc5f66db9c3a85 https://github.com/groonga/groonga/commit/5e0e8539b50cafa1332abf924fdc5f66db9c3a85 Message: logical_range_filter: add tests for in_values by range-index/select Added files: test/command/suite/sharding/logical_range_filter/filter/in_values/range_index.expected test/command/suite/sharding/logical_range_filter/filter/in_values/range_index.test test/command/suite/sharding/logical_range_filter/filter/in_values/select.expected test/command/suite/sharding/logical_range_filter/filter/in_values/select.test Added: test/command/suite/sharding/logical_range_filter/filter/in_values/range_index.expected (+81 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/in_values/range_index.expected 2015-07-09 23:00:15 +0900 (695fba2) @@ -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 'in_values(action, "Running", "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/in_values/range_index.test (+48 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/in_values/range_index.test 2015-07-09 23:00:15 +0900 (c4cf676) @@ -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 'in_values(action, "Running", "Start")' +log_level --level notice +#@remove-important-log-levels debug Added: test/command/suite/sharding/logical_range_filter/filter/in_values/select.expected (+86 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/in_values/select.expected 2015-07-09 23:00:15 +0900 (7177a58) @@ -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 'in_values(action, "Running", "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/in_values/select.test (+48 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/in_values/select.test 2015-07-09 23:00:15 +0900 (c876267) @@ -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 'in_values(action, "Running", "Start")' +log_level --level notice +#@remove-important-log-levels debug -------------- next part -------------- HTML����������������������������...Download