7
votes

I have a table defined in Glue data catalog that I can query using Athena. As there is some data in the table that I want to use with other Redshift tables, can I access the table defined in Glue data catalog?

What will be the create external table query to reference the table definition in Glue catalog?

1

1 Answers

7
votes

From AWS (Creating External Schemas),

create external schema athena_schema from data catalog 
database 'sampledb' 
iam_role 'arn:aws:iam::123456789012:role/MySpectrumRole' 
region 'us-east-2';

This creates a schema athena_schema that points to the sampledb database in Athena / Glue.

You need to grant appropriate access to the IAM role you specify: the Redshift cluster needs to be able to assume the role, and the role needs access to Glue.