read_side_padding ignores the pad string for dictionary inputs in lpad and rpad
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ó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 72/100
Hướng nghiên cứu
Lỗi nằm trong native/spark-expr/src/static_invoke/char_varchar_utils/read_side_padding.rs, ở nhánh ba tham số xử lý đầu vào Dictionary: cả hai nhánh Dictionary đều truyền SPACE, trong khi nhánh Utf8 và LargeUtf8 truyền chuỗi đệm. Hãy đọc nhánh đó trước, rồi thêm một unit test với đầu vào Dictionary và chuỗi đệm khác khoảng trắng, chẳng hạn "x", với kết quả mong đợi là ["abxxx", "abxxx"]. Công việc hoàn tất khi kết quả Dictionary khớp với kết quả Utf8 cho cùng đầu vào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
In read_side_padding.rs, the three-argument arm ([Array, Scalar(Int32), Scalar(Utf8)]) ignores the pad string when the input is a dictionary array. The Utf8 and LargeUtf8 branches pass string to spark_read_side_padding_internal, but both Dictionary branches pass SPACE. So rpad/lpad with a custom pad pads with spaces instead.
Steps to reproduce
Kernel-level, on main at 644a87088:
let dict: DictionaryArray<Int32Type> = vec!["ab", "ab"].into_iter().collect();
let args = vec![
ColumnarValue::Array(Arc::new(dict)),
ColumnarValue::Scalar(ScalarValue::Int32(Some(5))),
ColumnarValue::Scalar(ScalarValue::Utf8(Some("x".to_string()))),
];
spark_rpad(&args) // ["ab ", "ab "]
I couldn't find a SQL query that reaches this today. The native scan input unpacks dictionary-encoded strings (see test_unpack_dictionary_string in planner.rs), and the existing string_rpad.sql tests with a custom pad pass. So this looks latent, but it would give silent wrong results if a dictionary array ever reaches the kernel, which is what the Dictionary arm (added for SPARK-48498) is there for.
Expected behavior
["abxxx", "abxxx"], the same as for a Utf8 input.
Additional context
Found while reviewing my change for #7245 (PR #7450). The fix is to pass string instead of SPACE in the two Dictionary branches and add a unit test with a dictionary input and a non-space pad.
Willingness to contribute
I can contribute a fix for this bug independently
AI disclosure: this issue was investigated and written with an AI coding assistant, and reviewed by me.
- Ngôn ngữ chính
- Scala
- Star
- 1.3k
- Fork
- 405
- Merge trung bình
- 3 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 225
Chuẩn bị môi trường
- 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-comet
-
requires-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/datafusion-comet#7479 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:writer enhancement requires-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
apache/datafusion-comet#7463 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
requires-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/datafusion-comet#7458 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:ci enhancement priority:low requires-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
apache/datafusion-comet#7319 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
area:ci bug priority:low requires-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/datafusion-comet#7315 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của apache/datafusion-comet
Issue tương tự
-
Area: PDF support
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
orbeon/orbeon-forms#8055 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Table of downloads is too longĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
lichess-org/database#103 ·
-
kind:bug priority:major
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] The LZ4 shuffle decompressor leaks a reference on its inputs when an output allocation failsĐang mở? - Needs Triage bug shuffle
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NVIDIA/cudf-spark#16770 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Spark benchmarks crash with `[INVALID_DRIVER_MEMORY]` on JVMs whose default heap is below Spark's ~450 MB minimumCó thể đã có người làm @sendaoYan đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100