-
Notifications
You must be signed in to change notification settings - Fork 0
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
Set target routing shard by partition key #316
Set target routing shard by partition key #316
Conversation
Codecov Report
@@ Coverage Diff @@
## integ-metafields-set-routing-shard #316 +/- ##
========================================================================
- Coverage 97.42% 97.41% -0.01%
- Complexity 4647 4651 +4
========================================================================
Files 408 408
Lines 11526 11549 +23
Branches 839 845 +6
========================================================================
+ Hits 11229 11251 +22
Misses 290 290
- Partials 7 8 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
@acarbonetto do you think we can pass routingId from query to OpenSearchRequest
without having to modify
legacy/src/main/java/org/opensearch/sql/legacy/request/SqlRequestFactory.java
Outdated
Show resolved
Hide resolved
@@ -98,6 +99,7 @@ private static SQLQueryRequest createSqlQueryRequest(String query, Optional<Stri | |||
builder.endObject(); | |||
JSONObject jsonContent = new JSONObject(Strings.toString(builder)); | |||
|
|||
// TODO pass through |
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.
TODO?
@@ -363,6 +363,17 @@ SQL query:: | |||
{ | |||
"query" : "SELECT account_number FROM accounts/account" | |||
} | |||
Example 4: Selecting From Index using Partition Shard |
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.
What happens when PARTITION
is provided for another data source, like Prometheus or Spark?
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.
They will need to implement a sharing or partition option separately. Most datasources would have such an option.
|
||
POST /_plugins/_sql | ||
{ | ||
"query" : "SELECT account_number FROM account PARTITION(shard1, shard2)" |
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 may be confusing to use PARTITION
an existing operation in SQL for this.
What about introducing a general notion of data source options, keeping them as key-value pairs in Relation that get analyzed by each StorageEngine.
This would allow other data sources to benefit from this and avoid question about features that only apply to OpenSearch.
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.
This is exactly what the PARTITION in SQL is designed for. Also, the proposal in the issue suggested using this syntax.
I DO like your idea, but I'd rather stick with well-understood SQL syntax than introduce something new.
Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
* Fix core refactor: StreamIO from common to core.common Signed-off-by: acarbonetto <[email protected]> * Fix core refactor: StreamIO from common to core.common Signed-off-by: acarbonetto <[email protected]> --------- Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
b1928ae
to
430d7a9
Compare
Signed-off-by: acarbonetto <[email protected]>
…-set-routing-shard Signed-off-by: acarbonetto <[email protected]>
…routing-shard Signed-off-by: acarbonetto <[email protected]>
Signed-off-by: acarbonetto <[email protected]>
Description
Allows user to set routing shard via the relation partition keys. For example:
Note that multiple keys can be send to OpenSearch storage by using comma-delimited list.
IT tests
New IT tests running against a multi-node cluster have been added to the build. These can be run using
./gradlew :integ-test:multiClusterSearch
and will be automatically run against CI.TODO
Issues Resolved
Note (out of scope): PPL syntax is still TBD
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.