Register Redshift data catalogs in Athena
Athena can read and write data stored in Redshift clusters or serverless namespaces that have been registered in the Amazon Glue Data Catalog. This works in tandem with Amazon Lake Formation, which provides centralized security and governance, ensuring that data access is managed consistently across different query engines and maintaining fine-grained access controls for the shared Redshift data.
Considerations and limitations
-
Materialized views – Amazon Redshift materialized views are queryable from Athena but creating materialized views using Athena or Spark is not supported.
-
DDL operations, including setting Amazon Glue Data Catalog configuration and operations on Amazon Redshift managed storage tables, are not supported.
Prerequisites
Before you can query a Amazon Glue data catalog from Athena, complete the following tasks:
-
Create and register an Amazon Redshift cluster or serverless namespace to the Amazon Glue Data Catalog. For more information, see Registering a cluster to the Amazon Glue Data Catalog or Registering namespaces to the Amazon Glue Data Catalog in the Amazon Redshift Management guide.
-
Create a data catalog in Amazon Lake Formation from the registered namespace. For more information, see Creating Amazon Redshift federated catalogs in the Amazon Lake Formation Developer Guide.
-
(Optional) Use Lake Formation to set fine-grained access controls on the catalog. For more information, see Bringing your data into the Amazon Glue Data Catalog in the Amazon Lake Formation Developer Guide.
Register a Redshift data catalog with the Athena console
To register a Redshift data catalog with Athena console, perform the following steps.
-
Open the Athena console at https://console.aws.amazon.com/athena/
. -
In the navigation pane, choose Data sources and catalogs.
-
On the Data sources and catalogs page, choose Create data source.
-
For Choose a data source, choose Amazon S3 - Amazon Glue Data Catalog.
-
In the Amazon Glue Data Catalog section, for Data source account, choose Amazon Glue Data Catalog in this account.
-
For Create a table or register a catalog, choose Register a new Amazon Glue Catalog.
-
In the Data source details section, for Data source name, enter the name that you want to use to specify the data source in your SQL queries or use the default name that is generated.
-
For Catalog, choose Browse to search for a list of Amazon Glue catalogs in the same account. If you do not see any existing catalogs, create one in Amazon Glue console
. -
In the Browse Amazon Glue catalogs dialog box, select the catalog that you want to use, and then choose Choose.
-
(Optional) For Tags, enter any key/value pairs that you want to associate with the data source.
-
Choose Next.
-
On the Review and create page, verify that the information that you entered is correct, and then choose Create data source.