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.
WIP test: add drilldowns[LABEL].columns[NAME].window.sort_keys withou…
…t cache Wrong usage of window.sort_keys?
- Loading branch information
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
test/command/suite/select/cache/drilldowns/columns/window_sort_keys.actual
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,64 @@ | ||
| 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 Shops TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Shops items COLUMN_VECTOR Items | ||
| [[0,0.0,0.0],true] | ||
| load --table Shops | ||
| [ | ||
| {"_key": "Stationery store", "items": ["Book", "Note", "Box", "Pen"]}, | ||
| {"_key": "Supermarket", "items": ["Food", "Drink", "Pen"]}, | ||
| {"_key": "Convenience store", "items": ["Pen", "Note","Food", "Drink"]} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| load --table Items | ||
| [ | ||
| {"_key": "Book", "price": 1000}, | ||
| {"_key": "Note", "price": 1000}, | ||
| {"_key": "Box", "price": 500}, | ||
| {"_key": "Pen", "price": 500}, | ||
| {"_key": "Food", "price": 500}, | ||
| {"_key": "Drink", "price": 300} | ||
| ] | ||
| [[0,0.0,0.0],6] | ||
| select Shops --drilldowns[item].keys items --drilldowns[item].sortby price --drilldowns[item].output_columns _key,_nsubrecs,price,price_with_tax --drilldowns[item].columns[price_with_tax].stage initial --drilldowns[item].columns[price_with_tax].type UInt32 --drilldowns[item].columns[price_with_tax].flags COLUMN_SCALAR --drilldowns[item].columns[price_with_tax].value 'price * 1.08' --drilldowns[item].columns[price_with_tax].window.sort_keys _key | ||
| [ | ||
| [ | ||
| [ | ||
| -22, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| "[table][apply][window-function] must be window function call: #<expr\n vars:{\n $1:#<record:hash:(anonymous:2147483649) id:(n" | ||
| ], | ||
| [ | ||
|
|
||
| ] | ||
| ] | ||
| #|e| [table][apply][window-function] must be window function call: #<expr | ||
| vars:{ | ||
| $1:#<record:hash:(anonymous:2147483649) id:(no value)>, | ||
| $condition:#<ptr:(NULL)> | ||
| }, | ||
| codes:{ | ||
| 0:<get_value n_args:1, flags:0, modify:2, value:#<accessor _key(anonymous).price(Items)>>, | ||
| 1:<push n_args:1, flags:0, modify:0, value:1.08>, | ||
| 2:<star n_args:2, flags:0, modify:0, value:(NULL)> | ||
| } | ||
| > | ||
| select Shops --drilldowns[item].keys items --drilldowns[item].sortby price --drilldowns[item].output_columns _key,_nsubrecs,price,price_with_tax --drilldowns[item].columns[price_with_tax].stage initial --drilldowns[item].columns[price_with_tax].type UInt32 --drilldowns[item].columns[price_with_tax].flags COLUMN_SCALAR --drilldowns[item].columns[price_with_tax].value 'price * 1.08' --drilldowns[item].columns[price_with_tax].window.sort_keys price | ||
| [ | ||
| [ | ||
| [ | ||
| -22, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| "[table][apply][window-function] must be window function call: #<expr\n vars:{\n $1:#<record:hash:(anonymous:2147483649) id:(n" | ||
| ], | ||
| [ | ||
|
|
||
| ] | ||
| ] |
42 changes: 42 additions & 0 deletions
42
test/command/suite/select/cache/drilldowns/columns/window_sort_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,42 @@ | ||
| table_create Items TABLE_HASH_KEY ShortText | ||
| column_create Items price COLUMN_SCALAR UInt32 | ||
|
|
||
| table_create Shops TABLE_HASH_KEY ShortText | ||
| column_create Shops items COLUMN_VECTOR Items | ||
|
|
||
| load --table Shops | ||
| [ | ||
| {"_key": "Stationery store", "items": ["Book", "Note", "Box", "Pen"]}, | ||
| {"_key": "Supermarket", "items": ["Food", "Drink", "Pen"]}, | ||
| {"_key": "Convenience store", "items": ["Pen", "Note","Food", "Drink"]} | ||
| ] | ||
|
|
||
| load --table Items | ||
| [ | ||
| {"_key": "Book", "price": 1000}, | ||
| {"_key": "Note", "price": 1000}, | ||
| {"_key": "Box", "price": 500}, | ||
| {"_key": "Pen", "price": 500}, | ||
| {"_key": "Food", "price": 500}, | ||
| {"_key": "Drink", "price": 300} | ||
| ] | ||
|
|
||
| select Shops \ | ||
| --drilldowns[item].keys items \ | ||
| --drilldowns[item].sortby price \ | ||
| --drilldowns[item].output_columns _key,_nsubrecs,price,price_with_tax \ | ||
| --drilldowns[item].columns[price_with_tax].stage initial \ | ||
| --drilldowns[item].columns[price_with_tax].type UInt32 \ | ||
| --drilldowns[item].columns[price_with_tax].flags COLUMN_SCALAR \ | ||
| --drilldowns[item].columns[price_with_tax].value 'price * 1.08' \ | ||
| --drilldowns[item].columns[price_with_tax].window.sort_keys _key | ||
|
|
||
| select Shops \ | ||
| --drilldowns[item].keys items \ | ||
| --drilldowns[item].sortby price \ | ||
| --drilldowns[item].output_columns _key,_nsubrecs,price,price_with_tax \ | ||
| --drilldowns[item].columns[price_with_tax].stage initial \ | ||
| --drilldowns[item].columns[price_with_tax].type UInt32 \ | ||
| --drilldowns[item].columns[price_with_tax].flags COLUMN_SCALAR \ | ||
| --drilldowns[item].columns[price_with_tax].value 'price * 1.08' \ | ||
| --drilldowns[item].columns[price_with_tax].window.sort_keys price |