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

[#3630] feat(trino-connector): Support insert and select operation on Gravitino catalog #3631

Merged
merged 19 commits into from
May 30, 2024

Conversation

diqiu50
Copy link
Contributor

@diqiu50 diqiu50 commented May 29, 2024

What changes were proposed in this pull request?

  1. Support insert and select operation on Gravitino catalog
  2. Support query optimize
  3. Upgrade CI docker environment

Why are the changes needed?

Fix: #3630

Does this PR introduce any user-facing change?

NO

How was this patch tested?

UT IT

@diqiu50 diqiu50 self-assigned this May 29, 2024
@diqiu50 diqiu50 requested review from yuqi1129 and mchades May 29, 2024 13:11
"https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.26/mysql-connector-java-8.0.26.jar";

private static final String DOWNLOAD_POSTGRESQL_JDBC_DRIVER_URL =
"https://jdbc.postgresql.org/download/postgresql-42.7.0.jar";
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't we need this before?

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'm not sure at the moment. I disable the tester of TrinoConnectorIT.

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 bug directory means?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The EXPLAIN command cannot show the scanner details about query optimization. I will debug the problem.

JdbcDriverDownloader.downloadJdbcDriver(DOWNLOAD_JDBC_DRIVER_URL, tmpPath.toString());
Path tmpPath = Paths.get(gravitinoHome, relativeDeployLibsPath);
JdbcDriverDownloader.downloadJdbcDriver(DOWNLOAD_MYSQL_JDBC_DRIVER_URL, tmpPath.toString());
JdbcDriverDownloader.downloadJdbcDriver(
Copy link
Contributor

Choose a reason for hiding this comment

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

You should remove other download actions in the sub-classes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

@diqiu50 diqiu50 force-pushed the dynamic-catalog branch from a328402 to fa55320 Compare May 30, 2024 07:03
import org.junit.jupiter.api.Test;

@Disabled
Copy link
Contributor

Choose a reason for hiding this comment

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

why disable this test? please add a todo comment or open a new issue to track this

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 not work now. i will fix later

@@ -92,24 +93,36 @@ public static GravitinoConnectorPluginManager instance(ClassLoader classLoader)
}
synchronized (GravitinoConnectorPluginManager.class) {
if (instance == null) {
if (!APP_CLASS_LOADER_NAME.equals(classLoader.getName())) {
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 name AppClassLoader app?

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

@@ -0,0 +1,48 @@
/*
* Copyright 2023 Datastrato Pvt Ltd.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check the version wholely

}
}

static TypeManager createTypeManger(ClassLoader classLoader) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Manger -> Manager


objectMapper.registerModule(module);
return objectMapper;
} catch (Exception e) {;
Copy link
Contributor

Choose a reason for hiding this comment

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

;

objectMapper.registerModule(new RecordAutoDetectModule());

// Handle serialization for plugin classes
registerHandleSerializationModule(objectMapper, classLoader);
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused classloader

@@ -141,40 +155,40 @@ private void loadPlugin(String pluginPath, String pluginName) {
"org.openjdk.jol.",
"io.opentelemetry.api.",
"io.opentelemetry.context."));
pluginClassLoaders.put(pluginName, (ClassLoader) pluginClassLoader);

ServiceLoader<Plugin> serviceLoader =
Copy link
Contributor

Choose a reason for hiding this comment

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

Why move this logic here? It's in the createConnector before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously, the class only supported loading plugins from a directory, but in the test environment, we don't have a plugin directory. However, we can create a plugin immediately. Therefore, we have added a new interface, installPlugin(name, plugin), and then refactored the code to move the plugin loading from the createConnector function.

@diqiu50 diqiu50 merged commit bef1dab into apache:branch-dynamic-catalog May 30, 2024
22 checks passed
diqiu50 added a commit to diqiu50/gravitino that referenced this pull request May 30, 2024
…ion on Gravitino catalog (apache#3631)

### What changes were proposed in this pull request?

1. Support insert and select operation on Gravitino catalog
2. Support query optimize
3. Upgrade CI docker environment  

### Why are the changes needed?

Fix: apache#3630

### Does this PR introduce _any_ user-facing change?

NO

### How was this patch tested?

UT IT
diqiu50 added a commit to diqiu50/gravitino that referenced this pull request May 30, 2024
…ion on Gravitino catalog (apache#3631)

1. Support insert and select operation on Gravitino catalog
2. Support query optimize
3. Upgrade CI docker environment

Fix: apache#3630

NO

UT IT
diqiu50 added a commit to diqiu50/gravitino that referenced this pull request May 30, 2024
…ion on Gravitino catalog (apache#3631)

1. Support insert and select operation on Gravitino catalog
2. Support query optimize
3. Upgrade CI docker environment

Fix: apache#3630

NO

UT IT
diqiu50 added a commit to diqiu50/gravitino that referenced this pull request May 31, 2024
…ion on Gravitino catalog (apache#3631)

1. Support insert and select operation on Gravitino catalog
2. Support query optimize
3. Upgrade CI docker environment

Fix: apache#3630

NO

UT IT
jerryshao pushed a commit that referenced this pull request May 31, 2024
… Gravitino catalog (#3631)

1. Support insert and select operation on Gravitino catalog
2. Support query optimize
3. Upgrade CI docker environment

Fix: #3630

NO

UT IT
jerryshao pushed a commit that referenced this pull request May 31, 2024
… Gravitino catalog (#3631)

### What changes were proposed in this pull request?

1. Support insert and select operation on Gravitino catalog
2. Support query optimize
3. Upgrade CI docker environment  

### Why are the changes needed?

Fix: #3630

### Does this PR introduce _any_ user-facing change?

NO

### How was this patch tested?

UT IT
@diqiu50 diqiu50 deleted the dynamic-catalog branch June 5, 2024 03:44
diqiu50 added a commit to diqiu50/gravitino that referenced this pull request Jun 13, 2024
…ion on Gravitino catalog (apache#3631)

### What changes were proposed in this pull request?

1. Support insert and select operation on Gravitino catalog
2. Support query optimize
3. Upgrade CI docker environment  

### Why are the changes needed?

Fix: apache#3630

### Does this PR introduce _any_ user-facing change?

NO

### How was this patch tested?

UT IT
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