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

未关闭
#11,860 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
c, cpp, java, rust
领域
api

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Rust
星标
3.2k
派生
239
平均合并
1 天 4 小时
30 天内合并 PR
684

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vortex-data/vortex 的其他 Issue

查看 vortex-data/vortex 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。