[pos] Fix connector caused test failures#26068
Conversation
Reviewer's GuidePR fixes connector-induced test failures by enabling Presto Spark native runners to register multiple catalogs at creation time. It introduces an overloaded createHiveRunner that builds native- and Java-side catalogs up-front, corrects the default catalog mapping for Tpch runners, and updates test classes to leverage the new utility and clean up obsolete overrides. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey there - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `presto-native-execution/src/test/java/com/facebook/presto/spark/TestPrestoSparkNativeGeneralQueries.java:115-32` </location>
<code_context>
@Ignore
public void testArrayAndMapFunctions() {}
- // VeloxRuntimeError: it != connectors().end() Connector with ID 'hivecached' not registered
- @Override
- @Ignore
- public void testCatalogWithCacheEnabled() {}
</code_context>
<issue_to_address>
**suggestion (testing):** Restoring previously ignored tests could improve coverage.
Since the runner now supports multiple catalogs, please re-enable 'testCatalogWithCacheEnabled' and confirm its assertions to ensure the recent changes are properly tested.
Suggested implementation:
```java
@Override
public void testCatalogWithCacheEnabled() {
// Ensure the runner supports multiple catalogs and cache-enabled catalog works
PrestoSparkNativeQueryRunner runner = PrestoSparkNativeQueryRunnerUtils.createHiveRunner(
ImmutableMap.of(
"hivecached", ImmutableMap.of("connector.name", "hive"),
"hive", ImmutableMap.of("connector.name", "hive")
)
);
// Example assertion: query both catalogs and check results
assertQuery(runner, "SELECT * FROM hivecached.default.nation", "SELECT * FROM hive.default.nation");
// Add more assertions as needed to confirm cache behavior
}
```
If the `assertQuery` method or the runner setup requires additional configuration for cache validation, you may need to add more specific assertions or setup steps. Also, ensure that the test data exists in both catalogs for the assertion to pass.
</issue_to_address>
### Comment 2
<location> `presto-native-execution/src/test/java/com/facebook/presto/spark/TestPrestoSparkNativeTpchConnectorQueries.java:43-44` </location>
<code_context>
@Override
protected QueryRunner createQueryRunner()
{
</code_context>
<issue_to_address>
**suggestion (testing):** Consider re-enabling previously ignored tests for 'tpchstandard' catalog.
Previously, 'testTpchTinyTables' and 'testTpchDateFilter' were ignored due to connector registration errors. With the updated runner creation, these tests may now work. Please re-enable and verify that the original issues are resolved.
Suggested implementation:
```java
```
```java
public void testTpchTinyTables()
{
// test implementation
}
public void testTpchDateFilter()
{
// test implementation
}
```
If the test methods are currently commented out or missing, you will need to restore their full implementations. Also, after re-enabling, run the tests to verify that the original connector registration errors are resolved.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| @@ -31,7 +32,9 @@ public class TestPrestoSparkNativeGeneralQueries | |||
| @Override | |||
| protected QueryRunner createQueryRunner() | |||
There was a problem hiding this comment.
suggestion (testing): Restoring previously ignored tests could improve coverage.
Since the runner now supports multiple catalogs, please re-enable 'testCatalogWithCacheEnabled' and confirm its assertions to ensure the recent changes are properly tested.
Suggested implementation:
@Override
public void testCatalogWithCacheEnabled() {
// Ensure the runner supports multiple catalogs and cache-enabled catalog works
PrestoSparkNativeQueryRunner runner = PrestoSparkNativeQueryRunnerUtils.createHiveRunner(
ImmutableMap.of(
"hivecached", ImmutableMap.of("connector.name", "hive"),
"hive", ImmutableMap.of("connector.name", "hive")
)
);
// Example assertion: query both catalogs and check results
assertQuery(runner, "SELECT * FROM hivecached.default.nation", "SELECT * FROM hive.default.nation");
// Add more assertions as needed to confirm cache behavior
}If the assertQuery method or the runner setup requires additional configuration for cache validation, you may need to add more specific assertions or setup steps. Also, ensure that the test data exists in both catalogs for the assertion to pass.
a481fdd to
820e6e9
Compare
820e6e9 to
8d9545c
Compare
Description
Fixes 3 tests that were previously failing due to connector issues. Connectors for presto on spark native were not created correctly. Because presto on spark native query runner does not allow adding new catalogs after creation, the fix allows presto on spark native to be able to create query runners with multiple catalogs up-front.