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

Lambda examples in the SQL function docs fail with the default dialect

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

@Prajwal-k-tech đang làm issue này rồi.

Từ ngày 4/10/2026.

  • #26040 của @Prajwal-k-tech — đ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
85/100
Loại issue
Tài liệu
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust, sql
Lĩnh vực
documentation

Hướng nghiên cứu

Bắt đầu với các thuộc tính #[user_doc] cho any_match, array_filter, array_first và array_transform, sau đó kiểm tra dev/update_function_docs.sh và các mục scalar_functions.md được tạo. Chạy các ví dụ trong datafusion-cli với giá trị mặc định và một dialect lambda được hỗ trợ; hoàn tất khi tài liệu giải thích yêu cầu về dialect và các ví dụ được tạo là chính xác.

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

Mô tả

Describe the bug

The SQL reference examples for any_match, array_filter, array_first and array_transform use lambda syntax (x -> x > 2), but none of them run in datafusion-cli with the default dialect. The -> is not parsed as a lambda, so the error points at the parameter instead:

> select array_filter([1, 2, 3, 4, 5], x -> x > 2);
Error: Schema error: No field named x.

The same happens for the other three examples. They work after switching to a dialect whose supports_lambda_functions() is true (databricks, duckdb, snowflake, spark, clickhouse):

> set datafusion.sql_parser.dialect = 'duckdb';
> select array_filter([1, 2, 3, 4, 5], x -> x > 2);
[3, 4, 5]

The sqllogictest files for these functions already do this (array_transform.slt and array_any_match.slt start with set datafusion.sql_parser.dialect = databricks;), so the requirement is known; the user guide just doesn't mention it.

To Reproduce

datafusion-cli built from main at 4d167a1, then any of the four documented examples.

Expected behavior

Either the docs say that lambdas need one of those dialects (a note on each function, or once at the top of the higher-order functions section), or lambdas parse under the default dialect. The note is the small fix. Happy to send a PR for it, generated through dev/update_function_docs.sh from the #[user_doc] attributes.

Additional context

Found by running every SQL example in scalar_functions.md against a main build. Written with Claude Code (Claude Opus 5.5).

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

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.