FFI/C++: preserve row range and limit presence in vx_scan_options instead of using 0 as sentinel
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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 = 0returns 0 rows in Java, but all rows in C/C++.- An open-ended
row_range_begin = nreads rowsn..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.
- Dominant language
- Rust
- Stars
- 3.2k
- Forks
- 239
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 684
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vortex-data/vortex
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vortex-data/vortex#12633 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
vortex-data/vortex#12628 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vortex-data/vortex#12491 ·
Maintainers usually reply within 1 day
-
Fallible constructor for nested_case_whenPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
vortex-data/vortex#11425 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 67/100
vortex-data/vortex#12635 ·
Maintainers usually reply within 1 day
All issues in vortex-data/vortex
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
valkey-io/valkey-glide#7975 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
marklauter/tsong#110 ·
-
docs enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wasm-bindgen/wasm-bindgen#5503 · 1 comment ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day