Copies data from one MapR-DB table to another MapR-DB table.
This utility is different from Apache HBase's CopyTable utility. When copying data to MapR-DB tables, it is recommended to use the MapR-DB version.
If the destination table does not exist, CopyTable creates the target table with the same metadata (column families and access control expressions) as the source table, and then copies data.
If the destination table exists, CopyTable copies data only.
If you manually set up replication to a MapR-DB table, you use this utility to perform an initial load of source data to the replica before table replication begins.
- ACE permission for column-family and column reads (readperm) on the data in the source table that you want to copy.
- When bulkload =
false, the ACE permission for column writes (writeperm) on the destination table.
- When bulkload =
true(default), the ACE permission to load the destination table with bulk loads (bulkloadperm).
If CopyTable is run between tables on different clusters, the user that runs the command must have the required permissions on each cluster.
For information about how to set ACE permissions, see Setting Permissions by Defining Access Control Expressions.
-src <source table path>
-dst <destination table path>
[-maxversions <max number of versions to copy>]
[-mapreduce <true|false> (default: true)]
[-bulkload <true|false> (default: true)]
[-numthreads <numThreads> (default:16, valid only when -mapreduce is false)]
The path to the source table that you want to replicate.
The path to the replica.
|columns||By default, all columns in the source table are copied. If you do not want to copy all columns in the table, you can specify columns to copy. Provide a comma-separated list of column families or columns from a certain column family (column family:qualifier). |
For example, use the following syntax to copy only the purchases column family and the stars column in the reviews column family:
|maxversions||By default, all versions from the source table are copied. If you do not want to copy all versions, use this parameter to specify the number of versions to copy.|
|starttime||By default, all table values regardless of their associated timestamp are copied. You can specify a timestamp to indicate the table cell version at which to start the copy. The timestamp is a long integer value that is either user-defined or system-defined (epoch in milliseconds). Values with timestamps lower than the specified timestamp will not be copied to the destination.|
|endtime||By default, all table values regardless of their associated timestamp are copied. You can specify a timestamp to indicate the table cell version at which to end the copy. The timestamp is a long integer value that is either user-defined or system-defined (epoch in milliseconds). Values with timestamps greater than or equal to the specified timestamp will not be copied to the destination.|
A Boolean value that specifies whether or not to use a MapReduce program to perform the copy table operation. The default, preferred method is to use a MapReduce program (true).
When this parameter is set to false, a client process uses multiple threads to read rows of the source table and write rows to the destination table.
The MapReduce program runs as MapReduce v1 job or MapReduce v2 application based on the MapReduce mode that is configured on this node. For more information, see Managing the MapReduce Mode.
|bulkload||A Boolean value that specifies whether or not to perform a full bulk load of the table. The default is to use bulk loading (|
|numthreads||When -mapreduce is |
Monitoring the CopyTable Operation
Use one of the following methods to monitor the progress of the copy table operation:
If the copy table operation runs as a MapReduce v1 job, monitor the job using the JobTracker UI.
If the copy table operation runs as a MapReduce v2 application, monitor the application using the ResourceManager UI.
If the copy table operation runs as a client process, go to the Tables view of the destination table in the MapR Control System. Then, on the Region tab, monitor the pace at which the number of rows increases.