title: How does Calcite deal with data conversion?
body: <p>I am trying to convert a date that's stored as a string to a date, e.g.</p>
  
  <p>YYYYMMDD (string) to YYYY-MM-DD (date) </p>
  
  <p>As far as I know there is no conversion function that checks input format and output format, I tried manual logic, e.g. </p>
  
  <pre><code>CASE 
    WHEN CHAR_LENGTH(TRIM(some_string_date)) = 8
    THEN
      CAST(
        SUBSTRING(TRIM(some_string_date) FROM 1 FOR 4)
        || '-'
        || SUBSTRING(TRIM(some_string_date) FROM 5 FOR 2)
        ||'-'
        || SUBSTRING(TRIM(some_string_date) FROM 7 FOR 2)
      as DATE) 
    ELSE
      NULL 
  END
  </code></pre>
  
  <p>However this is not accepted by Apache SQL Validator, does anyone see problem here?</p>