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
103 changes: 103 additions & 0 deletions .github/workflows/hudi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
#
# 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.
#

name: Hudi

on:
workflow_dispatch:
push:
branches:
- master
- branch-*
pull_request:
branches:
- master
- branch-*

concurrency:
group: hudi-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
test-hudi:
name: Test Hudi (${{ matrix.sparkver }} / JDK${{ matrix.javaver }} / Scala${{ matrix.scalaver }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- sparkver: "3.0"
scalaver: "2.12"
javaver: "8"
- sparkver: "3.1"
scalaver: "2.12"
javaver: "8"
- sparkver: "3.2"
scalaver: "2.12"
javaver: "8"
- sparkver: "3.3"
scalaver: "2.12"
javaver: "8"
- sparkver: "3.4"
scalaver: "2.12"
javaver: "17"
- sparkver: "3.5"
scalaver: "2.12"
javaver: "17"
- sparkver: "3.5"
scalaver: "2.12"
javaver: "21"
Comment on lines +43 to +63
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we simplify this like so, similar to the structure we have in flink/paimon related yml files?

      matrix:
        paimon: [ "0.15" ]
        javaver: [ "8", "17" ]
        scalaver: [ "2.12" ]
        module: [ "thirdparty/auron-hudi" ]
        sparkver: [ "spark-3.5" ]


steps:
- name: Checkout Auron
uses: actions/checkout@v6

- name: Setup Java and Maven cache
uses: actions/setup-java@v5
with:
distribution: 'adopt-hotspot'
java-version: ${{ matrix.javaver }}
cache: 'maven'

- name: Build dependencies (skip tests)
run: >
./build/mvn -B install
-pl thirdparty/auron-hudi
-am
-Pscala-${{ matrix.scalaver }}
-Pspark-${{ matrix.sparkver }}
-Phudi-0.15
Copy link
Contributor

Choose a reason for hiding this comment

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

If in the future we will be supporting multiple versions of hudi? Can we model this to be similar to how we have it for our other third party plugins? (check comment above for more info)

-Prelease
-DhudiEnabled=true
-DskipTests

- name: Test Hudi Module
run: >
./build/mvn -B test
-pl thirdparty/auron-hudi
-Pscala-${{ matrix.scalaver }}
-Pspark-${{ matrix.sparkver }}
-Phudi-0.15
-Prelease
-DhudiEnabled=true

- name: Upload reports
if: failure()
uses: actions/upload-artifact@v6
with:
name: auron-hudi-${{ matrix.sparkver }}-jdk${{ matrix.javaver }}-test-report
path: thirdparty/auron-hudi/target/surefire-reports
33 changes: 32 additions & 1 deletion auron-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ SUPPORTED_UNIFFLE_VERSIONS=("0.10")
SUPPORTED_PAIMON_VERSIONS=("1.2")
SUPPORTED_FLINK_VERSIONS=("1.18")
SUPPORTED_ICEBERG_VERSIONS=("1.9")
SUPPORTED_HUDI_VERSIONS=("0.15")

# -----------------------------------------------------------------------------
# Function: print_help
Expand All @@ -63,6 +64,7 @@ print_help() {
IFS=','; echo " --uniffle <VERSION> Specify Uniffle version (e.g. ${SUPPORTED_UNIFFLE_VERSIONS[*]})"; unset IFS
IFS=','; echo " --paimon <VERSION> Specify Paimon version (e.g. ${SUPPORTED_PAIMON_VERSIONS[*]})"; unset IFS
IFS=','; echo " --iceberg <VERSION> Specify Iceberg version (e.g. ${SUPPORTED_ICEBERG_VERSIONS[*]})"; unset IFS
IFS=','; echo " --hudi <VERSION> Specify Hudi version (e.g. ${SUPPORTED_HUDI_VERSIONS[*]})"; unset IFS

echo " -h, --help Show this help message"
echo
Expand All @@ -77,7 +79,8 @@ print_help() {
"--celeborn ${SUPPORTED_CELEBORN_VERSIONS[*]: -1}" \
"--uniffle ${SUPPORTED_UNIFFLE_VERSIONS[*]: -1}" \
"--paimon ${SUPPORTED_PAIMON_VERSIONS[*]: -1}" \
"--iceberg ${SUPPORTED_ICEBERG_VERSIONS[*]: -1}"
"--iceberg ${SUPPORTED_ICEBERG_VERSIONS[*]: -1}" \
"--hudi ${SUPPORTED_HUDI_VERSIONS[*]: -1}"
exit 0
}

Expand Down Expand Up @@ -133,6 +136,7 @@ CELEBORN_VER=""
UNIFFLE_VER=""
PAIMON_VER=""
ICEBERG_VER=""
HUDI_VER=""

# -----------------------------------------------------------------------------
# Section: Argument Parsing
Expand Down Expand Up @@ -284,6 +288,27 @@ while [[ $# -gt 0 ]]; do
exit 1
fi
;;
--hudi)
if [[ -n "$2" && "$2" != -* ]]; then
HUDI_VER="$2"
if ! check_supported_version "$HUDI_VER" "${SUPPORTED_HUDI_VERSIONS[@]}"; then
print_invalid_option_error Hudi "$HUDI_VER" "${SUPPORTED_HUDI_VERSIONS[@]}"
fi
if [ -z "$SPARK_VER" ]; then
echo "ERROR: Building hudi requires spark at the same time, and only Spark versions 3.0 to 3.5 are supported."
exit 1
fi
if [ "$SPARK_VER" != "3.0" ] && [ "$SPARK_VER" != "3.1" ] && [ "$SPARK_VER" != "3.2" ] && [ "$SPARK_VER" != "3.3" ] && [ "$SPARK_VER" != "3.4" ] && [ "$SPARK_VER" != "3.5" ]; then
echo "ERROR: Building hudi requires spark versions are 3.0 to 3.5."
exit 1
fi
shift 2
else
IFS=','; echo "ERROR: Missing argument for --hudi," \
"specify one of: ${SUPPORTED_HUDI_VERSIONS[*]}" >&2; unset IFS
exit 1
fi
;;
--flinkver)
if [[ -n "$2" && "$2" != -* ]]; then
FLINK_VER="$2"
Expand Down Expand Up @@ -395,6 +420,10 @@ fi
if [[ -n "$ICEBERG_VER" ]]; then
BUILD_ARGS+=("-Piceberg-$ICEBERG_VER")
fi
if [[ -n "$HUDI_VER" ]]; then
BUILD_ARGS+=("-Phudi-$HUDI_VER")
BUILD_ARGS+=("-DhudiEnabled=true")
fi

MVN_ARGS=("${CLEAN_ARGS[@]}" "${BUILD_ARGS[@]}")

Expand Down Expand Up @@ -422,6 +451,7 @@ get_build_info() {
"paimon.version") echo "${PAIMON_VER}" ;;
"flink.version") echo "${FLINK_VER}" ;;
"iceberg.version") echo "${ICEBERG_VER}" ;;
"hudi.version") echo "${HUDI_VER}" ;;
"build.timestamp") echo "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" ;;
*) echo "" ;;
esac
Expand All @@ -439,6 +469,7 @@ for key in \
"paimon.version" \
"flink.version" \
"iceberg.version" \
"hudi.version" \
"build.timestamp"; do
value="$(get_build_info "$key")"
if [[ -n "$value" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion dev/reformat
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fi
sparkver=spark-3.5
for celebornver in celeborn-0.5 celeborn-0.6
do
run_maven -P"${sparkver}" -Pceleborn,"${celebornver}" -Puniffle,uniffle-0.10 -Ppaimon,paimon-1.2 -Pflink,flink-1.18 -Piceberg,iceberg-1.9
run_maven -P"${sparkver}" -Pceleborn,"${celebornver}" -Puniffle,uniffle-0.10 -Ppaimon,paimon-1.2 -Phudi,hudi-0.15 -Pflink,flink-1.18 -Piceberg,iceberg-1.9
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

-Phudi,hudi-0.15 enables a hudi profile that doesn't appear to exist in the root pom (only hudi-0.15 is defined). This will at least emit Maven warnings during reformat and may hide real profile issues; consider dropping the nonexistent hudi profile and only enabling -Phudi-0.15 (or just -Phudi-0.15 consistent with auron-build.sh).

Suggested change
run_maven -P"${sparkver}" -Pceleborn,"${celebornver}" -Puniffle,uniffle-0.10 -Ppaimon,paimon-1.2 -Phudi,hudi-0.15 -Pflink,flink-1.18 -Piceberg,iceberg-1.9
run_maven -P"${sparkver}" -Pceleborn,"${celebornver}" -Puniffle,uniffle-0.10 -Ppaimon,paimon-1.2 -Phudi-0.15 -Pflink,flink-1.18 -Piceberg,iceberg-1.9

Copilot uses AI. Check for mistakes.

done

Expand Down
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1099,6 +1099,17 @@
</properties>
</profile>

<profile>
<id>hudi-0.15</id>
<modules>
<module>thirdparty/auron-hudi</module>
</modules>
<properties>
<hudiVersion>0.15.0</hudiVersion>
<hudiEnabled>true</hudiEnabled>
</properties>
</profile>

<profile>
<id>flink-1.18</id>
<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,12 @@ public class SparkAuronConfiguration extends AuronConfiguration {
.withDescription("Enable PaimonScanExec operation conversion to native Auron implementations.")
.withDefaultValue(true);

public static final ConfigOption<Boolean> ENABLE_HUDI_SCAN = new SQLConfOption<>(Boolean.class)
.withKey("auron.enable.hudi.scan")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should there be a granularity for COW tables?

.withCategory("Operator Supports")
.withDescription("Enable Hudi scan operation conversion to native Auron implementations.")
.withDefaultValue(true);

public static final ConfigOption<Boolean> ENABLE_PROJECT = new SQLConfOption<>(Boolean.class)
.withKey("auron.enable.project")
.withCategory("Operator Supports")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ object AuronConverters extends Logging {
case e: BroadcastExchangeExec if enableBroadcastExchange =>
tryConvert(e, convertBroadcastExchangeExec)
case e: FileSourceScanExec if enableScan => // scan
tryConvert(e, convertFileSourceScanExec)
extConvertProviders.find(p => p.isEnabled && p.isSupported(e)) match {
case Some(provider) => tryConvert(e, provider.convert)
case None => tryConvert(e, convertFileSourceScanExec)
}
case e: ProjectExec if enableProject => // project
tryConvert(e, convertProjectExec)
case e: FilterExec if enableFilter => // filter
Expand Down
121 changes: 121 additions & 0 deletions thirdparty/auron-hudi/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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>org.apache.auron</groupId>
<artifactId>auron-parent_${scalaVersion}</artifactId>
<version>${project.version}</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>auron-hudi_${scalaVersion}</artifactId>
<packaging>jar</packaging>
<name>Apache Auron Hudi ${hudiVersion} ${scalaVersion}</name>

<dependencies>
<dependency>
<groupId>org.apache.auron</groupId>
<artifactId>spark-extension_${scalaVersion}</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-spark${shortSparkVersion}-bundle_${scalaVersion}</artifactId>
<version>${hudiVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scalaVersion}</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest_${scalaVersion}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_${scalaVersion}</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-sql_${scalaVersion}</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-catalyst_${scalaVersion}</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-hive_${scalaVersion}</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.auron</groupId>
<artifactId>spark-extension-shims-spark_${scalaVersion}</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<executions>
<execution>
<id>hudi-spark-version-compat</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>hudiEnabled</property>
<regex>true</regex>
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The enforcer rule hudiEnabled uses regex true without anchors, so values like true1 would incorrectly pass. Anchor the regex (e.g., ^true$) to ensure only the exact expected value is accepted.

Suggested change
<regex>true</regex>
<regex>^true$</regex>

Copilot uses AI. Check for mistakes.
<regexMessage>Hudi module requires hudiEnabled=true.</regexMessage>
</requireProperty>
<requireProperty>
<property>shortSparkVersion</property>
<regex>3\.0|3\.1|3\.2|3\.3|3\.4|3\.5</regex>
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The shortSparkVersion regex is not anchored, so unsupported values like 3.10 would match the 3\.1 alternative and incorrectly pass. Anchor the regex to the full string (e.g., ^(3\.0|3\.1|3\.2|3\.3|3\.4|3\.5)$).

Suggested change
<regex>3\.0|3\.1|3\.2|3\.3|3\.4|3\.5</regex>
<regex>^(3\.0|3\.1|3\.2|3\.3|3\.4|3\.5)$</regex>

Copilot uses AI. Check for mistakes.
<regexMessage>Hudi integration supports Spark 3.0-3.5 only. Current: ${shortSparkVersion}</regexMessage>
</requireProperty>
<requireProperty>
<property>hudiVersion</property>
<regex>0\.15\.0</regex>
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

The hudiVersion regex is not anchored, so a version like 0.15.0-SNAPSHOT could still match 0\.15\.0 and pass. If the intent is to pin strictly to 0.15.0, anchor the regex (e.g., ^0\.15\.0$).

Suggested change
<regex>0\.15\.0</regex>
<regex>^0\.15\.0$</regex>

Copilot uses AI. Check for mistakes.
<regexMessage>Hudi integration supports only Hudi 0.15.0. Current: ${hudiVersion}</regexMessage>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# 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.
#

org.apache.spark.sql.auron.hudi.HudiConvertProvider
Loading
Loading