[jdbc-v2] Option to trim trailing NULs from FixedString on read

Đang mở
#3,288 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

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

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 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
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
clickhouse, java
Lĩnh vực
database

Hướng nghiên cứu

The read path lives in the JDBC v2 module, where BinaryStreamReader decodes FixedString values with new String(bytes, 0, precision); start there and check how the connection properties are parsed and passed down to column readers. Done means an opt-in jdbc_trim_fixed_string=true property strips trailing \0 bytes on getString and getObject, with the default behaviour unchanged. Check related issue #2929 before starting, since it may overlap.

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

Mô tả

area:data-type area:jdbc-read jdbc-v2

getString() / getObject() on a FixedString(N) column return all N bytes, trailing \0 included (BinaryStreamReader decodes new String(bytes, 0, precision)).

That matches ClickHouse semantics. But Tableau 2026.3.0 no longer hides the NULs (2026.2.1 did), so Tableau users see "Dario Medina\0\0\0…". The Tableau connector can't trim on its side, and output_format_trim_fixed_string only applies to text formats, not RowBinary.

Repro (clickhouse-jdbc 0.11.0, ClickHouse 26.10.3.7):

ResultSet rs = conn.createStatement().executeQuery("SELECT toFixedString('Dario', 10)");
rs.next();
rs.getString(1);  // "Dario\0\0\0\0\0", length 10

Ask: an opt-in connection property (e.g. jdbc_trim_fixed_string=true) that strips trailing \0 from FixedString on read. Off by default; the Tableau connector would enable it.

Related: #2929

Ngôn ngữ chính
Java
Star
1.6k
Fork
649
Merge trung bình
1 ngày 20 giờ
Pull request đã merge (30 ngày)
39

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 ClickHouse/clickhouse-java

Tất cả issue của ClickHouse/clickhouse-java

Issue tương tự

Thêm issue về Java

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.