Search docs.molo17.com
    Operational guide Pipelines

    Validate data with the Validator

    Validator compares one replicated entity with the table it is written to. This guide walks through a whole validation: run it, read the result, narrow it with filters, tell a real difference from a conversion artefact, handle the awkward cases (NULL, padding, floats, keys, rows that change while you compare) and fix and re-check the rows. Every result shown here was captured on a MySQL to PostgreSQL pipeline, so the type and date conversions are real.

    In this guide

    You will learn how to run a comparison, choose between Count only and a full comparison, read the counters, the notices and the grid, write a source and a target WHERE condition for each database, slice a big table by key range, see how filters interact with the entity filter and with column selection, understand how Validator normalizes dates, times and timestamps, avoid the false differences that some options create, handle NULL and empty text, trailing spaces, case, numbers, floats, binary columns, keys, duplicates and rows that change during the run, then reconcile and re-check.

    Quick information

    Goal

    Prove that a target table matches its source, and explain every difference that Validator reports

    Audience

    Gluesync users who replicate between two different databases and have to trust the result

    Level

    Intermediate

    Time required

    About 60 minutes

    Area

    Control Plane → Validator, and an entity’s Validate action

    Applies to

    Gluesync 2.3

    Before you begin

    Make sure that:

    1. A pipeline has a source agent, a target agent and at least one entity whose target table already holds data. Both connectors must be able to compare data. See Supported connectors;

    2. You can sign in to the Control Plane with a role that can view differences and, to fix them, reconcile;

    3. You can run SQL on both databases, for example with Query Studio, so that you can confirm what Validator reports.

    This guide uses a MySQL 8 source and a PostgreSQL 16 target, three entities and the names below. Replace them with your own.

    Entity Content

    customers

    Key id. 6 rows with one column of each type this guide discusses: VARCHAR, CHAR, DECIMAL(12,4), FLOAT, DOUBLE, DATETIME(6), DATE, TIMESTAMP(6), BLOB, TEXT. The target columns are numeric(12,2), real, timestamp(3), timestamptz and varchar.

    big_orders

    Key id. 20,000 rows. Used to slice a table with filters.

    text_keys

    Text key code, created with a binary collation on the source, so that a1 and A1 are two rows.

    Run the repair steps on a practice copy first. Reconcile writes to the target.

    Guide steps

    Run a first comparison

    UI

    1. Open the entity’s overflow menu (three dots) in the pipeline and select Validate, or open Validator from the navigation and pick the pipeline and the entity. Validator opens in a new tab with the pipeline and entity already selected;

    2. Select Validate. The Validator options dialog opens with three tabs: General, Columns & rules and Matching;

    3. Leave the defaults and select Start validation.

    The dialog keeps the choices of your last run until you reload the page, so a later run starts with them. Reload the page to go back to the defaults, or the next run will carry an option that you set for an earlier test.

    Validator options dialog on the Columns & rules tab
    Figure 1. The Columns & rules tab lists every column with its source and target type. Tick Key to match rows on a column, clear the box on the left to leave a column out.
    Expected result

    The summary shows the status, Source rows scanned and Target rows scanned (for example 6 / 6) and the counters. A clean run ends as Completed with Row data is in sync. On the example customers entity, with matching data, the default run ended as Completed, even though the target stores 99.9950 as 100.00, .123456 as .123 and a CHAR(8) as a varchar. Validator replays those conversions and lists them as notices. See the date, number and text steps below.

    For the meaning of every counter, status and error code, read What the results mean. This guide does not repeat those tables.

    Choose between Count only and a full comparison

    UI

    A full comparison reads every row of both tables, in key order. Count only reads no row. It counts both tables and compares the two numbers.

    1. Select Validate, switch Count only on (General tab, Scope) and select Start validation;

    2. If the counts match, the run ends as Completed. If they differ, it ends as Completed with warnings. The message names both counts and their difference, and the summary shows Source rows, Target rows and More rows in source (or More rows in target). On big_orders the message read: Source counts 20000 rows and target 19998 (difference 2): run a full comparison to find out which rows. The No differences found panel under it only says that no row was compared, so read the message and the counters;

    3. Run again without Count only to list the rows.

    Validator options dialog on the General tab
    Figure 2. The General tab. Count only is in the Scope group, the limits are below it.
    Expected result

    The count-only run returns in a moment, whatever the table size. The full run lists the two source-only rows and two rows that differ.

    Equal counts do not mean equal data: a row missing on one side and an extra row on the other cancel out.

    Read the differences

    UI

    Select a run in Run history and read the grid. The Source table is on the left, the Target table on the right, and a red bar marks the cells that differ.

    Validator grid with the source MySQL table on the left and the target PostgreSQL table on the right
    Figure 3. A run with rows that differ. Each marked pair shows the source value and the target value of one column.

    Every row in the grid has a type: Source only, Target only, Differs, Extra in target, Duplicate key or NULL key. Only the columns that differ are filled. A source note of '' against a target NULL shows an empty cell on the left and null on the right.

    Besides differences, a run reports notices. A notice says how a column was compared, or why it was not, and it is not a difference. You will meet these in this guide:

    Notice What it tells you

    Compared at lower precision

    The two types cannot hold the same values, so the column is compared as strictly as the narrower side. For example DECIMAL against DECIMAL: an exact number of scale 4 held at scale 2, compared at 2.

    Equal within tolerance

    Values that are equal only because the lenient profile ignores trailing spaces or line endings. The detail gives the number of values.

    Column skipped by an option

    An option of the run leaves the column out, for example Skip BLOB / CLOB columns.

    Transformed column compared raw

    A field function writes the column and the run did not replay it.

    Reader warning

    A text key is ordered with a forced binary collation, and the warning names an index that would speed the run up.

    See Notices for the full list. A run that finds only notices ends as Completed.

    Narrow a run with a WHERE condition on each side

    UI + SQL

    Open Validate, then General → Advanced: query filters. Each side has its own WHERE condition and its own Key ordering expressions.

    Advanced query filters of the Validator options dialog
    Figure 4. Advanced: query filters. The condition is written in the SQL of each database.

    How the condition is used:

    • Validator adds it to its own query as WHERE (your condition) AND (the key paging condition). You type only the condition. A leading WHERE is accepted;

    • The text is SQL of that database, not Gluesync syntax. Quote identifiers the way the database does: backticks on MySQL (+`status = 'PAID'`), double quotes on PostgreSQL (`"status" = 'PAID'+`). Plain lower-case names work on both;

    • A condition with a semicolon, a comment (--) or unbalanced parentheses is refused, and the run ends as Failed with the message SQL clauses must not contain comments or semicolons or Unbalanced parentheses in SQL clause. A condition that names an unknown column fails the run with the message of the database, for example Unknown column 'nope' in 'where clause'.

    The two sides are independent. Validator does not copy the source condition to the target.

    === Slice a big table by key range

    Validator reads a table in one pass and does not split it. To compare a big table in parts, give both sides the same key range and run once per range:

    -- source (MySQL) and target (PostgreSQL), same text on both sides
    id BETWEEN 1 AND 5000
    id BETWEEN 5001 AND 10000
    id BETWEEN 10001 AND 15000
    id BETWEEN 15001 AND 20000

    On big_orders the four runs reported, in turn: 1 source-only row, 1 row that differs, 1 source-only row together with 1 row that differs, and a clean slice. Each run lists only its own range, so a slice is the unit you fix and re-check. Use a range on an indexed column, normally the key. Date ranges work too: created >= '2026-01-10' AND created < '2026-01-11' returned 1,917 rows on each side.

    === Keep the two conditions equal

    A condition on one side only is the most common source of a flood of differences. With id ⇐ 5000 on the source and nothing on the target, the run compared 5,000 source rows with the target rows and stopped with the message Stopped after 10000 differences: rows after that point were not compared, because 9,999 rows were Target only.

    A condition on a column that has drifted hides the row instead of reporting it. With status = 'PAID' on both sides, a row whose target status had changed to another value was absent from the target slice, so it showed as Source only, not as a different value. Filter on the key or on a column that never changes.

    === How the conditions interact with the entity filter

    • The entity’s target filter is replayed by default (Apply the entity filter on the Matching tab). A source row that the filter excludes is expected to be absent from the target and is not a difference. A target row that the filter would not have written is reported as Extra in target. In the example, a target filter status = 'PAID' was added after the data was copied. The run with id ⇐ 300 on both sides reported 150 Extra in target rows, and with the option off it reported none. Reconcile deletes such rows only when you tick Delete target rows the entity filter excludes on the General tab. See Filter rows with a snapshot WHERE clause and target filters;

    • Your WHERE conditions and the entity filter apply together. The first limits the rows read, the second decides which of them the pipeline would have written.

    === Include or exclude columns

    Columns & rules lists every column with a checkbox on the left. Key columns are always compared. Clear a column to leave it out. With name cleared, the carol against Carol difference of the example was no longer reported. Use this to skip a column that you know differs on purpose, for example one that the target database fills. Reset to pipeline mapping restores the mapping of the entity. The target column of each row has a drop-down, so a column with a different target name can be mapped for this validation only.

    Expected result

    Each slice ends with its own counters, and a slice with no difference ends as Completed.

    Understand how dates and times are compared

    UI + SQL

    Validator does not compare the text of two date values. Each side is read as its type, brought to a common form and compared by value.

    Situation What Validator does

    Two timestamps with different fractional digits (DATETIME(6) against timestamp(3))

    Compares at the digits the target keeps. A notice says a time with 6 fractional digits held with 3, compared at 3. In the example, 10:15:30.123456 against 10:15:30.123 was equal.

    A value that the target rounded across midnight

    Equal by default. 23:59:59.999999 was stored by PostgreSQL as 00:00:00 of the next day, and the default run reported no difference.

    TIMESTAMP against TIMESTAMP WITH TIME ZONE

    Compared as instants, and the notice says so. A target value one hour or two hours away from the source is a real difference.

    A date held as text

    Compared by its instant when the text reads as a date. A column written by a field function is replayed first (see below).

    === Choose how to match

    Open Validator options → Columns & rules → Date & time. The choice applies to every date and time column of the run:

    Choice Use it when

    Normalize to UTC (recommended)

    Default. Instants are compared at the precision both sides keep.

    Exact match

    You want values compared as stored, without converting them to UTC.

    Ignore fractions of a second

    One side drops the fraction. See the warning below.

    Ignore time, compare date only

    Only the date matters. See the warning below.

    Ignore date and time columns

    You do not want date columns compared. In the example it also left out the DATE column.

    On the Matching tab, Temporal precision sets the finest time unit compared (Nanoseconds, Microseconds, Milliseconds or Seconds).

    Two choices create false differences when the target rounds. With Ignore fractions of a second the run truncated 23:59:59.999999 to 23:59:59 and compared it with the target’s 00:00:00 of the next day: a difference that the default run did not report. Ignore time, compare date only did the same, 2026-03-01 against 2026-03-02. Keep Normalize to UTC unless you know that the target truncates.

    === A time zone shift

    By default, two timestamps hours apart differ, even in the lenient profile: Validator has to catch a shifted clock. On the example rows, 09:00 against 10:00 and 09:00 against 11:00 were reported as differences.

    Tick Tolerate a whole time zone shift on the Matching tab to treat two timestamps that are a zone offset apart as equal. With it on, those two rows were no longer reported.

    The option cannot tell a zone shift from a wrong hour. A row that is really one hour off is hidden too. Use it to diagnose a zone problem, then fix the zone and switch it off.

    === Dates written by a field function

    When a field function such as Convert Date to String writes the target column, comparing the raw source value would report a difference on every row. Validator replays the built-in functions by default (Apply the field functions on the Matching tab, under Pipeline transformations).

    In the example, a DATE column was written to a varchar column with the pattern dd/MM/yyyy:

    1. Default run: Completed, no difference;

    2. A target value changed to 03/01/2026 (day and month swapped): one row that differs. The source side shows the value the pipeline would have written, 01/03/2026, and the target side 03/01/2026;

    3. The same entity with the option off: every row differed, and a notice, Transformed column compared raw, said the column was written by Convert Date to String, which this run did not replay.

    For columns whose target value cannot be predicted, because it is written by the clock or by the target database, choose in Columns whose target value cannot be predicted between Leave them out and say so, Compare the raw values anyway and Refuse the run.

    Expected result

    Dates that differ only by precision, rounding or a replayed function end as Completed. A row is reported only when the instant, or the written text, really differs.

    Handle NULL, empty text, padding and case

    UI

    Text columns are compared exactly unless the run is told otherwise, with these exceptions.

    === NULL against an empty string

    NULL and '' are different values. On the example, a source '' against a target NULL was reported as a difference.

    NULL and empty text on the Matching tab has three values:

    • Automatic (when a database stores '' as NULL): the default. A MySQL to PostgreSQL pair never equates the two, and the example row was reported;

    • Always equal: removed the '' against NULL difference in the example;

    • Never equal: reports it for every pair.

    === Trailing spaces and line endings

    The lenient profile treats two character values as equal when they differ only by trailing spaces or by \r\n against \n. The column gets an Equal within tolerance notice with the number of values. A source trail␠␠ against a target trail, and line1\r\nline2 against line1\nline2, were both equal, and reported as notices.

    The strict profile (Matching → Comparison profile → Strict) reports them as differences. On the example it listed the trailing-space value and the line-ending value as well.

    === Case and surrounding whitespace

    Case matters by default: carol against Carol is a difference. On Columns & rules, Trim surrounding whitespace and Ignore letter case are in the Value rules group. With Ignore letter case on, the carol against Carol difference was removed.

    Expected result

    After you pick the NULL rule and the string rules that match how your target stores text, the remaining differences are rows whose text really differs.

    Handle numbers and floats

    UI + SQL

    • A target column with a smaller scale is compared at that scale and the run says so with a Compared at lower precision notice. On the example, 99.9950 stored as 100.00 and 0.0049 stored as 0.00 were equal. 10.5 against 10.51 was a difference, because the value really changed at the column’s scale;

    • A float is compared within the noise of its width in the lenient profile, a relative 1e-6. 21.21 stored in a real column and read back as 21.209999 was equal;

    • A larger gap stays a difference. 3.14159 against 3.1416 is a relative difference of about 6e-6, and the default run reported it. Set Float relative tolerance (|a − b| / max(|a|, |b|)) to 0.0001 on the Matching tab and it was no longer reported. Float absolute tolerance (|a − b|) covers values near zero, where a relative tolerance says nothing. 0 means exact.

    Expected result

    Rounding to the column’s scale and float noise are not differences. A value that changed beyond them is.

    Handle binary and large columns

    UI

    On Columns & rules, Skip BLOB / CLOB columns and Skip byte-array columns are on by default. A skipped column gets a Column skipped by an option notice naming the option, so that a clean run does not read as a check of a column that was never compared.

    1. Clear both options to compare those columns. On the example, a MySQL BLOB that read DEADBEEF on the source and 00FE on the target was reported with both values in Base64. Clearing only Skip BLOB / CLOB columns left the column skipped;

    2. Keep them on for big tables.

    A TEXT column was compared with the options on, so what is skipped follows the type that the connector reports, not the word text.

    Choose and check the comparison key

    UI

    Validator matches rows by key. It reads both tables in key order and walks them together, so the key decides everything. The key columns are marked in the Key column of Columns & rules, and they start from the primary key of the entity.

    • Key order. A text key is ordered with a forced binary collation on both sides. Each such run carries a Reader warning notice that names an index that makes the run faster. On the example text_keys entity, with the two keys a1 and A1, the run ended as Completed with that notice, and the two keys were two rows;

    • Key types. Both sides need the same kind of key. With the key id (a number) mapped to a text column on the target, the run failed with SchemaIncompatible and a message that asks you to align the types, choose another key or give a Key ordering expression for each side;

    • Duplicate keys. If the target has the same key twice, Validator reports Duplicate key. In the example, a second a1 was added to a target table without a primary key: the run counted one duplicate. Remove the extra row yourself. Tick Validate key uniqueness (Columns & rules) to fail the run at once (DuplicateComparisonKey) instead;

    • NULL keys. The default is to refuse the run with NullComparisonKey. NULL key values on the Matching tab can sort `NULL`s first or last. With Sort NULLs first, the row was reported as NULL key;

    • No key. The entity needs a primary key or a logical key. See Choose keys for tables without a primary key.

    Expected result

    Duplicate and NULL keys are listed and counted. Rows with a unique, non-NULL key are matched and compared.

    Compare while the pipeline is running

    UI

    A running pipeline keeps writing, so a row can differ for a moment. Validator guards against this in two ways.

    1. Re-verify. After the scan, each difference is read again by key on both sides. A difference that is gone is discarded and counted in Transient, discarded. Re-verify differences before reporting them is on by default (Matching tab, with a batch size of 500 and no delay);

    2. Run again. Re-verify reads once, right after the scan, so it cannot absorb a lag longer than that. In the example, every row of big_orders was updated on the source and a run started at once. It stopped at the difference limit, because the updates had not reached the target yet. A run after CDC had delivered them was clean.

    For an exact answer, pause the entity, run, and start it again. See Start, pause and restart an entity. A difference that stays across two runs a minute apart is real.

    Run very big tables safely

    UI

    1. Run Count only first;

    2. Slice the table with a key range on both sides (see the filter step);

    3. Raise Max runtime (seconds) (General → Limits, 3600 by default) before the first full run. A run that goes past it ends as Failed, and in the example the message was Statement cancelled due to client request. The rows scanned so far are not a result;

    4. Index the key columns. The Reader warning notice names an index for a text key;

    5. Do not start two runs of one entity. The second is refused with A data comparison job is already running for entity …​. Select Cancel run to stop the first. A run cancelled while the database was reading ended as Failed too.

    Max differences (default 10,000) stops a run that finds more, with the message Stopped after <n> differences: rows after that point were not compared. Fix the first batch, or correct a filter that is not the same on both sides, and run again. Max rows in results grid (default 10,000) caps what the page loads.

    See Sizing for big tables for the limits.

    Fix the rows and re-check

    UI

    1. Tick the rows to fix in the grid, or select Select all, then select Reconcile in the page header. A dialog asks Reconcile 4 differences? and says that the target changes cannot be undone from here. Select Reconcile to confirm. The three Operations allowed when reconciling (General tab: insert rows missing in the target, delete rows missing in the source, update rows with mismatched values) decide what it may do. Write predicted values to columns the pipeline transforms is off by default;

    2. A message reports the result. On the example it read Reconciliation completed. Inserted: 2, deleted: 0, updated: 2, skipped: 0, already in sync: 0. Reconcile writes the source value to the target;

    3. Start a new run. The counters of the old run clear after a reconcile, but its status does not change, so only a new run tells you the table is in sync.

    In Run history, every run of the entity is listed with its status and counters. Select one to read it again.

    Run history table of the Validator with failed runs and runs completed with warnings
    Figure 5. Run history. Each row is one run, with its status and the counters that were found.
    Expected result

    The new run ends as Completed. On the example big_orders entity the run after the reconcile reported 20,000 rows on each side and no difference.

    Schedule validation

    UI

    A Validate action can run on a schedule. See Schedule validation and Automate pipeline actions with schedules, chained events, and webhooks for how to set it up and what a scheduled run does with differences.

    Troubleshooting

    Problem Possible cause What to do

    Thousands of Target only rows and Stopped after 10000 differences

    A WHERE condition on one side only

    Put the same condition on both sides, or on neither

    A row is Source only although it exists on the target

    A filter on a column that changed on the target

    Filter on the key, and compare the rows in SQL

    Rows that differ lists timestamps that are one second or one day apart

    Ignore fractions of a second or Ignore time, compare date only against a target that rounds

    Go back to Normalize to UTC. See the date and time step

    Timestamps differ by whole hours

    The two databases or sessions use different time zones, or the data is wrong

    Tick Tolerate a whole time zone shift to confirm, then fix the zone and clear it

    '' against NULL

    The target stores an empty string as NULL, or the source does

    Set NULL and empty text to Always equal if the pipeline is meant to do that

    A text value differs only by case

    A target with a case-insensitive collation or a normalizing UDF

    Tick Ignore letter case for non-key columns

    A float differs in the fifth digit

    A 32-bit target column

    Set Float relative tolerance to the precision the column keeps

    A clean run that did not look at a column

    A Column skipped by an option notice, or a column cleared in Columns & rules

    Read the notices, and clear Skip BLOB / CLOB columns and Skip byte-array columns

    Run fails with NullComparisonKey

    A NULL in a key column

    Change the key, or set NULL key values to sort `NULL`s first or last

    Run fails with SchemaIncompatible on a key

    The key has different types on the two sides

    Align the types, or give a key ordering expression for each side

    A data comparison job is already running for entity …​

    A second run for the same entity

    Wait, or select Cancel run

    Run fails with Statement cancelled due to client request

    The run passed Max runtime (seconds), or you selected Cancel run

    Raise the limit, or slice the table with key ranges

    Unknown column '…​' in 'where clause', or SQL clauses must not contain comments or semicolons

    The WHERE text is SQL of the database, passed as it is

    Fix the column name, quote it for that database, and remove the semicolon or the comment

    Contact MOLO17 Support if you need assistance with Validator.