Lesson 2 of 6 AWS Glue

Cataloguing Data with the AWS Glue Data Catalog and Crawlers

This lesson explains the AWS Glue Data Catalog, the shared, Hive-compatible metadata layer that AWS analytics services use to find and understand data in the lake, and the crawlers that populate it.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe databases, tables and partitions in the Data Catalog.
  • Configure crawlers to create and update tables.
  • Use partition indexes and partition projection for tables with many partitions.
  • Define tables without crawlers.

The Data Catalog

The AWS Glue Data Catalog is the central metadata store for data on AWS. It stores databases, which group related tables; tables, which record a dataset's schema, location and format; partitions; and connections to data stores. There is one catalogue per account in each Region.

Its value is that many services share it. Amazon Athena, Amazon EMR, Redshift Spectrum, Glue jobs, AWS Lake Formation and Amazon SageMaker AI all read the same table definitions, so a table defined once can be queried by any of them. Metadata and connection passwords can be encrypted with AWS KMS. Access is controlled with IAM, with catalogue resource policies, which also allow cross-account access, and with Lake Formation for fine-grained permissions.

The following diagram shows the Data Catalog and the services that share its definitions.

The Glue Data Catalog as the shared metadata store. Databases, tables, partitions and connections are defined once, and Athena, EMR, Redshift Spectrum, Glue jobs, Lake Formation and SageMaker AI all read the same definitions. The data itself stays in Amazon S3, and access is controlled with IAM, catalogue resource policies and Lake Formation.
The catalogue holds metadata only; the data stays in its stores.
Select all that apply

The Glue Data Catalog

Exam skills 2.2.1 · 2.2.2

Identify the true statements about the AWS Glue Data Catalog.

Log in to try this activity Interactive activities are free with an account.

Crawlers

A Glue crawler connects to a data store, such as Amazon S3, a JDBC database or Amazon DynamoDB, examines the data and creates or updates tables and partitions in the Data Catalog. Classifiers determine each dataset's format and infer its schema; built-in classifiers recognise common formats, and custom classifiers handle unusual ones.

When a crawler finds that a schema has changed, its schema change policy decides what happens: update the table definition, add new columns only, or only log the change for review. For large S3 datasets, S3 event mode uses S3 event notifications delivered through Amazon SQS to crawl only the folders that changed since the last run, which is much faster and cheaper than re-crawling everything.

The following diagram compares the tables a Glue crawler creates from two folder layouts.

Why the crawler created a table per folder. With folders named 2026-10-01/ and slightly different schemas each day, the crawler treats each folder as a separate table. With Hive-style folders such as dt=2026-10-01/ and a single schema for the path, it creates one table partitioned by dt.
The folder and table names are illustrative.
Scenario questions

Crawler behaviour

Exam skills 2.2.3

Choose the crawler setting for each requirement.

Log in to try this activity Interactive activities are free with an account.

Tables with many partitions

A table partitioned by several columns, such as date and hour, can have hundreds of thousands of partitions, and query engines then spend a long time just listing which partitions to read. Partition indexes on the Glue Data Catalog let engines find matching partitions quickly instead of listing them all. Athena partition projection goes further: Athena calculates the partition locations from configured rules, such as a date range, without reading the catalogue at all. For Iceberg tables, catalogue optimisers keep tables healthy automatically by compacting small files, expiring old snapshots and deleting orphaned files. The following table summarises the features.

FeatureBenefit
Partition indexesSpeed up partition filtering
Athena partition projectionCalculates partitions from configuration instead of reading the catalogue
Iceberg catalogue optimisersCompaction, snapshot retention and orphan file deletion

The following diagram compares the three ways an engine can find the partitions a query needs.

Three ways a query engine finds the partitions to read in a table with hundreds of thousands of partitions. Without help, it lists partitions from the catalogue, which takes a long time. A partition index lets the catalogue find matching partitions quickly. Athena partition projection calculates partition locations from configured rules without reading the catalogue at all.
The partition count is illustrative.
Match the pairs

Many partitions

Exam skills 2.2.4 · 2.4.5

Match each need with the feature that meets it.

Log in to try this activity Interactive activities are free with an account.

Other ways to define tables

Crawlers are convenient, but tables can also be defined without them, and often should be. Tables can be created with Athena DDL statements such as CREATE EXTERNAL TABLE, through the Glue API, or in AWS CloudFormation templates alongside the rest of a pipeline's infrastructure. ETL jobs can update the catalogue as they write, with the enableUpdateCatalog option, so new tables and partitions appear without a separate crawl. Partitions can be added with MSCK REPAIR TABLE or ALTER TABLE ADD PARTITION.

Defining schemas explicitly avoids surprises from inferred types, such as a column that a crawler infers as a number in one run and as a string in the next because of a few unusual values.

Match the pairs

Defining tables without crawlers

Exam skills 2.2.2 · 2.2.4

Match each need with a way to define tables or partitions.

Log in to try this activity Interactive activities are free with an account.
Worked example

A crawler that creates hundreds of tables

A crawler over s3://lake/raw/events/ creates a separate table for every date folder instead of one partitioned table.

CauseFix
Folders use 2026-10-01/ instead of dt=2026-10-01/, and schemas differ slightly between daysUse Hive-style partition folders
Inconsistent file formats or headers across foldersFix the producer or exclude bad files
Crawler grouping behaviourEnable "Create a single schema for each S3 path"

For tables that receive a new partition every hour, the team stops re-running the crawler and uses partition projection instead, so new partitions are queryable in Athena immediately without any catalogue updates.

Check yourself

How can a crawler process only newly added files?

Show answer

With S3 event mode, which crawls only the changes reported by S3 events instead of the whole location.

Exam Tips

Remember for the exam

  • To discover schemas automatically, use a Glue crawler.
  • For incremental crawls of only new files, use S3 event mode.
  • To speed up queries on tables with many partitions, use partition indexes or partition projection.
  • For fine-grained table, column and row permissions, use Lake Formation on the Data Catalog.
  • A single metadata store for Athena, EMR and Redshift Spectrum is the Glue Data Catalog.