Backport ANSI skipped-operand fix for arithmetic and concat to branch-1.2

Đang mở
#7,542 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 2 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust, scala
Lĩnh vực
backend, databases

Hướng nghiên cứu

Read docs/source/contributor-guide/backporting.md and compare the branch-1.2 implementation using NullShortCircuit with the fix proposed in PR 7456, which depends on LazyLogical from PR 7326. Reproduce the ANSI-mode query in the issue and investigate whether wrapping operands gives Spark-compatible results and what performance tradeoff it introduces. Done means proposing and implementing a viable backport approach with correctness and performance addressed.

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

Mô tả

area:expressions bug priority:medium
Describe the bug

branch-1.2 has the ANSI bug from https://github.com/apache/datafusion-comet/issues/7246 for arithmetic and concat: native Comet evaluates an operand on rows where Spark skips it, so a query Spark answers fails with CAST_INVALID_INPUT. For example, with spark.sql.ansi.enabled=true:

CREATE TABLE t(n int, txt string) USING parquet;
INSERT INTO t VALUES (NULL, 'bad'), (3, '6');
SELECT n + CAST(txt AS INT) FROM t;  -- Spark: NULL, 9. Comet: CAST_INVALID_INPUT

The fix on main is https://github.com/apache/datafusion-comet/pull/7456 (not merged yet). It cannot be cherry-picked as is: it builds on https://github.com/apache/datafusion-comet/pull/7326 (LazyLogical, speculative evaluation), which branch-1.2 does not have. branch-1.2 does have NullShortCircuit (https://github.com/apache/datafusion-comet/pull/6716), so a backport could wrap the operands without speculation.

This issue tracks whether, and how, to backport the fix to branch-1.2, as docs/source/contributor-guide/backporting.md asks for a correctness fix.

Steps to reproduce

Run the query above on branch-1.2 with ANSI mode on.

Expected behavior

Comet returns the same result as Spark: NULL where n is NULL, without evaluating CAST(txt AS INT) there.

Additional context
Willingness to contribute

I can contribute a fix for this bug independently

Ngôn ngữ chính
Scala
Star
1.3k
Fork
414
Merge trung bình
3 ngày 5 giờ
Pull request đã merge (30 ngày)
210

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

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

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.