Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

JSONL File Scan reads a JSON null as the text "null"

Đang mở Phù hợp với người mới
#8,674 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
86/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ệ
scala
Lĩnh vực
data-engineering

Hướng nghiên cứu

Bắt đầu tại JSONUtils.JSONToMap và kiểm tra cách xử lý value-node đối với JSON null. Chạy JSONUtilsSpec, bao gồm cả hai assertion cho null, và xác minh việc tái hiện JSONL File Scan với {"a":1} và {"a":null}. Được coi là hoàn tất khi null vẫn là một giá trị rỗng và suy luận schema tạo ra một cột INTEGER thay vì STRING.

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

Mô tả

What happened?

The JSONL File Scan reads a JSON null as the text "null". One null in a column is enough to make the whole column STRING, so a column of numbers comes out as text and its missing value is the word null rather than an empty cell. A sort, a filter or any arithmetic downstream then works on the wrong type.

The cause is JSONUtils.JSONToMap: a null is a value node, so it takes the child.asText() branch, and NullNode.asText() returns "null". Schema inference then fails to parse "null" as a number and widens the column to STRING.

Two assertions in JSONUtilsSpec expect "null" today. They were added in #4716, whose description says the spec pins the current behavior so that a fix has to update it on purpose.

How to reproduce?
  1. Upload a JSONL file with these two lines:
    {"a":1}
    {"a":null}
    
  2. Add a JSONL File Scan that reads it and run the workflow.
  3. Column a is inferred as STRING, and the two rows hold the text "1" and the text "null". Expected: INTEGER, with 1 and an empty value.
Version/Branch

1.4.0-incubating-SNAPSHOT (main)

Commit Hash (Optional)

53052c482

What browsers are you seeing the problem on?

No response

Relevant log output
Schema[Attribute[name=a, type=string]]
row 1: '1' (String)
row 2: 'null' (String)
Ngôn ngữ chính
Scala
Star
316
Fork
189
Merge trung bình
4 ngày 6 giờ
Pull request đã merge (30 ngày)
161

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 apache/texera

Tất cả issue của apache/texera

Issue tương tự

Thêm issue về Scala

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.