Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
select drilldown_sortby: support real column
drilldown_output_columns also supports real column. It always uses the first sub record. Should we support Nth sub record?
- Loading branch information
Showing
5 changed files
with
175 additions
and
20 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
82 changes: 82 additions & 0 deletions
82
test/command/suite/select/drilldown_sortby/real_column.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,82 @@ | ||
| table_create Bookmarks TABLE_HASH_KEY UInt32 | ||
| [[0,0.0,0.0],true] | ||
| column_create Bookmarks url COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Bookmarks user COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| load --table Bookmarks | ||
| [ | ||
| {"_key": 1, "url": "http://groonga.org/", "user": "mori"}, | ||
| {"_key": 2, "url": "http://groonga.org/", "user": "kou"}, | ||
| {"_key": 3, "url": "http://groonga.org/", "user": "s-yata"}, | ||
| {"_key": 4, "url": "http://mroonga.org/", "user": "kou"}, | ||
| {"_key": 5, "url": "http://droonga.org/", "user": "piro"} | ||
| ] | ||
| [[0,0.0,0.0],5] | ||
| select Bookmarks --limit 0 --drilldown url --drilldown_sortby user --drilldown_output_columns _key,_nsubrecs,user | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 5 | ||
| ], | ||
| [ | ||
| [ | ||
| "_id", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "_key", | ||
| "UInt32" | ||
| ], | ||
| [ | ||
| "url", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "user", | ||
| "ShortText" | ||
| ] | ||
| ] | ||
| ], | ||
| [ | ||
| [ | ||
| 3 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "_nsubrecs", | ||
| "Int32" | ||
| ], | ||
| [ | ||
| "user", | ||
| "ShortText" | ||
| ] | ||
| ], | ||
| [ | ||
| "http://mroonga.org/", | ||
| 1, | ||
| "kou" | ||
| ], | ||
| [ | ||
| "http://groonga.org/", | ||
| 3, | ||
| "mori" | ||
| ], | ||
| [ | ||
| "http://droonga.org/", | ||
| 1, | ||
| "piro" | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
18 changes: 18 additions & 0 deletions
18
test/command/suite/select/drilldown_sortby/real_column.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,18 @@ | ||
| table_create Bookmarks TABLE_HASH_KEY UInt32 | ||
| column_create Bookmarks url COLUMN_SCALAR ShortText | ||
| column_create Bookmarks user COLUMN_SCALAR ShortText | ||
|
|
||
| load --table Bookmarks | ||
| [ | ||
| {"_key": 1, "url": "http://groonga.org/", "user": "mori"}, | ||
| {"_key": 2, "url": "http://groonga.org/", "user": "kou"}, | ||
| {"_key": 3, "url": "http://groonga.org/", "user": "s-yata"}, | ||
| {"_key": 4, "url": "http://mroonga.org/", "user": "kou"}, | ||
| {"_key": 5, "url": "http://droonga.org/", "user": "piro"} | ||
| ] | ||
|
|
||
| select Bookmarks \ | ||
| --limit 0 \ | ||
| --drilldown url \ | ||
| --drilldown_sortby user \ | ||
| --drilldown_output_columns _key,_nsubrecs,user |