-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Migrate to BaseConnectorTest in BigQuery #11108
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e2ca2c6
Don't insert rows in skipTestUnlessSupportsDeletes
ebyhr 13690df
Create an empty table in testQueryLoggingCount
ebyhr 8b9ce67
Make AbstractTestDistributedQueries.testColumnName protected
ebyhr 764c566
Rename TestBigQueryIntegrationSmokeTest to TestBigQueryConnectorTest
ebyhr d6b0159
Migrate to BaseConnectorTest in BigQuery
ebyhr 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -771,7 +771,7 @@ public void testDeleteWithVarcharPredicate() | |
protected void skipTestUnlessSupportsDeletes() | ||
{ | ||
skipTestUnless(supportsCreateTable()); | ||
try (TestTable table = new TestTable(getQueryRunner()::execute, "test_supports_delete", "(col varchar(1))", ImmutableList.of("'a'", "'A'"))) { | ||
try (TestTable table = new TestTable(getQueryRunner()::execute, "test_supports_delete", "(col varchar(1))")) { | ||
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. Thank you. I was testing for CREATE TABLE but performing CTAS in the test. |
||
if (!supportsDelete()) { | ||
assertQueryFails("DELETE FROM " + table.getName(), "This connector does not support deletes"); | ||
throw new SkipException("This connector does not support deletes"); | ||
|
@@ -1035,8 +1035,8 @@ public void testQueryLoggingCount() | |
long beforeCompletedQueriesCount = waitUntilStable(() -> dispatchManager.getStats().getCompletedQueries().getTotalCount(), new Duration(5, SECONDS)); | ||
long beforeSubmittedQueriesCount = dispatchManager.getStats().getSubmittedQueries().getTotalCount(); | ||
String tableName = "test_logging_count" + randomTableSuffix(); | ||
assertUpdate("CREATE TABLE " + tableName + " AS SELECT 1 foo_1, 2 foo_2_4", 1); | ||
assertQuery("SELECT foo_1, foo_2_4 FROM " + tableName, "SELECT 1, 2"); | ||
assertUpdate("CREATE TABLE " + tableName + tableDefinitionForQueryLoggingCount()); | ||
assertQueryReturnsEmptyResult("SELECT foo_1, foo_2_4 FROM " + tableName); | ||
assertUpdate("DROP TABLE " + tableName); | ||
assertQueryFails("SELECT * FROM " + tableName, ".*Table .* does not exist"); | ||
|
||
|
@@ -1048,6 +1048,15 @@ public void testQueryLoggingCount() | |
}); | ||
} | ||
|
||
/** | ||
* The table must have two columns foo_1 and foo_2_4 of any type. | ||
*/ | ||
@Language("SQL") | ||
protected String tableDefinitionForQueryLoggingCount() | ||
{ | ||
return "(foo_1 int, foo_2_4 int)"; | ||
} | ||
|
||
private <T> T waitUntilStable(Supplier<T> computation, Duration timeout) | ||
{ | ||
T lastValue = computation.get(); | ||
|
@@ -1197,7 +1206,7 @@ public void testColumnName(String columnName) | |
testColumnName(columnName, true); | ||
} | ||
|
||
private void testColumnName(String columnName, boolean delimited) | ||
protected void testColumnName(String columnName, boolean delimited) | ||
{ | ||
String nameInSql = columnName; | ||
if (delimited) { | ||
|
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
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.
Can we fix this in base test? It seems we don't need CTAS to test rename table either?
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.
We could do it, but I hesitated to change in this PR because the test contains assertion for values.