Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug for "XXX && sub_filter(...)" type filter
In the filter, "sub_filter(...)" is just ignored. "sub_filter(...)" should substitute matched records from records that are matched against "XXX".
- Loading branch information
Showing
3 changed files
with
118 additions
and
11 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
75 changes: 75 additions & 0 deletions
75
test/command/suite/select/function/sub_filter/and.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,75 @@ | ||
| table_create Files TABLE_PAT_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Files revision COLUMN_SCALAR UInt32 | ||
| [[0,0.0,0.0],true] | ||
| table_create Packages TABLE_PAT_KEY ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Packages files COLUMN_VECTOR Files | ||
| [[0,0.0,0.0],true] | ||
| column_create Files packages_files_index COLUMN_INDEX Packages files | ||
| [[0,0.0,0.0],true] | ||
| table_create Revisions TABLE_PAT_KEY UInt32 | ||
| [[0,0.0,0.0],true] | ||
| column_create Revisions files_revision_index COLUMN_INDEX Files revision | ||
| [[0,0.0,0.0],true] | ||
| table_create Names TABLE_PAT_KEY ShortText --default_tokenizer TokenBigramSplitSymbolAlpha | ||
| [[0,0.0,0.0],true] | ||
| column_create Names packages_key_index COLUMN_INDEX|WITH_POSITION Packages _key | ||
| [[0,0.0,0.0],true] | ||
| load --table Files | ||
| [ | ||
| {"_key": "include/groonga.h", "revision": 100}, | ||
| {"_key": "src/groonga.c", "revision": 29}, | ||
| {"_key": "lib/groonga.rb", "revision": 12}, | ||
| {"_key": "README.textile", "revision": 24}, | ||
| {"_key": "ha_mroonga.cc", "revision": 40}, | ||
| {"_key": "ha_mroonga.hpp", "revision": 6} | ||
| ] | ||
| [[0,0.0,0.0],6] | ||
| load --table Packages | ||
| [ | ||
| {"_key": "groonga", "files": ["include/groonga.h", "src/groonga.c"]}, | ||
| {"_key": "rroonga", "files": ["lib/groonga.rb", "README.textile"]}, | ||
| {"_key": "mroonga", "files": ["ha_mroonga.cc", "ha_mroonga.hpp"]} | ||
| ] | ||
| [[0,0.0,0.0],3] | ||
| select Packages --filter '_key @ "rroonga" && sub_filter(files, "revision >= 10 && revision < 40")' --output_columns '_key, files, files.revision' | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 1 | ||
| ], | ||
| [ | ||
| [ | ||
| "_key", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "files", | ||
| "Files" | ||
| ], | ||
| [ | ||
| "files.revision", | ||
| "UInt32" | ||
| ] | ||
| ], | ||
| [ | ||
| "rroonga", | ||
| [ | ||
| "lib/groonga.rb", | ||
| "README.textile" | ||
| ], | ||
| [ | ||
| 12, | ||
| 24 | ||
| ] | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
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,35 @@ | ||
| table_create Files TABLE_PAT_KEY ShortText | ||
| column_create Files revision COLUMN_SCALAR UInt32 | ||
|
|
||
| table_create Packages TABLE_PAT_KEY ShortText | ||
| column_create Packages files COLUMN_VECTOR Files | ||
|
|
||
| column_create Files packages_files_index COLUMN_INDEX Packages files | ||
|
|
||
| table_create Revisions TABLE_PAT_KEY UInt32 | ||
| column_create Revisions files_revision_index COLUMN_INDEX Files revision | ||
|
|
||
| table_create Names TABLE_PAT_KEY ShortText \ | ||
| --default_tokenizer TokenBigramSplitSymbolAlpha | ||
| column_create Names packages_key_index COLUMN_INDEX|WITH_POSITION Packages _key | ||
|
|
||
| load --table Files | ||
| [ | ||
| {"_key": "include/groonga.h", "revision": 100}, | ||
| {"_key": "src/groonga.c", "revision": 29}, | ||
| {"_key": "lib/groonga.rb", "revision": 12}, | ||
| {"_key": "README.textile", "revision": 24}, | ||
| {"_key": "ha_mroonga.cc", "revision": 40}, | ||
| {"_key": "ha_mroonga.hpp", "revision": 6} | ||
| ] | ||
|
|
||
| load --table Packages | ||
| [ | ||
| {"_key": "groonga", "files": ["include/groonga.h", "src/groonga.c"]}, | ||
| {"_key": "rroonga", "files": ["lib/groonga.rb", "README.textile"]}, | ||
| {"_key": "mroonga", "files": ["ha_mroonga.cc", "ha_mroonga.hpp"]} | ||
| ] | ||
|
|
||
| select Packages \ | ||
| --filter '_key @ "rroonga" && sub_filter(files, "revision >= 10 && revision < 40")' \ | ||
| --output_columns '_key, files, files.revision' |