Repository navigation
feat(agent): add Hudi Architect Agent to assist with designing pipelines - #19380
Conversation
|
Thanks for contributing this. Seems valuable. |
1a9586e to
c98712c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19380 +/- ##
============================================
- Coverage 80.22% 80.21% -0.01%
- Complexity 34669 34671 +2
============================================
Files 2546 2546
Lines 142452 142452
Branches 17330 17330
============================================
- Hits 114281 114272 -9
- Misses 20265 20272 +7
- Partials 7906 7908 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
hudi-agent
left a comment
There was a problem hiding this comment.
Thanks for the docs update! This adds a well-structured, tiered Hudi table-design Skill, and the hoodie.* config keys, enum values, and defaults I spot-checked against the 1.2.0 source (RLI file-group configs and their deprecated aliases, hoodie.compaction.target.io MB units, hoodie.clean.failed.writes.policy, RECORD_LEVEL_INDEX/GLOBAL_RECORD_LEVEL_INDEX, key generators, HoodieSparkKryoRegistrar) all check out — nicely validated. The main thing to reconcile is a contradiction in the compaction-target-IO guidance between decision-tables.md and the other two reference files, plus a couple of minor config-value/arithmetic nits in the derivation tables. Please have a Hudi committer or PMC member confirm the design guidance before merge.
|
|
||
| **Never emit a fixed 1000 / 1200.** The active-timeline target is ~1000 entries; an archival floor at 1000 leaves no headroom above the number it exists to protect. | ||
|
|
||
| **Bucketization note:** archival bucketizes by instant type — ingestion commits and table-service commits (clean, compaction, clustering, rollback) are tracked separately with their own thresholds. `keep.min.commits` governs the ingestion bucket. The ~6-entries-per-commit figure behind the active-timeline math is the combined count across buckets, which is why the window can be sized off ingestion commits without the timeline overrunning. |
There was a problem hiding this comment.
🤖 This section advises Bump hoodie.compaction.target.io to 2-5TB, but config-templates.md and warnings.md both explicitly say not to derive a point value from table size — quoting them, doing so "just re-creates the same trap at a higher threshold as the table grows" — and instead recommend setting it effectively uncapped (104857600 MB ≈ 100 TB). Since SKILL.md tells the agent to consult these references when emitting compaction config, the two paths produce conflicting values. It would also help to repeat the "value is in MB, not bytes" caveat here: this section states the 500 GB default without it, and 2-5TB is exactly the figure where the MB/bytes mistake bites.
|
|
||
| `hoodie.compaction.target.io` defaults to **500GB per round**. At TB-scale MOR, file groups accumulate uncompacted → log files grow forever → read latency degrades. | ||
|
|
||
| If projected size ≥ 1TB with MOR → surface ADR flag: "Bump `hoodie.compaction.target.io` to 2-5TB." |
There was a problem hiding this comment.
🤖 These clustering thresholds are written as 300MB / 1GB literals inside a config block, but hoodie.clustering.plan.strategy.small.file.limit and ...target.file.max.bytes take byte counts — config-templates.md correctly emits 314572800 (300MB) and 1073741824 (1GB). A user (or the agent) copying the byte-less form from here would get an unparseable value. Consider using the byte forms here too, or marking these as human-readable annotations only.
|
|
||
| **Archival window derivation — from commit cadence, never a constant.** | ||
|
|
||
| Archival must outlast the cleaner. If instants are archived while the cleaner still treats those file versions as live, incremental and time-travel readers lose the timeline entries they depend on. So the window is always the cleaner window plus a margin. |
There was a problem hiding this comment.
🤖 Small arithmetic inconsistency between the stated formula and the worked table: the formula is keep.min.commits = max(100, ceil(cleaner_commits × 1.1)), but the 15-min row shows 211, whereas ceil(192 × 1.1) = ceil(211.2) = 212 (and keep.max would then be 255, not 253). The 5-min row (634) and hourly row (53→100 floor) do apply ceil correctly. The same 211 / 253 also appears in config-templates.md. Worth reconciling the worked values with the formula so the derived bundle is exactly reproducible.
|
I'd love to review this in full. |
hudi-agent
left a comment
There was a problem hiding this comment.
Thanks for the substantial multi-writer additions here — the concurrency material is well-organized and I spot-checked the new technical claims against the 1.2.0 source: the lock-provider FQCNs (including the InProcessLockProvider move to org.apache.hudi.core.transaction.lock with the deprecated client.* shim), the NBCC eligibility gate (MOR + simple bucket index + table version ≥ 8, verified in HoodieWriteConfig.validate() and CommonClientUtils), the storage-based provider's 1.0.2 since-version and its "validity ≥ 10× renew, ≥ 10s" constraint, and the DynamoDB required keys all check out.
One new item worth reconciling: the docs assert in three places that an explicitly-set hoodie.clean.failed.writes.policy=EAGER is a "hard config validation failure" under multi-writer modes, but tracing HoodieWriteConfig.Builder shows it is silently auto-overridden to LAZY before validation runs — see the inline comment (this also contradicts the doc's own adjacent "auto-inferred" note).
On the prior review: the three earlier findings — the compaction-target-IO guidance contradiction (decision-tables.md vs config-templates.md/warnings.md), the 300MB/1GB byte-literal clustering thresholds, and the archival-window arithmetic (211/253 vs 212/255) — all sit in sections this diff did not modify, so they remain open. Please take a look at the inline comment, and this should be ready for a Hudi committer or PMC member to take it from here.
|
|
||
| `hoodie.clean.failed.writes.policy=LAZY` is the one exception: it is **auto-inferred** for any | ||
| multi-writer mode, so emitting it is not strictly required, but emit it anyway with a comment | ||
| saying so. It documents intent, and an explicitly-set `EAGER` is a hard config validation |
There was a problem hiding this comment.
🤖 I traced this in HoodieWriteConfig.Builder: setDefaults() calls autoAdjustConfigsForConcurrencyMode, which force-sets hoodie.clean.failed.writes.policy=LAZY via setValue for any multi-writer mode — and that runs before validate(). So an explicitly-set EAGER is silently overwritten to LAZY, not rejected; the checkArgument(!EAGER) in validate() never sees it. That matches the "auto-inferred" note on the line just above, but not "hard config validation failure." Could you reword this (and config-templates.md:554, adr-template.md:293) to something like "silently overridden to LAZY"? The advice to emit LAZY explicitly still holds.
There was a problem hiding this comment.
🤖 Confirmed this trace against the source. build(true) runs setDefaults() before validate(), and setDefaults() → autoAdjustConfigsForConcurrencyMode() unconditionally does setValue(FAILED_WRITES_CLEANER_POLICY, LAZY) for any multi-writer mode (HoodieWriteConfig.java:3903-3911) — which overwrites an explicit EAGER via a plain setProperty. So by the time validate()'s checkArgument(!EAGER) runs (line 3925-3931), it only ever sees LAZY and the guard never trips. "Silently overridden to LAZY" is the accurate wording; the checkArgument effectively can't fire for the auto-adjusted policy.
f59d7f6 to
5505d2b
Compare
hudi-agent
left a comment
There was a problem hiding this comment.
Thanks for the docs update! These reference files lay out a thorough, well-structured design flow for Hudi table architecture, and the config keys I spot-checked against 1.x source (hoodie.table.ordering.fields, RECORD_LEVEL_INDEX/GLOBAL_RECORD_LEVEL_INDEX) are valid. One critical issue remains for this round: the EVENT-shape sample config bundle pairs auto-generated record keys with disabled meta fields, a combination Hudi rejects at write init, so the bundle as written cannot produce a working table. Please have a Hudi committer (e.g. @yihua) confirm the fix before merge.
|
|
||
| ### DataHub (discovery, not queries) | ||
|
|
||
| Additive — pair it with HMS or Glue, never instead of one, when a query engine is involved. |
There was a problem hiding this comment.
🤖 This EVENT-shape sample bundle combines auto-generated record keys (hoodie.datasource.write.recordkey.field= left empty, per the comment) with hoodie.populate.meta.fields=false. Those two are mutually exclusive — as this skill's own decision-tables.md ("Mutual exclusion with auto-gen") states, auto-gen keys require _hoodie_record_key to be materialized, which meta fields provide. This isn't only incoherent on paper: in 1.x, AutoRecordKeyGenerationUtils.mayBeValidateParamsForAutoGenerationOfRecordKeys throws HoodieKeyGeneratorException when meta fields resolve to a mode that leaves the record key unpopulated, so a job using this exact bundle fails at write init (the code comment there notes some legacy-config paths are even worse — rows land with no identity at all). Since these bundles are presented as directly usable, this section could switch the EVENT archetype to one of the two coherent presets in decision-tables.md: a user-provided natural key when disabling meta fields, or keep hoodie.populate.meta.fields=true if auto-gen is what's intended.
|
|
||
| `hoodie.clean.failed.writes.policy=LAZY` is the one exception: it is **auto-inferred** for any | ||
| multi-writer mode, so emitting it is not strictly required, but emit it anyway with a comment | ||
| saying so. It documents intent, and an explicitly-set `EAGER` is a hard config validation |
There was a problem hiding this comment.
🤖 Confirmed this trace against the source. build(true) runs setDefaults() before validate(), and setDefaults() → autoAdjustConfigsForConcurrencyMode() unconditionally does setValue(FAILED_WRITES_CLEANER_POLICY, LAZY) for any multi-writer mode (HoodieWriteConfig.java:3903-3911) — which overwrites an explicit EAGER via a plain setProperty. So by the time validate()'s checkArgument(!EAGER) runs (line 3925-3931), it only ever sees LAZY and the guard never trips. "Silently overridden to LAZY" is the accurate wording; the checkArgument effectively can't fire for the auto-adjusted policy.
Adds a specialized, design-time agent skill that turns workload
requirements into a Hudi table architecture: an Architecture Decision
Record, a grouped hoodie.* config bundle, and a runnable submit command.
It asks workload questions ("how often does data land?", "what do
consumers filter on?") rather than Hudi questions ("which index type?"),
and derives the Hudi decisions from the answers.
Lands under hudi-agent-gateway/skills/ as a first specialist agent for
apache#19263. The gateway's own loop is grounded and read-only --
it answers from tool results over tables that exist. Table design is the
opposite shape: generative, interrogative, and about a table that does
not exist yet, so there is nothing to query. That is the narrower-
toolset argument in apache#19263 applied to design time.
Contents:
- SKILL.md -- flow control, tier gating, question-delivery contract
- references/question-flow.md -- round-by-round questions with gating
- references/decision-tables.md -- derivation per decision domain
- references/warnings.md -- 14 named traps with trigger + firing point
- references/config-templates.md -- hoodie.* templates and sample bundles
- references/adr-template.md -- ADR output structure
- RUNBOOK.md -- operator guide for data engineering / ETL teams
- validate_config_keys.py -- validates every hoodie.* key referenced by
the skill against ConfigProperty definitions in the source tree
(83 keys, exit 1 on unknown), plus an allowlist with a documented
reason per entry
Scope: this is deliberately knowledge-and-flow only, with no rule engine.
Config correctness rests on the reference tables plus the key validator
rather than on model inference. A hallucinated hoodie.* property becomes
a durable table property, not a re-runnable wrong answer, so the
derivation logic is owed as a follow-up before this drives anything
unattended.
Four workload archetypes were driven end-to-end while writing this;
the fixes from those runs are folded in, including three config defects
that would otherwise have shipped: hoodie.compaction.target.io is
denominated in MB rather than bytes, hoodie.metadata.record.index.* are
deprecated aliases for the global properties rather than the partitioned
ones, and an initialized record index file-group count is durable rather
than resizable.
Co-Authored-By: codope <sagarsumit09@gmail.com>
Multi-writer was the largest gap declared in this PR's "where M1 stops today" table: the flow asked whether a second writer existed, then emitted an OCC skeleton with a `<lock provider class>` placeholder and a blocking open question. It now derives the concurrency mode, selects a lock provider, and emits a complete runnable block. Every config key and class name here is verified against 1.2.0 source rather than the published docs, which disagree in three places: `hoodie.cleaner.policy.failed.writes` is a deprecated alias for `hoodie.clean.failed.writes.policy`; DynamoDB validates `table` + `region` rather than the documented `endpoint_url`; and `InProcessLockProvider` has moved to `org.apache.hudi.core.transaction.lock`. Decision rubric (decision-tables.md -> Concurrency, placed after all table services since a standalone service job is itself a writer): - Mode: OCC by default. NBCC only when the design has already landed on MOR + simple bucket index for its own reasons, gated on the constraint HoodieWriteConfig enforces. Table type and index are never reshaped to reach NBCC -- bucket count is durable and concurrency mode is not, so that trade runs the wrong way. - Provider: ordered by maturity, not convenience. DynamoDB (0.10.0) on AWS, an existing ZooKeeper quorum or Hive Metastore otherwise. The storage-based provider (1.0.2) is offered only where no lock infrastructure exists, with its maturity stated -- a lock provider is the wrong place to be an early adopter, since the cost of an undiscovered edge case is silent corruption. - Identity: emit the implicit provider variants, which derive the lock from `hoodie.base.path`. The explicit variants require operators to keep a lock key identical across every writing job by hand; when two disagree, each takes its own lock, both succeed, and nothing logs. The writer question moves from Round 3 to Round 1 and fires at every tier but EXPLORATION. A second writer is a correctness fact rather than a scale one, and it costs a single question about something the user already knows. Round 3 keeps a refinement step, because a standalone compactor or async clustering job derived later is itself an uncounted writer. Six warnings added: NBCC_INELIGIBLE, NBCC_CLUSTERING_CONFLICT, STORAGE_LOCK_MATURITY, LOCK_PROVIDER_MISMATCH (fires only on explicit providers, the sole configuration where the failure is reachable), FILESYSTEM_LOCK_UNSAFE, OCC_INSERT_DUPLICATES. The ADR's blocking open question becomes a pre-launch checklist: the provider and config are decided, so what remains is applying them to every writing job. validate_config_keys.py gains the hudi-aws and hudi-gcp source globs. Without them the DynamoDB lock keys resolve as unknown and correct content fails the check. 100 keys verified, up from 83.
The provider question presented four locking backends as a menu, as though
the user were choosing fresh. Most arrive with the answer already settled
by their platform -- their org runs ZooKeeper, or standardizes on DynamoDB
locking, or a sibling Hudi table made the call. Handing that user a menu
asks them to re-decide something settled, and invites changing a working
answer. It also breaks the skill's own rule against asking questions whose
answer would not change the recommendation.
Restructured into three steps:
- Step A asks what they already have, always, before naming any backend.
An existing platform standard is taken as the answer and not
re-litigated; the only override is a genuine incompatibility, such as
filesystem-based locking on cloud storage, which is a correctness
objection rather than a preference.
- Step B educates only when Step A shows they need it, and leads with what
a lock provider does in operational terms before naming products. The
comparison table carries a maturity column and is filtered to what
applies -- no DynamoDB row for a GCP user.
- Step C discloses the lock defaults and takes an acknowledgement, reusing
the skill's existing disclosed-defaults mechanism. Values are stated in
operational terms rather than as key names ("wait up to 60s to acquire a
lock, 15 retries a second apart"), with a multi-select router for anyone
who wants to own specific values. A value the user explicitly chooses is
emitted even when it equals the default, since it now records a decision
rather than restating a default. Step C is skipped when Step A found a
platform standard, which already owns these values.
Config coverage, checked against every lock ConfigProperty in source: all
eleven no-default keys are accounted for -- emitted, deliberately omitted
because an implicit provider derives them, or documented as optional.
`dynamodb.table` and `.region` carry defaults but are hard-validated in
DynamoDbBasedLockConfig, so they are emitted as required.
Also documents that `hoodie.write.lock.storage.heartbeat.poll.secs` is a
deprecated alias for `renew.interval.secs`, notes why DynamoDB's default
PAY_PER_REQUEST billing suits a lock table, and extends the not-emitted
table to cover the ZooKeeper timeouts, DynamoDB capacity keys, `app_id`,
and `endpoint_url` with reasons.
…skill Catalog sync was declared out of scope in RUNBOOK.md: a user whose table is read by Trino or Athena got a design that would produce a table those engines cannot see, with a pointer to the docs. The flow now asks which engines query the table and derives the sync config from the answer. Covers Hive Metastore, AWS Glue, BigQuery, and DataHub, with Polaris routed. HMS is the default and Glue is the default on AWS, matching where users actually are; the rest are reached only when named. The question is "which engines query this table", never "do you want Hive sync". Spark and Flink read by path, so a Spark-only pipeline correctly gets no catalog at all -- stated explicitly, since silence there reads as an omission rather than a decision. As with the lock provider, the flow asks what metastore the user already runs before recommending one. Constraints that are easy to get wrong, each verified against source: - Partition extractor must match the partitioning. The common cases are inferred, but a TimestampBasedKeyGenerator producing yyyy/MM/dd needs SinglePartPartitionValueExtractor, or the catalog gets three partition columns instead of one date and date filters stop pruning. This is a sync that succeeds and then produces a table nobody can query correctly. - MOR registers two tables, _ro and _rt. Both are named in the ADR along with which consumers should use which; the wrong suffix gives stale data or unexpected latency with no error either way. - BigQuery accepts MOR -- BigQuerySyncTool handles both table types -- but its manifest lists base files only, so BigQuery reads read-optimized rather than snapshot. The published docs describe this as MOR being unsupported, which understates what happens: the sync succeeds and the data merely looks stale. - Glue writes a new catalog version per commit, since hoodie.datasource.meta_sync.condition.sync defaults to false. At a 15-minute cadence that is ~96 versions a day for an unchanged schema. - A sync failure does not fail the write, so the catalog falls behind silently. This is an operational-playbook item, not a writer concern. - Each non-HMS sync tool lives in its own module, so a missing bundle fails at the first commit rather than at submit time. DataHub is treated as additive rather than an alternative: it publishes metadata over REST and registers the table nowhere a query engine looks, so a user who calls it their catalog and needs Trino needs both. Multiple tools comma-separate in hoodie.meta.sync.client.tool.class. Five warnings added: PARTITION_EXTRACTOR_MISMATCH, GLUE_SYNC_VERSION_CHURN, CATALOG_SYNC_SILENT_STALENESS, BIGQUERY_MOR_READ_OPTIMIZED, and CATALOG_BUNDLE_REQUIRED. One more published-docs correction: there is no hoodie.gcp.bigquery.sync.base_path. The BigQuery docs list it as a config; BigQuerySyncConfig defines table_name and takes the location from the standard base-path config. Allowlisted as negation prose, since the reference now warns users away from it. 130 config keys verified against source, up from 100.
Two fixes from a dry run of the catalog-sync flow. **Cloud bundles were named in prose but never in the submit command.** A design with DynamoDB locking or Glue sync needs hudi-aws-bundle on the classpath, and the properties bundle is valid without it -- so the job submits, starts, and dies at the first commit with a ClassNotFoundException on a class the properties file names. Correct config that cannot possibly work is the worst shape of output this skill can produce, and burying the requirement in reference prose means the user reads it after the failure rather than before. The bundle now belongs in the emitted `--packages` line. Added a mapping from derived decision to required artifact, covering the DynamoDB and storage-based lock providers alongside the Glue, BigQuery, and DataHub sync tools; hudi-aws-bundle serves both AWS cases, which is stated explicitly so a reader seeing one jar justified twice does not think they need two. The HoodieStreamer template carries a `<CLOUD_BUNDLE>` slot that is substituted at emission rather than left for the user -- unlike `<MEM>` or `<SCALA>`, this one is derived, and a literal placeholder would leave them guessing. The Spark DataSource path gets explicit treatment because it is easier to miss there: the skill emits `.option(...)` calls and never sees the user's launch command, so the requirement is shown against spark-shell / spark-sql / spark-submit directly. Artifact coordinates verified against packaging/: all three bundles are unsuffixed, unlike hudi-spark<version>-bundle_<scala>. `CATALOG_BUNDLE_REQUIRED` renamed to `CLOUD_BUNDLE_REQUIRED`, since locking needs the same jar and the old name implied catalog sync was the only trigger. It fires once per bundle rather than once per decision. **Storage scheme now precedes the query-engine question.** The dry run produced a contradiction -- GCS storage with Athena, which is AWS-only and cannot read GCS -- because the two were asked side by side. A widget's options are fixed when it renders, so a question whose option set depends on a gate cannot share a screen with that gate. Storage is now Q2.1a and filters Q2.1b's engine list; Athena is separated from Trino/Presto, which need the same kind of registration but are not interchangeable across clouds. If a contradiction still arrives the flow names it and asks rather than guessing, since the two readings imply different catalogs. The general rule is in SKILL.md, alongside the existing never-split-a-gate rule: never merge a gate with a question whose options it narrows either.
…detail The catalog section derived whether sync was needed from the engine list, which inverted the order: a user who had already decided they wanted no catalog answered storage and engine questions before anything established they wanted sync at all. Plenty of tables need none -- Spark-only pipelines, intermediate tables in a chain, anything whose consumers read by path -- and deriving that from three questions the user did not need to answer is the same waste as one unnecessary question, multiplied. Q2.1a now gates the section. Storage becomes Q2.1b and engines Q2.1c, reached only when the gate opens. Two things make the gate honest. It is phrased as an outcome rather than a Hudi feature: "does this table need to show up in a catalog so SQL engines and BI tools can find it by name?", not "do you want meta sync?". A user may have no name for the thing while knowing perfectly well whether their tables appear in Athena. And it states that the decision is reversible. Catalog sync is not durable -- it can be enabled later against a live table by running the standalone sync tool once and then adding the properties, with nothing rewritten. A user who does not know that may say yes defensively to avoid being locked out of an option they were never at risk of losing. There is one genuine exception, now surfaced at the gate rather than discovered later: BigQuery sync requires hive-style partitioning, and that IS fixed at table creation. A table that might later be read from BigQuery should set hoodie.datasource.write.hive_style_partitioning=true today even with no sync configured, since it costs nothing and preserves the option. Raised only on GCS or when the user hints at a future BigQuery consumer. "Not sure" is the one answer that still derives from the engine list, which is the right behavior -- a user who names Athena has answered yes without knowing the term. Storage is captured even when the gate closes the section, because the lock-provider derivation needs it. The general rule is in SKILL.md beside the existing never-ask-a-question- whose-answer-changes-nothing principle: gate optional sections with one plain question, phrase it as an outcome, and say whether declining is reversible.
…e it Cross-format interop was the remaining gap in the catalog section. It gets a mention rather than a rubric, because XTable is not a Hudi sync target in the way Hive Metastore or Glue are: - The sync class is org.apache.xtable.hudi.sync.OneTableSyncTool, in XTable's repo, not Hudi's. - The hoodie.onetable.* keys are defined in XTable's codebase, so validate_config_keys.py cannot check them. Every other hoodie.* key this skill emits resolves to a ConfigProperty in this source tree; emitting unverifiable keys beside verified ones would misrepresent how much of the output is actually checked. - The bundle is built and versioned by XTable (still a SNAPSHOT artifact), so its coordinate moves independently of the Hudi version targeted here. - XTable is incubating at the ASF, so its config surface is less settled than the sync tools that ship in this repo. Four XTable mentions exist in the whole Hudi tree, one of them RFC-41 marked ABANDONED, and no XTable code. Writing a config rubric would mean transcribing another project's docs with no way to keep them honest -- precisely the failure mode this skill exists to avoid. So: no question in the flow, no config templates. A short section that fires only when the user's own answers make it relevant -- they name an Iceberg or Delta consumer, or ask about interoperability -- explaining that XTable translates metadata rather than copying data, naming the two integration shapes, and pointing at xtable.apache.org, the incubator repo, and Hudi's own syncing_xtable page for follow-up. One design-time coupling is worth surfacing, because it is durable: the XTable FAQ lists MOR tables as unsupported for both Hudi and Iceberg, Copy-on-Write only. Hudi's page does not mention this. If it holds, a workload needing Iceberg or Delta interop should probably be CoW, and table type is fixed at creation. New XTABLE_MOR_UNSUPPORTED surfaces that tension with both options rather than silently reshaping the table type. The claim is attributed rather than asserted: it appears on their FAQ but not in the repo README, so it cannot be corroborated against code, and the warning tells the user to confirm it against current docs since an incubating project's support matrix moves. Also notes that XTable is not a catalog -- it translates format metadata and registers the table nowhere a SQL engine looks, so cross-format reads plus engine discovery needs XTable and a catalog sync both.
Signed-off-by: codope <sagarsumit09@gmail.com>
450b99d to
60321fc
Compare























































Describe the issue this Pull Request addresses
Part of #19263 (specialized sub-agents), under the #19256 umbrella. Milestone 1, raised
for community feedback — it targets pipeline modelling, with multi-writer, table-services
operationalization, and Flink as tracked extensions. See Scope.
The problem: onboarding onto Hudi is harder than it should be.
Hudi is a good deal more than a table format — it ships ingestion utilities, self-managing
table services, indexing, catalog sync, and a CLI, across three engines (Spark, Flink, Java).
Each of those engines offers more than one way to ingest, with different deployment models
behind them: HoodieStreamer in continuous or run-once mode, Spark DataSource, Spark SQL,
Structured Streaming, Flink SQL and the Flink datastream API. Table services can run inline,
async in the writing job, or as separate jobs. That breadth is a genuine strength — it is what
lets one system serve a 100GB dimension table and a petabyte fact table, streaming and batch —
but the feedback we consistently get from the community is that getting started feels
complex, and that the number of configs is overwhelming when you are still working out which
of those paths you are even on.
So the distance between "I have a Kafka topic of trip updates" and "here is a correct table
configuration" gets bridged today by one of three things:
and GitHub issues for someone with a similar-sounding workload, reading through dozens of
blog posts of varying vintage, and cross-referencing a config reference that is organized
by config rather than by decision. Nothing in that reference tells you that
hoodie.compaction.target.iois denominated in megabytes, or that partitioning cannot bechanged after table creation. Worse, a Slack thread or blog post that was correct for
0.14 may quietly not be for 1.2, and nothing signals which.
else's workload. This is the most common path and the most quietly damaging one.
of our community support traffic is exactly this request.
This PR aims at the onboarding experience, by automating option 3 so nobody has to fall
back on 1 or 2. Instead of combing through Slack, GitHub issues, and a hundred blog posts
to work out how to design a pipeline with Hudi, every user gets their own Hudi practitioner
to talk to — and walks out with a config bundle, an ADR, and a runnable submit command in a
matter of minutes.
The platform breadth above is exactly what an interview is good at absorbing. A user does not
need to know that HoodieStreamer continuous mode gets async compaction in-process while Spark
DataSource does not; they need to answer "where does the data come from?" and "how is the
pipeline expressed?" and have the engine, writer, deployment model, and service posture fall
out of those answers. The optionality stays — it just stops being the user's problem to
navigate cold.
The valuable thing a solutions architect brings isn't knowing config names — it's knowing
which questions to ask. They don't open the config reference. They ask: how often does
data land? Do records change after insert? What do consumers filter on? Can that column's
value change for a record? Then they derive the Hudi decisions from those answers, and tell
you which decisions you can't take back.
That interview is a formalizable artifact: the questions are finite, their gating is
deterministic, the derivations are table lookups, and the traps are enumerable. This skill
encodes it, and it stays in the repo next to the configs it reasons about — so unlike a blog
post, it can be kept honest against the code (see the key validator below).
It also directly answers a question raised on #19264. @vaibhavk1992 asked whether the
agent would have Hudi-specific knowledge baked in rather than behaving like a generic
text-to-SQL layer, and the reply was that we plan to land skills and tools that make it
really know Hudi internals. This is one of those, aimed at design time.
Summary and Changelog
Adds a design-time architect agent: an interactive skill that interviews a user about
their workload in plain language and produces a Hudi table design — an Architecture
Decision Record, a grouped
hoodie.*config bundle, and a runnable submit command. Itasks workload questions ("how often does data land?", "what do consumers filter on?"),
never Hudi questions ("which index type?"), and derives the Hudi decisions from the
answers.
What a user gets. A ~15-minute conversation instead of days of research across Slack,
GitHub issues, blog posts, and the config reference — ending in three artifacts they can put
straight through normal design review: an ADR with tradeoff tables and measurable revisit
conditions, a config bundle where every property encodes a decision, and a submit command
whose flags are split into load-bearing (derived from the design) versus environment
placeholders (paths, memory, Scala/Spark versions the flow deliberately never asks about).
It is also, deliberately, an interview rather than a questionnaire — it explains the
tradeoff before each durable decision, recommends one with reasoning, and lets the user
override. Someone who has never designed a Hudi table gets a working one; someone who has
gets a second opinion and a written record of why.
Why this is a separate agent rather than part of the gateway loop. The landed loop is
grounded and read-only — it answers from tool results over tables that exist, and its
system prompt tells it to never invent table or column names. Table design is the opposite
shape: generative, interrogative, and about a table that does not exist yet, so there is
nothing to query and nothing to ground against. That is the narrower-toolset argument in
#19263 applied to design time. #19263 names optimization, analysis, and visualization as
its examples; this is a fourth specialist alongside them.
Worth noting one asymmetry, since it came up on #19264: the observation that CoW vs MoR
shouldn't matter because queries have the same semantics is true for reads, which is
all the current loop does. At design time it's one of the most consequential choices
on the table, with a whole tradeoff surface behind it and a table rewrite as the cost of
changing your mind. Design-time and read-time agents need different knowledge.
Three properties that distinguish this from asking a foundation model directly:
index can still answer "can this record move to a different date after insert?" — and
that answer is what selects index scope.
hoodie.*key it emits comes from the checked-inreference tables, and
validate_config_keys.pyverifies all 83 of them againstConfigPropertydefinitions in the source tree. A model configuring Hudi from memoryproduces plausible properties that don't exist — and unlike a wrong query, a wrong table
property is durable.
key, bucket count, and record-index file-group count are one-way. Every ADR carries a
durability table naming each applicable one and what unlocking costs.
Changelog — files added, all under
hudi-agent-gateway/skills/hudi-architect/:SKILL.mdreferences/question-flow.mdreferences/decision-tables.mdreferences/warnings.mdreferences/config-templates.mdhoodie.*templates per decision, plus sample bundles for three workload archetypesreferences/adr-template.mdREADME.mdRUNBOOK.mdvalidate_config_keys.py+ allowlisthoodie.*key referenced by the skill against the source tree; exit 1 on unknown keys; allowlist entries each carry a documented reasonTiering. The interview scales to intent, gated by one opening question: exploring
(concept explanation), prototyping (minimum questions for a genuinely runnable table),
productionizing (full workload interview), production-at-scale (adds index sizing math and
a derived-facts checkpoint). A prototyping user gets disclosed defaults they consent to
rather than a bundle full of placeholders.
Playtesting. Four workload archetypes were driven end-to-end while writing this, and
the fixes are folded in. Three were config defects that would otherwise have shipped:
hoodie.compaction.target.iois denominated in MB, not bytes (default512000=500GB). Earlier drafts emitted byte counts, off by ~10^6. It is also an IO ceiling that
throttles compaction, not a sizing target.
hoodie.metadata.record.index.*are deprecated aliases for the global properties.Partitioned RLI uses
hoodie.metadata.record.level.index.*and is per partition.Templates were setting global knobs under a partitioned heading.
file-group count is durable at initialization, like bucket count.
That last class of bug is the reason
validate_config_keys.pyexists: correctness here hasto be mechanically checkable, not reviewed by eye.
Scope
Milestone 1 targets pipeline modelling — taking a workload description and deriving the
durable shape of the table and the ingestion pipeline around it: table type, partitioning,
record key and ordering, index, writer selection, retention, and the table-service posture
that follows from those. That's the slice where a wrong answer is most expensive, because
most of it is fixed at table creation.
This patch is raised to get community feedback on the direction and the interview itself
while the extensions are being built. Deliberately out of M1 scope, each already sketched
in the flow so it can be filled in rather than retrofitted. (Multi-writer was on this list
when the PR was opened and has since been built out — see the update below.)
Also deferred: benchmarking, record-level TTL, z-order/layout guidance, multi-table
transactions,
CONSISTENT_HASHINGbucket sizing, and versions other than 1.2.0. All ofthese are stated as limitations in
RUNBOOK.md§8 rather than being silently missing — theskill defers honestly instead of guessing, and anything it declines to decide lands in the
ADR's open-questions section as a pre-launch action item.
One structural gap worth naming rather than leaving to be discovered: there is no rule
engine. M1 is knowledge and flow only, so config correctness rests on the checked-in
reference tables plus the key validator, not on model inference. A hallucinated
hoodie.*becomes a durable table property, not a re-runnable wrong answer, so the derivation logic —
workload profile schema, decision functions, property generator, fixture tests — is owed as
a follow-up in this module's idiom before this drives anything unattended. Landing the
knowledge first makes that work reviewable against something concrete, and the feedback from
this patch is what should shape it.
Update — multi-writer concurrency is now derived
Multi-writer was the first row of the extensions table when this PR was opened. It is now
built out, so the table above has been amended rather than left to mislead.
Before: the flow asked whether anything else wrote the table, then emitted an OCC
skeleton containing a literal
<lock provider class>placeholder plus a blocking openquestion. A user with a second writer got a correct diagnosis and an incomplete bundle.
Now: the skill derives the concurrency mode, selects a lock provider, and emits a
complete runnable block.
Every key and class name is verified against 1.2.0 source rather than the published
docs, which disagree in three places. Worth flagging separately since they affect anyone
following the docs today, not just this skill:
hoodie.cleaner.policy.failed.writesis a deprecated alias; the modern key ishoodie.clean.failed.writes.policy(HoodieCleanConfig.java:155).tableandregion(
DynamoDbBasedLockConfig.java:138-139), not the documentedendpoint_url, which isoptional.
InProcessLockProviderhas moved toorg.apache.hudi.core.transaction.lock; the oldclass is a deprecated shim, and the docs still cite it.
Happy to raise a separate docs PR for those if useful.
Mode derivation. OCC is the default. NBCC is offered only when the design has already
landed on MOR + simple bucket index for its own reasons — the constraint
HoodieWriteConfigenforces at
:3842, plus the table-version-8 floor inCommonClientUtils. The rubric neverreshapes table type or index to reach NBCC: bucket count is durable and concurrency mode is
not, so that trade runs the wrong way. When NBCC is requested and ineligible, the skill says
why and emits OCC rather than failing at write time.
Provider selection asks what exists before recommending anything. The first version of
this presented four backends as a menu, which was wrong: most users arrive with the answer
already settled by their platform, and asking them to re-pick invites changing a working
configuration. The flow now asks whether they already have a locking backend, or one their
org standardizes on. An existing standard is taken as the answer and not re-litigated — the
only override is a genuine incompatibility such as filesystem-based locking on cloud storage,
which is a correctness objection rather than a preference. Only a user who says "nothing set
up" gets the comparison, and it leads with what a lock provider does in operational terms
before naming products.
Where a recommendation is needed, it is ordered by maturity, not convenience. DynamoDB
(since 0.10.0) is the default on AWS; an existing ZooKeeper quorum or Hive Metastore is
preferred over standing up anything new.
StorageBasedLockProvideris appealing — it locks under the table's ownpath, so there is no infrastructure and no lock identity to keep in sync — but it arrived in
1.0.2 and carries lease renewal with a heartbeat plus per-cloud lock clients. It is
surfaced only where no lock infrastructure exists, always with its maturity stated. No known
defect; this is an age argument, and a lock provider is the wrong place to be an early
adopter when the failure mode is silent corruption. Worth revisiting as it gains mileage.
Lock identity is derived, not configured. The skill emits the implicit provider
variants (
DynamoDBBasedImplicitPartitionKeyLockProvider,ZookeeperBasedImplicitBasePathLockProvider), which hash the lock fromhoodie.base.pathwith
s3a://normalized tos3://. The explicit variants require an operator to keep alock_keyorpartition_keyidentical across every writing job by hand; when two disagree,each acquires its own lock, both writers succeed, and the table corrupts with nothing in any
log. The explicit variants stay documented for the two cases that genuinely need them —
sharing one lock across tables, or matching an existing deployment — with a warning attached
there, where the failure is actually reachable.
Lock defaults are disclosed and acknowledged, not applied silently. Every remaining lock
config has a default in code, so nothing is broken by leaving them alone — but the user sees
them once rather than discovering them during an incident. The values are stated in
operational terms rather than as key names ("wait up to 60s to acquire a lock, 15 retries a
second apart"; "lock validity 5 minutes, renewed every 30s, so a dead writer's lock expires
instead of blocking the table"), followed by keep-or-set-them-yourself and a multi-select
router for anyone who wants specific values. A value the user explicitly chooses is emitted
even when it equals the default, since it then records a decision rather than restating a
default. This step is skipped when the user already has a platform standard, which owns these
values.
All eleven lock configs that have no default in code are accounted for — emitted,
deliberately omitted because an implicit provider derives them, or documented as optional.
dynamodb.tableand.regioncarry defaults but are hard-validated inDynamoDbBasedLockConfig, so they are treated as required.The writer question moved from Round 3 to Round 1 and now fires at every tier but
EXPLORATION. A second writer is a correctness fact rather than a scale one, and it costs a
single question about something the user already knows; previously a modest-scale user with
a nightly cleanup job was never asked. Round 3 keeps a refinement step, because a standalone
compactor or async clustering job derived during the design is itself a writer the user did
not count when first asked.
Six new warnings:
NBCC_INELIGIBLE,NBCC_CLUSTERING_CONFLICT,STORAGE_LOCK_MATURITY,LOCK_PROVIDER_MISMATCH,FILESYSTEM_LOCK_UNSAFE(hard block on cloud storage), andOCC_INSERT_DUPLICATES— concurrentINSERT/BULK_INSERTcan duplicate even with dedupenabled, since dedup is per-batch while conflict detection is per-file-group.
The ADR's blocking open question becomes a pre-launch checklist: the provider and config
are decided, so what remains is applying the identical block to every writing job.
Validator.
SOURCE_GLOBSgainshudi-awsandhudi-gcp— without them the DynamoDBlock keys resolve as unknown and correct content fails the check. Now 100 keys verified
against 1204 resolved from source, up from 83/1165. Separately, class names are not yet
machine-checked, which the
InProcessLockProviderpackage move shows is a real hazard; aone-off script confirmed all 22
org.apache.hudi.*FQCNs in the skill resolve to a class atthat exact package, and folding that into the validator is an obvious follow-up.
Verified by driving it. A PRODUCTIONIZING session with a declared second writer: the
writer question fired at the right tier, provider selection produced a complete DynamoDB
block, and
OCC_INSERT_DUPLICATESfired and then correctly retracted when the user clarifiedthat the backfill only upserts. The same run also caught a design error unprompted — a
proposed ingestion-date partition column against consumers that filter on business date. One
gap it exposed and worth naming: the templates do not tell the user that DynamoDB locking
needs
hudi-aws-bundleon the classpath, which is correct config that still fails atruntime. That fix is next.
Update — catalog / metastore sync is now derived
Second extension off the list. A user whose table is read by Trino or Athena previously got a
design that would produce a table those engines cannot see, plus a pointer to the docs.
Covers Hive Metastore and AWS Glue as the two common paths, with BigQuery and
DataHub derived and Polaris routed. HMS is the default; Glue is the default on AWS.
The section is gated behind one plain question, asked before anything else: does this table
need to show up in a catalog so SQL engines and BI tools can find it by name? Plenty of tables
need no catalog — Spark-only pipelines, intermediate tables in a chain — and a "no" closes the
section rather than being derived from three questions the user did not need to answer. The gate
is phrased as an outcome, not as "do you want meta sync?", and it states that the decision is
reversible: sync can be enabled later against a live table by running the standalone tool
once, with nothing rewritten. A user who does not know that may otherwise say yes defensively.
The one genuine exception is surfaced at the gate: BigQuery sync requires hive-style
partitioning, which is fixed at table creation, so a table that might later be read from
BigQuery should set
hoodie.datasource.write.hive_style_partitioning=truetoday even with nosync configured.
Constraints, each verified against source rather than the docs:
TimestampBasedKeyGeneratorproducingyyyy/MM/ddneedsSinglePartPartitionValueExtractor, or the catalog registers threepartition columns instead of one date and date filters stop pruning. This is a sync that
succeeds and then produces a table nobody can query correctly, which is worse than a failure.
_roand_rt. Both are named in the ADR along with whichconsumers should use which; the wrong suffix yields stale data or unexpected latency with no
error either way.
BigQuerySyncToolhandles both table types — but its manifest listsbase files only, so BigQuery reads read-optimized rather than snapshot. The published docs
describe this as MOR being unsupported, which understates it: the sync succeeds and the data
merely looks stale.
hoodie.datasource.meta_sync.condition.syncdefaults tofalse. At a 15-minute cadence that is~96 versions a day for an unchanged schema; the warning computes that figure from the answered
cadence rather than leaving it abstract.
stale schema with nothing in the writer's logs. Operational-playbook item, not a writer concern.
table nowhere a query engine looks, so a user who calls it their catalog and needs Trino needs
both. Multiple tools comma-separate in
hoodie.meta.sync.client.tool.class.Cloud bundles are now in the emitted submit command, not just in prose. Glue sync and the
DynamoDB lock provider both need
hudi-aws-bundle; BigQuery needshudi-gcp-bundle; DataHubneeds
hudi-datahub-sync-bundle. The properties are valid without the jar, so the job submits,starts, and dies at the first commit with a
ClassNotFoundExceptionon a class the propertiesfile names — correct config that cannot possibly work, which is the worst output this skill can
produce. It now appears in
--packages, with the Spark DataSource path handled separately sincethe skill never sees that job's launch command. Artifact coordinates were checked against
packaging/: these bundles are unsuffixed, unlikehudi-spark<version>-bundle_<scala>.Two question-design defects, both found by driving the flow and both fixed. Storage scheme
now precedes the query-engine question and filters its options, because a widget's options are
fixed when it renders and a same-screen pairing cannot filter on the answer beside it — a live
run produced GCS storage plus Athena, which is impossible, because the two were asked together.
Athena is also separated from Trino/Presto: same kind of registration, but Athena is AWS-only, and
bundling them let the contradiction through unchallenged. Both rules are now stated generally in
SKILL.md.One more published-docs correction: there is no
hoodie.gcp.bigquery.sync.base_path. TheBigQuery page lists it;
BigQuerySyncConfigdefinestable_nameand takes the location from thestandard base-path config. That brings this patch's docs corrections to five, all listed here and
in the reference files — happy to raise a docs PR for them separately.
Cross-format interop (Apache XTable) is explained and linked, not configured. XTable is not a
Hudi sync target in the way HMS or Glue are: the sync class and the
hoodie.onetable.*keys livein XTable's codebase, so
validate_config_keys.pycannot check them, the bundle is versionedindependently (still a SNAPSHOT artifact), and the project is incubating. Emitting unverifiable
keys beside verified ones would misrepresent how much of this skill's output is actually checked,
so the section explains what XTable does, names the two integration shapes, and hands off to
xtable.apache.org, the
incubator repo, and Hudi's own
syncing_xtable page.
One durable coupling is surfaced, because it would be expensive to discover late: XTable's FAQ
lists MOR tables as unsupported for both Hudi and Iceberg — Copy-on-Write only — which Hudi's
own page does not mention. If it holds, a workload needing Iceberg or Delta interop should
probably be CoW, and table type is fixed at creation. The warning attributes the claim rather than
asserting it (it appears on their FAQ but not the repo README, so it cannot be corroborated
against code) and tells the user to confirm against current docs.
Out of scope and stated in
RUNBOOK.md§8: Polaris beyond the Spark-catalog pointer, per-catalogauth (Kerberos, IAM policy documents, service-account keys), and Snowflake/Redshift specifics.
How to try it
The skill is a directory of markdown loaded by an agent host — nothing to build, and no Hudi
cluster, installation, or cloud access needed. It designs; it never deploys, modifies tables,
or applies configuration.
With Claude Code (or any agent host that supports skills):
Or drop it in a project instead of user-level:
mkdir -p .claude/skills && cp -r hudi-agent-gateway/skills/hudi-architect .claude/skills/. For a data platform team, theproject-level copy checked into your pipelines repo is the pattern worth using — everyone gets
the same advisor, and upgrades ship through normal review.
Without Claude Code, the skill degrades to a readable spec: paste
SKILL.mdas a systemprompt into any capable LLM chat (the question flow falls back from interactive widgets to
numbered prose blocks), or just read
references/as design documentation — the decisiontables and warnings stand on their own.
The first question is always the tier gate (exploring / prototyping / productionizing /
production-at-scale); answer it honestly, because it controls which checks run. Then describe
your workload.
RUNBOOK.md§4 has a pre-session checklist worth skimming first — sessions gomuch faster if you have the source, cadence, mutability, and read-pattern facts to hand.
To verify the config keys independently:
Exits 0 when every
hoodie.*key referenced anywhere in the skill resolves to a realConfigPropertyin this source tree (130 keys at present); exit 1 lists any that don't. Run itafter editing a reference file. It must run from inside a Hudi checkout — it resolves keys from
the actual source, not a snapshot.
What feedback would be most useful
The interview is the part that benefits most from review by people who have designed real
Hudi tables, since its quality is entirely in which questions fire and in what order:
against what you actually built. Divergence in either direction is the most valuable
signal here — either the skill is wrong, or it found something.
phrasing exists. The design rule is that no question should be asked whose answer wouldn't
change the recommendation.
references/warnings.md, or that fire at the wrong moment.A warning whose only firing point is a checkpoint a tier skips is a warning that never
fires — one round of that class of bug is already fixed in this patch, and there may be more.
references/decision-tables.md, especially aroundindex selection and the retention safe-maximums per commit cadence.
challenging: ordering providers by maturity rather than convenience (which demotes
StorageBasedLockProviderdespite it needing no infrastructure), and defaulting to theimplicit-identity variants so a lock key cannot drift between jobs. Also whether scoping
NBCC to simple bucket index is right — that follows
HoodieWriteConfig's validation, whilethe docs also mention partition-level bucket index.
is done; table-services operationalization is my read of what comes next, and Flink ahead of
it is a reasonable argument.
Impact
No impact on existing behavior. Purely additive: 10 new files, all documentation and one
standalone validation script. No file outside
hudi-agent-gateway/skills/hudi-architect/ismodified, no Hudi API, config, or storage format is touched, and nothing is wired into the gateway's runtime — the skill is loaded by
an external agent host (Claude Code, or any MCP-speaking client), not by
hudi_agent_gateway.setuptoolspackage discovery iswhere = ["src"], soskills/isnot swept into the wheel.
User-facing gain: a supported path from workload requirements to a reviewed Hudi table
design, without needing to read the config reference first.
Risk Level
low
Nothing executes in any Hudi code path. The only executable file is
validate_config_keys.py, a developer-run script that reads markdown and Java/Scalasources and exits non-zero on unknown config keys; it never writes.
The residual risk is advice quality — a user could act on a design that is wrong for
their workload. Mitigations:
hoodie.*key is machine-verified againstConfigPropertydefinitions (130 keys,currently clean). Run:
python3 hudi-agent-gateway/skills/hudi-architect/validate_config_keys.pyreferences/; unresolved decisions must be surfaced as open questions instead.can tell what was checked from what was guessed.
durability table.
corrections are in this PR.
HoodieWriteConfigandCommonClientUtils, so an ineligible combination is refused atdesign time rather than failing at write time.
Known gaps in that verification: the exploration tier and the Flink path have not been driven
end-to-end. Class names are not yet machine-checked the way config keys are — verified once by
script (30/30 as of the catalog work) but not on every run, which the
InProcessLockProviderpackage move shows is a real hazard; folding that check into
validate_config_keys.pyis anobvious follow-up. The cloud-bundle gap named here previously is now closed.
Documentation Update
None required for this PR — no new configs, no changed defaults, no public API or storage
change. The skill is self-documenting (
README.mdfor reviewers,RUNBOOK.mdforoperators).
Website documentation would be worth adding once the direction is agreed and the follow-up
rule engine lands; happy to take that as a separate contribution if reviewers want it
surfaced on hudi.apache.org rather than discovered in-repo.
Contributor's checklist