[Bug]: BigQueryVectorSearchParameters.format_query generates invalid SQL for options and duplicate embedding_column

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

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

@arijeetmukherjee3108-droid がすでに取り組んでいます。

2026年11月25日 から。

  • #41690 @arijeetmukherjee3108-droid による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
18/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python, sql

調査の方向性

Start with format_query in sdks/python/apache_beam/ml/rag/enrichment/bigquery_vector_search.py, checking how options is interpolated and how the base subquery selects embedding_column alongside columns. Run the reproduction from the issue to see the generated SQL. Done means options is emitted as a single-quoted JSON string and embedding_column is not duplicated. Pull request #41690 already targets this, so review or coordinate with it rather than starting a parallel fix.

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

説明

bug P2 python
What happened?

BigQueryVectorSearchParameters.format_query() in sdks/python/apache_beam/ml/rag/enrichment/bigquery_vector_search.py generates invalid BigQuery SQL in two cases:

  1. Invalid options clause: BigQuery's VECTOR_SEARCH expects options to be a single-quoted JSON string literal (e.g. options => '{"use_brute_force": true}'). Currently, format_query() interpolates the Python dict directly (f", options => {self.options}"), producing invalid SQL such as:
    , options => {'use_brute_force': True, 'fraction_lists_to_search': 0.01}
    
  2. Duplicate embedding_column in subquery: The base table subquery unconditionally selects (SELECT {columns_str}, {self.embedding_column} ...). If embedding_column is also included in columns, BigQuery receives a duplicate column name (e.g. SELECT content, embedding, embedding).
Reproduction
from apache_beam.ml.rag.enrichment.bigquery_vector_search import BigQueryVectorSearchParameters
from apache_beam.ml.rag.types import Content, EmbeddableItem, Embedding

params = BigQueryVectorSearchParameters(
    project='my-proj',
    table_name='my-proj.ds.tbl',
    embedding_column='embedding',
    columns=['content', 'embedding'],
    neighbor_count=5,
    options={'use_brute_force': True, 'fraction_lists_to_search': 0.01},
)
item = EmbeddableItem(
    id='1',
    content=Content(text='hi'),
    embedding=Embedding(dense_embedding=[0.1, 0.2]),
)
print(params.format_query([item]))
Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

Issue Components
  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam YAML
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Infrastructure
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Prism Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner
主要言語
Java
スター
8.7k
フォーク
4.8k
平均マージ
3日 16時間
マージ済み PR(30日)
445

環境構築

はじめの一歩

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

apache/beam のほかの issue

apache/beam の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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