Query the Amazon Glue Data Catalog - Amazon Athena
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Query the Amazon Glue Data Catalog

Because Amazon Glue Data Catalog is used by many Amazon Web Services 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 Amazon Glue catalog metadata like databases, tables, partitions, and columns.

To obtain Amazon 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 Amazon 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 Amazon Glue metadata. If you have a large amount of metadata, errors can occur.

  • You cannot use CREATE VIEW to create a view on the information_schema database.