Compare data
Compare two tables or files, see the rows that differ, save it, schedule it and get email alerts.
Choose the two sides and the key
Open Compare. Side A and side B are either "Database table" (any connection) or "File" (CSV, TSV or Excel, which you can upload on this screen, up to 50 MB; the first sheet of an Excel file is used). You can compare a table with a file, or across databases.
Choose the key that pairs the rows, 1 to 5 columns. It is guessed from the primary key or a column called id. The columns to compare are paired by name for you; adjust them or add pairs yourself, up to 100 columns. For numbers you can set an accepted difference.
Try it on the sample data: export products as CSV from Data Explorer, change some rows in Excel and upload it as side B. Choose sku as the key and let unit_price differ by 0.01.
How it compares
- Rows are paired by the key (a full outer join), giving four groups: identical, matched but different, only in A, only in B.
- Numbers compare as numbers within the accepted difference, dates compare as date-times, text compares exactly, and you can ignore upper / lower case and surrounding spaces.
- A column that is a number on one side and text on the other compares as numbers when the text parses, as text otherwise.
- A repeated key: only the first row of each key is compared and the number repeated is shown. A row with an empty key cannot be paired, so it counts as only in that side.
Reading the result
The cards on top give the rows of each side and of the four groups, with the match percentage. The ring shows the shares, the bars show the rows that differ per column, the paired bars compare the totals of number columns in A and B, and the spread chart shows the difference (B − A) of the rows that differ.
The tabs below list the first 100 rows of each group, with the cells that disagree highlighted next to the numeric difference. Export CSV gives every row of that group (Thai text opens correctly in Excel).
Save, schedule and alert
Press "Save comparison" and name it. It appears in the Saved tab. Change it on the Compare screen (the saved settings are loaded back) or press "Run now" on its page.
Schedule: every 30 minutes, every hour, every day, every week, or your own cron, in Thailand time and at least 15 minutes apart. If the platform is down at the time, that run is skipped rather than run late.
Alert: an email to up to 5 people when a scheduled run matches less than your threshold (100% means any difference, even one row) or fails. It is sent every time the condition holds, through the mail server set up in Settings > Email, or the platform’s.
History: the page of a comparison has a trend chart and a table of every run (the last 200 are kept). Only row counts and percentages are kept, never the compared data.
The Compare node in Join Canvas
To let the difference flow on, drag the Compare node from Transforms and connect two inputs: the first line is side A and the second is side B (swap them in the Properties panel). Choose the key (1 to 5 columns), the columns to compare (by default every column with the same name) and how much a number may differ.
The output has compare.status (SAME, DIFFERENT, ONLY_A, ONLY_B), the key, the A and B value of each column (name_a, name_b, name_diff) and compare.diff_count, keeping only the statuses you chose (by default everything but SAME). Continue with Filter, Select, Template or Output like any other node, so the difference can be written to a table, sent as a report or run on a schedule by a pipeline.
Compare table structure
The "Table structure" tab shows where two connections or two schemas differ. Choose the connection and schema of side A and side B. Tables are paired by name, then columns found on one side only, data types, NULL / NOT NULL and primary keys are compared. The result has a summary, charts and the list of tables that differ; press a row for the detail, and export as CSV.
Options: ignore upper / lower case in names (Oracle uses upper case, PostgreSQL lower case) and how types are compared: exactly for databases of the same kind, or by family (integer, decimal, text, date) across kinds. It uses the structure read most recently; press "Reload the structure" if you just changed the database.
Limits
- Up to 500,000 rows per side (beyond that you are told instead of getting a partial comparison), and one comparison has to finish within 2 minutes.
- SQL Server, Oracle and MongoDB are copied in to compare; PostgreSQL, MySQL and SQLite are read directly.
- A workspace can save 50 comparisons and schedule 10 at a time.
- Editor or higher can create, change and delete saved comparisons; everyone can view and run them.