feat(bigquery): Support queryResultsFormat and compressionCodec in query_and_wait()
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Client.query_and_wait() から開始し、次に BigQuery リクエストのペイロードについては _job_helpers.py、RowIterator と Arrow のパースについては table.py を追跡します。関連する PR 18027 と比較し、両方のオプションが受け付けられて API に送信されること、また圧縮された Arrow 結果が記載された to_arrow() と to_dataframe() のユースケースをサポートすることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Determine this is the right repository
- I determined this is the correct repository in which to report this feature request.
Summary of the feature request
Feature Description
Add support for query_results_format (e.g., "ARROW") and compression_codec (e.g., "LZ4_FRAME") in Client.query_and_wait() and related job helper functions in google-cloud-bigquery.
Use Case & Problem Statement
Currently, Client.query_and_wait() executes a query and fetches results, but does not allow callers to request the underlying query results format as Apache Arrow streams or specify compression options directly during the fetch process.
For high-performance data processing pipelines using Apache Arrow or PyArrow, requesting query results in Arrow format with compression significantly reduces network payload size, deserialization overhead, and total query result fetch latency.
Proposed Solution
- Update
google.cloud.bigquery.client.Client.query_and_wait()to accept optional parameters:query_results_format: Optional string specifying result serialization format (e.g."ARROW").compression_codec: Optional string specifying compression algorithm
- Update underlying helper functions in
_job_helpers.pyto populate these options in the request payload sent to the BigQuery API. - Update
RowIteratorand Arrow parsing logic intable.pyto seamlessly handle Arrow record batch streams whenquery_results_format="ARROW"is specified.
Alternative Approaches Considered
- Manually constructing custom
QueryJobinstances and extracting Arrow record batches post-execution, which requires boilerplate code and loses the convenience ofquery_and_wait().
Additional Context
Related PR: https://github.com/googleapis/google-cloud-python/pull/18027
Desired code experience
from google.cloud import bigquery
client = bigquery.Client()
query = "SELECT * FROM bigquery-public-data.usa_names.usa_1910_2013 LIMIT 10000"
Request query results directly in Apache Arrow format with LZ4_FRAME compression
results = client.query_and_wait(
query,
query_results_format="ARROW",
compression_codec="LZ4_FRAME",
)
Convert directly to PyArrow Table or Pandas DataFrame
arrow_table = results.to_arrow()
df = results.to_dataframe()
Expected results
- Client.query_and_wait() accepts query_results_format and compression_codec parameters.
- The BigQuery API receives these parameters in the job execution request.
- Query results are returned and parsed efficiently via compressed Apache Arrow streams into the resulting RowIterator / Arrow table without client errors.
API client name and version
No response
Use case
e.g. This feature would be useful in a scenario where I need to process large amounts of data efficiently.
Additional context
https://github.com/googleapis/google-cloud-python/pull/18027
- 主要言語
- Python
- スター
- 5.4k
- フォーク
- 1.8k
- 平均マージ
- 2日 7時間
- マージ済み PR(30日)
- 173
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
googleapis/google-cloud-python のほかの issue
-
firestore: field path with a quoted name ending in a backslash is misparsed対応中かも @sebxt が 25 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
googleapis/google-cloud-python#18771 ·
メンテナーはふだん 1 日以内に返信
-
api: spanner type: feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
googleapis/google-cloud-python#18584 ·
メンテナーはふだん 1 日以内に返信
-
auth: `impersonated_credentials` loses `subject` on copy, so `with_scopes()` and `with_quota_project()` turn off domain wide delegation対応中かも @Om-singhaI が 55 日前に担当しました。 オープンauth priority: p2 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
googleapis/google-cloud-python#18428 ·
メンテナーはふだん 1 日以内に返信
-
A client called `run_in_transaction` be stuck if Spanner is down対応中かも @founderinaction が 7 日前に担当しました。 オープンpriority: p2 type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
googleapis/google-cloud-python#18375 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
ci: enable --strict flag in presubmit twine_check再び着手できるかも @ohmayr が 44 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
googleapis/google-cloud-python#18339 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
googleapis/google-cloud-python の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
cpp-best-practices/project_validator#267 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Project-N-E-K-O/N.E.K.O#3725 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] Sending a Telegram message chain twice duplicates mentions対応中かも @123XieC が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AstrBotDevs/AstrBot#11125 ·
メンテナーはふだん 1 日以内に返信
-
backend bug priority: high
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
nooriegarg/ContribIQ#73 ·
メンテナーはふだん 1 日以内に返信
-
bug p3 security
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信