Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Investigate numpy-array-like Arrow view to avoid the scatter copy

Abierto
#173 1 comentario 1 reacción 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
numpy, python, sqlalchemy

Línea de trabajo

Start by reading SQLBackendArray._raw_getitem and the eager aggregation path, then review the _array_like contract in xarray/core/variable.py referenced in the issue. Prototype an adapter for float64 PyArrow arrays and compare the copy and round-trip behavior. Done means the prototype shows whether the scatter copy can be avoided and how indexing and .chunk() behave.

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

Descripción

SQLBackendArray._raw_getitem and the eager aggregation path both copy PyArrow RecordBatch columns into a preallocated numpy buffer (one read pass per batch column). The copy is necessary today because PyArrow buffers are immutable views and numpy needs a writable buffer.

xarray.Variable does not strictly require a numpy ndarray; it accepts anything that meets the _array_like contract (see xarray/core/variable.py#L373). If we can wrap a pyarrow.Array in a tiny adapter that satisfies that contract, the scatter step becomes a pointer assignment and the round-trip skips a full read pass.

Open questions:

  • Do we need contiguous storage per dim, or can we hand xarray a list of pyarrow.Array chunks with a custom __array__ that materializes lazily?
  • How does indexing (slicing, fancy indexing) compose with the adapter once xarray asks for sub-views?
  • Does this play nicely with the chunked / dask path users will reach for after .chunk()?

Worth prototyping on a single dtype family first (float64) to see if the adapter shape is even tractable.

Spun out of #167.

Lenguaje dominante
Python
Estrellas
142
Forks
19
Merge medio
1 d 9 h
PR fusionados (30 d)
9

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 xqlsystems/xarray-sql

Todos los issues de xqlsystems/xarray-sql

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.