10

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?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Abhay Dubey
  • 549
  • 2
  • 7
  • 18

1 Answers1

11

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.

Kirk Broadhurst
  • 27,836
  • 16
  • 104
  • 169