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

Abierto
#11,860 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c, cpp, java, rust
Área
api

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Rust
Estrellas
3.2k
Forks
239
Merge medio
1 d 4 h
PR fusionados (30 d)
684

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de vortex-data/vortex

Todos los issues de vortex-data/vortex

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.