A recon module to compare two databases in UC
Project description
Recon Comp
Overview
Recon is a Python class designed for comparing data between two tables in a Spark environment. It provides methods for performing various types of comparisons including schema, data, record count, completeness, consistency, and distribution.
Installation
You can install Recon using pip:
pip install recon
Usage
Import the Recon class:
from recon import Recon
Initialize a Recon object:
recon = Recon(spark, sql_comp, audit_table)
Parameters:
spark: SparkSession object. sql_comp: A string indicating whether SQL comparison is enabled ('y' or 'n'). audit_table: Name of the audit table to store comparison results.
Call the comparison methods:
comparison_results = recon.compare_all(table_name1, table_name2, primary_keys, fields_to_compare, where_clause, sql1, sql2)
Parameters:
table_name1(mandatory): Name of the first table.
table_name2(mandatory): Name of the second table.
primary_keys(mandatory): List of primary keys for comparison.
fields_to_compare(mandatory): List of fields to compare.
where_clause(recommeded when comparing tables and not providing sqls): SQL WHERE clause for filtering data.
sql1(Optional): SQL query for the first table.
sql2(Optional): SQL query for the second table.
View results:
The comparison results are stored in an audit table specified during initialization.
License
Open source
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file recon_comp-0.0.1.tar.gz
.
File metadata
- Download URL: recon_comp-0.0.1.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9771ed8728e59843be86a2ecd4fe8dbce765d73fac5318bf3db61214bcaf056d |
|
MD5 | 931a34a82aeedd538a53493ac4e1f54c |
|
BLAKE2b-256 | 030756381653fd7875d588cd99fbd2406cc52ee9c51e8b5d0fc99dfb73798610 |
File details
Details for the file recon_comp-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: recon_comp-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ddbe8822681344f234d221bbc1773c4a6dfbd6ca3bfa9115c1abefbba5b2a7c |
|
MD5 | cf97522aea12af3b343f4fede0d181ce |
|
BLAKE2b-256 | 1672a5de3e80b78b76a295cf433e051a190bf5d5bd8aed261c4ef71c516b0682 |