ClickHouse / ClickHouse/ClickHouse
Protobuf Output Converts "" and 0 to NULL for Nullable columns
- Dominant language
- C++
- Stars
- 49.9k
- Forks
- 9k
- Avg merge
- 21h 32m
- Merged PRs (30d)
- 515
Description
### Company or project name
ClickHouse/pg_chdb
### Describe what's wrong
Empty string and zero values from Nullable columns return as NULL rather than an empty string or 0.
### Does it reproduce on the most recent release?
Yes
### How to reproduce
```
ClickHouse client version 26.7.2.11 (official build).
Connecting to localhost:9000 as user default.
Connected to ClickHouse server version 26.7.2.
Mac :) INSERT INTO FUNCTION file('test.tmp', 'Protobuf', 'a Nullable(Int64), b String, c Nullable(String)')
VALUES (0, '', '')
Ok.
Mac :) SELECT * FROM file('test.tmp', 'Protobuf', 'a Nullable(Int64), b String, c Nullable(String)')
┌────a─┬─b─┬─c────┐
1. │ ᴺᵁᴸᴸ │ │ ᴺᵁᴸᴸ │
└──────┴───┴──────┘
```
### Expected behavior
```
Mac :) SELECT * FROM file('test.tmp', 'Protobuf', 'a Nullable(Int64), b String, c Nullable(String)')
┌─a─┬─b─┬─c─┐
1. │ 0 │ │ │
└───┴───┴───┘
```
### Error message and/or stacktrace
_No response_
### Related issues and pull requests
chdb-io/chdb-core#152
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.