Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit a9a30f1

Browse files
committed
no mutual
1 parent cd0e5ed commit a9a30f1

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

data_diff/diff_tables.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,6 @@ def choose_checkpoints(self, bisection_factor: int) -> List[DbKey]:
128128
return list(real_checkpoints[0])
129129
>>>>>>> 8914eaf (no full index scans)
130130

131-
def find_checkpoints(self, checkpoints: List[DbKey]) -> List[DbKey]:
132-
"Takes a list of potential checkpoints and returns those that exist"
133-
where = In(self.key_column, checkpoints)
134-
return self.database.query(self._make_select(where=where), List[int])
135-
136131
def segment_by_checkpoints(self, checkpoints: List[DbKey]) -> List["TableSegment"]:
137132
"Split the current TableSegment to a bunch of smaller ones, separate by the given checkpoints"
138133

@@ -354,21 +349,13 @@ def _diff_tables(self, table1, table2, level=0, bisection_factor=None):
354349
yield from diff
355350
return
356351

357-
# Find mutual checkpoints between the two tables
352+
# Find checkpoints between the two tables
358353
checkpoints = table1.choose_checkpoints(bisection_factor)
359354
assert checkpoints
360-
mutual_checkpoints = table2.find_checkpoints([Value(c) for c in checkpoints])
361-
mutual_checkpoints = list(set(mutual_checkpoints)) # Duplicate values are a problem!
362-
mutual_checkpoints.sort()
363-
# print(f"level={level} cp={checkpoints} mc={mutual_checkpoints} bf={bisection_factor} t1start_key={table1.start_key} t1end_key={table1.end_key} t2_start_key={table2.start_key} t2_end_key={table2.end_key}")
364-
logger.debug(". " * level + f"Found {len(mutual_checkpoints)} mutual checkpoints (out of {len(checkpoints)}) origin={checkpoints} mutual={mutual_checkpoints}")
365-
if not mutual_checkpoints:
366-
raise Exception("Tables are too different.")
367-
368355

369356
# Create new instances of TableSegment between each checkpoint
370-
segmented1 = table1.segment_by_checkpoints(mutual_checkpoints)
371-
segmented2 = table2.segment_by_checkpoints(mutual_checkpoints)
357+
segmented1 = table1.segment_by_checkpoints(checkpoints)
358+
segmented2 = table2.segment_by_checkpoints(checkpoints)
372359
# print(segmented1)
373360

374361
# Compare each pair of corresponding segments between table1 and table2

0 commit comments

Comments
 (0)