wirybeaver opened a new pull request, #1110:
URL: https://github.com/apache/hudi-rs/pull/1110
## Motivation
After #1086, hudi-rs can read shredded and unshredded Variant columns. This
implements the next step in #630 by writing both layouts to a Hudi v9 COW table
so Rust and Spark can read them back.
## Modification
The PR adds a dedicated `CowWriter` alongside the existing table write APIs.
It creates or reopens nonpartitioned Parquet tables with a fixed Avro schema. A
single writer appends each batch to a new file group. Callers can choose a
shredding type per top-level Variant column. Values that do not fit that type
stay in the residual, and the logical schema stays the same across appends.
```text
Arrow batch -> validate schema and keys -> optionally shred -> encode Parquet
-> requested and inflight instants -> create data file ->
publish completed commit
```
Both layouts carry an explicit Parquet Variant specification version of 1
for Spark interoperability. The writer uses create-only storage operations and
publishes completion last. The diff exceeds the project's 1,000-line guideline
because it includes the append lifecycle, failure recovery coverage, a
cross-client verifier, and API documentation together.
## Test
The Rust integration test writes one unshredded batch, reopens the writer,
and appends a shredded batch. Snapshot and incremental reads check the decoded
values, including a type mismatch stored in the residual and the distinction
between SQL null and Variant null. A second test introduces a data-file
collision and verifies that the prior commit remains visible, the existing
bytes are preserved, and a later append succeeds.
Spark 4.1.4 with Hudi 1.2.1 read all five expected logical rows from the
Rust-written table. The verifier also resolved both commit records against
Java's Avro schema.
Refs #630.
--
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]