Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

compare options

Every option of compare, duplicate keys and profiles.

OptionEffect
-k, --keycomposite key, required (or from a profile)
-c, --comparecolumns to diff; default every column present in both files except the key
-i, --ignorecolumns to skip (timestamps, run ids)
--trim, --ignore-casenormalisation before comparing (applies to key and values); a value --trim leaves empty is absent, as an empty cell is, so " " against an empty or missing value is no change
--empty-is-nullkept for old scripts and profiles: an empty value and a missing one are always equal, in every format
--toleranceabsolute numeric tolerance where both sides parse as numbers
--delimiteroverride delimiter detection (CSV only): one character, or '\t' (or tab) for a tab; one that isn’t in a file’s header is noted
--encodingUTF-8 (the default) is read as text; Latin-1 or a Windows code page compares as bytes, with the right counts; UTF-16 and UTF-32 are refused with how to convert
--threadshow wide the engines run; the default is every core
--memorymemory to plan for (e.g. 8G); decides when large text files are joined in one pass instead of two, and how many columns of two Parquet files are read at once (a Parquet pair that needs more than a stated budget is refused)
--max-rowsrows embedded per report section (default 50 000)
-o, --outwrite the HTML report here, or to standard output with -o -; there is no report without it
--export-dirfull, uncapped changed/added/removed CSVs
--jsonwrite a JSON summary (counts and column stats; schema in docs/contract.schema.json)
--summaryprint the counts and refuse any flag that writes a file (the default without -o, --json or --export-dir)
--engineauto (default), turbo, sortmerge or native; sortmerge and native read CSV only
--no-compressplain JSON payload in the report, for pre-2023 browsers (with -o)
--fail-on-dupsexit 3 when either file has duplicate keys
--exit-zeroexit 0 when the tables differ: for a scheduled job whose output is the report (a Kubernetes Job, an Airflow task)

An option that names columns (-k, -c, -i) may be given more than once, and the names add up: -k order_id -k line_no is -k order_id,line_no. Any other option given twice with two values is refused.

A column that only one of the two files has is not compared, and the exit code does not answer for it: a note after the counts names it (note: column only in B, not compared: carrier), unless -i names the column or -c names the ones to compare, and the JSON summary lists such columns as meta.only_in_a and meta.only_in_b.

Duplicate keys are counted and listed per file; the first occurrence of each key takes part in the join.

Profiles. A compara.toml in the working directory (or ~/.config/compara/compara.toml, or --config PATH) names recurring comparisons: key, compared and ignored columns, normalisation, engine. See compara.example.toml. The command line overrides the profile. A list may run over several lines. A key a profile does not have, or a value of the wrong kind (trim = yes), is refused with its line, and a profile name that is not in the file is answered with the names that are.


Made from docs/options.md.