-
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
Add new setting to ignore pagination where it is unsupported in V2. #318
Add new setting to ignore pagination where it is unsupported in V2. #318
Conversation
Codecov Report
@@ Coverage Diff @@
## integ-ignore-pagination-switch #318 +/- ##
=================================================================
Coverage ? 97.52%
Complexity ? 4656
=================================================================
Files ? 408
Lines ? 11963
Branches ? 830
=================================================================
Hits ? 11667
Misses ? 289
Partials ? 7
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 |
plugin/src/main/java/org/opensearch/sql/plugin/config/OpenSearchPluginModule.java
Outdated
Show resolved
Hide resolved
Maybe update the PR description to include an example showing how you change/set the new setting. Also I noticed how the setting can be changed when making an opensearch request but how would I change the setting if I wanted to make it through the opensearchsql plugin? |
Updated |
@@ -41,6 +41,7 @@ public enum Key { | |||
QUERY_SIZE_LIMIT("plugins.query.size_limit"), | |||
ENCYRPTION_MASTER_KEY("plugins.query.datasources.encryption.masterkey"), | |||
DATASOURCES_URI_ALLOWHOSTS("plugins.query.datasources.uri.allowhosts"), | |||
IGNORE_UNSUPPORTED_PAGINATION("plugins.query.ignore_unsupported_pagination"), |
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.
does this only affect sql request? Maybe plugins.sql.ignore_unsupported_pagination
or plugins.sql.cursor.ignore_unsupported
?
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 affects all pagination requests, but we support pagination in SQL only for now.
I can easily rename the setting.
165e98c
to
2d33f53
Compare
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: Yury-Fridlyand <[email protected]>
2d33f53
to
9ba8341
Compare
Signed-off-by: Yury-Fridlyand <[email protected]>
@@ -392,7 +392,7 @@ protected static JSONObject updateClusterSettings(ClusterSetting setting, RestCl | |||
return new JSONObject(executeRequest(request, client)); | |||
} | |||
|
|||
protected static JSONObject updateClusterSettings(ClusterSetting setting) throws IOException { | |||
public static JSONObject updateClusterSettings(ClusterSetting setting) throws IOException { |
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.
why does this need to be made public? It's being called by ITs that extend this class.
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 use it in correctness test, which does not inherit this class.
@@ -404,7 +404,7 @@ protected static JSONObject getAllClusterSettings() throws IOException { | |||
return new JSONObject(executeRequest(request)); | |||
} | |||
|
|||
protected static class ClusterSetting { | |||
public static class ClusterSetting { |
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.
ditto
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 use it in correctness test, which does not inherit this class.
l -> l.endsWith("Request is not supported and falling back to old SQL engine"))); | ||
logSize = lines.size(); | ||
|
||
updateClusterSettings( |
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.
feels like these should be two different tests
@@ -23,6 +28,9 @@ public class SQLCorrectnessIT extends CorrectnessTestBase { | |||
@Override | |||
protected void init() throws Exception { | |||
super.init(); | |||
updateClusterSettings( |
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.
is this needed? I feel like this is unnecessary for the tests to pass.
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 it true
by default, but previous test may set it to false
.
@@ -155,8 +155,8 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli | |||
if (newSqlRequest.isExplainRequest()) { | |||
LOG.info("Request is falling back to old SQL engine due to: " + exception.getMessage()); | |||
} | |||
LOG.info("[{}] Request {} is not supported and falling back to old SQL engine", | |||
QueryContext.getRequestId(), newSqlRequest); | |||
LOG.info("[{}] Request is not supported and falling back to old SQL engine", |
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.
why?
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 was dumping non anonymized query
@@ -3,7 +3,7 @@ | |||
OpenSearch SQL Reference Manual | |||
=============================== | |||
|
|||
OpenSearch SQL enables you to extract insights out of OpenSearch using the familiar SQL query syntax. Please refer to the `technical documentation <https://docs-beta.opensearch.org/>`_ for detailed information on installing and configuring opendistro-elasticsearch-sql plugin. In this user reference manual, you can find many information for your reference. In each part, we try to make it clear by adding work example along with detailed description. Here is table of contents of the documentation: | |||
OpenSearch SQL enables you to extract insights out of OpenSearch using the familiar SQL query syntax. Please refer to the `technical documentation <https://opensearch.org/docs/latest/install-and-configure/plugins/>`_ for detailed information on installing and configuring SQL plugin. In this user reference manual, you can find many information for your reference. In each part, we try to make it clear by adding work example along with detailed description. Here is table of contents of the documentation: |
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.
❤️
1bb815b
into
integ-ignore-pagination-switch
Description
Changes how pagination requests with unsupported/incompatible [with pagination] queries are handled.
Adds new setting
plugins.query.ignore_unsupported_pagination
:true
by defaulttrue
such requests are performed without paginationfalse
such requests fall back to legacy engineMisc changes:
Issues Resolved
opensearch-project#1765, opensearch-project#78
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.