Select from map with LowCardinality keys returns ClickHouseUnknownException: ClickHouse exception, message: Parse exception: ByteFragment
See original GitHub issueHello,
My setup Clickhouse server version 21.9.4 revision 54449 Clickhouse client version 21.9.4.35 JDBC version 0.3.1
Native client works
CREATE TABLE lcmap (m Map(LowCardinality(String), Int32)) ENGINE=Memory;
//...
INSERT INTO lcmap(m) VALUES ({'key1':1});
//...
select * from lcmap;
//...
┌─m──────────┐
│ {'key1':1} │
└────────────
But when I try to execute select * from lcmap;
in Datagrip I get
<failed to load>
ru.yandex.clickhouse.except.ClickHouseUnknownException: ClickHouse exception, message: Parse exception: ByteFragment{[{'key1':1}], start=0, len=10}; null
at ru.yandex.clickhouse.response.ClickHouseResultSet.getObject(ClickHouseResultSet.java:648)
in JdbcHelperImpl.getObject(JdbcHelperImpl.java:321)
Caused by: java.lang.NullPointerException
at java.base/java.util.Objects.requireNonNull(Objects.java:221)
at ru.yandex.clickhouse.response.parser.ClickHouseMapParser.parse(ClickHouseMapParser.java:119)
at ru.yandex.clickhouse.response.parser.ClickHouseMapParser.parse(ClickHouseMapParser.java:17)
at ru.yandex.clickhouse.response.ClickHouseResultSet.getObject(ClickHouseResultSet.java:749)
at ru.yandex.clickhouse.response.ClickHouseResultSet.getObject(ClickHouseResultSet.java:642)
... 21 more
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
LowCardinality Data Type | ClickHouse Docs
LowCardinality is a superstructure that changes a data storage method and rules of data ... increases performance of SELECT queries for many applications....
Read more >Using Array(Tuple(LowCardinality(String), Int32)) in ClickHouse
Until it will be fixed (see bug 7815), can be used this workaround: SELECT uniqExact((id, date)) AS count FROM table ARRAY JOIN values...
Read more >clickhouse-jdbc - bytemeta
Select from map with LowCardinality keys returns ClickHouseUnknownException: ClickHouse exception, message: Parse exception: ByteFragment. PavelRuban.
Read more >ClickHouse tips #10: Null behavior with LowCardinality columns
If you have LowCardinality(String) column, inserting a NULL value will work fine. ... DB::Exception: Sorting key cannot contain nullable columns.
Read more >Polling_Interval attribute not initialized in Azure Datafactory ...
Select from map with LowCardinality keys returns ClickHouseUnknownException: ClickHouse exception, message: Parse exception: ByteFragment, 5, 2021-10-04, 2022- ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry I’m in the middle of merging new gRPC client into develop branch. After which, I’ll create another pull request by updating JDBC driver, clickhouse-jdbc module to be more specific, to use the new client in order to support more data types.
If you’re familiar with Java, you may play with the new client in these two days to explore what’s coming next.
Thanks for reporting the issue. The driver does not support nested data types very well at this point. It understands
Map(String, Int32)
but notMap(LowCardinality(String), Int32)
,Map(String, Nullable(Int32))
, orMap<String, Tuple(Int32, Array())>
. Actually these cases work in an in-development version, so I believe this will be addressed in next release.