HiveServer metadata collection
Atlas collects metadata about HiveServer queries through a hook in HiveServer, and metadata about the affected databases, tables, and columns through a hook in Hive Metastore (HMS).
An Atlas hook runs in each HiveServer instance. By default, this hook sends the metadata of Hive operations to Atlas: process and process execution entities, column lineage entities, and entities for the data definition language (DDL) statements. In addition, an Atlas hook runs in HMS. This hook sends the metadata of Hive databases, tables, views, and columns. Atlas represents Hive operations as process and process execution entities, and Hive databases, tables, views, and columns as entities. When a Hive operation involves files, the metadata for the file system and files are represented in Atlas as file system paths.

Atlas collects metadata through the following steps:
- An operation runs in HiveServer.
- HiveServer updates HMS with the changes to the databases, tables, and columns that the operation affects.
- The Atlas hook for HMS collects information for the changed and new assets and forms it into metadata entities. It publishes the metadata on a Kafka topic.
- The Atlas hook for HiveServer collects information for the operation and forms it into metadata entities. It publishes the metadata on a Kafka topic.
- Atlas reads the messages from the topic and determines what information will create new entities and what information updates existing entities.
- Atlas creates and updates the appropriate entities and determines lineage from existing entities to the new entities.
The Atlas bridge for Hive, the import-hive.sh utility, pulls the same metadata from HMS. Instead of sending the metadata through Kafka, it passes the metadata in bulk in an API call. The bridge creates entities in Atlas for all of the existing Hive databases, tables, and columns. For details, see Importing Hive Metadata using Command-Line (CLI) utility.
