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

Commit 1838dd3

Browse files
committed
Various fixes to PR
1 parent 84e1377 commit 1838dd3

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

data_diff/diff_tables.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ def count_and_checksum(self) -> Tuple[int, int]:
120120
)
121121
duration = time.time() - start
122122
if duration > RECOMMENDED_CHECKSUM_DURATION:
123-
logger.warn(f"Checksum is taking longer than expected ({duration:.2f}s). ")
123+
logger.warn(
124+
f"Checksum is taking longer than expected ({duration:.2f}s). "
125+
"We recommend increasing the bisection-factor."
126+
)
124127

125128
# TODO Handle None TODO
126129
return count or 0, checksum
@@ -243,14 +246,14 @@ def _bisect_and_diff_tables(self, table1, table2, level=0, max_rows=None):
243246
def _diff_tables(self, table1, table2, level=0, segment_index=None, segment_count=None):
244247
logger.info(
245248
". " * level
246-
+ f"Diffing segment {segment_index}/{segment_count}, key-range: {table1.start_key:x}..{table2.end_key:x}"
249+
+ f"Diffing segment {segment_index}/{segment_count}, key-range: {table1.start_key}..{table2.end_key}"
247250
)
248251

249252
(count1, checksum1), (count2, checksum2) = self._threaded_call("count_and_checksum", [table1, table2])
250253

251-
if not (count1 or count2):
254+
if count1 == 0 and count2 == 0:
252255
logger.warn(
253-
"Uneven distribution of keys detected. "
256+
"Uneven distribution of keys detected. (big gaps in the key column). "
254257
"For better performance, we recommend to increase the bisection-threshold."
255258
)
256259
assert checksum1 is None and checksum2 is None

dev/prepare_db_gaps.pql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ print "Create more tables"
7171
const table rating_gap1_update0001p = rating_gap1
7272
const table rating_gap2_update0001p = rating_gap2
7373
const table rating_gap3_update0001p = rating_gap3
74+
create_indices(rating_gap1_update0001p)
75+
create_indices(rating_gap2_update0001p)
76+
create_indices(rating_gap3_update0001p)
77+
7478
rating_gap1_update0001p[random() < 0.000001] update {timestamp: timestamp + 1}
7579
rating_gap2_update0001p[random() < 0.000001] update {timestamp: timestamp + 1}
7680
rating_gap3_update0001p[random() < 0.000001] update {timestamp: timestamp + 1}

0 commit comments

Comments
 (0)