Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/trino-connector/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ license: "This software is licensed under the Apache License version 2."
| gravitino.trino.skip-version-validation | boolean | false | The `gravitino.trino.skip-version-validation` defines whether to skip Trino version validation. Gravitino supports Trino versions between 435 and 478. If this option is `true`, unsupported Trino versions can still be used, but compatibility is not guaranteed. | No | 1.0.0 |
| gravitino.client. | string | (none) | The configuration key prefix for the Gravitino client config. | No | 1.0.0 |
| gravitino.trino.skip-catalog-patterns | string | (none) | The `gravitino.trino.skip-catalog-patterns` defines a comma-separated list of catalog name regex patterns that should be excluded from loading. For example, `test_.*, .*_tmp` excludes all catalogs starting with `test_` or ending with `_tmp`. | No | 1.2.0 |
| gravitino.use-single-metalake | boolean | true | If `true`, only one metalake is used and catalogs are identified by `<catalog_name>`. If `false`, multi-metalake mode is enabled and catalogs are identified by `<metalake_name>.<catalog_name>`. | No | 1.2.0 |

To configure the Gravitino client, use properties prefixed with `gravitino.client.`. These properties will directly passed to the Gravitino client.

**Note:** Invalid configuration properties will result in exceptions. Please see [Gravitino Java client configurations](../how-to-use-gravitino-client.md#gravitino-java-client-configuration) for more support client configuration.

Multi-metalake mode (`gravitino.use-single-metalake=false`) is supported on Trino connector versions 435-451 and 469-478. On versions 452-468, a warning is logged and the connector initializes, but the mode is not fully supported and some operations may fail.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gravitino Trino connector 435-465 is support too

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@diqiu50 Thanks for the feedback. I checked the code on main — supportCatalogNameWithMetalake() returns true for 435-451 and false for 452-468. The connector version boundaries are 435-439, 440-445, 446-451, 452-468, so "435-465" doesn't align with a boundary.

Did you mean 435-451 should be documented as supported? Or should 452-468 also be enabled?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, we should document it. Trino 452–468 does not support it, and UT fails when it is enabled.

## Authentication

The Gravitino Trino connector supports authenticating to the Gravitino server using Simple, OAuth, and Kerberos authentication. For detailed authentication configuration, please refer to [Trino Connector Authentication](./authentication.md).
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ protected int getMaxSupportTrinoSpiVersion() {
return 468;
}

@Override
protected String getTrinoCatalogName(String metalake, String catalog) {
return "\"" + metalake + "." + catalog + "\"";
}

@Override
protected boolean supportCatalogNameWithMetalake() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ protected int getMaxSupportTrinoSpiVersion() {
return 472;
}

@Override
protected String getTrinoCatalogName(String metalake, String catalog) {
return "\"" + metalake + "." + catalog + "\"";
}

@Override
protected boolean supportCatalogNameWithMetalake() {
return false;
}

@Override
protected GravitinoConnector createConnector(CatalogConnectorContext connectorContext) {
return new GravitinoConnector469(connectorContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.gravitino.trino.connector.GravitinoPlugin469;
import org.apache.gravitino.trino.connector.TestGravitinoConnector;
import org.apache.gravitino.trino.connector.TestGravitinoConnectorWithMetalakeCatalogName;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Nested;

public class TestGravitinoConnector469 {
Expand All @@ -45,7 +44,6 @@ protected DistributedQueryRunner createTrinoQueryRunner() throws Exception {
}

@Nested
@Disabled
class MultiMetalake extends TestGravitinoConnectorWithMetalakeCatalogName {
@Override
protected GravitinoPlugin createGravitinoPlugin(GravitinoAdminClient client) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ protected int getMaxSupportTrinoSpiVersion() {
return 478;
}

@Override
protected String getTrinoCatalogName(String metalake, String catalog) {
return "\"" + metalake + "." + catalog + "\"";
}

@Override
protected boolean supportCatalogNameWithMetalake() {
return false;
}

@Override
protected GravitinoConnector createConnector(CatalogConnectorContext connectorContext) {
return new GravitinoConnector478(connectorContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.trino.Session;
import io.trino.testing.DistributedQueryRunner;
import org.apache.gravitino.client.GravitinoAdminClient;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Nested;

public class TestGravitinoConnector478 {
Expand All @@ -42,7 +41,6 @@ protected DistributedQueryRunner createTrinoQueryRunner() throws Exception {
}

@Nested
@Disabled
class MultiMetalake extends TestGravitinoConnectorWithMetalakeCatalogName {
@Override
protected GravitinoPlugin createGravitinoPlugin(GravitinoAdminClient client) {
Expand All @@ -54,5 +52,15 @@ protected DistributedQueryRunner createTrinoQueryRunner() throws Exception {
Session session = testSessionBuilder().setCatalog("gravitino").build();
return DistributedQueryRunner.builder(session).setWorkerCount(0).build();
}

@Override
protected String getTrinoCliCatalogName(String metalake, String catalog) {
return metalake + "." + catalog;
}

@Override
protected String getTrinoSqlCatalogName(String metalakeName, String catalogName) {
return "\"" + metalakeName + "." + catalogName + "\"";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ private void checkTrinoSpiVersion(ConnectorContext context, GravitinoConfig conf

// check catalog name with metalake are supported in this trino version
if (!config.singleMetalakeMode() && !supportCatalogNameWithMetalake()) {
String errmsg =
String.format(
"The trino-connector-%s-%s does not support catalog name with metalake.",
getMinSupportTrinoSpiVersion(), getMaxSupportTrinoSpiVersion());
throw new TrinoException(GravitinoErrorCode.GRAVITINO_UNSUPPORTED_TRINO_VERSION, errmsg);
LOG.warn(
"The trino-connector-{}-{} does not fully support catalog name with metalake. "
+ "The DROP CATALOG operation may not work correctly in multi-metalake mode.",
getMinSupportTrinoSpiVersion(),
getMaxSupportTrinoSpiVersion());
}

// skip version validation
Expand Down