HiveServer audit entries

Atlas lists changes to Hive metadata entities in the Audits tab of the entity.

Atlas tracks the lifecycle of each Hive entity, including its creation, update, and deletion. User access and actions that affect the data content of the source asset are not included in the audit.

To view the audit entries of a Hive entity:

  1. In the Atlas Dashboard, search for the entity. For example, enter the name of a Hive table in the search box.
  2. In the search results, select the entity to open its details page.
  3. Click the Audits tab.
  4. Click the arrow next to an audit entry to show the details of the change.

Audit entries of a Hive table

The following figures show the audit entries of a table that was created and then changed.

Figure 1. Hive table audit entries in the New User Interface

Audits tab of the passengers hive_table entity in the New User Interface. Two records by the hive user are listed: Entity Updated and Entity Created. The Entity Updated record is expanded. Technical Properties lists the parameters attribute as a JSON object, and Relationship Properties lists five columns: passenger_id, full_name, tier, home_airport, and email.

The Audits tab of the passengers hive_table entity in the New User Interface. The tab lists an Entity Created record and an Entity Updated record. In the expanded Entity Updated record, Technical Properties lists the changed parameters attribute, and Relationship Properties lists the five columns of the table after the change, including the new email column.

Figure 2. Hive table audit entries in the Classic User Interface

Audits tab of the passengers hive_table entity in the Classic User Interface. Two records by the hive user are listed: Entity Updated and Entity Created. The Entity Updated record is expanded. Technical properties lists the parameters attribute as a JSON object, and Relationship properties lists five columns: passenger_id, full_name, tier, home_airport, and email.

The Audits tab of the passengers hive_table entity in the Classic User Interface. The tab lists an Entity Created record and an Entity Updated record. In the expanded Entity Updated record, Technical properties lists the changed parameters attribute, and Relationship properties lists the five columns of the table after the change, including the new email column.

The user of the audit entries of databases, tables, and columns is hive, because the Atlas hook for Hive Metastore (HMS) sends these entities. The audit entries of the processes show the user who ran the query.

Statements that only insert data, such as INSERT INTO, do not add audit entries to the table by default. Statements that change the structure of the table, such as adding a column, add an Entity Updated entry.

Audit entries of a Hive process

The following figures show the audit entries of the process of an INSERT ... SELECT statement. For the lineage of this process, see HiveServer lineage.

Figure 3. Hive process audit entries in the New User Interface

Audits tab of a hive_process entity in the New User Interface. Two records are listed and both are expanded. The Entity Updated record lists the endTime and startTime technical properties. The Entity Created record lists the clusterName, endTime, name, operationType, qualifiedName, queryId, queryPlan, queryText, recentQueries, startTime, and userName technical properties, and the inputs and outputs relationship properties.

The Audits tab of the hive_process entity of an INSERT ... SELECT statement in the New User Interface. In the Entity Created record, Technical Properties lists the attributes of the process. The operationType is QUERY, queryPlan is Not Supported, and recentQueries holds the text of the statement. Relationship Properties lists the input table passenger_revenue and the output table loyalty_report. The Entity Updated record shows the changed startTime and endTime attributes.

Figure 4. Hive process audit entries in the Classic User Interface

Audits tab of a hive_process entity in the Classic User Interface. Two records are listed and both are expanded. The Entity Updated record lists the endTime and startTime technical properties. The Entity Created record lists the clusterName, endTime, name, operationType, qualifiedName, queryId, queryPlan, queryText, recentQueries, startTime, and userName technical properties, and the inputs and outputs relationship properties.

The Audits tab of the hive_process entity of an INSERT ... SELECT statement in the Classic User Interface. In the Entity Created record, Technical properties lists the attributes of the process. The operationType is QUERY, queryPlan is Not Supported, and recentQueries holds the text of the statement. Relationship properties lists the input table passenger_revenue and the output table loyalty_report. The Entity Updated record shows the changed startTime and endTime attributes.

The queryId, queryText, and userName attributes of the process are empty by default. The process execution entity stores the query ID, the query text, and the user for each run. When the same statement runs again, Atlas updates the startTime and endTime of the process and creates another process execution entity. For the attributes of the entities, see Hive Process.