I'm trying to execute the following query on AWS Athena:
CREATE TABLE IF NOT EXISTS salesforce_processed."case"
WITH (
format = 'JSON',
external_location = 's3://path/to/my/bucket/',
partitioned_by = ARRAY['dt_obs']
)
AS
SELECT
nullif(trim("case".id), '') AS "id" ,
try(cast(date_parse("case".dt_obs, '%Y-%m-%d') as date)) as "dt_obs"
FROM salesforce_raw."case" as "case"
But it returns this error message: [ErrorCode: INTERNAL_ERROR_QUERY_ENGINE] Amazon Athena experienced an internal error while executing this query. Please contact AWS support for further assistance. You will not be charged for this query. We apologize for the inconvenience.
There's no other error info, and if I execute the select statement alone, it runs with success.