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 columns[NAME].window.sort_keys test case without cache
- Loading branch information
Showing
2 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
115 changes: 115 additions & 0 deletions
115
test/command/suite/select/cache/columns/window_sort_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,115 @@ | ||
| 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] | ||
| column_create Items comment COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| load --table Items | ||
| [ | ||
| {"_key": "item1", "price": 200, "comment": 10}, | ||
| {"_key": "item2", "price": 100, "comment": 30}, | ||
| {"_key": "item3", "price": 300, "comment": 20} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| select Items --columns[nth_record].stage initial --columns[nth_record].value 'record_number()' --columns[nth_record].type UInt32 --columns[nth_record].window.sort_keys price --output_columns '_key, price, comment, nth_record' | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 3 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "price", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "comment", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "nth_record", | ||
| "UInt32" | ||
| ] | ||
| ], | ||
| [ | ||
| "item1", | ||
| 200, | ||
| 10, | ||
| 2 | ||
| ], | ||
| [ | ||
| "item2", | ||
| 100, | ||
| 30, | ||
| 1 | ||
| ], | ||
| [ | ||
| "item3", | ||
| 300, | ||
| 20, | ||
| 3 | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| select Items --columns[nth_record].stage initial --columns[nth_record].value 'record_number()' --columns[nth_record].type UInt32 --columns[nth_record].window.sort_keys comment --output_columns '_key, price, comment, nth_record' | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 3 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "price", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "comment", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "nth_record", | ||
| "UInt32" | ||
| ] | ||
| ], | ||
| [ | ||
| "item1", | ||
| 200, | ||
| 10, | ||
| 1 | ||
| ], | ||
| [ | ||
| "item2", | ||
| 100, | ||
| 30, | ||
| 3 | ||
| ], | ||
| [ | ||
| "item3", | ||
| 300, | ||
| 20, | ||
| 2 | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
24 changes: 24 additions & 0 deletions
24
test/command/suite/select/cache/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,24 @@ | ||
| table_create Items TABLE_HASH_KEY ShortText | ||
| column_create Items price COLUMN_SCALAR UInt32 | ||
| column_create Items comment COLUMN_SCALAR UInt32 | ||
|
|
||
| load --table Items | ||
| [ | ||
| {"_key": "item1", "price": 200, "comment": 10}, | ||
| {"_key": "item2", "price": 100, "comment": 30}, | ||
| {"_key": "item3", "price": 300, "comment": 20} | ||
| ] | ||
|
|
||
| select Items \ | ||
| --columns[nth_record].stage initial \ | ||
| --columns[nth_record].value 'record_number()' \ | ||
| --columns[nth_record].type UInt32 \ | ||
| --columns[nth_record].window.sort_keys price \ | ||
| --output_columns '_key, price, comment, nth_record' | ||
|
|
||
| select Items \ | ||
| --columns[nth_record].stage initial \ | ||
| --columns[nth_record].value 'record_number()' \ | ||
| --columns[nth_record].type UInt32 \ | ||
| --columns[nth_record].window.sort_keys comment \ | ||
| --output_columns '_key, price, comment, nth_record' |