Iceberg processor writes 0 into a required column when the record has no value for it

オープン 初心者向け
#492 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

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

調査の方向性

internal/sink/iceberg.go の appendColumnValues から始めてください。issue には、Required を確認せずに、欠損値や解析できない値が null として追加されると記載されています。Iceberg writer が必須フィールドの null をどのように扱うかを追い、関連するテストを見つけてください。必須値が欠けているレコードが、0 を含む通常の行として現れるのではなく、拒否または報告され、その動作がテストでカバーされていれば完了です。

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

説明

The Iceberg processor writes records that have no value for a required: true column. The column is NOT NULL in the table, so the missing value lands as 0 instead of the record being rejected or reported.

Steps

  1. Map a topic with a required column, for example:

    mappings:
      - topic: orders
        table: kafscale.orders
        mode: append
        create_table_if_missing: true
        schema:
          columns:
            - {name: order_id, type: long, required: true}
            - {name: status, type: string}
    
  2. Produce one record that is not JSON (value hello) and some valid JSON records such as {"order_id":1,"status":"paid"}.

  3. Query the table.

Expected

The record without order_id is not written as a normal row (skipped and counted, or the batch fails), or the docs say what happens.

Actual

KafScale v2.2.0 (fc9ed22), schema mode off:

record_id   order_id  status  value
orders:3:0  0         NULL    r2
orders:1:0  0         NULL    hello

DESCRIBE shows order_id bigint not null. appendColumnValues in internal/sink/iceberg.go calls appendNull() for a missing or unparsable value without checking Required, and the writer turns the null into 0 for the required field. Readers cannot tell a missing order_id from a real 0.

主要言語
Go
スター
59
フォーク
16
平均マージ
5時間 46分
マージ済み PR(30日)
121

環境構築

はじめの一歩

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

KafScale/platform のほかの issue

KafScale/platform の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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