expect_table_row_count_to_equal_other_table
Feb 24, 2026
·
5
min read
Volume, Tables relationship
·
dbt-expectations
·
Model,Seed,Source
How it Works
The expect_table_row_count_to_equal_other_table test from the dbt-expectations package validates that two models contain exactly the same number of rows. This is the dbt-expectations equivalent of equal_rowcount from dbt-utils™, providing a cross-table volume consistency check.
Steps and Conditions
Comparison Model: Specify the reference model using
compare_model.Execution: Both models are counted and compared.
Outcome: Pass if counts are equal; fail if they differ.
Example Usage: ETL Validation
A data team wants to confirm that their transformation layer preserves exactly the same number of records as the source, ruling out any dropped or duplicated rows.
Any row count discrepancy between staging and source immediately surfaces for investigation.





