![]() ![]() In such cases, the external database metadata is stored in your Data Catalog. You can create an external database by including the CREATE EXTERNAL DATABASE IF NOT EXISTS clause as part of your CREATE EXTERNAL SCHEMA statement. Viewing Redshift Spectrum databases in Athena and AWS Glue We recommend using Amazon Redshift to create and manage external databases and external tables in Redshift Spectrum. You can also create and manage external databases and external tables using Hive data definition language (DDL) using Athena or a Hive metastore, such as Amazon EMR. ![]() You can view and manage Redshift Spectrum databases and tables in your Athena console. By default, Redshift Spectrum metadata is stored in an Athena Data Catalog. The metadata for Amazon Redshift Spectrum external databases and external tables is stored in an external data catalog. Working with external catalogs in Amazon Redshift Spectrum The following example creates an external schema named spectrum_schema using the external database spectrum_db.įor the full command syntax and examples, see CREATE EXTERNAL SCHEMA. To create an external database at the same time you create an external schema, specify FROM DATA CATALOG and include the CREATE EXTERNAL DATABASE clause in your CREATE EXTERNAL SCHEMA statement. For more information, see Upgrading to the AWS Glue Data Catalog in the Amazon Athena User Guide. To use an AWS Glue Data Catalog with Redshift Spectrum, you might need to change your IAM policies. If you currently have Redshift Spectrum external tables in the Athena Data Catalog, you can migrate your Athena Data Catalog to an AWS Glue Data Catalog. For more information about authorization, see IAM policies for Amazon Redshift Spectrum. Then you attach the role to your cluster and provide Amazon Resource Name (ARN) for the role in the Amazon Redshift CREATE EXTERNAL SCHEMA statement. To provide that authorization, you first create an AWS Identity and Access Management (IAM) role. To create a database in a Hive metastore, you need to create the database in your Hive application.Īmazon Redshift needs authorization to access the Data Catalog in Athena and the data files in Amazon S3 on your behalf. If you create an external database in Amazon Redshift, the database resides in the Athena Data Catalog. You can create the external database in Amazon Redshift, in Amazon Athena, in AWS Glue Data Catalog, or in an Apache Hive metastore, such as Amazon EMR. ![]() In Amazon Redshift, we use the term schema.Īn Amazon Redshift external schema references an external database in an external data catalog. Some applications use the term database and schema interchangeably. Creating external schemas for Amazon Redshift SpectrumĪll external tables must be created in an external schema, which you create using a CREATE EXTERNAL SCHEMA statement. ![]()
0 Comments
Leave a Reply. |