I am trying to create a table in AWS Athena with the following command. However I get the error:mismatched input 'EXTERNAL'. Expecting: 'OR', 'SCHEMA', 'TABLE', 'VIEW'
Can you helpp with this?
CREATE EXTERNAL TABLE IF NOT EXISTS 'transport_evaluator_prod' (
`messageId` STRING,
`type` STRING,
`causationId` STRING,
`correlationId` STRING,
`traceparent` STRING,
`data` STRUCT<
`evaluationOccurred`:STRING,
`eta`:STRUCT<
`distance`:INT,
`timeToDestination`:INT,
`eta`:STRING,
`destination`:STRUCT<
`latitude`:DOUBLE,
`longitude`:DOUBLE,
`altitude`:DOUBLE>,
`destinationEventId`:STRING,
`origin`:STRUCT<
`latitude`:DOUBLE,
`longitude`:DOUBLE,
`altitude`:DOUBLE>,
`originEventId`:STRING,
`plannedArrival`:STRING,
`locationActionReference`:STRING,
`resourceUrn`:STRING,
`eventProvider`:STRING,
`occured`:STRING,
`position`:STRUCT<
`latitude`:DOUBLE,
`longitude`:DOUBLE,
`altitude`:DOUBLE>,
`equipmentNumber`:STRING,
`received`:STRING>>)
ROW FORMAT SERDE
'org.openx.data.jsonserde.JsonSerDe'
LOCATION
'for-security-pointing-to-folder'
I am providing what I changed in order to get it to work for the sake of the next person that might run into similar issues