Skip to content

Querying JSON field returns "Failed to read value for column data" or "Failed to read next row" #2598

@philip-dbvis

Description

@philip-dbvis

Description

When querying certain JSON column I get following errors.

Steps to reproduce

1.
Create a table with id and JSON as columns.
CREATE TABLE test (id UInt64, data JSON) ENGINE = MergeTree ORDER BY id;
Insert data.

INSERT INTO test (id, data) VALUES
(
     1,
    '{"FailedToReadValueForColumnData":{"bar":[{"field1":"value1","field2":"value2","field3":"value3","field4":"value4"},{"field1":"value5","field2":"value6","field3":"value7","field4":"value8"}]}}'
);

INSERT INTO test (id, data) VALUES
(
     2,
    '{"Works":"bye"}'
);
INSERT INTO test (id, data) VALUES
(
     3,
    '{"FailedReadNextRow":{"hi":[{"hi":"byyyyyyyyye"}]}}'
);

2.
Query them

SELECT * from test where id=1;
SELECT * from test where id=2;
SELECT * from test where id=3;

3.

You'll see that id 1 gives error with message "Failed to read value for column data", id 2 works, id 3 gives error with message "Failed to read next row"

Error Log or Exception StackTrace

0 = {StackTraceElement@20265} "com.clickhouse.jdbc.internal.ExceptionUtils.toSqlState(ExceptionUtils.java:69)"
1 = {StackTraceElement@20266} "com.clickhouse.jdbc.internal.ExceptionUtils.toSqlState(ExceptionUtils.java:42)"
2 = {StackTraceElement@20267} "com.clickhouse.jdbc.ResultSetImpl.next(ResultSetImpl.java:118)"

Expected Behaviour

To get the full rows back

Configuration

Client Configuration

Using the JDBC driver version 0.9.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions