Starting compaction manually
You manually start compaction when automatic compaction fails for some reason. You can start compaction by running a Hive statement.
AND WAIT
clause. Compaction actually occurs asynchronously, but seems synchronous. The compaction
request is recorded and queued, and remains in a waiting cycle, querying the status of
the compaction in the background until a failure, success, or timeout occurs. The
hive.compactor.wait.timeout
(default: 300s) property sets the
timeout. Start compaction using a query
You use the following syntax to issue a query that starts compaction: ALTER TABLE tablename [PARTITION (partition_key='partition_value' [,...])] COMPACT 'compaction_type'
Required role: DWAdmin
- Tables or partitions you are compacting must be full ACID or insert-only ACID tables.
- Compaction must be enabled (
initiator hive.compactor.initiator.on=true
)