-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
SQL: Deprecate index_include_frozen request parameter and FROZEN
keyword
#83943
Conversation
Pinging @elastic/es-ql (Team:QL) |
Hi @Luegg, I've created a changelog YAML for you. Note that since this PR is labelled |
e5e8ef5
to
f74839f
Compare
@elasticmachine run elasticsearch-ci/part-2 |
FROZEN
keyword
Hi @Luegg, I've updated the changelog YAML for you. Note that since this PR is labelled |
30aad46
to
a19741a
Compare
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 please add a test (to assert that the warning doesn't reach the driver)?
There needs to be a follow-up to plug the warnings to both JDBC and ODBC since said mechanism is not in place (and likely that might affect the communication protocol).
LGTM.
Worth checking and doing a similar PR for EQL. |
Do you mean to assert that the Warning header is not set for request using JDBC/ODBC/CLI mode? Or just asserting it's not passed through as a warning to the JDBC interface? |
As far as I can tell, EQL does not support frozen indices. |
@elasticmachine run elasticsearch-ci/part-2 |
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.
Looks good. Left some comments.
import java.sql.ResultSet; | ||
import java.sql.Statement; | ||
|
||
public class JdbcWarningsIT extends JdbcIntegrationTestCase { |
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.
Any reason for having this test only in single_node
scenario? With regards to multi_node
it's probably not worth considering it, but how about the security
tests suite?
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 also saw that this test is better put to the JDBC test cases in org.elasticsearch.xpack.sql.qa.jdbc
instead of org.elasticsearch.xpack.sql.qa
testFrozenSyntaxIsDeprecated("SELECT * FROM FROZEN test", "FROZEN"); | ||
} | ||
|
||
public void testFrozenSyntaxIsDeprecated(String query, String syntax) 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.
private
?
); | ||
} | ||
|
||
public void testDeprecationWarning(RequestObjectBuilder query, String warning) 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.
private
?
private static final String FROZEN_DEPRECATION_WARNING = "[{}] syntax is deprecated because frozen indices have been deprecated. " | ||
+ "Consider cold or frozen tiers in place of frozen indices."; | ||
|
||
protected void warnDeprecatedFrozenSyntax(boolean includeFrozen, String syntax) { |
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.
A better name for this method is maybeWarnDeprecatedFrozenSyntax
since the logic on issuing the message depends on the value of the parameter. Or, keep the same name, but move the if (includeFrozen)
decision to the calling code.
285012e
to
7f946e2
Compare
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.
LGTM. Thank you
💔 Backport failedThe backport operation could not be completed due to the following error: You can use sqren/backport to manually backport by running |
…yword (elastic#83943) Resolves elastic#81939 (part of elastic#70192) Deprecates the `index_include_frozen` REST parameter in the `/_sql` endpoint and all the syntax including the `FROZEN` keyword. # Conflicts: # x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/parser/LogicalPlanBuilder.java
…yword (elastic#83943) Resolves elastic#81939 (part of elastic#70192) Deprecates the `index_include_frozen` REST parameter in the `/_sql` endpoint and all the syntax including the `FROZEN` keyword.
Follow up on #83943 to ensure that users of the JDBC drivers also can act on the warnings. The change ensures that warnings in the response headers from the `_sql` API are available in `JdbcResultSet.getWarnings()`.
Follow up on elastic#83943 to ensure that users of the JDBC drivers also can act on the warnings. The change ensures that warnings in the response headers from the `_sql` API are available in `JdbcResultSet.getWarnings()`.
Resolves #81939 (part of #70192)
Deprecates the
index_include_frozen
REST parameter in the/_sql
endpoint and all the syntax including theFROZEN
keyword.