forked from groonga/groonga
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add drilldowns[LABEL].columns[NAME].window.group_keys test case…
… without cache When the value of --drilldowns[LABEL].columns[NAME].window.group_keys parameter is changed, Groonga returns result without using cache.
- Loading branch information
Showing
2 changed files
with
213 additions
and
0 deletions.
There are no files selected for viewing
154 changes: 154 additions & 0 deletions
154
...command/suite/sharding/logical_select/cache/drilldowns/columns/window/group_keys.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| plugin_register sharding | ||
| [[0,0.0,0.0],true] | ||
| table_create Items TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Items price COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20170415 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170415 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170415 item COLUMN_SCALAR Items | ||
| [[0,0.0,0.0],true] | ||
| table_create Logs_20170416 TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170416 timestamp COLUMN_SCALAR Time | ||
| [[0,0.0,0.0],true] | ||
| column_create Logs_20170416 item COLUMN_SCALAR Items | ||
| [[0,0.0,0.0],true] | ||
| load --table Items | ||
| [ | ||
| {"_key": "item1", "price": 200}, | ||
| {"_key": "item2", "price": 100} | ||
| ] | ||
| [[0,0.0,0.0],2] | ||
| load --table Logs_20170415 | ||
| [ | ||
| {"timestamp": "2017/04/15 00:00:00", "item": "item1"}, | ||
| {"timestamp": "2017/04/15 01:00:00", "item": "item2"}, | ||
| {"timestamp": "2017/04/15 02:00:00", "item": "item1"} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| load --table Logs_20170416 | ||
| [ | ||
| {"timestamp": "2017/04/16 10:00:00", "item": "item2"}, | ||
| {"timestamp": "2017/04/16 11:00:00", "item": "item1"}, | ||
| {"timestamp": "2017/04/16 12:00:00", "item": "item1"} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| logical_select Logs --shard_key timestamp --limit 0 --output_columns _id --drilldowns[group].keys item --drilldowns[group].columns[number].stage initial --drilldowns[group].columns[number].type UInt32 --drilldowns[group].columns[number].flags COLUMN_SCALAR --drilldowns[group].columns[number].value 'window_record_number()' --drilldowns[group].columns[number].window.group_keys _key --drilldowns[group].output_columns _key,_nsubrecs,price,number | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 6 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ] | ||
| ] | ||
| ], | ||
| { | ||
| "group": [ | ||
| [ | ||
| 2 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_nsubrecs", | ||
| "Int32" | ||
| ], | ||
| [ | ||
| "price", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "number", | ||
| "UInt32" | ||
| ] | ||
| ], | ||
| [ | ||
| "item1", | ||
| 4, | ||
| 200, | ||
| 1 | ||
| ], | ||
| [ | ||
| "item2", | ||
| 2, | ||
| 100, | ||
| 1 | ||
| ] | ||
| ] | ||
| } | ||
| ] | ||
| ] | ||
| logical_select Logs --shard_key timestamp --limit 0 --output_columns _id --drilldowns[group].keys item --drilldowns[group].columns[number].stage initial --drilldowns[group].columns[number].type UInt32 --drilldowns[group].columns[number].flags COLUMN_SCALAR --drilldowns[group].columns[number].value 'window_record_number()' --drilldowns[group].columns[number].window.group_keys number --drilldowns[group].output_columns _key,_nsubrecs,price,number | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 6 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ] | ||
| ] | ||
| ], | ||
| { | ||
| "group": [ | ||
| [ | ||
| 2 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_nsubrecs", | ||
| "Int32" | ||
| ], | ||
| [ | ||
| "price", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "number", | ||
| "UInt32" | ||
| ] | ||
| ], | ||
| [ | ||
| "item1", | ||
| 4, | ||
| 200, | ||
| 1 | ||
| ], | ||
| [ | ||
| "item2", | ||
| 2, | ||
| 100, | ||
| 2 | ||
| ] | ||
| ] | ||
| } | ||
| ] | ||
| ] |
59 changes: 59 additions & 0 deletions
59
test/command/suite/sharding/logical_select/cache/drilldowns/columns/window/group_keys.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| #@on-error omit | ||
| plugin_register sharding | ||
| #@on-error default | ||
|
|
||
| table_create Items TABLE_HASH_KEY ShortText | ||
| column_create Items price COLUMN_SCALAR UInt32 | ||
|
|
||
| table_create Logs_20170415 TABLE_NO_KEY | ||
| column_create Logs_20170415 timestamp COLUMN_SCALAR Time | ||
| column_create Logs_20170415 item COLUMN_SCALAR Items | ||
|
|
||
| table_create Logs_20170416 TABLE_NO_KEY | ||
| column_create Logs_20170416 timestamp COLUMN_SCALAR Time | ||
| column_create Logs_20170416 item COLUMN_SCALAR Items | ||
|
|
||
| load --table Items | ||
| [ | ||
| {"_key": "item1", "price": 200}, | ||
| {"_key": "item2", "price": 100} | ||
| ] | ||
|
|
||
| load --table Logs_20170415 | ||
| [ | ||
| {"timestamp": "2017/04/15 00:00:00", "item": "item1"}, | ||
| {"timestamp": "2017/04/15 01:00:00", "item": "item2"}, | ||
| {"timestamp": "2017/04/15 02:00:00", "item": "item1"} | ||
| ] | ||
|
|
||
| load --table Logs_20170416 | ||
| [ | ||
| {"timestamp": "2017/04/16 10:00:00", "item": "item2"}, | ||
| {"timestamp": "2017/04/16 11:00:00", "item": "item1"}, | ||
| {"timestamp": "2017/04/16 12:00:00", "item": "item1"} | ||
| ] | ||
|
|
||
|
|
||
| logical_select Logs \ | ||
| --shard_key timestamp \ | ||
| --limit 0 \ | ||
| --output_columns _id \ | ||
| --drilldowns[group].keys item \ | ||
| --drilldowns[group].columns[number].stage initial \ | ||
| --drilldowns[group].columns[number].type UInt32 \ | ||
| --drilldowns[group].columns[number].flags COLUMN_SCALAR \ | ||
| --drilldowns[group].columns[number].value 'window_record_number()' \ | ||
| --drilldowns[group].columns[number].window.group_keys _key \ | ||
| --drilldowns[group].output_columns _key,_nsubrecs,price,number | ||
|
|
||
| logical_select Logs \ | ||
| --shard_key timestamp \ | ||
| --limit 0 \ | ||
| --output_columns _id \ | ||
| --drilldowns[group].keys item \ | ||
| --drilldowns[group].columns[number].stage initial \ | ||
| --drilldowns[group].columns[number].type UInt32 \ | ||
| --drilldowns[group].columns[number].flags COLUMN_SCALAR \ | ||
| --drilldowns[group].columns[number].value 'window_record_number()' \ | ||
| --drilldowns[group].columns[number].window.group_keys number \ | ||
| --drilldowns[group].output_columns _key,_nsubrecs,price,number |