-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cross cluster search in PPL #1512
Cross cluster search in PPL #1512
Conversation
@@ -590,6 +600,10 @@ qualifiedName | |||
: ident (DOT ident)* #identsAsQualifiedName | |||
; | |||
|
|||
clusterQualifiedName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the other to do this would be to allow the use of : in index names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've considered this option. The reason why I didn't think it work very well is because we really only want : in search commands. We'll need to reject the : symbol else where such as describe command.
I will take this into consideration. Which do you think is better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allowed use of : in index name
opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchRequest.java
Outdated
Show resolved
Hide resolved
93d441c
to
6ac5d70
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1512 +/- ##
=========================================
Coverage 97.16% 97.16%
- Complexity 4116 4120 +4
=========================================
Files 371 371
Lines 10366 10373 +7
Branches 704 704
=========================================
+ Hits 10072 10079 +7
Misses 287 287
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Can I use this for SQL ITs? How can I configure number of nodes? How can I set per-node settings in IT? |
Yes if it's based on
Set Line 310 in 16b900c
I'm not sure about per-node settings...
in this PR I allow it to also update remote cluster settings |
Thanks! |
88bbcc1
to
7797ba7
Compare
7797ba7
to
d94322c
Compare
@@ -34,7 +34,8 @@ Example: Create the ppl_role for test_user. then test_user could use PPL to quer | |||
], | |||
"allowed_actions": [ | |||
"indices:data/read/search*", | |||
"indices:admin/mappings/get" | |||
"indices:admin/mappings/get", | |||
"indices:monitor/settings/get" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you explain more why this permission is required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found during testing that this permission is needed. I believe it's this part to get cluster max result window setting that needs this permission.
I shall remove this change and make a separate PR for it, as it's not directly related to this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is ok to add to this PR.
Please create an follow up issue to create the PPL_ACCESS in security plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added back to the doc. will make a PR to security plugin to create roles for both ppl and ccs
opensearch/src/main/java/org/opensearch/sql/opensearch/request/OpenSearchRequest.java
Outdated
Show resolved
Hide resolved
d94322c
to
38f4a15
Compare
Signed-off-by: Sean Kao <[email protected]>
Signed-off-by: Sean Kao <[email protected]>
Signed-off-by: Sean Kao <[email protected]>
Signed-off-by: Sean Kao <[email protected]>
Signed-off-by: Sean Kao <[email protected]>
00410d3
to
c03b69e
Compare
Signed-off-by: Sean Kao <[email protected]>
Signed-off-by: Sean Kao <[email protected]>
90a0e96
to
30971b1
Compare
Signed-off-by: Sean Kao <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.x 2.x
# Navigate to the new working tree
cd .worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-1512-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 1bda5fe73312017b3bc6029e2eaf378c2e72306c
# Push it to GitHub
git push --set-upstream origin backport/backport-1512-to-2.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.x Then, create a pull request where the |
* feat: PPL parser for ccs Signed-off-by: Sean Kao <[email protected]> * feat: disable describe remote cluster index in PPL Allowing the syntax will lead to misunderstanding in the query result, because we will do a local cluster query for index mapping, even for remote indices. This is due to the restriction that OpenSearch doesn't support remote cluster index mapping query at the moment. Signed-off-by: Sean Kao <[email protected]> * feat: Query system index without cluster name We require system index query to happen at the local cluster. Currently, OpenSearch does not support cross cluster system index query. Thus, mapping of a remote index is unavailable. Therefore, we require the local cluster to have the system index of the remote cluster index. The full "cluster:index" name is still used to query OpenSearch for datarows, as CCS is natively supported. Signed-off-by: Sean Kao <[email protected]> * fix: index name parsing for datasources To identify datasources in the index qualified names, they need to be parsed into parts (separated only by dots). clusterQualifiedName can't contain custom datasources, hence the distinction. Signed-off-by: Sean Kao <[email protected]> * multi clusters setup for integration test Signed-off-by: Sean Kao <[email protected]> * Add IT test case Signed-off-by: Sean Kao <[email protected]> * Document ccs for ppl Signed-off-by: Sean Kao <[email protected]> * documentation update Signed-off-by: Sean Kao <[email protected]> * feat: allow describe remote cluster index in PPL Signed-off-by: Sean Kao <[email protected]> * feat: allow "*:index" to match all remote clusters Signed-off-by: Sean Kao <[email protected]> * use local index names for field mappings request Signed-off-by: Sean Kao <[email protected]> * allow ':' in index identifier Signed-off-by: Sean Kao <[email protected]> * docs update Signed-off-by: Sean Kao <[email protected]> * limit cluster prefix to table names only Signed-off-by: Sean Kao <[email protected]> * move multicluster capability to sql rest test case Signed-off-by: Sean Kao <[email protected]> * add IT for failure case Signed-off-by: Sean Kao <[email protected]> * remove logger info for connection in IT test case Signed-off-by: Sean Kao <[email protected]> --------- Signed-off-by: Sean Kao <[email protected]> (cherry picked from commit 1bda5fe)
* feat: PPL parser for ccs Signed-off-by: Sean Kao <[email protected]> * feat: disable describe remote cluster index in PPL Allowing the syntax will lead to misunderstanding in the query result, because we will do a local cluster query for index mapping, even for remote indices. This is due to the restriction that OpenSearch doesn't support remote cluster index mapping query at the moment. Signed-off-by: Sean Kao <[email protected]> * feat: Query system index without cluster name We require system index query to happen at the local cluster. Currently, OpenSearch does not support cross cluster system index query. Thus, mapping of a remote index is unavailable. Therefore, we require the local cluster to have the system index of the remote cluster index. The full "cluster:index" name is still used to query OpenSearch for datarows, as CCS is natively supported. Signed-off-by: Sean Kao <[email protected]> * fix: index name parsing for datasources To identify datasources in the index qualified names, they need to be parsed into parts (separated only by dots). clusterQualifiedName can't contain custom datasources, hence the distinction. Signed-off-by: Sean Kao <[email protected]> * multi clusters setup for integration test Signed-off-by: Sean Kao <[email protected]> * Add IT test case Signed-off-by: Sean Kao <[email protected]> * Document ccs for ppl Signed-off-by: Sean Kao <[email protected]> * documentation update Signed-off-by: Sean Kao <[email protected]> * feat: allow describe remote cluster index in PPL Signed-off-by: Sean Kao <[email protected]> * feat: allow "*:index" to match all remote clusters Signed-off-by: Sean Kao <[email protected]> * use local index names for field mappings request Signed-off-by: Sean Kao <[email protected]> * allow ':' in index identifier Signed-off-by: Sean Kao <[email protected]> * docs update Signed-off-by: Sean Kao <[email protected]> * limit cluster prefix to table names only Signed-off-by: Sean Kao <[email protected]> * move multicluster capability to sql rest test case Signed-off-by: Sean Kao <[email protected]> * add IT for failure case Signed-off-by: Sean Kao <[email protected]> * remove logger info for connection in IT test case Signed-off-by: Sean Kao <[email protected]> --------- Signed-off-by: Sean Kao <[email protected]> (cherry picked from commit 1bda5fe)
* feat: PPL parser for ccs Signed-off-by: Sean Kao <[email protected]> * feat: disable describe remote cluster index in PPL Allowing the syntax will lead to misunderstanding in the query result, because we will do a local cluster query for index mapping, even for remote indices. This is due to the restriction that OpenSearch doesn't support remote cluster index mapping query at the moment. Signed-off-by: Sean Kao <[email protected]> * feat: Query system index without cluster name We require system index query to happen at the local cluster. Currently, OpenSearch does not support cross cluster system index query. Thus, mapping of a remote index is unavailable. Therefore, we require the local cluster to have the system index of the remote cluster index. The full "cluster:index" name is still used to query OpenSearch for datarows, as CCS is natively supported. Signed-off-by: Sean Kao <[email protected]> * fix: index name parsing for datasources To identify datasources in the index qualified names, they need to be parsed into parts (separated only by dots). clusterQualifiedName can't contain custom datasources, hence the distinction. Signed-off-by: Sean Kao <[email protected]> * multi clusters setup for integration test Signed-off-by: Sean Kao <[email protected]> * Add IT test case Signed-off-by: Sean Kao <[email protected]> * Document ccs for ppl Signed-off-by: Sean Kao <[email protected]> * documentation update Signed-off-by: Sean Kao <[email protected]> * feat: allow describe remote cluster index in PPL Signed-off-by: Sean Kao <[email protected]> * feat: allow "*:index" to match all remote clusters Signed-off-by: Sean Kao <[email protected]> * use local index names for field mappings request Signed-off-by: Sean Kao <[email protected]> * allow ':' in index identifier Signed-off-by: Sean Kao <[email protected]> * docs update Signed-off-by: Sean Kao <[email protected]> * limit cluster prefix to table names only Signed-off-by: Sean Kao <[email protected]> * move multicluster capability to sql rest test case Signed-off-by: Sean Kao <[email protected]> * add IT for failure case Signed-off-by: Sean Kao <[email protected]> * remove logger info for connection in IT test case Signed-off-by: Sean Kao <[email protected]> --------- Signed-off-by: Sean Kao <[email protected]> (cherry picked from commit 1bda5fe)
* feat: PPL parser for ccs Signed-off-by: Sean Kao <[email protected]> * feat: disable describe remote cluster index in PPL Allowing the syntax will lead to misunderstanding in the query result, because we will do a local cluster query for index mapping, even for remote indices. This is due to the restriction that OpenSearch doesn't support remote cluster index mapping query at the moment. Signed-off-by: Sean Kao <[email protected]> * feat: Query system index without cluster name We require system index query to happen at the local cluster. Currently, OpenSearch does not support cross cluster system index query. Thus, mapping of a remote index is unavailable. Therefore, we require the local cluster to have the system index of the remote cluster index. The full "cluster:index" name is still used to query OpenSearch for datarows, as CCS is natively supported. Signed-off-by: Sean Kao <[email protected]> * fix: index name parsing for datasources To identify datasources in the index qualified names, they need to be parsed into parts (separated only by dots). clusterQualifiedName can't contain custom datasources, hence the distinction. Signed-off-by: Sean Kao <[email protected]> * multi clusters setup for integration test Signed-off-by: Sean Kao <[email protected]> * Add IT test case Signed-off-by: Sean Kao <[email protected]> * Document ccs for ppl Signed-off-by: Sean Kao <[email protected]> * documentation update Signed-off-by: Sean Kao <[email protected]> * feat: allow describe remote cluster index in PPL Signed-off-by: Sean Kao <[email protected]> * feat: allow "*:index" to match all remote clusters Signed-off-by: Sean Kao <[email protected]> * use local index names for field mappings request Signed-off-by: Sean Kao <[email protected]> * allow ':' in index identifier Signed-off-by: Sean Kao <[email protected]> * docs update Signed-off-by: Sean Kao <[email protected]> * limit cluster prefix to table names only Signed-off-by: Sean Kao <[email protected]> * move multicluster capability to sql rest test case Signed-off-by: Sean Kao <[email protected]> * add IT for failure case Signed-off-by: Sean Kao <[email protected]> * remove logger info for connection in IT test case Signed-off-by: Sean Kao <[email protected]> --------- Signed-off-by: Sean Kao <[email protected]> (cherry picked from commit 1bda5fe)
* feat: PPL parser for ccs Signed-off-by: Sean Kao <[email protected]> * feat: disable describe remote cluster index in PPL Allowing the syntax will lead to misunderstanding in the query result, because we will do a local cluster query for index mapping, even for remote indices. This is due to the restriction that OpenSearch doesn't support remote cluster index mapping query at the moment. Signed-off-by: Sean Kao <[email protected]> * feat: Query system index without cluster name We require system index query to happen at the local cluster. Currently, OpenSearch does not support cross cluster system index query. Thus, mapping of a remote index is unavailable. Therefore, we require the local cluster to have the system index of the remote cluster index. The full "cluster:index" name is still used to query OpenSearch for datarows, as CCS is natively supported. Signed-off-by: Sean Kao <[email protected]> * fix: index name parsing for datasources To identify datasources in the index qualified names, they need to be parsed into parts (separated only by dots). clusterQualifiedName can't contain custom datasources, hence the distinction. Signed-off-by: Sean Kao <[email protected]> * multi clusters setup for integration test Signed-off-by: Sean Kao <[email protected]> * Add IT test case Signed-off-by: Sean Kao <[email protected]> * Document ccs for ppl Signed-off-by: Sean Kao <[email protected]> * documentation update Signed-off-by: Sean Kao <[email protected]> * feat: allow describe remote cluster index in PPL Signed-off-by: Sean Kao <[email protected]> * feat: allow "*:index" to match all remote clusters Signed-off-by: Sean Kao <[email protected]> * use local index names for field mappings request Signed-off-by: Sean Kao <[email protected]> * allow ':' in index identifier Signed-off-by: Sean Kao <[email protected]> * docs update Signed-off-by: Sean Kao <[email protected]> * limit cluster prefix to table names only Signed-off-by: Sean Kao <[email protected]> * move multicluster capability to sql rest test case Signed-off-by: Sean Kao <[email protected]> * add IT for failure case Signed-off-by: Sean Kao <[email protected]> * remove logger info for connection in IT test case Signed-off-by: Sean Kao <[email protected]> --------- Signed-off-by: Sean Kao <[email protected]> Signed-off-by: Mitchell Gale <[email protected]>
Description
Support cross cluster search in PPL.
Issues Resolved
#789
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.