You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by vh...@apache.org on 2026/06/04 06:43:18 UTC
(hudi) 01/36: feat(trino): wire hudi-trino-plugin and bundle for RFC-105 shim split
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 72b78687d6bac3a37141ebc44229c4f6515cb994
Author: voon <vo...@gmail.com>
AuthorDate: Thu May 21 19:24:38 2026 +0800
feat(trino): wire hudi-trino-plugin and bundle for RFC-105 shim split
Configures the Hudi-side build to publish org.apache.hudi:hudi-trino-bundle
as the artifact consumed by the Trino-side HudiPlugin shim:
- Rewrite hudi-trino-plugin/pom.xml as a regular Hudi module (parent
org.apache.hudi:hudi, packaging jar, ${project.version} for hudi-* deps);
import io.trino:trino-root:472 as a BOM for Trino/Airlift version mgmt;
enforce JDK 25 for compile and runtime.
- Add -Phudi-trino profile gating both hudi-trino-plugin and
packaging/hudi-trino-bundle so default builds are unaffected; remove the
obsolete RAT exclusion for hudi-trino-plugin/**; add trino.connector.version
property to the root pom.
- Update hudi-trino-bundle to depend on hudi-trino-plugin and shade its
classes into the published jar (io.trino.plugin.hudi.* stays at its
canonical FQN).
- Add hudi_trino_ci.yml (build + test under JDK 25, asserts
HudiConnectorFactory is present in the bundle jar) and
hudi_trino_compat.yml (nightly SPI-drift compile against trinodb/trino
master).
Connector source porting to Hudi 1.3.0-SNAPSHOT APIs is a separate follow-up.
---
.github/workflows/hudi_trino_ci.yml | 50 +++++++++++++++
.github/workflows/hudi_trino_compat.yml | 55 +++++++++++++++++
hudi-trino-plugin/pom.xml | 104 +++++++++++++++++++++++---------
packaging/hudi-trino-bundle/pom.xml | 6 ++
pom.xml | 13 +++-
5 files changed, 199 insertions(+), 29 deletions(-)
diff --git a/.github/workflows/hudi_trino_ci.yml b/.github/workflows/hudi_trino_ci.yml
new file mode 100644
index 000000000000..82910688c81e
--- /dev/null
+++ b/.github/workflows/hudi_trino_ci.yml
@@ -0,0 +1,50 @@
+name: Hudi Trino Connector CI
+
+on:
+ push:
+ branches:
+ - master
+ - 'release-*'
+ paths:
+ - 'hudi-trino-plugin/**'
+ - 'packaging/hudi-trino-bundle/**'
+ - '.github/workflows/hudi_trino_ci.yml'
+ pull_request:
+ branches:
+ - master
+ - 'release-*'
+ paths:
+ - 'hudi-trino-plugin/**'
+ - 'packaging/hudi-trino-bundle/**'
+ - '.github/workflows/hudi_trino_ci.yml'
+ workflow_dispatch:
+
+concurrency:
+ group: hudi-trino-ci-${{ github.ref }}
+ cancel-in-progress: ${{ !contains(github.ref, 'master') && !contains(github.ref, 'release-') }}
+
+env:
+ MVN_ARGS: -e -ntp -B -V -Dgpg.skip -Djacoco.skip -Pwarn-log
+
+jobs:
+ build-and-test:
+ name: Build and Test (JDK 25)
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v5
+ - name: Set up JDK 25
+ uses: actions/setup-java@v5
+ with:
+ java-version: '25'
+ distribution: 'temurin'
+ cache: maven
+ - name: Build connector and bundle
+ run: ./mvnw $MVN_ARGS -Phudi-trino -pl hudi-trino-plugin,packaging/hudi-trino-bundle -am install -DskipTests
+ - name: Verify bundle contains connector classes
+ run: |
+ BUNDLE_JAR=$(ls packaging/hudi-trino-bundle/target/hudi-trino-bundle-*.jar | grep -v sources | head -n 1)
+ echo "Inspecting $BUNDLE_JAR"
+ jar tf "$BUNDLE_JAR" | grep -E 'io/trino/plugin/hudi/HudiConnectorFactory\.class$' \
+ || (echo "ERROR: HudiConnectorFactory not present in bundle"; exit 1)
+ - name: Run connector tests
+ run: ./mvnw $MVN_ARGS -Phudi-trino -pl hudi-trino-plugin test
diff --git a/.github/workflows/hudi_trino_compat.yml b/.github/workflows/hudi_trino_compat.yml
new file mode 100644
index 000000000000..97162d2fe214
--- /dev/null
+++ b/.github/workflows/hudi_trino_compat.yml
@@ -0,0 +1,55 @@
+name: Hudi Trino SPI Compatibility
+
+on:
+ schedule:
+ - cron: '17 4 * * *'
+ workflow_dispatch:
+
+env:
+ MVN_ARGS: -e -ntp -B -V -Dgpg.skip -Djacoco.skip
+
+jobs:
+ compile-against-trino-master:
+ name: Compile hudi-trino-plugin against trinodb/trino master
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Hudi
+ uses: actions/checkout@v5
+ with:
+ path: hudi
+ - name: Checkout trinodb/trino master
+ uses: actions/checkout@v5
+ with:
+ repository: trinodb/trino
+ ref: master
+ path: trino
+ - name: Set up JDK 25
+ uses: actions/setup-java@v5
+ with:
+ java-version: '25'
+ distribution: 'temurin'
+ cache: maven
+ - name: Read Trino SPI version
+ id: trino-version
+ run: |
+ # trinodb/trino's root pom declares <version>NNN-SNAPSHOT</version>; strip the suffix.
+ VERSION=$(grep -m1 '<version>' trino/pom.xml | sed -E 's|.*<version>([0-9]+)(-SNAPSHOT)?</version>.*|\1|')
+ echo "trino_version=$VERSION" >> "$GITHUB_OUTPUT"
+ echo "Detected Trino version: $VERSION"
+ - name: Compile hudi-trino-plugin against current Trino SPI
+ working-directory: hudi
+ run: |
+ ./mvnw $MVN_ARGS -Phudi-trino \
+ -Dtrino.connector.version=${{ steps.trino-version.outputs.trino_version }} \
+ -pl hudi-trino-plugin -am compile
+ - name: Open issue on failure
+ if: failure()
+ uses: actions/github-script@v7
+ with:
+ script: |
+ github.rest.issues.create({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ title: `hudi-trino-plugin SPI drift detected against Trino ${{ steps.trino-version.outputs.trino_version }}`,
+ body: `Nightly compatibility build failed. See run ${context.runId}.`
+ });
diff --git a/hudi-trino-plugin/pom.xml b/hudi-trino-plugin/pom.xml
index c67ab6a07f51..be6f3a324369 100644
--- a/hudi-trino-plugin/pom.xml
+++ b/hudi-trino-plugin/pom.xml
@@ -1,28 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>io.trino</groupId>
- <artifactId>trino-root</artifactId>
- <version>472</version>
- <!-- Stop looking for the parent on local file system -->
- <relativePath />
+ <groupId>org.apache.hudi</groupId>
+ <artifactId>hudi</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>trino-hudi</artifactId>
- <packaging>trino-plugin</packaging>
- <description>Trino - Hudi connector</description>
+ <artifactId>hudi-trino-plugin</artifactId>
+ <packaging>jar</packaging>
+ <description>Hudi connector for Trino (RFC-105)</description>
<properties>
- <air.compiler.fail-warnings>true</air.compiler.fail-warnings>
- <dep.hudi.version>1.0.2</dep.hudi.version>
+ <!-- Trino SPI / library version this connector compiles against. Bumped via root pom. -->
+ <dep.trino.version>${trino.connector.version}</dep.trino.version>
<trino.parquet.version>1.15.2</trino.parquet.version>
+ <!-- Connector requires JDK 25 to compile and run (matches Trino runtime requirement). -->
+ <hudi.trino.java.version>25</hudi.trino.java.version>
+ <main.basedir>${project.parent.basedir}</main.basedir>
+ <checkstyle.skip>true</checkstyle.skip>
</properties>
+ <dependencyManagement>
+ <dependencies>
+ <!-- Import Trino's parent POM as a BOM. This pulls in version mgmt for io.trino:*,
+ io.airlift:*, jackson, opentelemetry, slice, guice, jakarta.validation, etc.
+ Per RFC-105, Trino versions are authoritative for shared deps. -->
+ <dependency>
+ <groupId>io.trino</groupId>
+ <artifactId>trino-root</artifactId>
+ <version>${dep.trino.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<dependencies>
<dependency>
- <!--Used to test execution in task executor after de-serializing-->
+ <!-- Used to test execution in task executor after de-serializing -->
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
<version>4.0.2</version>
@@ -132,7 +167,7 @@
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-common</artifactId>
- <version>${dep.hudi.version}</version>
+ <version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>io.dropwizard.metrics</groupId>
@@ -156,7 +191,7 @@
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-hive-sync</artifactId>
- <version>${dep.hudi.version}</version>
+ <version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.hudi</groupId>
@@ -168,7 +203,7 @@
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-io</artifactId>
- <version>${dep.hudi.version}</version>
+ <version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>com.google.protobuf</groupId>
@@ -180,7 +215,7 @@
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-sync-common</artifactId>
- <version>${dep.hudi.version}</version>
+ <version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.hudi</groupId>
@@ -380,7 +415,7 @@
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-client-common</artifactId>
- <version>${dep.hudi.version}</version>
+ <version>${project.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
@@ -393,7 +428,7 @@
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-hadoop-common</artifactId>
- <version>${dep.hudi.version}</version>
+ <version>${project.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
@@ -406,7 +441,7 @@
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-java-client</artifactId>
- <version>${dep.hudi.version}</version>
+ <version>${project.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
@@ -463,19 +498,34 @@
<build>
<plugins>
<plugin>
- <groupId>org.basepom.maven</groupId>
- <artifactId>duplicate-finder-maven-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <ignoredResourcePatterns>
- <!-- org.apache.hudi:hudi-client-common and org.apache.hudi:hudi-java-client log4j.properties duplicates -->
- <ignoredResourcePattern>log4j.properties</ignoredResourcePattern>
- <ignoredResourcePattern>log4j-surefire.properties</ignoredResourcePattern>
- </ignoredResourcePatterns>
+ <!-- Override Hudi parent's Java 11 target. Trino SPI requires recent JDK. -->
+ <source>${hudi.trino.java.version}</source>
+ <target>${hudi.trino.java.version}</target>
+ <release>${hudi.trino.java.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>enforce-jdk25</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <requireJavaVersion>
+ <version>[${hudi.trino.java.version},)</version>
+ <message>hudi-trino-plugin requires JDK ${hudi.trino.java.version} or newer.</message>
+ </requireJavaVersion>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
diff --git a/packaging/hudi-trino-bundle/pom.xml b/packaging/hudi-trino-bundle/pom.xml
index 691e2cce38e2..c58d7ae3c80b 100644
--- a/packaging/hudi-trino-bundle/pom.xml
+++ b/packaging/hudi-trino-bundle/pom.xml
@@ -67,6 +67,7 @@
</transformers>
<artifactSet>
<includes combine.children="append">
+ <include>org.apache.hudi:hudi-trino-plugin</include>
<include>org.apache.hudi:hudi-hadoop-common</include>
<include>org.apache.hudi:hudi-common</include>
<include>org.apache.hudi:hudi-client-common</include>
@@ -168,6 +169,11 @@
<dependencies>
<!-- Hoodie -->
+ <dependency>
+ <groupId>org.apache.hudi</groupId>
+ <artifactId>hudi-trino-plugin</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-hadoop-mr-bundle</artifactId>
diff --git a/pom.xml b/pom.xml
index bc2f12137830..fbefb7577389 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,7 +59,6 @@
<module>packaging/hudi-utilities-bundle</module>
<module>packaging/hudi-utilities-slim-bundle</module>
<module>packaging/hudi-timeline-server-bundle</module>
- <module>packaging/hudi-trino-bundle</module>
<module>hudi-examples</module>
<module>hudi-flink-datasource</module>
<module>hudi-kafka-connect</module>
@@ -130,6 +129,8 @@
<hive.avro.version>1.11.4</hive.avro.version>
<presto.version>0.273</presto.version>
<trino.version>390</trino.version>
+ <!-- Trino SPI version that hudi-trino-plugin (RFC-105) compiles against. -->
+ <trino.connector.version>472</trino.connector.version>
<hive.exec.classifier>core</hive.exec.classifier>
<metrics.version>4.1.1</metrics.version>
<orc.spark.version>1.6.0</orc.spark.version>
@@ -682,7 +683,6 @@
<!-- local files not in version control -->
<exclude>**/*.iml</exclude>
<exclude>.mvn/**</exclude>
- <exclude>hudi-trino-plugin/**</exclude>
</excludes>
</configuration>
<executions>
@@ -2271,6 +2271,15 @@
<module>packaging/hudi-metaserver-server-bundle</module>
</modules>
</profile>
+ <profile>
+ <!-- RFC-105: builds the Trino connector and its publishable shaded bundle.
+ Excluded from default builds because it requires JDK 25 and the Trino SPI. -->
+ <id>hudi-trino</id>
+ <modules>
+ <module>hudi-trino-plugin</module>
+ <module>packaging/hudi-trino-bundle</module>
+ </modules>
+ </profile>
<profile>
<id>integration-tests</id>
<activation>