- Mais recentes
- Mais votos
- Mais comentários
Hi Fahad,
It seems like you're encountering a syntax error in your Athena SQL query. The error message is indicating that it's not expecting the keyword 'EXTERNAL' at the point where it's used. Without seeing the exact query, it's a bit difficult to provide a precise solution, but here are a few general tips:
- Ensure that you're using the correct syntax for the CREATE EXTERNAL TABLE statement according to the Athena documentation.
- Verify that you don't have any typos or misplaced keywords in your query.
- Check that you have the necessary permissions to create external tables in the designated S3 location linked to Athena.
If you've checked these points and the error persists, try running a simpler CREATE EXTERNAL TABLE statement to see if the problem is with the query complexity.
If you continue to have issues, providing the full query might be the best next step.
Hope this helps!
Assuming you are not using iceberg, you are correct as you should use external.
https://docs.aws.amazon.com/athena/latest/ug/creating-tables.html
I would check into some typo, comma or similar, as the error message could be misleading and just indicate a different reason.
Hi Antio You can check the above message regarding the error which is posted.
Conteúdo relevante
- AWS OFICIALAtualizada há 3 anos
- AWS OFICIALAtualizada há um ano
CREATE EXTERNAL TABLE
covid
(patient number
bigint,state patient number
string,date announced
string,estimated onset date
string,age bracket
string,Gender
string,detected city
string,detected district
string,detected state
string,state code
string,current status
string,notes
string,contracted from which patient (suspected)
string,nationality
string,type of transmission
string, support@k21academy.com 19status change date
string,source_1
string,source_2
string,source_3
string,backup notes
string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' LOCATION 's3://Yoursourcebucketname/covid/' Note: replace the source bucket NameHi Vitor, I'm copying and pasting the above Data Definition language with out any spaces and running the query which is giving the error
See if you can paste in Athena and run the query. If error is showing up any other DDL New table?
Try something like this checking all items above.
CREATE EXTERNAL TABLE covid( patient_number bigint, state_patient_number string, date_announced string, estimated_onset_date string, age_bracket string, gender string, detected_city string, detected_district string, detected_state string, state_code string, current_status string, notes string, contracted_from_which_patient_suspected string, nationality string, type_of_transmission string, status_change_date string, source_1 string, source_2 string, source_3 string, backup_notes string ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' LOCATION 's3://bucket-name/covid/';