Skip to content

Commit

Permalink
Merge pull request #583 from apache/generate_theta_compressed
Browse files Browse the repository at this point in the history
generate compressed theta sketches for cross-language test
  • Loading branch information
AlexanderSaydakov committed Jul 26, 2024
2 parents fa08048 + 481265a commit ab51c6c
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ public void generateBinariesForCompatibilityTesting() throws IOException {
}
}

@Test(groups = {GENERATE_JAVA_FILES})
public void generateBinariesForCompatibilityTestingCompressed() throws IOException {
final int[] nArr = {10, 100, 1000, 10_000, 100_000, 1_000_000};
for (int n: nArr) {
final UpdateSketch sk = UpdateSketch.builder().build();
for (int i = 0; i < n; i++) sk.update(i);
Files.newOutputStream(javaPath.resolve("theta_compressed_n" + n + "_java.sk")).write(sk.compact().toByteArrayCompressed());
}
}

@Test(groups = {GENERATE_JAVA_FILES})
public void generateBinariesForCompatibilityTestingNonEmptyNoEntries() throws IOException {
final UpdateSketch sk = UpdateSketch.builder().setP(0.01f).build();
Expand Down

0 comments on commit ab51c6c

Please sign in to comment.