title: How to extract month name on a string datatype on athena
body: <pre><code>SELECT sales_invoice_date,
         MONTH( DATE_TRUNC('month',
                           CASE
                             WHEN TRIM(sales_invoice_date) = '' THEN
                             DATE('1999-12-31')
                            ELSE
                             DATE_PARSE(sales_invoice_date, '%m/%d/%Y')
                           END) ) AS DT
    FROM testdata_parquet
  </code></pre>
  
  <p>I used the query above to convert the string into date and was able to get the month number on AWS athena but I wasn't able to get the corresponding month name</p>
  
  <p>I have already tried <code>monthname</code> and <code>datename('month', ...)</code> but they gave the following error messages respectively:</p>
  
  <blockquote>
    <p>SYNTAX_ERROR: line 2:1: Function <strong>monthname</strong> not registered</p>
    
    <p>SYNTAX_ERROR: line 2:1: Function <strong>datename</strong> not registered</p>
  </blockquote>