`SELECT *` fails after a column is added until the next write to the table

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
58/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust, sql
領域
backend, databases

調査の方向性

Start by reproducing the query after the schema-only column addition, then read crates/datafusion/src/table/mod.rs at the provider declarations and iceberg-rust's TableScanBuilder::build, which binds scans to the snapshot schema. Done means the fresh provider can run SELECT * and return the existing value with NULL for the newly added column without a new table write.

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

説明

bug
Describe the bug

IcebergTableProvider and IcebergStaticTableProvider::try_new_from_table declare the table's current schema (table/mod.rs#L94-L97, table/mod.rs#L258-L262). iceberg-rust's scan binds the projection and filters to the schema of the snapshot it reads instead: TableScanBuilder::build uses snapshot.schema(...). After a schema change that has no snapshot of its own, the provider declares columns the scan can't find.

To Reproduce
  1. Create t(a INT NOT NULL) and insert one row.
  2. Add an optional column c STRING, for example with Transaction::update_schema().add_column(AddColumn::optional("c", ...)) or with ALTER TABLE ... ADD COLUMN from Spark. Don't write any new data.
  3. Build a fresh provider and run SELECT * FROM t:
DataInvalid => Column c not found in table. Schema: table {
  1: a: required int
}
Expected behavior

The query returns a = 1, c = NULL.

Additional context

The root cause is the iceberg-rust scan behavior tracked in apache/iceberg-rust#2565 and apache/iceberg-rust#2905. Until that's fixed upstream, this crate could declare the scanned snapshot's schema, or fill columns missing from it with nulls.

主要言語
Rust
スター
33
フォーク
34
平均マージ
4日 14時間
マージ済み PR(30日)
10

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

apache/datafusion-iceberg のほかの issue

apache/datafusion-iceberg の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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