clickhouse : Cannot parse JSON string: expected opening quote: (while read the value of key data): (at row 1): While executing SourceFromInputStream

Viewed 2045

this error messge:

SELECT *
FROM queue2
Received exception from server (version 20.9.3):
Code: 26. DB::Exception: Received from xxxx:xxxx. DB::Exception: Cannot parse JSON string: expected opening quote: (while read the value of key data): (at row 1)
: While executing SourceFromInputStream.

I had created a kafka table to get data from kafka topic , and this is data structure:

{
  "deviceId": 0,
  "data": [
    {
      "port_id": "2137",
      "time":1617103821,
      "in":200.5496688741722,
      "out":319.4801324503311
    }
  ]
}

this is kafka table :

CREATE TABLE queue 
(
    deviceId Int8,
    data Nested(
    port_id String,
    time Int64,
    in Float32,
    out Float32)
) 
ENGINE = Kafka 
SETTINGS kafka_broker_list = 'xxx,xxx,xxx',
    kafka_topic_list = 'librenms_flow',
    kafka_group_name = 'niop-billing-test-group',
    kafka_format = 'JSONEachRow',
    kafka_num_consumers = 1;    

What should I do about create kafka table and MATERIALIZED VIEW ?

0 Answers
Related