linliu-code opened a new pull request, #671: URL: https://github.com/apache/hudi-rs/pull/671
**Stacked on #639–#670** — review only the last commit. ## What Delete blocks were the **last** caller of the vendored Avro→Arrow array builder. Moving them to `arrow-avro` lets that builder go: **−1,073 lines**. ## Why now That converter produced two silent-wrong-answer bugs while it was in use: - an Avro map became `Dictionary(Utf8, V)` — not a valid Arrow type (#664) - a decimal column read as **entirely NULL**, because `resolve_decimal128` missed `Value::Decimal` (#668) Neither was on the delete path — delete records are `Utf8`, `Utf8`, and a narrowed primitive, which it handled correctly. But keeping a second decoder alive for one call site was not worth the risk of a third. ## The two shapes **A delete block is one Avro datum**, not a run of framed records, so it decodes as a single row whose only column holds the list. The records come out of that list as a struct array, and the merge's batch is its columns lifted out. **The ordering value needs unwrapping.** Hudi writes it as a union of per-type wrapper records, so decoding against that schema yields a union of one-field structs: ``` orderingVal: Union([(0,"null"), (1,"BooleanWrapper"), (2,"IntWrapper"), (3,"LongWrapper"), ...]) ``` A block writes one ordering type, so exactly one branch is populated and its `value` child is the column. **A block mixing branches is now rejected** rather than quietly reduced to one of them. The previous code read the type from the *first* record and narrowed the schema to it, applying that to every record in the block — so a mixed block was mis-decoded silently. This errors instead. ## What stays `avro_to_arrow::schema` (378 lines). The schema resolver converts Avro schemas to Arrow well beyond log files, so only the row-oriented **array builder** is deleted, not the schema conversion. Also unchanged: `schema::delete`'s `unwrap_ordering_value`, `avro_schema_for_delete_record` and `avro_schema_for_delete_record_list` are now unused by production code. They are `pub` in a `pub mod`, so removing them is a public-API change that deserves its own PR and a maintainer's call rather than being folded in here. ## Tests No behavior should change, and the existing coverage is what says so: **11 delete-ordering harness cases** (long, decimal, timestamp, int, double, string), the delete gold fixtures, and the `table_read_tests` delete paths on the legacy engine — all unchanged and passing. Two new unit tests on the genuinely new logic — union extraction: the populated branch is unwrapped to its values, and a mixed-branch block errors with a message naming the conflict. Full workspace green: 1202 lib + 79 table-read + 39 datafusion + 21 + 12. Clippy clean in the changed files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
