Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
select drilldown: support calc_types and calc_target
- Loading branch information
Showing
9 changed files
with
427 additions
and
6 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
81 changes: 81 additions & 0 deletions
81
test/command/suite/select/drilldown/plain/calc_types/avg.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,81 @@ | ||
| 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 priority COLUMN_SCALAR Int64 | ||
| [[0,0.0,0.0],true] | ||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga1", "tag": "Groonga", "priority": 10}, | ||
| {"_key": "Groonga2", "tag": "Groonga", "priority": 20}, | ||
| {"_key": "Groonga3", "tag": "Groonga", "priority": 60}, | ||
| {"_key": "Mroonga1", "tag": "Mroonga", "priority": 61}, | ||
| {"_key": "Mroonga2", "tag": "Mroonga", "priority": 24}, | ||
| {"_key": "Mroonga3", "tag": "Mroonga", "priority": 8}, | ||
| {"_key": "Rroonga1", "tag": "Rroonga", "priority": 3}, | ||
| {"_key": "Rroonga2", "tag": "Rroonga", "priority": -9}, | ||
| {"_key": "Rroonga3", "tag": "Rroonga", "priority": 0} | ||
| ] | ||
| [[0,0.0,0.0],9] | ||
| select Memos --limit 0 --drilldown tag --drilldown_calc_types AVG --drilldown_calc_target priority --drilldown_output_columns _key,_avg | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 9 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "priority", | ||
| "Int64" | ||
| ], | ||
| [ | ||
| "tag", | ||
| "Tags" | ||
| ] | ||
| ] | ||
| ], | ||
| [ | ||
| [ | ||
| 3 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_avg", | ||
| "Float" | ||
| ] | ||
| ], | ||
| [ | ||
| "Groonga", | ||
| 30.0 | ||
| ], | ||
| [ | ||
| "Mroonga", | ||
| 31.0 | ||
| ], | ||
| [ | ||
| "Rroonga", | ||
| -2.0 | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
25 changes: 25 additions & 0 deletions
25
test/command/suite/select/drilldown/plain/calc_types/avg.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,25 @@ | ||
| table_create Tags TABLE_PAT_KEY ShortText | ||
|
|
||
| table_create Memos TABLE_HASH_KEY ShortText | ||
| column_create Memos tag COLUMN_SCALAR Tags | ||
| column_create Memos priority COLUMN_SCALAR Int64 | ||
|
|
||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga1", "tag": "Groonga", "priority": 10}, | ||
| {"_key": "Groonga2", "tag": "Groonga", "priority": 20}, | ||
| {"_key": "Groonga3", "tag": "Groonga", "priority": 60}, | ||
| {"_key": "Mroonga1", "tag": "Mroonga", "priority": 61}, | ||
| {"_key": "Mroonga2", "tag": "Mroonga", "priority": 24}, | ||
| {"_key": "Mroonga3", "tag": "Mroonga", "priority": 8}, | ||
| {"_key": "Rroonga1", "tag": "Rroonga", "priority": 3}, | ||
| {"_key": "Rroonga2", "tag": "Rroonga", "priority": -9}, | ||
| {"_key": "Rroonga3", "tag": "Rroonga", "priority": 0} | ||
| ] | ||
|
|
||
| select Memos \ | ||
| --limit 0 \ | ||
| --drilldown tag \ | ||
| --drilldown_calc_types AVG \ | ||
| --drilldown_calc_target priority \ | ||
| --drilldown_output_columns _key,_avg |
81 changes: 81 additions & 0 deletions
81
test/command/suite/select/drilldown/plain/calc_types/max.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,81 @@ | ||
| 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 priority COLUMN_SCALAR Int64 | ||
| [[0,0.0,0.0],true] | ||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga1", "tag": "Groonga", "priority": 10}, | ||
| {"_key": "Groonga2", "tag": "Groonga", "priority": 20}, | ||
| {"_key": "Groonga3", "tag": "Groonga", "priority": 40}, | ||
| {"_key": "Mroonga1", "tag": "Mroonga", "priority": 50}, | ||
| {"_key": "Mroonga2", "tag": "Mroonga", "priority": 25}, | ||
| {"_key": "Mroonga3", "tag": "Mroonga", "priority": 10}, | ||
| {"_key": "Rroonga1", "tag": "Rroonga", "priority": 25}, | ||
| {"_key": "Rroonga2", "tag": "Rroonga", "priority": -25}, | ||
| {"_key": "Rroonga3", "tag": "Rroonga", "priority": 0} | ||
| ] | ||
| [[0,0.0,0.0],9] | ||
| select Memos --limit 0 --drilldown tag --drilldown_calc_types MAX --drilldown_calc_target priority --drilldown_output_columns _key,_max | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 9 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "priority", | ||
| "Int64" | ||
| ], | ||
| [ | ||
| "tag", | ||
| "Tags" | ||
| ] | ||
| ] | ||
| ], | ||
| [ | ||
| [ | ||
| 3 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_max", | ||
| "Int64" | ||
| ] | ||
| ], | ||
| [ | ||
| "Groonga", | ||
| 40 | ||
| ], | ||
| [ | ||
| "Mroonga", | ||
| 50 | ||
| ], | ||
| [ | ||
| "Rroonga", | ||
| 25 | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
25 changes: 25 additions & 0 deletions
25
test/command/suite/select/drilldown/plain/calc_types/max.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,25 @@ | ||
| table_create Tags TABLE_PAT_KEY ShortText | ||
|
|
||
| table_create Memos TABLE_HASH_KEY ShortText | ||
| column_create Memos tag COLUMN_SCALAR Tags | ||
| column_create Memos priority COLUMN_SCALAR Int64 | ||
|
|
||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga1", "tag": "Groonga", "priority": 10}, | ||
| {"_key": "Groonga2", "tag": "Groonga", "priority": 20}, | ||
| {"_key": "Groonga3", "tag": "Groonga", "priority": 40}, | ||
| {"_key": "Mroonga1", "tag": "Mroonga", "priority": 50}, | ||
| {"_key": "Mroonga2", "tag": "Mroonga", "priority": 25}, | ||
| {"_key": "Mroonga3", "tag": "Mroonga", "priority": 10}, | ||
| {"_key": "Rroonga1", "tag": "Rroonga", "priority": 25}, | ||
| {"_key": "Rroonga2", "tag": "Rroonga", "priority": -25}, | ||
| {"_key": "Rroonga3", "tag": "Rroonga", "priority": 0} | ||
| ] | ||
|
|
||
| select Memos \ | ||
| --limit 0 \ | ||
| --drilldown tag \ | ||
| --drilldown_calc_types MAX \ | ||
| --drilldown_calc_target priority \ | ||
| --drilldown_output_columns _key,_max |
81 changes: 81 additions & 0 deletions
81
test/command/suite/select/drilldown/plain/calc_types/min.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,81 @@ | ||
| 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 priority COLUMN_SCALAR Int64 | ||
| [[0,0.0,0.0],true] | ||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga1", "tag": "Groonga", "priority": 10}, | ||
| {"_key": "Groonga2", "tag": "Groonga", "priority": 20}, | ||
| {"_key": "Groonga3", "tag": "Groonga", "priority": 40}, | ||
| {"_key": "Mroonga1", "tag": "Mroonga", "priority": 50}, | ||
| {"_key": "Mroonga2", "tag": "Mroonga", "priority": 25}, | ||
| {"_key": "Mroonga3", "tag": "Mroonga", "priority": 5}, | ||
| {"_key": "Rroonga1", "tag": "Rroonga", "priority": 25}, | ||
| {"_key": "Rroonga2", "tag": "Rroonga", "priority": -25}, | ||
| {"_key": "Rroonga3", "tag": "Rroonga", "priority": 0} | ||
| ] | ||
| [[0,0.0,0.0],9] | ||
| select Memos --limit 0 --drilldown tag --drilldown_calc_types MIN --drilldown_calc_target priority --drilldown_output_columns _key,_min | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 9 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "priority", | ||
| "Int64" | ||
| ], | ||
| [ | ||
| "tag", | ||
| "Tags" | ||
| ] | ||
| ] | ||
| ], | ||
| [ | ||
| [ | ||
| 3 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_min", | ||
| "Int64" | ||
| ] | ||
| ], | ||
| [ | ||
| "Groonga", | ||
| 10 | ||
| ], | ||
| [ | ||
| "Mroonga", | ||
| 5 | ||
| ], | ||
| [ | ||
| "Rroonga", | ||
| -25 | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
25 changes: 25 additions & 0 deletions
25
test/command/suite/select/drilldown/plain/calc_types/min.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,25 @@ | ||
| table_create Tags TABLE_PAT_KEY ShortText | ||
|
|
||
| table_create Memos TABLE_HASH_KEY ShortText | ||
| column_create Memos tag COLUMN_SCALAR Tags | ||
| column_create Memos priority COLUMN_SCALAR Int64 | ||
|
|
||
| load --table Memos | ||
| [ | ||
| {"_key": "Groonga1", "tag": "Groonga", "priority": 10}, | ||
| {"_key": "Groonga2", "tag": "Groonga", "priority": 20}, | ||
| {"_key": "Groonga3", "tag": "Groonga", "priority": 40}, | ||
| {"_key": "Mroonga1", "tag": "Mroonga", "priority": 50}, | ||
| {"_key": "Mroonga2", "tag": "Mroonga", "priority": 25}, | ||
| {"_key": "Mroonga3", "tag": "Mroonga", "priority": 5}, | ||
| {"_key": "Rroonga1", "tag": "Rroonga", "priority": 25}, | ||
| {"_key": "Rroonga2", "tag": "Rroonga", "priority": -25}, | ||
| {"_key": "Rroonga3", "tag": "Rroonga", "priority": 0} | ||
| ] | ||
|
|
||
| select Memos \ | ||
| --limit 0 \ | ||
| --drilldown tag \ | ||
| --drilldown_calc_types MIN \ | ||
| --drilldown_calc_target priority \ | ||
| --drilldown_output_columns _key,_min |
Oops, something went wrong.