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

`array_concat` with an untyped `NULL` argument fails with "does not support type Int64"

Đang mở Phù hợp với người mới
#26,243 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

@RishavTiwari25 đang làm issue này rồi.

Từ ngày 13/10/2026.

  • #26254 của @RishavTiwari25 — đang mở

Đá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
80/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ệ
rust
Lĩnh vực
backend, databases

Hướng nghiên cứu

Bắt đầu bằng cách đọc ArrayConcat::coerce_types và ArrayConcat::return_type, đặc biệt là phương án dự phòng coerced_type_with_base_type_only được mô tả trong issue. Tái hiện lỗi bằng SELECT array_concat([1, 2], NULL) trong datafusion-cli, sau đó kiểm tra các bài kiểm thử hiện có về phép nối mảng và trường hợp NULL có kiểu trong #16349. Công việc hoàn tất khi truy vấn có NULL không có kiểu trả về [1, 2] và dạng array_cat được báo cáo được kiểm thử.

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

Mô tả

Describe the bug

array_concat / array_cat fails to plan when one of the arguments is a plain NULL literal, and the error message names the element type of the other argument:

> SELECT array_concat([1, 2], NULL);
Error during planning: array_concat does not support type Int64

> SELECT array_cat(NULL, [1, 2]);
Error during planning: array_concat does not support type Int64

The same calls work when the NULL is typed (NULL::int[]) or when a NULL appears inside a list, so this is only the untyped literal:

> SELECT array_concat([1, 2], NULL::int[]);
[1, 2]

> SELECT array_concat([1, 2], [NULL]);
[1, 2, NULL]

ArrayConcat::return_type accepts DataType::Null arguments, but ArrayConcat::coerce_types runs every argument through coerced_type_with_base_type_only, whose fallback arm replaces a non-list type with the base type. The Null argument therefore becomes Int64, and the second return_type call rejects it.

To Reproduce

In datafusion-cli:

SELECT array_concat([1, 2], NULL);
SELECT array_cat(NULL, [1, 2]);
SELECT array_concat(['a'], NULL);
Expected behavior

The untyped NULL is treated like a NULL list of the result type and the other arguments are returned, matching PostgreSQL (array_cat(ARRAY[1, 2], NULL) is {1,2}) and the typed-NULL behavior above:

> SELECT array_concat([1, 2], NULL);
[1, 2]
Additional context

Reproduced on main at 6663e4348 (debug build of datafusion-cli).

#16349 covered NULL::int[] arguments; this is the remaining untyped case. I would like to work on this.

Ngôn ngữ chính
Rust
Star
9.4k
Fork
2.5k
Merge trung bình
4 ngày 9 giờ
Pull request đã merge (30 ngày)
329

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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/datafusion

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

Issue tương tự

Thêm issue về Rust

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.