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

Đang mở Phù hợp với người mới
#492 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
data-engineering

Hướng nghiên cứu

Bắt đầu với appendColumnValues trong internal/sink/iceberg.go, nơi issue cho biết các giá trị bị thiếu hoặc không thể phân tích được thêm vào dưới dạng null mà không kiểm tra Required. Theo dõi cách Iceberg writer xử lý null trong các trường bắt buộc và tìm các kiểm thử liên quan. Công việc hoàn tất khi một bản ghi thiếu giá trị bắt buộc bị từ chối hoặc được báo cáo, thay vì xuất hiện như một hàng bình thường có giá trị 0, và hành vi này được một kiểm thử bao quát.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
59
Fork
16
Merge trung bình
5 giờ 46 phút
Pull request đã merge (30 ngày)
121

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của KafScale/platform

Tất cả issue của KafScale/platform

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.