Add _routing to SQL includes list (#277)#1771
Add _routing to SQL includes list (#277)#1771MaxKsyunz merged 10 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com>
Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com>
Signed-off-by: acarbonetto <andrewc@bitquilltech.com>
Yury-Fridlyand
left a comment
There was a problem hiding this comment.
I think we need an IT to prove that filtering by _routing works fine, for example:
select *, _id from <index> where _routing = 'a'
select *, _id from <index> where _routing = 'b'The test should propagate the data properly into different shards and get their names using REST API.
Codecov Report
@@ Coverage Diff @@
## main #1771 +/- ##
=========================================
Coverage 97.32% 97.32%
- Complexity 4458 4459 +1
=========================================
Files 388 388
Lines 11050 11052 +2
Branches 790 791 +1
=========================================
+ Hits 10754 10756 +2
Misses 289 289
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Right now routing shard names are randomly assigned, so I cannot filter by shard name. Yet. Note: this is also why a doctest with _routing doesn't work, because the documents are assigned to random shards. |
|
Yes, but you can get shard names with REST API or CAT API |
Signed-off-by: acarbonetto <andrewc@bitquilltech.com>
Signed-off-by: acarbonetto <andrewc@bitquilltech.com>
integ-test/src/test/java/org/opensearch/sql/sql/IdentifierIT.java
Outdated
Show resolved
Hide resolved
dai-chen
left a comment
There was a problem hiding this comment.
Thanks for the changes!
Signed-off-by: acarbonetto <andrewc@bitquilltech.com>
ede3956
…uting Signed-off-by: acarbonetto <andrewc@bitquilltech.com>
* Add _routing to SQL includes list Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update IT index Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update doctest Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Add WHERE clause IT tests Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Fix IT test Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Update documentation for _routing Signed-off-by: acarbonetto <andrewc@bitquilltech.com> --------- Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> Signed-off-by: acarbonetto <andrewc@bitquilltech.com> (cherry picked from commit 876a9c8)
* Add _routing to SQL includes list Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update IT index Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update doctest Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Add WHERE clause IT tests Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Fix IT test Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Update documentation for _routing Signed-off-by: acarbonetto <andrewc@bitquilltech.com> --------- Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> Signed-off-by: acarbonetto <andrewc@bitquilltech.com> (cherry picked from commit 876a9c8) Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>
* Add _routing to SQL includes list Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update IT index Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update doctest Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Add WHERE clause IT tests Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Fix IT test Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Update documentation for _routing Signed-off-by: acarbonetto <andrewc@bitquilltech.com> --------- Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> Signed-off-by: acarbonetto <andrewc@bitquilltech.com> (cherry picked from commit 876a9c8)
* Add _routing to SQL includes list Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update IT index Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update doctest Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Add WHERE clause IT tests Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Fix IT test Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Update documentation for _routing Signed-off-by: acarbonetto <andrewc@bitquilltech.com> --------- Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> Signed-off-by: acarbonetto <andrewc@bitquilltech.com> (cherry picked from commit 876a9c8) Co-authored-by: Andrew Carbonetto <andrewc@bitquilltech.com>
* Add _routing to SQL includes list Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update IT index Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update doctest Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Add WHERE clause IT tests Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Fix IT test Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Update documentation for _routing Signed-off-by: acarbonetto <andrewc@bitquilltech.com> --------- Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> Signed-off-by: acarbonetto <andrewc@bitquilltech.com> Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
* Add _routing to SQL includes list Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update IT index Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update doctest Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Add WHERE clause IT tests Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Fix IT test Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Update documentation for _routing Signed-off-by: acarbonetto <andrewc@bitquilltech.com> --------- Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> Signed-off-by: acarbonetto <andrewc@bitquilltech.com> Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
* Add _routing to SQL includes list Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update IT index Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> * Update doctest Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Add WHERE clause IT tests Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Fix IT test Signed-off-by: acarbonetto <andrewc@bitquilltech.com> * Update documentation for _routing Signed-off-by: acarbonetto <andrewc@bitquilltech.com> --------- Signed-off-by: Andrew Carbonetto <andrewc@bitquilltech.com> Signed-off-by: acarbonetto <andrewc@bitquilltech.com> Signed-off-by: Mitchell Gale <Mitchell.Gale@improving.com>
Description
Add the
_routingreserved word as a metafield accessible as an identifier from any opensearch index.Example:
Example response:
Issues Resolved
Partially resolves: sql#1478
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.