JindoTable provides two CLI commands — archiveTable and unarchiveTable — to change the storage class of Hive tables or partitions in Object Storage Service (OSS). Use these commands to move cold data to lower-cost storage classes (Archive, Cold Archive, or Infrequent Access) and restore it when you need access again.
Limit
This feature requires a Hive metastore to store metadata.
Archive tables or partitions
Use the archiveTable command to change the storage class of OSS data referenced by a Hive table or partition to Archive, Infrequent Access (IA), or Cold Archive.
Syntax
jindotable -archiveTable -t <dbName.tableName> -i/-a/-ca [-c "<condition>" | -fullTable] [-b/-before <before days>] [-p/-parallel <parallelism>] [-mr/-mapReduce] [-e/-explain] [-w/-workingDir <working directory>] [-l/-logDir <log directory>]To view all available options, run:
jindotable -help archiveTableParameters
| Parameter | Required | Description |
|---|---|---|
-t <dbName.tableName> | Yes | The table to archive, in database.table format. Supports both partitioned and non-partitioned tables. |
-i / -a / -ca | Yes | The target storage class: -a for Archive, -i for Infrequent Access (IA), or -ca for Cold Archive. When -i is specified, files already in Archive storage class are skipped. |
-c "<condition>" / -fullTable | No | The scope of the operation. You must configure either -c "<condition>" or -fullTable. Use -fullTable to archive the entire table, or -c "<condition>" to filter by partition key. Common comparison operators are supported. For example, to archive partitions where the ds column (String type) is greater than d, use -c " ds > 'd' ". |
-b / -before <before days> | No | Only archives tables or partitions created at least this many days ago. |
-p / -parallel <parallelism> | No | The number of parallel archive operations. |
-mr / -mapReduce | No | Uses Hadoop MapReduce instead of local multithreading. |
-e / -explain | No | Runs in explain mode: lists the partitions that would be archived without making any changes. |
-w / -workingDir <working directory> | No | The working directory for a MapReduce job. Temporary files are created during the job and deleted automatically when it completes. Only applies when -mr is used. |
-l / -logDir <log directory> | No | The directory for log files. |
Unarchive tables or partitions
The unarchiveTable command supports two restore modes:
Permanent storage class change: Moves data to a different storage class (Standard by default, or IA or Archive as specified). Use this when you need long-term access.
Temporary restore: Use the
-ooption to temporarily make archived data accessible without permanently changing its storage class. The data reverts after the number of days specified by-d.
Syntax
jindotable -unarchiveTable -t <dbName.tableName> [-i/-a/-o/-cr] [-notWait] [-c "<condition>" | -fullTable] [-d/-restoreDays <restore days>] [-b/-before <before days>] [-p/-parallel <parallelism>] [-mr/-mapReduce] [-e/-explain] [-w/-workingDir <working directory>] [-l/-logDir <log directory>]To view all available options, run:
jindotable -help unarchiveTableParameters
| Parameter | Required | Description |
|---|---|---|
-t <dbName.tableName> | Yes | The table to unarchive, in database.table format. Supports both partitioned and non-partitioned tables. |
-i / -a / -o / -cr | No | Controls how data is restored. If not specified, the storage class changes to Standard. Options: -i changes to IA (skips Standard files); -a changes to Archive; -o temporarily restores archived data without changing its storage class (skips Standard, IA, and already-restored files); -cr checks whether all restore jobs are complete. |
-notWait | No | Exits immediately after submitting the restore request to OSS, without waiting for the operation to complete. By default, the command waits until the operation completes or times out after 10 minutes. |
-c "<condition>" / -fullTable | No | The scope of the operation. You must configure either -fullTable or -c "<condition>". Use -fullTable to unarchive the entire table, or -c "<condition>" to filter by partition key. Common comparison operators are supported. |
-d / -restoreDays <restore days> | No | The number of days to keep the temporary restore state when using -o. The default is 1 day. Applies to Archive and Cold Archive storage. Has no effect when changing the storage class from IA to Standard. |
-b / -before <before days> | No | Only unarchives tables or partitions created at least this many days ago. |
-p / -parallel <parallelism> | No | The number of parallel unarchive operations. |
-mr / -mapReduce | No | Uses Hadoop MapReduce instead of local multithreading. |
-e / -explain | No | Runs in explain mode: lists the partitions that would be unarchived without making any changes. |
-w / -workingDir <working directory> | No | The working directory for a MapReduce job. Temporary files are created during the job and deleted automatically when it completes. Only applies when -mr is used. |
-l / -logDir <log directory> | No | The directory for log files. |
Behavior notes
Storage class skip rules: When using
-iwitharchiveTable, files already in Archive storage class are skipped. When using-iwithunarchiveTable, files already in Standard storage class are skipped.Temporary restore scope: The
-ooption applies only when restoring data from Archive or Cold Archive storage. It has no effect on Standard or IA data. Files that were previously restored are also skipped to prevent duplicate restore operations.Restore duration: The
-dparameter sets how long temporarily restored data (via-o) remains accessible. After the retention period, the data reverts to its original storage class. This applies to Archive and Cold Archive storage.Default wait behavior: By default,
unarchiveTablewaits for the OSS restore operation to complete or times out after 10 minutes. Use-notWaitto exit immediately after submitting the job, then use-crto check the restore status later.MapReduce working directory: When using
-mr, the working directory specified by-wcan be left blank. Temporary files created during the job are deleted automatically.