@Test public void singleClusteringWithMismatches() { TableSpec t = spec("table1", names("c1"), names("v1", "v2")); PartitionComparator comparator = comparator(t, rows(row(t, 0, 1, 2), row(t, 1, 11, 21), row(t, 2, 12, 22)), rows(row(t, 0, 1, 20), row(t, 1, 1100, 21), row(t, 2, 12, 1200))); PartitionStats stats = comparator.call(); assertStats(stats, false, true, 3, 3, 3); }
public PartitionStats call() { PartitionStats partitionStats = new PartitionStats(); if (source == null || target == null) { logger.error("Skipping partition because one result was null (timeout despite retries)"); partitionStats.skipped = true; return partitionStats; } while (hasNextRow(Type.SOURCE) && hasNextRow(Type.TARGET)) { Row sourceRow = getNextRow(Type.SOURCE); Row targetRow = getNextRow(Type.TARGET); if (!clusteringsEqual(sourceRow, targetRow)) { partitionStats.allClusteringsMatch = false; return partitionStats; } partitionStats.matchedRows++; checkRegularColumnEquality(partitionStats, sourceRow, targetRow); } if (hasNextRow(Type.SOURCE) || hasNextRow(Type.TARGET)) partitionStats.allClusteringsMatch = false; return partitionStats; }
PartitionComparator implements Callable<PartitionStats> { public PartitionStats call() { PartitionStats partitionStats = new PartitionStats(); if (source == null || target == null) { logger.error("Skipping partition because one result was null (timeout despite retries)"); partitionStats.skipped = true; return partitionStats; } while (hasNextRow(Type.SOURCE) && hasNextRow(Type.TARGET)) { Row sourceRow = getNextRow(Type.SOURCE); Row targetRow = getNextRow(Type.TARGET); if (!clusteringsEqual(sourceRow, targetRow)) { partitionStats.allClusteringsMatch = false; return partitionStats; } partitionStats.matchedRows++; checkRegularColumnEquality(partitionStats, sourceRow, targetRow); } if (hasNextRow(Type.SOURCE) || hasNextRow(Type.TARGET)) partitionStats.allClusteringsMatch = false; return partitionStats; } }
PartitionComparator implements Callable<PartitionStats> { public PartitionStats call() { PartitionStats partitionStats = new PartitionStats(); if (source == null || target == null) { logger.error("Skipping partition because one result was null (timeout despite retries)"); partitionStats.skipped = true; return partitionStats; } while (hasNextRow(Type.SOURCE) && hasNextRow(Type.TARGET)) { Row sourceRow = getNextRow(Type.SOURCE); Row targetRow = getNextRow(Type.TARGET); if (!clusteringsEqual(sourceRow, targetRow)) { partitionStats.allClusteringsMatch = false; return partitionStats; } partitionStats.matchedRows++; checkRegularColumnEquality(partitionStats, sourceRow, targetRow); } if (hasNextRow(Type.SOURCE) || hasNextRow(Type.TARGET)) partitionStats.allClusteringsMatch = false; return partitionStats; } PartitionComparator(TableSpec tableSpec,
                               Iterator<Row> source,
                               Iterator<Row> target,
                               RetryStrategyProvider retryStrategyProvider); }
PartitionComparator implements Callable<PartitionStats> { public PartitionStats call() { PartitionStats partitionStats = new PartitionStats(); if (source == null || target == null) { logger.error("Skipping partition because one result was null (timeout despite retries)"); partitionStats.skipped = true; return partitionStats; } while (hasNextRow(Type.SOURCE) && hasNextRow(Type.TARGET)) { Row sourceRow = getNextRow(Type.SOURCE); Row targetRow = getNextRow(Type.TARGET); if (!clusteringsEqual(sourceRow, targetRow)) { partitionStats.allClusteringsMatch = false; return partitionStats; } partitionStats.matchedRows++; checkRegularColumnEquality(partitionStats, sourceRow, targetRow); } if (hasNextRow(Type.SOURCE) || hasNextRow(Type.TARGET)) partitionStats.allClusteringsMatch = false; return partitionStats; } PartitionComparator(TableSpec tableSpec,
                               Iterator<Row> source,
                               Iterator<Row> target,
                               RetryStrategyProvider retryStrategyProvider); PartitionStats call(); }
PartitionComparator implements Callable<PartitionStats> { public PartitionStats call() { PartitionStats partitionStats = new PartitionStats(); if (source == null || target == null) { logger.error("Skipping partition because one result was null (timeout despite retries)"); partitionStats.skipped = true; return partitionStats; } while (hasNextRow(Type.SOURCE) && hasNextRow(Type.TARGET)) { Row sourceRow = getNextRow(Type.SOURCE); Row targetRow = getNextRow(Type.TARGET); if (!clusteringsEqual(sourceRow, targetRow)) { partitionStats.allClusteringsMatch = false; return partitionStats; } partitionStats.matchedRows++; checkRegularColumnEquality(partitionStats, sourceRow, targetRow); } if (hasNextRow(Type.SOURCE) || hasNextRow(Type.TARGET)) partitionStats.allClusteringsMatch = false; return partitionStats; } PartitionComparator(TableSpec tableSpec,
                               Iterator<Row> source,
                               Iterator<Row> target,
                               RetryStrategyProvider retryStrategyProvider); PartitionStats call();  }