title: Create external table from csv file in AWS Athena
body: <p>I am trying to create an external table in AWS Athena from a csv file that is stored in my S3.</p>
  <p>The csv file looks as follows. As you can see, the data is <strong>not</strong> enclosed in quotation marks (<code>&quot;</code>) and is delimited by commas (<code>,</code>).</p>
  <pre><code>ID,PERSON_ID,DATECOL,GMAT
  612766604,54723367,2020-01-15,637
  615921503,158634997,2020-01-25,607
  610656030,90359154,2020-01-07,670
  </code></pre>
  <p>I tried the following code to create a table:</p>
  <pre class="lang-sql prettyprint-override"><code>CREATE EXTERNAL TABLE my_table
      (
          ID string,
          PERSON_ID int,
          DATE_COL date,
          GMAT int
      )
  ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
  STORED AS TEXTFILE
  LOCATION 's3://my_bucket/som_bucket/dat/'
  TBLPROPERTIES
      (
          'skip.header.line.count'='1'
      )
  ;
  </code></pre>
  <p>I tried to preview the table with the following code:</p>
  <pre class="lang-sql prettyprint-override"><code>select
      *
  from
      my_table
  limit 10
  </code></pre>
  <p>Which raises this error:</p>
  <blockquote>
  <p>HIVE_BAD_DATA: Error parsing field value '2020-01-15' for field 2: For input string: &quot;2020-01-15&quot;</p>
  </blockquote>
  <p>My question is: Am I passing the correct serde? And if so, how can I format the date column (<code>DATE_COL</code>) such that it reads and displays days in YYYY-MM-DD?</p>