Compare Columns
const url = 'https://example.com/v1/datasets/example/compare';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"columns":["example"],"reference":"example","tolerance":1,"ignore_case":false,"trim_whitespace":false,"sql":"SELECT * FROM data"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/datasets/example/compare \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "columns": [ "example" ], "reference": "example", "tolerance": 1, "ignore_case": false, "trim_whitespace": false, "sql": "SELECT * FROM data" }'How often two or more columns give the same value in each row: several models’ answers,
a model against labels someone already has, or any columns at all. With a reference, also
each column’s accuracy against it. Every count comes with the filter for its rows, to use in a
query’s WHERE clause: to see them (query) or to ask about them again (runs).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Two or more; or one, with a reference.
Compare VARCHAR columns using Unicode lowercase (not full case folding).
Trim ASCII space, tab, newline, carriage return, form feed and vertical tab in VARCHAR columns. Empty strings remain answers.
The rows to compare: a SELECT over data.
Responses
Section titled “Responses”Successful Response
object
object
object
Rows compared: those the query returns.
The columns compared, with the reference last.
object
Some columns are empty, and the others agree.
Every column is empty.
Every two of the columns.
object
Rows where both have a value.
SQL picking the rows where the two differ.
object
Human-readable signed difference; column minus reference when a reference exists, otherwise second minus first.
object
The most common values, and how often each column gives them.
object
The two columns’ values, in the order compared.
object
object
Rows where both the column and the reference have a value.
SQL picking the rows where the column differs from the reference.
Up to 20 reference labels with lowest recall; aggregate metrics use all labels. Empty with a tolerance.
object
Rows where the reference has this value (and the column one).
Rows where the column has this value (and the reference one).
Example
{ "values_completeness": { "count_unit": "rows" }, "crosstab_completeness": { "count_unit": "rows" }, "reference": [ { "labels_completeness": { "count_unit": "rows" } } ]}Validation Error
object
object
object
Example generated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}