Import JSON into ClickHouse
<p>I create table with this statement:</p>

<pre><code>CREATE TABLE event(
    date Date,
    src UInt8,
    channel UInt8,
    deviceTypeId UInt8,
    projectId UInt64,
    shows UInt32,
    clicks UInt32,
    spent Float64
) ENGINE = MergeTree(date, (date, src, channel, projectId), 8192);
</code></pre>

<p>Raw data looks like:</p>

<pre><code>{ "date":"2016-03-07T10:00:00+0300","src":2,"channel":18,"deviceTypeId ":101, "projectId":2363610,"shows":1232,"clicks":7,"spent":34.72,"location":"Unknown", ...}
...
</code></pre>

<p>Files with data loaded with the following command:</p>

<pre><code>cat *.data|sed 's/T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]+0300//'| clickhouse-client --query="INSERT INTO event FORMAT JSONEachRow"
</code></pre>

<p><em>clickhouse-client</em> throw exception: </p>

<pre><code>Code: 117. DB::Exception: Unknown field found while parsing JSONEachRow format: location: (at row 1)
</code></pre>

<p>Is it possible to skip fields from JSON object that not presented in table description?</p>