This is an automated email from the ASF dual-hosted git repository. voonhous pushed a commit to tag rfc-105-pre-cleanup in repository https://gitbox.apache.org/repos/asf/hudi.git
commit 19f67bd4ece4dabcceb3904afb34cd192f12c464 Author: voon <[email protected]> AuthorDate: Wed May 27 16:14:51 2026 +0800 fix(trino): share file metastore between hive and hudi in TestHudiSharedMetastore The test creates a hive catalog and a hudi catalog and writes through both against a shared file metastore directory. The previous hive-side setup used TestingHivePlugin with no metastore config, which falls back to an in-memory metastore. The CREATE SCHEMA hive.default landed in that isolated metastore and the subsequent hudi-side createTable saw no default schema -> SchemaNotFoundException. Switches the hive catalog to the production HivePlugin with the same hive.metastore=file and hive.metastore.catalog.dir as the hudi catalog, mirroring the Trino-side TestHudiSharedMetastore. Both catalogs now read and write the same on-disk metastore, the CREATE SCHEMA is visible on the hudi side, and table init succeeds. --- .../java/io/trino/plugin/hudi/TestHudiSharedMetastore.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hudi-trino-plugin/src/test/java/io/trino/plugin/hudi/TestHudiSharedMetastore.java b/hudi-trino-plugin/src/test/java/io/trino/plugin/hudi/TestHudiSharedMetastore.java index 32994032265f..c97f836087e2 100644 --- a/hudi-trino-plugin/src/test/java/io/trino/plugin/hudi/TestHudiSharedMetastore.java +++ b/hudi-trino-plugin/src/test/java/io/trino/plugin/hudi/TestHudiSharedMetastore.java @@ -17,7 +17,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import io.trino.Session; import io.trino.filesystem.Location; -import io.trino.plugin.hive.TestingHivePlugin; +import io.trino.plugin.hive.HivePlugin; import io.trino.plugin.hudi.testing.TpchHudiTablesInitializer; import io.trino.testing.AbstractTestQueryFramework; import io.trino.testing.DistributedQueryRunner; @@ -65,8 +65,15 @@ final class TestHudiSharedMetastore "hive.metastore.catalog.dir", dataDirectory.toString(), "fs.hadoop.enabled", "true")); - queryRunner.installPlugin(new TestingHivePlugin(dataDirectory)); - queryRunner.createCatalog("hive", "hive"); + queryRunner.installPlugin(new HivePlugin()); + queryRunner.createCatalog( + "hive", + "hive", + ImmutableMap.of( + // Intentionally sharing the file metastore directory with Hudi + "hive.metastore", "file", + "hive.metastore.catalog.dir", dataDirectory.toString(), + "fs.hadoop.enabled", "true")); queryRunner.execute("CREATE SCHEMA hive.default");
