- Newest
- Most votes
- Most comments
Hi fbotton,
This response assumes you're external schema is using the Glue Data Catalog.
If you've already declared the external schema and external table then it should all exist in the Glue Data Catalog. If so, one thing you could try to isolate where the issue is would be to try to query the same external table from Athena. Athena should be able to see a Glue Data Catalog "database", here thanks to Hive a "database" and "schema" are really the same thing. In the Glue Data Catalog "database" you should be able to see the same Redshift external table you declared and query it from Athena. If you get a similar error in Athena then I'd look to the Glue Data Catalog table LOCATION property to see what may be wrong with the S3 location that table data is located in.
I'll bet this will help you find the problem.
Regards,
-Kurt
Hey,
managed to fix the issue following the path from Kurt.
Initially in my case what I did was the following:
- Used a crawler to create a table in glue from an existing S3
- Created a new database and schema/table from Redshift to point to the same S3 location
- Tried to query the table with the error
Clearly I missed that the database to query from Spectrum was the one created with the crawler, so I basically deleted the old table and schema in Redshift and created a new schema pointing to the database of the table already existing in Glue.
In this way I did not had to create the table in Spectrum since Redshift was in this case already capable of reaching the one in the catalog.
I did query this new table using this newly created schema and this time it worked fine.
Anyone reading feel free to reach out
Fabio
Edited by: fbotton on May 18, 2021 3:39 AM
Relevant content
- Accepted Answerasked 4 years ago
- asked 5 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago