Skip to content

RFC-0066: Native execution support for Hudi MOR tables - #66

Open
jja725 wants to merge 5 commits into
prestodb:mainfrom
jja725:rfc-hudi-mor-native
Open

RFC-0066: Native execution support for Hudi MOR tables#66
jja725 wants to merge 5 commits into
prestodb:mainfrom
jja725:rfc-hudi-mor-native

Conversation

@jja725

@jja725 jja725 commented Aug 17, 2026

Copy link
Copy Markdown

Summary

This RFC proposes native execution (Prestissimo/Velox) support for SELECT queries on Hudi MERGE_ON_READ tables, with the query type — snapshot (default) or read-optimized — chosen per query through a catalog session property, mirroring Spark's hoodie.datasource.query.type. The main piece is a native Hudi connector in Velox, built around a C++ HoodieLogFormat reader and record merger, structured like the existing Iceberg connector. It also covers the Presto native protocol, explicit Hudi handle conversion, coordinator-side compatibility validation, and native catalog registration.

The revised design treats Java Hudi behavior as the correctness oracle while acknowledging that native semantic parity will be incremental. Each release declares a compatibility matrix for table versions, log formats, merge modes, payloads, key generation, and schema evolution. Unsupported table configurations fail during planning, and unsupported block details discovered on the worker fail the query; there is no JVM fallback from native execution.

Query-level selection needs no SQL grammar changes: hudi.query_type = snapshot | read_optimized, defaulted by a hudi.default-query-type catalog config (OSS default snapshot, matching the JVM connector). Read-optimized is expressed entirely at split generation — latest base files, empty log list — so the native protocol and reader are unchanged by it, and no separate _ro table registration is needed. Incremental (change-pulling) queries and CDC output are non-goals: Spark-only today, natural follow-up RFC material on top of this machinery.

For Hudi tables read through the Hive connector, the RFC follows Trino's model (hive.hudi-catalog-name, Trino 411+): an opt-in, planning-time redirect to the Hudi catalog rather than extending the Hive connector's own Hudi integration to MOR snapshot. Redirected queries pick up compatibility validation and the query-type surface; without the redirect, native workers reject Hive splits carrying delta-log paths instead of silently reading base files. Presto has no table redirection today, so this adds one additive ConnectorMetadata SPI default method modeled on Trino's redirectTable, generic enough for Iceberg and Delta reuse.

Other key points:

  • Data predicates remain above the merged scan, matching the existing JVM connector behavior.
  • The initial in-memory merge index is visible to Velox memory accounting but non-reclaimable, so native splits have a coordinator- and worker-enforced log-byte limit (read-optimized queries are not subject to it).
  • The pure-C++ implementation includes a maintenance and Hudi-upgrade policy backed by JVM/native differential fixtures.

Related:

@jja725
jja725 force-pushed the rfc-hudi-mor-native branch from 8311e72 to 49eeb94 Compare August 17, 2026 21:19
@jja725 jja725 changed the title Add RFC for native execution support for Hudi MOR tables RFC-0066: Native execution support for Hudi MOR tables Aug 17, 2026
@jja725
jja725 force-pushed the rfc-hudi-mor-native branch from 49eeb94 to 0508137 Compare August 17, 2026 21:32
@jja725
jja725 force-pushed the rfc-hudi-mor-native branch from 0508137 to 31c8089 Compare August 17, 2026 22:03
jja725 added 4 commits August 17, 2026 15:45
Make the query type a per-query choice via catalog session properties
(hudi.query_type = snapshot | read_optimized | incremental), mirroring
Spark's hoodie.datasource.query.type, and move incremental queries from
the non-goals into scope.

Incremental semantics follow Spark's MergeOnReadIncrementalRelationV2:
the coordinator resolves the requested range to an explicit instant set
(completion-time based on Hudi 1.x timelines), lists the latest merged
file slices of the file groups touched by those commits, and the reader
merges fully before filtering rows by _hoodie_commit_time membership in
the set. Output is latest_state full merged records, not partial images.
Validation mirrors the Spark reader's: populated meta fields required,
missing begin instant rejected, and ranges broken by cleaning/archiving
fail with the earliest servable instant instead of returning an
incomplete change set.

Since no Presto or Trino incremental behavior exists, the correctness
oracle for incremental queries is the Hudi Spark reader; snapshot reads
keep the JVM HudiRecordCursors oracle. Time travel and CDC-format output
remain non-goals, with the instant-set machinery noted as their base.
Pull incremental queries back out of scope: they return to the
non-goals, with the split and reader machinery noted as their natural
base and a follow-up RFC as the path. No SQL engine offers Hudi
incremental reads today, and carrying their semantics (instant-set
resolution, retention validation, a Spark-only correctness oracle)
tripled the surface of this proposal.

Query-level selection stays, reduced to two values: hudi.query_type =
snapshot | read_optimized. The OSS default remains snapshot, matching
the JVM presto-hudi behavior this RFC treats as its oracle; a new
hudi.default-query-type catalog config lets a deployment default to
read_optimized instead - for fleets migrating MOR workloads from
Hive-connector setups whose split listing already resolves Hudi tables
to base files, so results and cost stay stable through the migration.

With incremental gone the query type no longer travels to the worker:
read_optimized is fully expressed by a split with an empty log-file
list, so the native protocol and reader revert to their original shape.
Answer the "what about Hudi tables read through the Hive connector?"
question the way Trino did (hive.hudi-catalog-name, Trino 411+):
redirect, don't reimplement. A new section 4 adds an opt-in Hive
connector config that redirects Hudi-format tables to the named Hudi
catalog at planning time, so existing hive.* SQL reaches the native
path unchanged. Extending the Hive connector's own Hudi integration to
MOR snapshot becomes an explicit non-goal: the Hive protocol carries
log files only as untyped customSplitInfo strings, offers no
planning-time hook for compatibility validation, and would double the
differential test surface.

Redirected queries pick up the full Hudi connector surface, including
hudi.query_type and the catalog default, so a deployment can make the
redirect behavior-neutral (default-query-type=read_optimized) with
snapshot as a per-query opt-in. Without the redirect, native workers
keep rejecting Hive splits that carry delta-log paths instead of
silently reading base files.

Presto has no table redirection today, so this amends the adoption
plan: one additive ConnectorMetadata default method modeled on Trino's
redirectTable, generic enough for Iceberg and Delta reuse (listed as a
follow-up). Adds a redirection risk item (policy evaluation moves to
the target catalog), a rollout-order bullet, and redirection tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant