FFI/C++: preserve row range and limit presence in vx_scan_options instead of using 0 as sentinel

Aperta
#11,860 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c, cpp, java, rust
Ambito
api

Direzione di ricerca

Start in vortex-ffi/src/scan.rs, where vx_scan_options turns zero values into absent row range and limit, and in lang/cpp/src/data_source.cpp, where the C++ wrapper flattens the optionals into 0. Compare with the Java binding, which already treats [0, 0) and limit = 0 as real values. Done means presence flags such as has_row_range_begin, has_row_range_end and has_limit are added to the C ABI and the wrapper passes them through, so C/C++ and Java return the same rows for the three cases in the issue. The ABI change is a design decision, so confirm the approach with maintainers before coding.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Follow-up from #11839.

vx_scan_options (vortex-ffi/src/scan.rs) still uses 0 as the sentinel for absent row_range_begin, row_range_end, and limit ((start > 0 || end > 0).then_some(start..end) and (limit != 0).then_some(limit)), and the C++ wrapper (lang/cpp/src/data_source.cpp) flattens std::optional<RowRange> and std::optional<uint64_t> into 0, losing presence information.

After #11839, the Java and C/C++ bindings diverge on the same requests:

  • row_range = [0, 0) returns 0 rows in Java, but all rows in C/C++ (so an empty split at offset 0 reads the whole file).
  • limit = 0 returns 0 rows in Java, but all rows in C/C++.
  • An open-ended row_range_begin = n reads rows n.. in Java, whereas C/C++ {n, 0} returns no rows (or an error after #11842).

Fixing this requires a C ABI change to carry explicit presence flags (e.g., has_row_range_begin, has_row_range_end, has_limit) on vx_scan_options and updating the C++ wrapper accordingly.

Lingua principale
Rust
Stelle
3.2k
Fork
239
Merge medio
1g 4h
PR unite (30g)
684

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vortex-data/vortex

Tutte le issue di vortex-data/vortex

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.