-
Notifications
You must be signed in to change notification settings - Fork 409
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
[#3526] feat(trino-connector): Support create Gravitino catalog by using Trino CREATE CATALOG command #3540
[#3526] feat(trino-connector): Support create Gravitino catalog by using Trino CREATE CATALOG command #3540
Conversation
2. Support create gravitino catalog by CREATE CATALOG statement
Could you please add a commit to enable the tests first? |
.../src/main/java/com/datastrato/gravitino/trino/connector/catalog/CatalogConnectorManager.java
Outdated
Show resolved
Hide resolved
@@ -420,4 +421,26 @@ public void addMetalake(String metalake) { | |||
public Set<String> getUsedMetalakes() { | |||
return usedMetalakes; | |||
} | |||
|
|||
public Connector createConnector( | |||
String connectorName, GravitinoConfig config, ConnectorContext context) { |
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.
context
has not been used, do you have other consideration that make it as a parameter?
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 will be used by next pr
@@ -13,6 +13,8 @@ | |||
public class GravitinoConfig { | |||
|
|||
public static String GRAVITINO_DYNAMIC_CONNECTOR = "__gravitino.dynamic.connector"; | |||
public static String GRAVITINO_DYNAMIC_CONNECTOR_CATALOG_CONFIG = | |||
"__gravitino.dynamic.connector.catalog.config"; |
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 the value of this key set automatically determined by Trino?
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.
Yes
GravitinoTable table = metadataAdapter.createTable(tableMetadata); | ||
catalogConnectorMetadata.createTable(table); | ||
catalogConnectorMetadata.createTable(table, saveMode == SaveMode.IGNORE); |
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.
What's the meaning of SaveMode.IGNORE
?
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.
saveMode == SaveMode.IGNORE
it means create table if not exist
@@ -22,7 +23,10 @@ default List<PropertyMetadata<?>> getTableProperties() { | |||
} | |||
|
|||
/** @return Return internal connector config with Trino. */ | |||
Map<String, Object> buildInternalConnectorConfig(GravitinoCatalog catalog) throws Exception; | |||
Map<String, String> buildInternalConnectorConfig(GravitinoCatalog catalog) throws Exception; |
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 change a result of the interfaced modification introduced by Trino 435?
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 modified by a newly created connector mechanism.
import org.junit.jupiter.api.MethodOrderer; | ||
import org.junit.jupiter.api.Order; | ||
import org.junit.jupiter.api.Tag; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.TestMethodOrder; | ||
import org.openqa.selenium.By; | ||
|
||
@Disabled |
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.
The CatalogPageTest
shouldn't rely on Trino, Can you decouple them?
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 Depend on the Trino docker environment
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.
But it doesn't use Trino, right?
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.
Yes
trino-connector/src/main/java/com/datastrato/gravitino/trino/connector/GravitinoConfig.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/datastrato/gravitino/trino/connector/catalog/hive/HiveConnectorAdapter.java
Outdated
Show resolved
Hide resolved
I'm okay with the current changes. |
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
… by using Trino CREATE CATALOG command (apache#3540) 1. Upgrade code to Trino-435 2. Support create Gravitino catalog by CREATE CATALOG statement 3. Disable testers of Trino Connector Fix: apache#3526 NO Exists UT
… by using Trino CREATE CATALOG command (apache#3540) 1. Upgrade code to Trino-435 2. Support create Gravitino catalog by CREATE CATALOG statement 3. Disable testers of Trino Connector Fix: apache#3526 NO Exists UT
… by using Trino CREATE CATALOG command (apache#3540) 1. Upgrade code to Trino-435 2. Support create Gravitino catalog by CREATE CATALOG statement 3. Disable testers of Trino Connector Fix: apache#3526 NO Exists UT
What changes were proposed in this pull request?
Why are the changes needed?
Fix: #3526
Does this PR introduce any user-facing change?
NO
How was this patch tested?
Exists UT