feat(writer): write vortex.union (declared in Rust's unstable2026.10.0 edition)

Đang mở
#660 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, rust
Lĩnh vực
backend, databases

Hướng nghiên cứu

Read #442 for the union wire layout, then inspect UnionEncodingEncoder registration in writer.encode and the cascade logic in vortex-compressor/src/compressor/cascade.rs. Check edition-family handling against ADR 0023 and the unstable declarations in vortex/editions/unstable/unstable2026.10.0.toml. Done means writing and cascading unions with unstable-edition gating, correcting docs/compatibility.md, and adding cross-language coverage; the issue lists a Rust-native harness as the first testing option.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

Write side of #442. #442 deferred the writer because vortex.union was in no Rust edition ("Revisit when an edition declares it"). That is no longer true: Rust's unstable2026.10.0 edition (vortex/editions/unstable/unstable2026.10.0.toml, vortex-edition/src/declarations/unstable/mod.rs) lists vortex.union. docs/compatibility.md (lines 39, 150) still says "in no edition" and needs correcting as part of this.

Scope

  • UnionEncodingEncoder in writer.encode, registered in WriteRegistry.Builder#registerDefaults(): type ids (U8, nullable iff the union is) + one row-aligned child per variant, no metadata, no buffers (Rust rejects either). Layout per #442.
  • Cascading: compress type_ids and each child independently and rebuild the union, as vortex-compressor/src/compressor/cascade.rs does.
  • Edition gating: Rust now has an unstable family; EditionFamily is CORE/PREVIEW/ZSTD. Decide whether to add it (ADR 0023 says closed enum mirroring Rust's families, so probably yes) and make a default write never emit vortex.union.
  • Update docs/compatibility.md, AGENTS.md if the edition family changes, CHANGELOG.

Testing (vortex-jni cannot help: vortex-arrow bails on DataType::Union)

Ideas, cheapest first:

  1. Rust-native cargo harness (as for the Pco encoder): a small Rust program linking vortex-array/vortex-file that (a) reads a Java-written file and dumps the array tree + values, and (b) builds a UnionArray and writes it with the unstable edition, so Java reads real Rust output. This also gives the #442 decoder its first real-producer coverage.
  2. Rust-side vtx/vortex-tui browse on a Java-written file, as a quick manual smoke check.
  3. Byte-compare node trees: write the same logical union through the Rust harness and Java, diff the ArrayNode trees (the replicate-JNI-on-size-gaps approach).
  4. Reuse Rust's own test vectors in vortex-array/src/arrays/union/tests as unit fixtures.
  5. Keep the hand-built reader tests from #442; add random unions via a seeded @MethodSource (variant counts 1..256, non-consecutive type ids, null tags, nested union children).

Open question: is the unstable edition's vortex.union wire layout final? It makes no stability promise, so changes may follow.

Ngôn ngữ chính
Java
Star
3
Fork
2
Merge trung bình
10 giờ 41 phút
Pull request đã merge (30 ngày)
136

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của dfa1/vortex-java

Tất cả issue của dfa1/vortex-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.