All posts

Apache XTable compatibility: what converts and what doesn't

The 19 types, six partition transforms and file model XTable uses, tested with day and bucket partitions: where Delta makes generated columns, where Hudi rejects bucketing, and what never crosses.

9 min read Lakehouse

TL;DR

Compatibility is per feature, not per format pair. The model has 19 types and six partition transforms, and anything outside that either fails with a named exception or is left out.

  • Sources are Hudi, Iceberg, Delta, Paimon and Parquet. Targets are Hudi, Iceberg and Delta.
  • An Iceberg table with decimal, timestamp, array, struct and map columns converted to Delta and Hudi with the same types.
  • Partition transforms cross differently. Delta turns time and bucket transforms into generated columns named xtable_partition_col_<TRANSFORM>_<field>, and a Hudi target rejects BUCKET outright.
  • The Delta implementation matters. The Delta Kernel target, which the Spark runtime selects on newer Spark versions, cannot write generated columns, so a day or bucket partition to Delta fails there and succeeds with RunSync’s default target.
  • Rows hidden by Hudi log files, Delta deletion vectors or Iceberg delete files stay visible in the target.
  • A partial failure is normal: one target can succeed while another fails in the same run.

“Does format A convert to format B?” is the wrong question, because most combinations do. The useful question is whether the features your table uses survive, and the answer sits in a few classes. They are listed here, with a tested table of how they behave.

Three groups: types and files that convert as is, partition columns that change shape, and Hudi log files, deletion vectors, Iceberg delete files and bucket partitions to a Hudi target that do not convert

Sources and targets

The source of truth is xtable-conversion-defaults.yaml plus the converters config:

Format Source Target How it is registered
Hudi Yes Yes Defaults file
Iceberg Yes Yes Defaults file
Delta Yes Yes, with a Kernel alternative Defaults file, org.apache.xtable.kernel classes through a converters config
Paimon Yes No Defaults file, source provider only
Parquet Yes No Converters config only

A target equal to the source format is skipped by the controller, so HUDI to HUDI does nothing.

Schema: the 19 types

Every schema passes through InternalSchema, whose types are RECORD, ENUM, LIST, MAP, UNION, UUID, FIXED, STRING, BYTES, INT, LONG, FLOAT, DOUBLE, BOOLEAN, NULL, DATE, DECIMAL, TIMESTAMP and TIMESTAMP_NTZ. Each source extractor maps into that set and each target maps out of it. Types with no entry fail with a named exception, for example Unsupported type: <name> from the Delta and Iceberg extractors and Unsupported Paimon type: <type> from the Paimon one. There is no time-of-day, interval or variant type in the model.

The 19 internal types grouped into scalars, dates and numbers, nested types and null

An Iceberg table with a decimal, a timestamp, an array, a struct and a map converted to Delta and Hudi with the types intact:

order_id bigint, customer_id bigint, amount decimal(12,2), status string,
order_ts timestamp, tags array<string>, addr struct<city:string,zip:string>,
attrs map<string,string>

That is the Delta read. The Hudi read matched it, apart from the partition column covered next.

Partitions: six transforms, three behaviours

A partition field carries YEAR, MONTH, DAY, HOUR, VALUE (identity) or BUCKET.

Time transforms become Delta generated columns, identity partitions are plain columns everywhere, and bucket partitions are rejected by a Hudi target

Target What it does with a transform
Iceberg Maps all six to Iceberg transforms. In the other direction an Iceberg source accepts year, month, day, hour, bucket and identity, and anything else, such as truncate, throws NotSupportedException with the transform’s name
Delta Has no partition transforms, so the default target adds a generated column and partitions on it. Time transforms use CAST, DATE_FORMAT or YEAR, and bucket uses MOD(HASH(...)). The Delta Kernel target cannot write generated columns
Hudi Partition columns come from the path. BUCKET is rejected, and the partition spec and record key fields cannot change after the table is created

Two tables, run on Spark 3.5.9 with XTable 0.5.0-incubating, show it. Both are Iceberg tables from a Hadoop catalog, synced to Delta and Hudi with tableDataPath set.

PARTITIONED BY (days(order_ts)). The sync succeeded for both targets. Delta gained a partition column:

partitionColumns ['xtable_partition_col_DAY_order_ts']   (type date)

The Hudi copy read order_ts as a string, because the Hudi partition value comes from the path. A query that filters on order_ts as a timestamp needs a cast on the Hudi side.

PARTITIONED BY (bucket(4, order_id)). Delta succeeded, with xtable_partition_col_BUCKET_order_id of type int. The Hudi target failed:

org.apache.xtable.exception.PartitionSpecException: Bucket partition is not yet supported by Hudi targets
INFO  ConversionController:215 - Sync is successful for the following formats DELTA
ERROR ConversionController:219 - Sync failed for the following formats HUDI

That is a partial failure from a real run: one target committed, one did not, and both log lines appeared. Time transforms on YEAR, MONTH and HOUR and a Hudi, Delta or Paimon source with those transforms were not tested.

The Delta Kernel target cannot write them. Both tables above went through RunSync, whose default Delta target uses delta-core. The Spark runtime selects Delta Kernel by itself on Spark 3.5 and newer. Run on Spark 3.5.9, the same two tables failed on the Delta target:

KernelException: Unsupported Delta writer feature: table `file:/.../cmp_day` requires writer
table feature "[generatedColumns]" which is unsupported by this version of Delta Kernel.

So which Delta implementation you get decides whether a time or bucket partition can reach Delta at all. The Kernel target also cannot evolve the schema of an existing Delta table. After a column was added to an Iceberg source, the second sync through the Spark runtime failed with Schema evolution on an existing Delta table is not supported by DeltaKernelConversionTarget, and RunSync’s default target synced it. Identity partitions need no generated column and converted through Kernel in the first sync lab.

A Delta source goes the other way: it reads those generated expressions back into transforms, and an expression it cannot parse fails with Unsupported expression for generated expression, or Unsupported date format expression for an unrecognised pattern.

Files, statistics and what is left out

A file in the model has a path, a size, a record count, partition values and column statistics. Statistics come from each source’s metadata and from Parquet footers where that is missing, as the architecture post shows.

What each source leaves out: Hudi log files, Delta deletion vector pairs, Iceberg delete files and Paimon non-top-level files

What the code leaves out:

  • Hudi log files. The Hudi file extractor filters them out with FSUtils.isLogFile, and its comments say merge-on-read updates are not captured. A Merge-on-Read table converts as its read-optimized view.
  • Delta deletion vectors. When Delta attaches a deletion vector to a file it writes an add and a remove for the same path. DeltaConversionSource recognises that pair and drops both from the change, so the data file stays as it was and the deleted rows stay visible in the target.
  • Iceberg delete files. The Iceberg source never reads them. The classes mention no delete handling.
  • Branches, tags and generated columns on the source side. Nothing in the model represents them.

The Merge-on-Read result and the Hudi version rules are in Apache Hudi as an XTable source.

Engines and catalogs

XTable writes metadata. Whether a particular engine reads it is a separate question, and the source has nothing to say about Flink, Presto, Athena or Trino as readers. The project’s documentation lists the engines. Spark read all three formats in the runs here, and nothing else was verified. Treat any other engine as untested until you query the converted table in it.

Validating a new combination

Before you rely on a pair, run this once:

  1. Sync a small copy of the real table, including every partition transform and nested type it uses.
  2. Compare row counts, the schema and a per-partition count across all formats.
  3. Filter on the partition column in each reader, because that is where Delta’s generated columns and Hudi’s string columns differ.
  4. Run a second sync after one more commit, so the incremental path is tested too.
  5. Look for the failure line in the log, not only the success line.

The comparison snippet is in the Hudi source post.

What changed in 0.5.0

From the release notes and the code:

  • Hudi table version 9 in the source and, on request, the target, and a column statistics index built for existing Hudi targets. A Hudi target made by 0.4.0 takes one snapshot pass to get it.
  • Delta: nested field IDs carried into the converted schema, partition values resolved by physical name under column mapping.
  • Parquet: record counts populated, and source partitioning in the Spark runtime.
  • Fixed after the release and not in it: Iceberg data files without column stats, Delta column mapping stats, and nested stats in the Delta Kernel source.

Checked against the source

Claim Where
The 19 types and six transforms InternalType, PartitionTransformType
Type and partition error messages DeltaSchemaExtractor, IcebergSchemaExtractor, PaimonSchemaExtractor, IcebergPartitionSpecExtractor, DeltaPartitionExtractor
Delta generated column names and expressions DeltaPartitionExtractor constants
Bucket rejected, spec and key fixed for Hudi targets HudiTableManager, HudiConversionTarget
Log files skipped HudiDataFileExtractor
Deletion vector add and remove pair dropped DeltaConversionSource
No Iceberg delete handling IcebergConversionSource, IcebergDataFileExtractor

The day and bucket results are from one run each in Docker. The rest of the transform and type matrix was read from the code and not run.

Key takeaways

Compatibility is a list of features, and the list is short enough to check before you start. Types and file metadata convert. Partitions convert in three different ways depending on the target. Anything that lives outside the file list is lost: log files, delete files and deletion vectors. Test your own columns and partition transforms once, in every reader, before you trust a pair.

References

Trademarks

Apache XTable (incubating), Apache Hudi, Apache Iceberg, Apache Paimon, Apache Parquet, Apache Spark and Apache are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries. Delta Lake is a trademark of the Linux Foundation. All other marks are the property of their respective owners.

Found this useful?

These posts and tools are free. If one saved you an afternoon, you can buy me a coffee.

Buy me a coffee

Comments

Questions, corrections and reviews are welcome. Sign in with GitHub to post; comments are stored in this site's public GitHub Discussions.