Skip to content
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

Merged
merged 5 commits into from
May 27, 2024

Conversation

diqiu50
Copy link
Contributor

@diqiu50 diqiu50 commented May 23, 2024

What changes were proposed in this pull request?

  1. Upgrade code to Trino-435
  2. Support create Gravitino catalog by CREATE CATALOG statement
  3. Disable testers of Trino Connector

Why are the changes needed?

Fix: #3526

Does this PR introduce any user-facing change?

NO

How was this patch tested?

Exists UT

2. Support create gravitino catalog by CREATE CATALOG statement
@diqiu50 diqiu50 self-assigned this May 23, 2024
@mchades
Copy link
Contributor

mchades commented May 23, 2024

Could you please add a commit to enable the tests first?

@diqiu50 diqiu50 requested a review from yuqi1129 May 24, 2024 02:23
@diqiu50 diqiu50 closed this May 24, 2024
@diqiu50 diqiu50 reopened this May 24, 2024
@diqiu50 diqiu50 requested a review from mchades May 24, 2024 02:35
@@ -420,4 +421,26 @@ public void addMetalake(String metalake) {
public Set<String> getUsedMetalakes() {
return usedMetalakes;
}

public Connector createConnector(
String connectorName, GravitinoConfig config, ConnectorContext context) {
Copy link
Contributor

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?

Copy link
Contributor Author

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";
Copy link
Contributor

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?

Copy link
Contributor Author

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);
Copy link
Contributor

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?

Copy link
Contributor Author

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;
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@diqiu50 diqiu50 requested review from yuqi1129 and mchades May 27, 2024 03:47
@yuqi1129
Copy link
Contributor

I'm okay with the current changes.

Copy link
Contributor

@mchades mchades left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@diqiu50 diqiu50 merged commit 30ef606 into apache:branch-dynamic-catalog May 27, 2024
22 checks passed
@diqiu50 diqiu50 deleted the dynamic_catalog_p1 branch May 28, 2024 06:21
diqiu50 added a commit to diqiu50/gravitino that referenced this pull request May 30, 2024
… 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
diqiu50 added a commit to diqiu50/gravitino that referenced this pull request May 30, 2024
… 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
jerryshao pushed a commit that referenced this pull request May 31, 2024
…ing Trino CREATE CATALOG command (#3540)

1. Upgrade code to Trino-435
2. Support create Gravitino catalog by CREATE CATALOG statement
3. Disable testers of  Trino Connector

Fix: #3526

NO

Exists UT
jerryshao pushed a commit that referenced this pull request May 31, 2024
…ing Trino CREATE CATALOG command (#3540)

1. Upgrade code to Trino-435
2. Support create Gravitino catalog by CREATE CATALOG statement
3. Disable testers of  Trino Connector

Fix: #3526

NO

Exists UT
diqiu50 added a commit to diqiu50/gravitino that referenced this pull request Jun 13, 2024
… 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants