Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#173 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
numpy, python, sqlalchemy

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
142
フォーク
19
平均マージ
1日 9時間
マージ済み PR(30日)
9

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

xqlsystems/xarray-sql のほかの issue

xqlsystems/xarray-sql の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。