Skip to content

[#10717] fix(trino-connector): Enable multi-metalake support for Trino 469+#10748

Open
sachinnn99 wants to merge 1 commit intoapache:mainfrom
sachinnn99:fix/10717-enable-multi-metalake-469
Open

[#10717] fix(trino-connector): Enable multi-metalake support for Trino 469+#10748
sachinnn99 wants to merge 1 commit intoapache:mainfrom
sachinnn99:fix/10717-enable-multi-metalake-469

Conversation

@sachinnn99
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Enable multi-metalake mode (gravitino.use-single-metalake=false) for Trino connector versions 469-472 and 473-478 by marking them as supporting catalog names with metalake prefix. Disable the flag for 446-451 which does not support this mode.

Why are the changes needed?

Fix: #10717

Connector versions 469+ and 473+ reported supportCatalogNameWithMetalake() == false, causing a hard startup error when gravitino.use-single-metalake=false. These versions do support the feature, so the flag is corrected and previously disabled multi-metalake tests are re-enabled.

Does this PR introduce any user-facing change?

Yes: users on Trino 469+ with gravitino.use-single-metalake=false can now start the connector successfully. Documentation for the gravitino.use-single-metalake property has been added to the configuration reference.

How was this patch tested?

  • Re-enabled MultiMetalake tests in TestGravitinoConnector469 and TestGravitinoConnector478.
  • ./gradlew :trino-connector:trino-connector:test :trino-connector:trino-connector-469-472:test :trino-connector:trino-connector-473-478:test -PskipITs — all pass.

@sachinnn99 sachinnn99 force-pushed the fix/10717-enable-multi-metalake-469 branch from 2d1f11a to 905f660 Compare April 11, 2026 16:59
@sachinnn99
Copy link
Copy Markdown
Contributor Author

sachinnn99 commented Apr 11, 2026

@diqiu50 Opened this as a clean PR based on your feedback. Added documentation for gravitino.use-single-metalake as requested. Please take a look when you get a chance. Thanks!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

Code Coverage Report

Overall Project 65.17% -0.08% 🟢
Files changed 48.01% 🔴

Module Coverage
aliyun 1.73% 🔴
api 47.09% 🟢
authorization-common 85.96% 🟢
aws 1.1% 🔴
azure 2.6% 🔴
catalog-common 10.2% 🔴
catalog-fileset 80.02% 🟢
catalog-glue 75.36% 🟢
catalog-hive 81.83% 🟢
catalog-jdbc-clickhouse 79.06% 🟢
catalog-jdbc-common 42.89% 🟢
catalog-jdbc-doris 80.28% 🟢
catalog-jdbc-hologres 54.03% 🟢
catalog-jdbc-mysql 79.23% 🟢
catalog-jdbc-oceanbase 78.38% 🟢
catalog-jdbc-postgresql 82.05% 🟢
catalog-jdbc-starrocks 78.27% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 45.07% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 87.16% 🟢
catalog-lakehouse-paimon 77.71% 🟢
catalog-model 77.72% 🟢
cli 44.51% 🟢
client-java 77.63% 🟢
common 48.97% 🟢
core 81.41% 🟢
filesystem-hadoop3 76.97% 🟢
flink 40.55% 🟢
flink-runtime 0.0% 🔴
gcp 14.2% 🔴
hadoop-common 10.39% 🔴
hive-metastore-common 46.14% 🟢
iceberg-common 50.73% 🟢
iceberg-rest-server 65.95% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 23.88% 🔴
lance-rest-server 57.84% 🟢
lineage 53.02% 🟢
optimizer 82.95% 🟢
optimizer-api 21.95% 🔴
server 85.89% -1.17% 🟢
server-common 70.44% -3.93% 🟢
spark 32.79% 🔴
spark-common 39.09% 🔴
trino-connector 33.83% 🔴
Files
Module File Coverage
server GravitinoServer.java 60.16% 🟢
server-common JettyServer.java 41.48% 🔴

Comment thread docs/trino-connector/configuration.md Outdated
| 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>`. Multi-metalake mode is supported on Trino connector versions 469-472 and 473-478. It is not supported on connector versions 446-451 or 452-468. | No | 1.2.0 |
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.

Please add all supported versions in the Note section.

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.

On the other hand, the configuration you added earlier is also useful. The unsupported part is the drop catalog operation, and users can choose to ignore it.

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.

Done — moved the version support details to the Note section and simplified the table cell description. Also added a note that DROP CATALOG is not supported in multi-metalake mode.

**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 469-478. It is not supported on versions 446-468. The `DROP CATALOG` operation is not supported in multi-metalake mode.

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.

@sachinnn99 sachinnn99 force-pushed the fix/10717-enable-multi-metalake-469 branch from 94b257d to 76ca0a8 Compare April 15, 2026 17:32
@diqiu50
Copy link
Copy Markdown
Contributor

diqiu50 commented Apr 16, 2026

You need to solve two issues in this PR.
1. Identify which version ranges fully support supportCatalogNameWithMetalake, and set it to true for the supported ones.
2. Decide how to handle unsupported versions: should we fail directly, or just log a warning explaining that DROP CATALOG may have issues?

There is a test named TestGravitinoConnectorWithMetalakeCatalogName in the tester. If supportCatalogNameWithMet is set to true, you need to make sure this test is enabled and verify it.

…r Trino 469+

Remove the supportCatalogNameWithMetalake and getTrinoCatalogName
overrides in the Trino 469-472 and 473-478 factories so they inherit
the default true from the base factory, fixing the startup exception
when gravitino.use-single-metalake=false on Trino 469+.

For connector versions where multi-metalake mode is not supported
(currently 452-468), log a warning instead of throwing; DROP CATALOG
and some other operations may fail on those versions.

Enable and adapt the MultiMetalake integration test for 469-472 and
473-478, and document which versions support multi-metalake mode.
@sachinnn99 sachinnn99 force-pushed the fix/10717-enable-multi-metalake-469 branch from 76ca0a8 to ffeaa5c Compare April 16, 2026 07:16
@sachinnn99
Copy link
Copy Markdown
Contributor Author

@diqiu50 Pushed an update addressing your feedback:

1. Version support matrix (supportCatalogNameWithMetalake)

  • 435-451 — true (unchanged from main)
  • 469-478 — true (enabled by this PR)
  • 452-468 — false (unchanged)

2. Unsupported version behavior

  • Changed from throwing TrinoException to LOG.warn noting that DROP CATALOG may not work correctly.

3. Tests

  • Enabled MultiMetalake test for 469-472 and 473-478 — verified passing locally.
  • Left MultiMetalake test @Disabled for 446-451 (matching main). Locally, after experimentally enabling the test and adding the same catalog-name overrides as 473-478, 3 of 4 subtests pass; testCreateCatalog fails because after metalake.dropCatalog + loadMetalakeSync, the catalog is still present in catalogConnectors on 446-451 while correctly removed on 469+. Appears to be a pre-existing 446-451 issue.

Question: For 446-451, should we keep the test @Disabled (matches main, address drop_catalog in a follow-up) or investigate the fix in this PR?

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.

[Bug report] TrinoException: The trino-connector-473-478 does not support catalog name with metalake

2 participants