The CompareColumns gem lets you compare columns between two DataFrames based on the key id columns defined.Documentation Index
Fetch the complete documentation index at: https://docs.prophecy.ai/llms.txt
Use this file to discover all available pages before exploring further.
Parameters
| Parameter | Description | Required |
|---|---|---|
| DataFrame 1 | First input DataFrame | True |
| DataFrame 2 | Second input DataFrame | True |
| ID columns to retain(Select Id Columns) | List of columns that are used joining two dataframes | True |
| Output Column Name(Select Output Columns) | In the output, alias name of the column name that was compared among dataframes | True |
| Match Count Column Name(Select Output Columns) | In the output, alias name of the column that shows the count of rows that matched between two dataframes | True |
| Mismatch Count Column Name(Select Output Columns) | In the output, alias name of the column that shows the count of rows that mismatched between two dataframes | True |
| Mismatch Example Left Column Name(Select Output Columns) | In the output, alias name of the column displaying an incorrect left column value | True |
| Mismatch Example Right Column Name(Select Output Columns) | In the output, alias name of the column displaying an incorrect right column value | True |
| Mismatch Example ID Column Prefix(Select Output Columns) | In the output, alias name of the ID column value that mismatched between two dataframes | True |
Example - Compare columns of two DataFrames
Example code
- Pivot the DataFrame to get the key column’s, compare column name and value
- Join the pivoted DataFrames and compare the column value using key column’s
- Calculate the match and mismatch record counts
Repartition the DataFrames as they will be exploded and joined with each other

