Kouhei Sutou
null+****@clear*****
Fri Jul 10 11:38:46 JST 2015
Kouhei Sutou 2015-07-10 11:38:46 +0900 (Fri, 10 Jul 2015) New Revision: 22bbe849ff2fb5f686d5b98a1f72a75e601fd4a5 https://github.com/groonga/groonga/commit/22bbe849ff2fb5f686d5b98a1f72a75e601fd4a5 Message: test logical_range_filter: add tests for match against vector by range-index/select Added files: test/command/suite/sharding/logical_range_filter/filter/vector/match/range_index.expected test/command/suite/sharding/logical_range_filter/filter/vector/match/range_index.test test/command/suite/sharding/logical_range_filter/filter/vector/match/select.expected test/command/suite/sharding/logical_range_filter/filter/vector/match/select.test Added: test/command/suite/sharding/logical_range_filter/filter/vector/match/range_index.expected (+81 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/vector/match/range_index.expected 2015-07-10 11:38:46 +0900 (6dc1d16) @@ -0,0 +1,81 @@ +plugin_register sharding +[[0,0.0,0.0],true] +table_create IDs TABLE_PAT_KEY UInt32 +[[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 ids COLUMN_VECTOR IDs +[[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 IDs index_20150205 COLUMN_INDEX Logs_20140205 ids +[[[-22,0.0,0.0],"[column][create] type doesn't exist: <Logs_20140205>"],false] +#|e| [column][create] type doesn't exist: <Logs_20140205> +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "ids": [1, 2, 3] +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "ids": [2, 3, 4] +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "ids": [2, 3, 4] +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:52:00", + "ids": [3, 4, 5] +} +] +[[0,0.0,0.0],4] +log_level --level debug +[[0,0.0,0.0],true] +logical_range_filter Logs timestamp --limit 1 --filter 'ids @ 4' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "ids", + "IDs" + ], + [ + "memo", + "ShortText" + ], + [ + "timestamp", + "Time" + ] + ], + [ + [ + 2, + 3, + 4 + ], + "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/vector/match/range_index.test (+48 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/vector/match/range_index.test 2015-07-10 11:38:46 +0900 (9e67563) @@ -0,0 +1,48 @@ +#@on-error omit +plugin_register sharding +#@on-error default + +table_create IDs TABLE_PAT_KEY UInt32 + +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 ids COLUMN_VECTOR IDs + +table_create Timestamp_20150205 TABLE_PAT_KEY Time +column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp + +column_create IDs index_20150205 COLUMN_INDEX Logs_20140205 ids + + +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "ids": [1, 2, 3] +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "ids": [2, 3, 4] +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "ids": [2, 3, 4] +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:52:00", + "ids": [3, 4, 5] +} +] + +#@add-important-log-levels debug +log_level --level debug +logical_range_filter Logs timestamp \ + --limit 1 \ + --filter 'ids @ 4' +log_level --level notice +#@remove-important-log-levels debug Added: test/command/suite/sharding/logical_range_filter/filter/vector/match/select.expected (+99 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/vector/match/select.expected 2015-07-10 11:38:46 +0900 (2d36798) @@ -0,0 +1,99 @@ +plugin_register sharding +[[0,0.0,0.0],true] +table_create IDs TABLE_PAT_KEY UInt32 +[[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 ids COLUMN_VECTOR IDs +[[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 IDs index_20150205 COLUMN_INDEX Logs_20140205 ids +[[[-22,0.0,0.0],"[column][create] type doesn't exist: <Logs_20140205>"],false] +#|e| [column][create] type doesn't exist: <Logs_20140205> +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "ids": [1, 2, 3] +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "ids": [2, 3, 4] +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "ids": [2, 3, 4] +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:52:00", + "ids": [3, 4, 5] +} +] +[[0,0.0,0.0],4] +log_level --level debug +[[0,0.0,0.0],true] +logical_range_filter Logs timestamp --limit -1 --filter 'ids @ 4' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "ids", + "IDs" + ], + [ + "memo", + "ShortText" + ], + [ + "timestamp", + "Time" + ] + ], + [ + [ + 2, + 3, + 4 + ], + "2015-02-05 13:50:00", + 1423111800.0 + ], + [ + [ + 2, + 3, + 4 + ], + "2015-02-05 13:51:00", + 1423111860.0 + ], + [ + [ + 3, + 4, + 5 + ], + "2015-02-05 13:52:00", + 1423111920.0 + ] + ] +] +#|d| [logical_range_filter][select] <Logs_20150205>: limit is negative: <-1> +log_level --level notice +[[0,0.0,0.0],true] Added: test/command/suite/sharding/logical_range_filter/filter/vector/match/select.test (+48 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/vector/match/select.test 2015-07-10 11:38:46 +0900 (b8998fe) @@ -0,0 +1,48 @@ +#@on-error omit +plugin_register sharding +#@on-error default + +table_create IDs TABLE_PAT_KEY UInt32 + +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 ids COLUMN_VECTOR IDs + +table_create Timestamp_20150205 TABLE_PAT_KEY Time +column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp + +column_create IDs index_20150205 COLUMN_INDEX Logs_20140205 ids + + +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "ids": [1, 2, 3] +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "ids": [2, 3, 4] +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "ids": [2, 3, 4] +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:52:00", + "ids": [3, 4, 5] +} +] + +#@add-important-log-levels debug +log_level --level debug +logical_range_filter Logs timestamp \ + --limit -1 \ + --filter 'ids @ 4' +log_level --level notice +#@remove-important-log-levels debug -------------- next part -------------- HTML����������������������������...Download