Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for outputting referenced column of vector reference column
XML output for this case has also a problem. And it had been fixed in eaafa38.
- Loading branch information
Showing
4 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
test/command/suite/select/output_columns/vector/reference/column/json.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,51 @@ | ||
| table_create Users TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Users full_name COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Bookmarks TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Bookmarks users COLUMN_VECTOR Users | ||
| [[0,0.0,0.0],true] | ||
| load --table Users | ||
| [ | ||
| {"_key": "mori", "full_name": "Daijiro MORI"}, | ||
| {"_key": "s-yata", "full_name": "Susumu Yata"} | ||
| ] | ||
| [[0,0.0,0.0],2] | ||
| load --table Bookmarks | ||
| [ | ||
| {"_key": "http://groonga.org/", "users": ["mori", "s-yata"]} | ||
| ] | ||
| [[0,0.0,0.0],1] | ||
| select Bookmarks --output_columns _key,users.full_name | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 1 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "users.full_name", | ||
| "ShortText" | ||
| ] | ||
| ], | ||
| [ | ||
| "http://groonga.org/", | ||
| [ | ||
| "Daijiro MORI", | ||
| "Susumu Yata" | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
18 changes: 18 additions & 0 deletions
18
test/command/suite/select/output_columns/vector/reference/column/json.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 Users TABLE_HASH_KEY ShortText | ||
| column_create Users full_name COLUMN_SCALAR ShortText | ||
|
|
||
| table_create Bookmarks TABLE_HASH_KEY ShortText | ||
| column_create Bookmarks users COLUMN_VECTOR Users | ||
|
|
||
| load --table Users | ||
| [ | ||
| {"_key": "mori", "full_name": "Daijiro MORI"}, | ||
| {"_key": "s-yata", "full_name": "Susumu Yata"} | ||
| ] | ||
|
|
||
| load --table Bookmarks | ||
| [ | ||
| {"_key": "http://groonga.org/", "users": ["mori", "s-yata"]} | ||
| ] | ||
|
|
||
| select Bookmarks --output_columns _key,users.full_name |
34 changes: 34 additions & 0 deletions
34
test/command/suite/select/output_columns/vector/reference/column/xml.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,34 @@ | ||
| table_create Users TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Users full_name COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Bookmarks TABLE_HASH_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Bookmarks users COLUMN_VECTOR Users | ||
| [[0,0.0,0.0],true] | ||
| load --table Users | ||
| [ | ||
| {"_key": "mori", "full_name": "Daijiro MORI"}, | ||
| {"_key": "s-yata", "full_name": "Susumu Yata"} | ||
| ] | ||
| [[0,0.0,0.0],2] | ||
| load --table Bookmarks | ||
| [ | ||
| {"_key": "http://groonga.org/", "users": ["mori", "s-yata"]} | ||
| ] | ||
| [[0,0.0,0.0],1] | ||
| select Bookmarks --output_columns _key,users.full_name --output_type xml | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <SEGMENTS> | ||
| <SEGMENT> | ||
| <RESULTPAGE> | ||
| <RESULTSET OFFSET="0" LIMIT="1" NHITS="1"> | ||
| <HIT NO="1"> | ||
| <FIELD NAME="_key">http://groonga.org/</FIELD> | ||
| </HIT> | ||
| </RESULTSET> | ||
| </RESULTPAGE> | ||
| </SEGMENT> | ||
| </SEGMENTS> | ||
|
|
||
|
|
18 changes: 18 additions & 0 deletions
18
test/command/suite/select/output_columns/vector/reference/column/xml.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 Users TABLE_HASH_KEY ShortText | ||
| column_create Users full_name COLUMN_SCALAR ShortText | ||
|
|
||
| table_create Bookmarks TABLE_HASH_KEY ShortText | ||
| column_create Bookmarks users COLUMN_VECTOR Users | ||
|
|
||
| load --table Users | ||
| [ | ||
| {"_key": "mori", "full_name": "Daijiro MORI"}, | ||
| {"_key": "s-yata", "full_name": "Susumu Yata"} | ||
| ] | ||
|
|
||
| load --table Bookmarks | ||
| [ | ||
| {"_key": "http://groonga.org/", "users": ["mori", "s-yata"]} | ||
| ] | ||
|
|
||
| select Bookmarks --output_columns _key,users.full_name --output_type xml |