Skip to content

java.io.IOException when selecting nested JSON array of mixed type objects via DataGrip #1240

@maxjustus

Description

@maxjustus

Clickhouse version: 23.1
clickhouse-jdbc version: 0.3.2.11 (also tried 0.4.0 and got the same behavior)
Datagrip version: 2022.3

steps to reproduce:

set allow_experimental_object_type = 1;
CREATE OR REPLACE TABLE json
(
    o JSON
) ENGINE = Memory;
insert into json (o) values ('{"a": [{ "b": [{"c": 1, "d": "value"}] }]}');
select * from json;

select * from json raises java.io.IOException: Reached end of input stream after reading 4 of 118 bytes

if I change the json insert to
insert into json (o) values ('{"a": [{ "b": [{"d": "value"}] }]}');
the select succeeds and shows ([[[['value']]]])

if I change the json insert to
insert into json (o) values ('{"a": [{ "b": [{"c": 1}] }]}');
the select succeeds and shows ([[[[1]]]])

so it appears that the error arises when you have mixed types in a nested array in a json type column.

I also created an issue in the datagrip tracker since it's not clear whether it's a problem with Datagrip or the clickhouse-jdbc driver

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions