Compares the row key, column family, timestamp, and value of each table cell in each specified Mapr-DB table. Then, it generates one or two directories with sequence files that you can use to either make a MapR-DB table identical to its master or merge the rows from two MapR-DB tables.
Sequence files are binary flat files. To convert the sequence file into a format that is easier to understand, use the FormatResults utility.
By default, the DiffTables utility considers both the source table and the destination table to be a master table. Therefore, it generates two directories with sequence files. These sequence files contain the puts required to update each table so that it contains a superset of the rows defined in both tables at the time at which the utility was run.
When you specify a master table, the DiffTables utility generates one of the following output directories:
opsForDst. A directory containing sequence files that correspond to each put and delete required to make the destination table identical to the source table.
opsForSrc. A directory containing sequence files that correspond to each put and delete required to make the source table identical to the destination table.
A user with write permissions on a table can run the
hbase org.apache.hadoop.hbase.mapreduce.Import command to implement the puts and deletes specified in the sequence files.
The user that runs the DiffTables utility must have the ACE permission for column reads (readperm) on each table.
-src <source table path>
-dst <destination table path>
-outdir <output directory>
[-master <src|dst> The master table to use for the diff. ]
[-first_exit Exit when first difference is found. ]
[-columns <comma separated list of family[:column]> ]
[-starttime <start diff at timestamp>]
[-endtime <end diff at timestamp>]
[-maxversions] <max number of versions to diff>
[-mapreduce] <true|false> (default: true)]
[-numthreads <numThreads> (default:16, valid only when -mapreduce is false)]
[-cmpmeta <true|false> (default: true)]
The path to the source table.
The path to the destination table.
The table that is considered to be the master table. The values are
By default, the utility compares all the table cells in the specified tables. Set this parameter if you want to exit after the first difference is identified between the tables.
|The path to a directory for the sequence files. The utility will create the specified directory. If the specified directory already exists, the command fails.|
|columns||By default, the utility compares all columns. If you do not want to compare all columns in the table, you can specify specific columns to include in the comparison. 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 include the column family purchases and the column stars in the reviews column family: |
|starttime||By default, the utility compares all table values regardless of their associated timestamp. You can specify a timestamp to indicate the table cell version at which to start the comparison. 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 included in the comparison.|
|endtime||By default, the utility compares all table values regardless of their associated timestamp. Values with timestamps greater than or equal to the specified timestamp will not be included in the comparison.|
|maxversions||By default, all versions from the master table are included in the comparison. If you do not want to compare all versions, use this parameter to specify the number of recent versions to include in the comparison.|
A Boolean value that specifies whether or not to use a MapReduce program to perform the comparison.
The default is to use a MapReduce program (
When this parameter is set to
|numthreads||When -mapreduce is |
|cmpmeta||A Boolean value that specifies whether or not to compare table metadata such as column families and ACEs. The default is to compare metadata (|