cast and convert function works as expected in Athena:
SELECT code_2 as mydate, cast( code_2 as varchar) from some_table
but how do I extract 8 leftmost characters? This throws an error:
SELECT code_2 as mydate, left(cast( code_2 as varchar),8) as date from some_table
Here is the error:
extraneous input 'left' expecting