data-parity

Validate that two tables or query results are identical or diagnose how they differ.

803|134|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/AltimateAI/altimate-code --skill data-parity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: data-parity
Source: https://github.com/AltimateAI/altimate-code/tree/main/.opencode/skills/data-parity
Command: npx skills add https://github.com/AltimateAI/altimate-code --skill data-parity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When migrating databases, refactoring queries, or validating ETL pipelines, you need to prove that two tables contain the same data — or pinpoint exactly where they diverge. Manual diff SQL is error-prone, and naive comparisons produce false positives from auto-generated timestamps or silently miss value differences.

Core Features & Use Cases

  • Guided diff workflow: Discovers schemas, identifies primary key candidates via cardinality checks, detects auto-timestamp columns, and confirms assumptions with the user before running comparisons.
  • Multi-algorithm comparison: Uses the data_diff tool with profile (column statistics), joindiff (same-database FULL OUTER JOIN), hashdiff (cross-database checksum bisection), and cascade modes, with partitioning for large tables.
  • Regulated data safeguards: Defaults to profile-only comparison for tables likely containing PII/PHI/PCI and requires explicit approval before sending sample diff rows to the LLM.
  • Use Case: After migrating orders from PostgreSQL to Snowflake, run a profile comparison to find that amount has rounding drift and status has 47 unexpected NULLs, then run a targeted hashdiff on only those columns to identify the affected rows.

Quick Start

Ask the assistant to verify that the orders table in the production Postgres database matches the migrated copy in Snowflake using the data-parity workflow.

Frequently Asked Questions about data-parity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compare two tables across different databases?

Use the data_diff tool with the hashdiff algorithm, which performs checksum-based bisection across separate connections. Never use joindiff for cross-database comparisons — it only sees one connection and always reports zero differences.

How to validate data after a database migration?

Run a column-level profile first to compare counts, nulls, and min/max per column without scanning rows. Then run a targeted row-level hashdiff on only the diverging columns, confirming primary keys and timestamp exclusions with the user first.

Why does my table diff report identical when values actually differ?

The engine only compares columns listed in extra_columns; an empty list checks key existence only. For SQL query sources, auto-discovery cannot run, so you must explicitly provide every column to compare.

Does data diff work with SQL Server and Microsoft Fabric?

Yes, both are supported over the TDS protocol with password or Azure AD authentication. Date partitioning requires SQL Server 2022 or later for DATETRUNC(); basic profile, joindiff, and hashdiff work on older versions.

How do I diff a table with billions of rows?

Use partition_column with monthly date granularity, numeric bucket sizes, or categorical values to diff the table in independent groups. Alternatively, scope the comparison with a where_clause such as a recent date window.

Is it safe to diff tables containing PII or regulated data?

Row-level diffs include up to 5 sample rows in the output sent to the LLM provider. For regulated tables, use the profile algorithm, which compares only column statistics without any row values leaving the database.