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 664e9f11299e6fe7686094b6b0c24367af1dfc74 Author: voon <[email protected]> AuthorDate: Mon May 25 22:32:24 2026 +0800 fix(trino): pin to released Trino 481 and gate test-jars behind a profile Pins trino.connector.version and trino.connector.test.version to the latest released Trino, 481. The previous 482-SNAPSHOT only existed in the developer local m2; CI starts with an empty m2 and cannot resolve the BOM, which made every version-managed dep in hudi-trino-plugin lose its version and the build collapse before any compilation. Moves the four test-jar dependencies (trino-spi, trino-filesystem, trino-hive, trino-main at the tests classifier) into a new hudi-trino-tests Maven profile. Trino does not publish three of those test-jars to Maven Central, so leaving them in the unconditional dependencies block made any reactor build with an empty m2 unresolvable. The profile is opt-in for developers who have a matching Trino source build in their m2. CI builds keep it off. hudi_trino_ci.yml switches from -DskipTests to -Dmaven.test.skip=true so test sources are not compiled (test imports come from the gated test-jars) and the build step resolves cleanly against Maven Central. README updated with the test profile activation flow. --- .github/workflows/hudi_trino_ci.yml | 7 ++-- hudi-trino-plugin/README.md | 15 +++++++ hudi-trino-plugin/pom.xml | 78 +++++++++++++++++++++---------------- pom.xml | 10 ++--- 4 files changed, 69 insertions(+), 41 deletions(-) diff --git a/.github/workflows/hudi_trino_ci.yml b/.github/workflows/hudi_trino_ci.yml index 20464810aa28..28214a815833 100644 --- a/.github/workflows/hudi_trino_ci.yml +++ b/.github/workflows/hudi_trino_ci.yml @@ -37,6 +37,7 @@ jobs: distribution: 'temurin' cache: maven - name: Build connector - run: mvn $MVN_ARGS -Phudi-trino -pl hudi-trino-plugin -am install -DskipTests - - name: Run connector tests - run: mvn $MVN_ARGS -Phudi-trino -pl hudi-trino-plugin test + # Tests live behind the hudi-trino-tests profile (Trino does not publish the + # test-jars we need). -Dmaven.test.skip=true skips test compilation so the build + # resolves cleanly against Maven Central. + run: mvn $MVN_ARGS -Phudi-trino -pl hudi-trino-plugin -am install -Dmaven.test.skip=true diff --git a/hudi-trino-plugin/README.md b/hudi-trino-plugin/README.md index 37f465baea8a..9448986bf401 100644 --- a/hudi-trino-plugin/README.md +++ b/hudi-trino-plugin/README.md @@ -14,6 +14,21 @@ mvn -Phudi-trino -pl hudi-trino-plugin install Requires JDK 25 (enforced via `maven-enforcer-plugin`). +## Running tests + +Tests depend on Trino test-jars (`trino-spi`, `trino-filesystem`, `trino-hive`, `trino-main` at the `tests` classifier). Trino does not publish three of those to Maven Central, so the test deps live behind the `hudi-trino-tests` profile, off by default. + +To run the tests: + +1. Build the matching Trino version locally so its `*-tests.jar` artifacts land in your `~/.m2` (see `trino.connector.test.version` in the root pom for the version to build). +2. Activate both profiles: + +``` +mvn -Phudi-trino,hudi-trino-tests -pl hudi-trino-plugin test +``` + +CI keeps `hudi-trino-tests` off so the build resolves cleanly against Maven Central. + ## IDE setup Only this module needs JDK 25. Leave the rest of Hudi on its native JDK (11 or 17) so you are not toggling the project default. diff --git a/hudi-trino-plugin/pom.xml b/hudi-trino-plugin/pom.xml index b76e5b60d774..a73341963b1f 100644 --- a/hudi-trino-plugin/pom.xml +++ b/hudi-trino-plugin/pom.xml @@ -367,57 +367,24 @@ <scope>test</scope> </dependency> - <dependency> - <groupId>io.trino</groupId> - <artifactId>trino-filesystem</artifactId> - <version>${dep.trino.test.version}</version> - <type>test-jar</type> - <scope>test</scope> - </dependency> - <dependency> <groupId>io.trino</groupId> <artifactId>trino-hdfs</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>io.trino</groupId> - <artifactId>trino-hive</artifactId> - <version>${dep.trino.test.version}</version> - <type>test-jar</type> - <scope>test</scope> - </dependency> - <dependency> <groupId>io.trino</groupId> <artifactId>trino-main</artifactId> <scope>test</scope> </dependency> - <dependency> - <groupId>io.trino</groupId> - <artifactId>trino-main</artifactId> - <version>${dep.trino.test.version}</version> - <type>test-jar</type> - <scope>test</scope> - </dependency> - <dependency> <groupId>io.trino</groupId> <artifactId>trino-parser</artifactId> <scope>test</scope> </dependency> - <dependency> - <!-- BOM does not manage test-jar coordinate; declare the version explicitly. --> - <groupId>io.trino</groupId> - <artifactId>trino-spi</artifactId> - <version>${dep.trino.test.version}</version> - <type>test-jar</type> - <scope>test</scope> - </dependency> - <dependency> <groupId>io.trino</groupId> <artifactId>trino-testing</artifactId> @@ -605,4 +572,49 @@ </plugin> </plugins> </build> + + <profiles> + <!-- + Test-only profile. Trino does not publish trino-spi / trino-filesystem / + trino-hive test-jars to Maven Central, and the published trino-main test-jar + still requires a matching SPI snapshot for the rest of the test classpath. + Activate this profile alongside hudi-trino when you have a locally-built + Trino snapshot in ~/.m2 (build via the Trino source tree and `mvn install`). + CI builds keep it off so the default reactor stays resolvable against + Maven Central. + --> + <profile> + <id>hudi-trino-tests</id> + <dependencies> + <dependency> + <groupId>io.trino</groupId> + <artifactId>trino-filesystem</artifactId> + <version>${dep.trino.test.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>io.trino</groupId> + <artifactId>trino-hive</artifactId> + <version>${dep.trino.test.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>io.trino</groupId> + <artifactId>trino-main</artifactId> + <version>${dep.trino.test.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + <dependency> + <groupId>io.trino</groupId> + <artifactId>trino-spi</artifactId> + <version>${dep.trino.test.version}</version> + <type>test-jar</type> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + </profiles> </project> diff --git a/pom.xml b/pom.xml index 323525c38e6f..0015f577ae3b 100644 --- a/pom.xml +++ b/pom.xml @@ -130,11 +130,11 @@ <presto.version>0.273</presto.version> <trino.version>390</trino.version> <!-- Trino SPI version that hudi-trino-plugin main code compiles against. --> - <trino.connector.version>482-SNAPSHOT</trino.connector.version> - <!-- Trino version used only for *-tests.jar classifier deps. Trino does not publish - test-jars for tagged releases, so this tracks a snapshot. Built locally via the - Trino source tree; consumers running tests need the snapshot in their m2. --> - <trino.connector.test.version>480-SNAPSHOT</trino.connector.test.version> + <trino.connector.version>481</trino.connector.version> + <!-- Trino version used by the hudi-trino-tests profile for *-tests.jar classifier deps. + Trino does not publish trino-spi / trino-filesystem / trino-hive test-jars; the + profile is opt-in and assumes a locally-built Trino snapshot in ~/.m2. --> + <trino.connector.test.version>481</trino.connector.test.version> <hive.exec.classifier>core</hive.exec.classifier> <metrics.version>4.1.1</metrics.version> <orc.spark.version>1.6.0</orc.spark.version>
