Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions data_diff/databases/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ def normalize_struct(self, value: str, _coltype: Struct) -> str:
# match on both sides: i.e. have properly ordered keys, same spacing, same quotes, etc.
return f"to_json_string({value})"

def normalize_decimal(self, value: str, coltype: Decimal) -> str:
# Format DECIMAL/NUMERIC values as strings with 2 decimal places for consistent comparison
return f"FORMAT('%.2f', {value})"


@attrs.define(frozen=False, init=False, kw_only=True)
class BigQuery(Database):
Expand Down
3 changes: 3 additions & 0 deletions data_diff/hashdiff_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ def _diff_segments(
return

info_tree.info.is_diff = True
logger.info(
". " * level + f"Diffing segment results: count1/count2 {count1}/{count2} checksum1/checksum2 {checksum1}/{checksum2}"
)
return self._bisect_and_diff_segments(ti, table1, table2, info_tree, level=level, max_rows=max(count1, count2))

def _bisect_and_diff_segments(
Expand Down
Loading