title: How to create a table from a CSV?
body: <p>SnappyData v.0.5</p>
  
  <p>I want to do something similar to loading parquet files as found in the QuickStart load scripts.</p>
  
  <blockquote>
    <p>CREATE TABLE STAGING_AIRLINEREF   USING parquet OPTIONS(path
    '../../quickstart/data/airportcodeParquetData');</p>
  </blockquote>
  
  <p>But, I have CSV files instead of parquet files.  I do not see either the "USING parquet" or a CSV version in any RowStore documentation, so I took a guess and this fails.  </p>
  
  <blockquote>
    <p>CREATE TABLE STAGING_ROADS   USING csv OPTIONS(path 'roads.csv');</p>
  </blockquote>
  
  <p>How can I create a table directly from a CSV file where the header row is the column names and the rest are loaded as data rows?</p>
  
  <h2>EDIT</h2>
  
  <p>OK. Following Spark-CSV syntax, I load this file and get zero rows or table.</p>
  
  <pre><code>"roadId","name"
  "1","Road 1"
  "2","Road 2"
  "3","Road 3"
  "4","Road 4"
  "5","Road 5"
  "6","Road 6"
  "7","Road 7"
  "8","Road 8"
  "9","Road 9"
  "10","Road 10"
  
  
  snappy&gt; run '/home/ubuntu/data/example/load_roads.sql';
  snappy&gt; SET SCHEMA A;
  0 rows inserted/updated/deleted
  snappy&gt; DROP TABLE IF EXISTS STAGING_ROADS;
  0 rows inserted/updated/deleted
  snappy&gt; CREATE TABLE STAGING_ROADS
  (road_id string, name string)
  USING com.databricks.spark.csv
  OPTIONS(path '/home/ubuntu/data/example/roads.csv', header 'true');
  0 rows inserted/updated/deleted
  </code></pre>