Query the AWS Glue Data Catalog
Because AWS Glue Data Catalog is used by many AWS services as their central metadata repository, you might want to query Data Catalog metadata. To do so, you can use SQL queries in Athena. You can use Athena to query AWS Glue catalog metadata like databases, tables, partitions, and columns.
To obtain AWS Glue Catalog metadata, you query the information_schema
database
on the Athena backend. The example queries in this topic show how to use Athena to query AWS Glue
Catalog metadata for common use cases.
Considerations and limitations
-
Instead of querying the
information_schema
database, it is possible to use individual Apache Hive DDL commands to extract metadata information for specific databases, tables, views, partitions, and columns from Athena. However, the output is in a non-tabular format. -
Querying
information_schema
is most performant if you have a small to moderate amount of AWS Glue metadata. If you have a large amount of metadata, errors can occur. -
You cannot use
CREATE VIEW
to create a view on theinformation_schema
database.