[FLINK] [VL] Support binary (VARBINARY/BYTES) arguments for the hash expressions (MD5/SHA1/SHA2 family)

Đang mở
#13,635 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 3 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
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp, java
Lĩnh vực
data-engineering

Hướng nghiên cứu

Start with the LogicalTypeConverter in gluten-flink, which has no VarBinaryType mapping and fails with 'Unsupported logical type: BYTES'. Then find the velox flinksql hash registrations, which only declare Varchar signatures for md5, sha1, sha2 and the sha224 to sha512 variants, and add Varbinary overloads with gtest cases. Done when MD5(X'6162') returns 187ef4436122d1cc2f40dc2b92f0eba0, the SHA-2 family matches native Flink, and empty bytes and NULL are covered.

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

Mô tả

bug triage
Backend

VL (Velox)

Bug description
Background

Flink's hash expressions (MD5, SHA1, SHA2 / SHA224 / SHA256 / SHA384 / SHA512)
accept the STRING family, which includes binary types, and hash the raw bytes of the input,
returning a lowercase hex string. Native reference (Flink 1.19.x):

SELECT MD5(X'6162') -> 187ef4436122d1cc2f40dc2b92f0eba0, the same as MD5('ab').

gluten-flink currently supports VARCHAR only:

  • velox's flinksql hash functions register Varchar input signatures only;
  • LogicalTypeConverter has no VarBinaryType mapping, so any BYTES column or expression
    fails at planning with java.lang.RuntimeException: Unsupported logical type: BYTES NOT NULL
    before the hash converter is reached.

The SHA-2 family (#13484) has exactly the same limitation, and end-to-end runs confirm it
(gluten fails at planning, native succeeds). This is not specific to MD5/SHA1 (#13420).

Scope
  1. velox (flinksql namespace): register (Varbinary) -> Varchar for md5, sha1, sha2,
    sha224, sha256, sha384, sha512, hashing the raw bytes and rendering lowercase hex;
    add gtest coverage for binary input (including empty bytes and NULL).
  2. gluten-flink LogicalTypeConverter: map VarBinaryType to the velox VarbinaryType.
  3. Tests: gluten UT with a BYTES column (X'6162', empty bytes, NULL) plus an end-to-end
    dual-run against native Flink.
  4. Covers MD5/SHA1 (#13420) and the SHA-2 family (#13484).
Expected behavior

MD5(bytes), SHA1(bytes) and SHA2(bytes, n) return the same digests as native Flink.

Gluten version

main branch

Spark version

None

Spark configurations

No response

System information

No response

Relevant logs

Ngôn ngữ chính
Scala
Star
1.6k
Fork
685
Merge trung bình
4 ngày 16 giờ
Pull request đã merge (30 ngày)
84

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

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

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.