-
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
Changes from all commits
f6e0e21
21318f1
1b6e543
382e955
6ca8fec
8edcc54
97379bb
5de0897
d543849
283428c
b1928ae
ef9332a
5d18908
f1371f7
087a5b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -363,6 +363,17 @@ SQL query:: | |
{ | ||
"query" : "SELECT account_number FROM accounts/account" | ||
} | ||
Example 4: Selecting From Index using Partition Shard | ||
----------------------------------------------------------- | ||
|
||
You can also specify a specific shard or partition to target using a routing hash key in ``PARTITION``. You can target multiple shards by providing a list separated by commas. | ||
|
||
SQL query:: | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. It may be confusing to use 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 commentThe 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. |
||
} | ||
|
||
WHERE | ||
===== | ||
|
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.