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

Offen
#11,860 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
30/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
c, cpp, java, rust
Bereich
api

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Rust
Sterne
3.2k
Forks
239
Ø Merge
1 T. 4 Std.
Gemergte PRs (30 T.)
684

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus vortex-data/vortex

Alle Issues in vortex-data/vortex

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.