title: Use csv-data in clickhouse table
body: <p>I have a problem when I want to use data from a csv-file in a table I have created. The database I created is called "test" and the table is created as following: </p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE testing
  (
      `year` Int16, 
      `amount` Int16, 
      `rate` Float32, 
      `number` Int16
  )
  ENGINE = Log
  
  Ok.
  
  0 rows in set. Elapsed: 0.033 sec. 
  </code></pre>
  
  <p>I created all these columns to be able to cover all the data in the csv-file. I've read through the clickhouse documentation but just can't figure out how to get the data into my database.</p>
  
  <p>I tested to do this:</p>
  
  <pre><code>$ cat test.csv | clickhouse-client \ &gt;-- database =test\ &gt;--query='INSERT test FORMAT CSV'
  
  Code: 62. DB::Exception: Syntax error: failed at position 1 (line 1, col 1): 2010,646,1.00,13
  2010,2486,1.00,19
  2010,8178,1.00,10
  2010,15707,1.00,4
  2010,15708,1.00,10
  2010,15718,1.00,4
  2010,16951,1.00,8
  2010,17615,1.00,13
  2010. Unrecognized token
  </code></pre>
  
  <p>Link: <a href="https://yadi.sk/d/ijJlmnBjsjBVc" rel="nofollow noreferrer">https://yadi.sk/d/ijJlmnBjsjBVc</a></p>