Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
You can use it in select such as:
select \
--drilldown[lable].calc_type SUM \
--drilldown[lable].calc_target target_column- Loading branch information
Showing
8 changed files
with
482 additions
and
47 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
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
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
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
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
78 changes: 78 additions & 0 deletions
78
test/command/suite/select/drilldown/labeled/calc_types/sum.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,78 @@ | ||
| table_create Tags TABLE_PAT_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Memos TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos tag COLUMN_SCALAR Tags | ||
| [[0,0.0,0.0],true] | ||
| column_create Memos value COLUMN_SCALAR Int64 | ||
| [[0,0.0,0.0],true] | ||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga is fast!", "tag": "Groonga", "value": 10}, | ||
| {"_key": "Mroonga is fast!", "tag": "Mroonga", "value": 20}, | ||
| {"_key": "Groonga sticker!", "tag": "Groonga", "value": 40}, | ||
| {"_key": "Rroonga is fast!", "tag": "Rroonga", "value": 80} | ||
| ] | ||
| [[0,0.0,0.0],4] | ||
| select Memos --limit 0 --drilldown[tag].keys tag --drilldown[tag].calc_types SUM --drilldown[tag].calc_target value --drilldown[tag].output_columns _key,_sum | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 4 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "tag", | ||
| "Tags" | ||
| ], | ||
| [ | ||
| "value", | ||
| "Int64" | ||
| ] | ||
| ] | ||
| ], | ||
| { | ||
| "tag": [ | ||
| [ | ||
| 3 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_sum", | ||
| "Int64" | ||
| ] | ||
| ], | ||
| [ | ||
| "Groonga", | ||
| 50 | ||
| ], | ||
| [ | ||
| "Mroonga", | ||
| 20 | ||
| ], | ||
| [ | ||
| "Rroonga", | ||
| 80 | ||
| ] | ||
| ] | ||
| } | ||
| ] | ||
| ] |
20 changes: 20 additions & 0 deletions
20
test/command/suite/select/drilldown/labeled/calc_types/sum.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,20 @@ | ||
| table_create Tags TABLE_PAT_KEY ShortText | ||
|
|
||
| table_create Memos TABLE_HASH_KEY ShortText | ||
| column_create Memos tag COLUMN_SCALAR Tags | ||
| column_create Memos value COLUMN_SCALAR Int64 | ||
|
|
||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga is fast!", "tag": "Groonga", "value": 10}, | ||
| {"_key": "Mroonga is fast!", "tag": "Mroonga", "value": 20}, | ||
| {"_key": "Groonga sticker!", "tag": "Groonga", "value": 40}, | ||
| {"_key": "Rroonga is fast!", "tag": "Rroonga", "value": 80} | ||
| ] | ||
|
|
||
| select Memos \ | ||
| --limit 0 \ | ||
| --drilldown[tag].keys tag \ | ||
| --drilldown[tag].calc_types SUM \ | ||
| --drilldown[tag].calc_target value \ | ||
| --drilldown[tag].output_columns _key,_sum |