title: ClickHouse JSON parse exception: Cannot parse input: expected ',' before
body: <p>I'm trying to add JSON data to ClickHouse from Kafka. Here's simplified JSON:</p>
  <pre class="lang-json prettyprint-override"><code>{
    ...
     &quot;sendAddress&quot;:{
        &quot;sendCommChannelTypeId&quot;:4,
        &quot;sendCommChannelTypeCode&quot;:&quot;SMS&quot;,
        &quot;sendAddress&quot;:&quot;789345345945&quot;},
     ...
  }
  </code></pre>
  <p>Here's the steps for creating table in ClickHouse, create another table using Kafka Engine and creating MATERIALIZED VIEW to connect these two tables, and also connect CH with Kafka.</p>
  <p>Creating the first table</p>
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE tab 
  (
      ...
  
      sendAddress Tuple (sendCommChannelTypeId Int32, sendCommChannelTypeCode String, sendAddress String),
       ...
  
  )Engine = MergeTree()
  PARTITION BY applicationId
  ORDER BY (applicationId);
  </code></pre>
  <p>Creating a second table with Kafka Engine SETTINGS:</p>
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE tab_kfk
  (
      ...
      sendAddress Tuple (sendCommChannelTypeId Int32, sendCommChannelTypeCode String, sendAddress String),
      ...
  )ENGINE = Kafka
  SETTINGS kafka_broker_list = 'localhost:9092',
         kafka_topic_list = 'topk2',
         kafka_group_name = 'group1',
         kafka_format = 'JSONEachRow',
         kafka_row_delimiter = '\n';
  </code></pre>
  <p>Create MATERIALIZED VIEW</p>
  <pre class="lang-sql prettyprint-override"><code>CREATE MATERIALIZED VIEW tab_mv TO tab AS
  SELECT ... sendAddress, ...
  FROM tab_kfk;
  </code></pre>
  <p>Then I try to SELECT all or specific items from the first table - tab and get nothing. Logs is following <a href="https://i.stack.imgur.com/00mY7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/00mY7.png" alt="exception" /></a></p>
  <p>OK. Just add '[]' before curly braces in the sendAddress like this:</p>
  <pre class="lang-json prettyprint-override"><code>&quot;authkey&quot;:&quot;some_value&quot;,
     &quot;sendAddress&quot;:[{
        &quot;sendCommChannelTypeId&quot;:4,
        &quot;sendCommChannelTypeCode&quot;:&quot;SMS&quot;,
        &quot;sendAddress&quot;:&quot;789345345945&quot;
     }]
  </code></pre>
  <p>And I still get a mistake, but slightly different:
  <a href="https://i.stack.imgur.com/sylSp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sylSp.png" alt="" /></a>
  What should I do to fix this problem, thanks!</p>