[836] xtable-spark-runtime: thin drop-in Spark bundle (Hudi 0.x)#843
Open
vinishjail97 wants to merge 6 commits into
Open
[836] xtable-spark-runtime: thin drop-in Spark bundle (Hudi 0.x)#843vinishjail97 wants to merge 6 commits into
vinishjail97 wants to merge 6 commits into
Conversation
Ports the xtable-spark-runtime packaging slice onto the Hudi 0.x line
(main-hudi-0x, Hudi 0.14 / Spark 3.4). New thin, relocated bundle that
runs an incremental XTable sync inside a Spark job; engines are provided
by the cluster, never bundled.
Module:
- xtable-spark-runtime_${scala.binary.version}: xtable-core compile;
Spark/Hadoop and the engines (Hudi/Iceberg/Delta) provided. Curated
shade allowlist (xtable modules + guava/protobuf/commons-cli relocated);
avro/parquet/jackson NOT relocated (exchanged with the engines). Thin
~3.7 MB bundle.
- XTableSparkSync: standalone spark-submit entry point (Apache Commons CLI).
- XTableSyncService / TableSyncSpec: build an INCREMENTAL ConversionConfig
and run ConversionController.sync; target metadata path = source data
path (required by Hudi; Iceberg data lives under <basePath>/data).
Hudi 0.14 specifics (vs the Hudi 1.x variant on main):
- No hudi-hadoop-common (that split is 1.x); hudi-common provides FSUtils.
- Engine classpath uses the hudi-spark bundle (its regenerated Avro model
classes link on Avro 1.12, which Iceberg 1.9.2 requires) plus
hudi-java-client for the Hudi target's Java write client, with the raw
hudi-common excluded so the bundle's clean DecimalWrapper wins.
ConversionTargetFactory: make ServiceLoader discovery resilient so a
subset of engines works when others are absent (warn + skip on
LinkageError/ServiceConfigurationError; name-based Delta-Kernel check).
ITXTableSparkRuntimeBundle: spark-submits the shaded jar for one case per
direction across Hudi, Iceberg and Delta (source and target), engines on
a flat classpath, asserting data-equivalence over comparable scalar
columns. Requires a Spark 3.4 SPARK_HOME; skipped otherwise.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vinishjail97
commented
Jul 10, 2026
…sing, RFC) Publish the shaded jar as the MAIN artifact with a dependency-reduced POM (shadedArtifactAttached=false, createDependencyReducedPom=true), matching iceberg-spark-runtime / hudi-spark-bundle. Resolving the coordinate via a Maven dependency or --packages now yields the relocated bundle and pulls no un-relocated transitive deps; --jars is equivalent. The thin main jar + separate -bundle classifier (which re-introduced the cluster guava clash) is gone. IT findBundleJar() now picks the shaded main jar. Pass release/scripts/validate_shaded_license_coverage.sh (the existing allowlist gate): the shade <includes> must equal the runtime dependency tree, so jackson / scala-library / log4j-1.2-api - which every Spark runtime supplies - are declared provided (dropped from the tree, kept off the shaded jar) and excluded from the IT's flat engine classpath so Spark's own copies win. avro/parquet stay on the flat classpath (the engine's newer avro must win over Spark 3.4's). Bundled-dependency licensing: add META-INF/LICENSE-bundled and NOTICE-bundled (wired via IncludeResourceTransformer) attributing the only bundled third-party - guava's closure (Apache-2.0) and commons-cli (Apache-2.0), plus checker-qual (MIT). Remove the dead protobuf-java allowlist entry and relocation: protobuf resolves as provided and was never bundled. RFC-3: scope v1 to the CLI (XTableSparkSync); mark the config-only XTableSyncListener on-ramp (and XTableSparkConfig / PlanTargetResolver) as a deferred follow-up. Fix the activation example to the shipped CLI and document the required engine Avro version + flat-classpath placement. XTableSyncService: normalize sourceFormat with Locale.ROOT. Root pom: exclude the shade-generated dependency-reduced-pom.xml from spotless (no license header; CI runs clean install). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Consolidate repeated rationale in the bundle pom (no functional change): - Tell the hudi-common DecimalWrapper / Avro-1.8-1.9 story once (on the hudi-spark bundle dep); the hudi-java-client exclusion just points to it. - State "engine Avro must win on a flat classpath" once (engine-classpath plugin); the avro dep and excludeGroupIds comments reference it. - Explain jackson/scala-library are Spark-supplied once. - Fix a stale "Spark 3.5" reference to Spark 3.4 (this is the Hudi 0.x line). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add main-hudi-0x to the push and pull_request branch filters of both workflows (same change as apache#841) so CI runs on PRs targeting the Hudi 0.x release line, including this one. A pull_request workflow's branch filter takes effect from the PR's own branch, so this makes CI fire on apache#843. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…k-submit stdout off-thread - ConversionTargetFactory: hasNext() resolves provider classes lazily and can throw ServiceConfigurationError too, so move it inside the existing ServiceConfigurationError|LinkageError guard alongside next(). - ITXTableSparkRuntimeBundle: drain spark-submit stdout on a background thread so a hung process is caught by waitFor(10min) instead of blocking forever on readOutput() reading until EOF.
main-hudi-0x was deleted and replaced by branch-0.4 (the 0.4.0 release line), so update the push/pull_request branch filters accordingly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft for review — ports
xtable-spark-runtimeonto the Hudi 0.x line (main-hudi-0x, Hudi 0.14 / Spark 3.4). A thin, relocated Spark bundle that runs an incremental XTable sync in-job; engines are provided by the cluster, never bundled.Why (context)
Per the [DISCUSS] rc1 for 0.4.0 thread, 0.4.0 is cut from the Hudi 0.x line and
xtable-spark-runtimeis a headline on-ramp (a better path than the standalone utilities jar). This is the Hudi-0.x counterpart of the packaging PR #838 (which targetsmain/ Hudi 1.x).Module
xtable-spark-runtime_${scala.binary.version}—xtable-corecompile; Spark/Hadoop + enginesprovided. Curated shade allowlist (xtable modules + guava/protobuf/commons-cli relocated); avro/parquet/jackson not relocated (exchanged with the engines). Thin ~3.7 MB bundle.XTableSparkSync— standalonespark-submitentry point (Apache Commons CLI).XTableSyncService/TableSyncSpec— build anINCREMENTALConversionConfigand runConversionController.sync; the target metadata path is the source data path (required by Hudi; Iceberg data lives under<basePath>/data).ConversionTargetFactory— resilient ServiceLoader discovery so a subset of engines works when others are absent (warn + skip onLinkageError/ServiceConfigurationError; name-based Delta-Kernel check).Hudi 0.14 specifics (vs the Hudi 1.x variant on
main)hudi-hadoop-common(that split is 1.x);hudi-commonstill providesFSUtils.hudi-sparkbundle — its regenerated Avro model classes (e.g.DecimalWrapper) link on Avro 1.12 (required by Iceberg 1.9.2), whereas rawhudi-common's are Avro-1.8/1.9-generated and referenceTimeConversions.TimeConversion, removed in Avro ≥1.10. Plushudi-java-clientfor the Hudi target's Java write client, with rawhudi-commonexcluded so the bundle's clean class wins.Testing
ITXTableSparkRuntimeBundlespark-submits the shaded jar for one case per direction across Hudi, Iceberg and Delta (source and target), engines on a flatspark.driver.extraClassPath, asserting data-equivalence over comparable scalar columns (local-timestamp columns excluded — HUDI-7088). Verified locally green (4/4) on a Spark 3.4.3SPARK_HOME. The IT isSPARK_HOME-gated, so CI skips it.🤖 Generated with Claude Code