ClickHouse / ClickHouse/clickhouse-java

When serialize FixedString and string is bigger than size defined in Table definition

Open
#2,223 3 comments 0 reactions 0 assignees View on GitHub
area:data-type client-api-v2 v2-feedback
Dominant language
Java
Stars
1.6k
Forks
636
Avg merge
2d 23h
Merged PRs (30d)
29

Description

### Describe your feedback
Currently, the behavior is that if the string that is sent to serialize is bigger, we send only the length defined in the table schema.

A good approach is to have a flag that indicates if it's a bigger throw Exception or send only a string of a defined size.

### Code example
How it's done today
writeFixedString only what is needed.
```java
BinaryStreamUtils.writeFixedString(stream, convertToString(value), column.getPrecision());
```

Contributor guide

Open the contributing guide

Research direction

Start at the serialization call to BinaryStreamUtils.writeFixedString in the Java client, where column.getPrecision() limits the value. Review how FixedString columns are represented and how serialization errors are handled; done means the chosen behavior for oversized strings is configurable and covered by tests, but the issue does not name existing test files.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.