-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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: Add support for FROZEN indices #41558
Merged
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b6a63ea
SQL: Add support for FROZEN indices
costin dd822d6
Consider frozen indices inside SysTables
costin f56649a
Merge remote-tracking branch 'remotes/upstream/master' into sql/froze…
costin e1c02f2
Address feedback
costin e0334e4
update tests
costin 6103d9b
Merge remote-tracking branch 'remotes/upstream/master' into sql/froze…
costin 7bddf5c
Move frozen to dedicated folder
costin cf63d3c
Address feedback
costin 9d3be49
Merge branch 'master' into sql/frozen-indices
costin 8ac59f8
Merge branch 'master' into sql/frozen-indices
costin ddf5509
Update test
costin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...le-node/src/test/java/org/elasticsearch/xpack/sql/qa/single_node/JdbcFrozenCsvSpecIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
package org.elasticsearch.xpack.sql.qa.single_node; | ||
|
||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; | ||
|
||
import org.elasticsearch.xpack.sql.qa.jdbc.CsvSpecTestCase; | ||
import org.elasticsearch.xpack.sql.qa.jdbc.CsvTestUtils.CsvTestCase; | ||
|
||
import java.util.List; | ||
import java.util.Properties; | ||
import java.util.concurrent.TimeUnit; | ||
|
||
import static org.elasticsearch.xpack.sql.qa.jdbc.CsvTestUtils.specParser; | ||
|
||
public class JdbcFrozenCsvSpecIT extends CsvSpecTestCase { | ||
|
||
@ParametersFactory(argumentFormatting = PARAM_FORMATTING) | ||
public static List<Object[]> readScriptSpec() throws Exception { | ||
return readScriptSpec("/slow/frozen.csv-spec", specParser()); | ||
} | ||
|
||
@Override | ||
protected Properties connectionProperties() { | ||
Properties props = new Properties(super.connectionProperties()); | ||
String timeout = String.valueOf(TimeUnit.MINUTES.toMillis(5)); | ||
props.setProperty("connect.timeout", timeout); | ||
props.setProperty("network.timeout", timeout); | ||
props.setProperty("query.timeout", timeout); | ||
props.setProperty("page.timeout", timeout); | ||
|
||
return props; | ||
} | ||
|
||
|
||
public JdbcFrozenCsvSpecIT(String fileName, String groupName, String testName, Integer lineNumber, CsvTestCase testCase) { | ||
super(fileName, groupName, testName, lineNumber, testCase); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
x-pack/plugin/sql/qa/src/main/resources/setup_mock_show_tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
CREATE TABLE mock ( | ||
"name" VARCHAR, | ||
"type" VARCHAR | ||
"type" VARCHAR, | ||
"kind" VARCHAR | ||
); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@matriv The previous hack was unnecessary - the conditional should be addressed in
connectionProperties
and further more,esJdbc()
actually callsesJdbc(connectionProperties())
so the code was not only duplicated but also identical in results.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 don't get how this is addressed only for a specific file, in this case:
time.csv-spec
.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 not but then again, it wasn't before.
In other words, the if ("time".equals(groupName)) does the right thing but calling esJdbc(connectionProperties()) is the same as calling esJdbc() meaning the if and else branch end up calling the same code path.
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's not the case, if you check again there are 2 different
connectionProperties()
involved there. and the one for thetime
sets the timezone to UTC where the other uses a random timezone.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.
@costin Did you check this ^^ ?