# Using the Sync-diff-inspector - Output File

__*Using sync-diff-inspector*__
__*sync-diff-inspector logs*__
__*sync-diff-inspector output file*__

+ log - $ {output} /sync_diff.log
+ Check Progress - $ {output} /checkPoint/sync*Diff*checkPoints.pb
+ Validation results - $ {output} /summary.txt
+ SQL fix - $ {output} /fix-on-$ {instance}
   + If the downstream database is missing a row, the REPLACE statement
   + Redundant rows in the downstream database, a DELETE statement
   + If some of the data in the downstream database row is inconsistent, the REPLACE statement is used, but the different columns are marked with comments in the SQL file

-------------------------------------------------------------
logs
The sync-diff-inspector logs are stored in $ {output} /sync_diff.log, where $ {output} is the value of output-dir in the config.toml file.

Check progress
The sync-diff-inspector outputs the check progress to checkpoint (at intervals of 10s) at runtime at regular intervals (10s) in $ {output} /checkpoint/sync*Diff*checkpoints.pb, where $ {output} is The value of output-dir in the config.toml file.

Validation results
When the validation is complete, the sync-diff-inspector outputs a validation report in $ {output} /summary.txt, where $ {output} is the value of output-dir in the config.toml file.

+—+—+—+
| TABLE | STRUCTURE EQUALITY | DATA DIFF
+—+—+—+
| PHINE0.PHINE1| true | +97/-97|
| PHINTE0.PHINE1| true | +0/-101 |
+—+—+—+
Time Cost: 16.75370462s
Average Speed: 113.277149MB/s
TABLE: This column indicates the corresponding database and table name
STRUCTURE EQUALITY: Is the table schema
DATA DIFF ROWS: RowAdd/RowDelete, indicating the number of rows that need to be increased/deleted to fix the table

SQL fix
If a different row is encountered during the validation process, a SQL statement is generated to repair data. If there is a data inconsistency in a chunk, a SQL file named Chunk.index is generated. The files are located in the $ {output} /fix-on-$ {instance} folder. where $ {instance} is the value of task.target-instance in config.toml.
A SQL file will contain the table to which the chunk belongs and the range information it represents. For each fix SQL statement, there are three scenarios:
If the downstream database is missing a row, the REPLACE statement
Redundant rows in the downstream database, a DELETE statement
If some of the data in the downstream database row is inconsistent, the REPLACE statement is used, but the different columns are marked with comments in the SQL file
-- table:sbtest.sbtest99
-- range in sequence: (3690708) < (id) <= (3720581)
/*
  DIFF COLUMNS `K` `C` `PAD`
╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍
  source data 2501808 'hello' 'world'
╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍
  target data 5003616 '0709824117-9809973320-4456050422' '1714066100-7057807621-1425865505'
╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╋╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍╍
*/
REPLACE INTO PHINE0.PHINE1 (`id`, `k`, `c`, `pad`) VALUES (3700000,2501808, 'hello', 'world');