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].stage test case without cache
TODO: confirm the value of price_with_tax
- Loading branch information
Showing
2 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
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,132 @@ | ||
| 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 Prices TABLE_PAT_KEY UInt32 | ||
| [[0,0.0,0.0],true] | ||
| column_create Prices item_index COLUMN_INDEX Items price | ||
| [[0,0.0,0.0],true] | ||
| load --table Items | ||
| [ | ||
| {"_key": "Book", "price": 1000}, | ||
| {"_key": "Note", "price": 1000}, | ||
| {"_key": "Box", "price": 520}, | ||
| {"_key": "Pen", "price": 510}, | ||
| {"_key": "Food", "price": 500}, | ||
| {"_key": "Drink", "price": 300} | ||
| ] | ||
| [[0,0.0,0.0],6] | ||
| select Items --columns[price_with_tax].stage initial --columns[price_with_tax].type UInt32 --columns[price_with_tax].flags COLUMN_SCALAR --columns[price_with_tax].value 'price * 1.08' --filter 'price >= 510' --sort_keys _id | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 4 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "price_with_tax", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "price", | ||
| "UInt32" | ||
| ] | ||
| ], | ||
| [ | ||
| 1, | ||
| "Book", | ||
| 1080, | ||
| 1000 | ||
| ], | ||
| [ | ||
| 2, | ||
| "Note", | ||
| 1080, | ||
| 1000 | ||
| ], | ||
| [ | ||
| 3, | ||
| "Box", | ||
| 561, | ||
| 520 | ||
| ], | ||
| [ | ||
| 4, | ||
| "Pen", | ||
| 550, | ||
| 510 | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| select Items --columns[price_with_tax].stage filtered --columns[price_with_tax].type UInt32 --columns[price_with_tax].flags COLUMN_SCALAR --columns[price_with_tax].value 'price * 1.08' --filter 'price >= 510' --sort_keys _id | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 4 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "price_with_tax", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "price", | ||
| "UInt32" | ||
| ] | ||
| ], | ||
| [ | ||
| 1, | ||
| "Book", | ||
| 550, | ||
| 1000 | ||
| ], | ||
| [ | ||
| 2, | ||
| "Note", | ||
| 561, | ||
| 1000 | ||
| ], | ||
| [ | ||
| 3, | ||
| "Box", | ||
| 1080, | ||
| 520 | ||
| ], | ||
| [ | ||
| 4, | ||
| "Pen", | ||
| 1080, | ||
| 510 | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
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,31 @@ | ||
| table_create Items TABLE_HASH_KEY ShortText | ||
| column_create Items price COLUMN_SCALAR UInt32 | ||
|
|
||
| table_create Prices TABLE_PAT_KEY UInt32 | ||
| column_create Prices item_index COLUMN_INDEX Items price | ||
|
|
||
| load --table Items | ||
| [ | ||
| {"_key": "Book", "price": 1000}, | ||
| {"_key": "Note", "price": 1000}, | ||
| {"_key": "Box", "price": 520}, | ||
| {"_key": "Pen", "price": 510}, | ||
| {"_key": "Food", "price": 500}, | ||
| {"_key": "Drink", "price": 300} | ||
| ] | ||
|
|
||
| select Items \ | ||
| --columns[price_with_tax].stage initial \ | ||
| --columns[price_with_tax].type UInt32 \ | ||
| --columns[price_with_tax].flags COLUMN_SCALAR \ | ||
| --columns[price_with_tax].value 'price * 1.08' \ | ||
| --filter 'price >= 510' \ | ||
| --sort_keys _id | ||
|
|
||
| select Items \ | ||
| --columns[price_with_tax].stage filtered \ | ||
| --columns[price_with_tax].type UInt32 \ | ||
| --columns[price_with_tax].flags COLUMN_SCALAR \ | ||
| --columns[price_with_tax].value 'price * 1.08' \ | ||
| --filter 'price >= 510' \ | ||
| --sort_keys _id |