Managing Apache Hive
Also available as:
PDF

Initiate compaction

You manually start a compaction when automated compaction fails for some reason to perform housekeeping of files as needed.

Carefully consider the need for a major compaction as this process can consume significant system resources and take a long time. Start a major compaction during periods of low traffic. Starting a compaction queues requests that compact base and delta files for a table or partition. You use the following syntax to issue a query that starts compaction:
 ALTER TABLE tablename [PARTITION (partition_key='partition_value' [,...])] COMPACT 'compaction_type'
Execute a query to start a major compaction of a table.
ALTER TABLE mytable COMPACT 'compaction_type'
ALTER TABLE compacts tables even if the NO_AUTO_COMPACTION table property is set.