Lambda examples in the SQL function docs fail with the default dialect
Maintainer thường phản hồi trong vòng 1 ngà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
- 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
- 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
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.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/datafusion
-
array_min / array_max fail on a zero-row batch for non-primitive element typesCó thể đã có người làm @linuxpi đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
apache/datafusion#26072 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
BaselineMetrics output_bytes converts every column to ArrayData for every batchCó thể đã có người làm @minhh-nguyen đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/datafusion#26071 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`CoalescePartitionsExec::cardinality_effect` returns `Equal` when `fetch` is setCó thể đã có người làm @asolimando đã nhận 4 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
apache/datafusion#26050 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Replace manual `RowSelection` bitmap conversion with `force_mask()` after arrow-rs releaseCó thể đã có người làm @isabellehuangg đã nhận 4 ngày trước. Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/datafusion#26030 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Spark `xxhash64` hashes the raw bits of a NaN instead of the canonical NaNCó thể đã có người làm @mrhard9090 đã nhận 7 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
apache/datafusion#25913 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/datafusion
Issue tương tự
-
[Feature]: [P3] engine-rs: the package source hash should ignore line endings and untracked filesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
maniator/verticopolis#880 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 3 ngày
-
defect
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 2 ngày