Kouhei Sutou
null+****@clear*****
Fri Jul 10 11:44:13 JST 2015
Kouhei Sutou 2015-07-10 11:44:13 +0900 (Fri, 10 Jul 2015) New Revision: 2b1aa8997ffb40fe67a3910e4e661c45024b636f https://github.com/groonga/groonga/commit/2b1aa8997ffb40fe67a3910e4e661c45024b636f Message: test logical_range_filter: add tests for equal by range-index/select Added files: test/command/suite/sharding/logical_range_filter/filter/equal/range_index.expected test/command/suite/sharding/logical_range_filter/filter/equal/range_index.test test/command/suite/sharding/logical_range_filter/filter/equal/select.expected test/command/suite/sharding/logical_range_filter/filter/equal/select.test Added: test/command/suite/sharding/logical_range_filter/filter/equal/range_index.expected (+77 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/equal/range_index.expected 2015-07-10 11:44:13 +0900 (16e1731) @@ -0,0 +1,77 @@ +plugin_register sharding +[[0,0.0,0.0],true] +table_create UserIDs 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 user_id COLUMN_SCALAR UserIDs +[[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 UserIDs index_20150205 COLUMN_INDEX Logs_20140205 user_id +[[[-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", + "user_id": 1 +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "user_id": 2 +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "user_id": 2 +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:52:00", + "user_id": 3 +} +] +[[0,0.0,0.0],4] +log_level --level debug +[[0,0.0,0.0],true] +logical_range_filter Logs timestamp --limit 1 --filter 'user_id == 2' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "memo", + "ShortText" + ], + [ + "timestamp", + "Time" + ], + [ + "user_id", + "UserIDs" + ] + ], + [ + "2015-02-05 13:50:00", + 1423111800.0, + 2 + ] + ] +] +#|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/equal/range_index.test (+48 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/equal/range_index.test 2015-07-10 11:44:13 +0900 (e661848) @@ -0,0 +1,48 @@ +#@on-error omit +plugin_register sharding +#@on-error default + +table_create UserIDs 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 user_id COLUMN_SCALAR UserIDs + +table_create Timestamp_20150205 TABLE_PAT_KEY Time +column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp + +column_create UserIDs index_20150205 COLUMN_INDEX Logs_20140205 user_id + + +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "user_id": 1 +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "user_id": 2 +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "user_id": 2 +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:52:00", + "user_id": 3 +} +] + +#@add-important-log-levels debug +log_level --level debug +logical_range_filter Logs timestamp \ + --limit 1 \ + --filter 'user_id == 2' +log_level --level notice +#@remove-important-log-levels debug Added: test/command/suite/sharding/logical_range_filter/filter/equal/select.expected (+82 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/equal/select.expected 2015-07-10 11:44:13 +0900 (fe6a379) @@ -0,0 +1,82 @@ +plugin_register sharding +[[0,0.0,0.0],true] +table_create UserIDs 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 user_id COLUMN_SCALAR UserIDs +[[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 UserIDs index_20150205 COLUMN_INDEX Logs_20140205 user_id +[[[-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", + "user_id": 1 +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "user_id": 2 +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "user_id": 2 +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:52:00", + "user_id": 3 +} +] +[[0,0.0,0.0],4] +log_level --level debug +[[0,0.0,0.0],true] +logical_range_filter Logs timestamp --limit -1 --filter 'user_id == 2' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + "memo", + "ShortText" + ], + [ + "timestamp", + "Time" + ], + [ + "user_id", + "UserIDs" + ] + ], + [ + "2015-02-05 13:50:00", + 1423111800.0, + 2 + ], + [ + "2015-02-05 13:51:00", + 1423111860.0, + 2 + ] + ] +] +#|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/equal/select.test (+48 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/sharding/logical_range_filter/filter/equal/select.test 2015-07-10 11:44:13 +0900 (8ac9aed) @@ -0,0 +1,48 @@ +#@on-error omit +plugin_register sharding +#@on-error default + +table_create UserIDs 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 user_id COLUMN_SCALAR UserIDs + +table_create Timestamp_20150205 TABLE_PAT_KEY Time +column_create Timestamp_20150205 index COLUMN_INDEX Logs_20150205 timestamp + +column_create UserIDs index_20150205 COLUMN_INDEX Logs_20140205 user_id + + +load --table Logs_20150205 +[ +{ + "timestamp": "2015-02-05 13:49:00", + "memo": "2015-02-05 13:49:00", + "user_id": 1 +}, +{ + "timestamp": "2015-02-05 13:50:00", + "memo": "2015-02-05 13:50:00", + "user_id": 2 +}, +{ + "timestamp": "2015-02-05 13:51:00", + "memo": "2015-02-05 13:51:00", + "user_id": 2 +}, +{ + "timestamp": "2015-02-05 13:52:00", + "memo": "2015-02-05 13:52:00", + "user_id": 3 +} +] + +#@add-important-log-levels debug +log_level --level debug +logical_range_filter Logs timestamp \ + --limit -1 \ + --filter 'user_id == 2' +log_level --level notice +#@remove-important-log-levels debug -------------- next part -------------- HTML����������������������������... ダウンロード