Skip to content

Commit

Permalink
use setLong instead of setInt and update test for partition values la…
Browse files Browse the repository at this point in the history
…rger than max int (#428)
  • Loading branch information
elliVM authored Nov 21, 2024
1 parent 46c3696 commit ed694e8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private void writeFilterTypes(final Config config) {
}
final String sql = "INSERT IGNORE INTO `filtertype` (`expectedElements`, `targetFpp`, `pattern`) VALUES (?, ?, ?)";
try (final PreparedStatement stmt = connection.prepareStatement(sql)) {
stmt.setInt(1, entry.getKey().intValue()); // filtertype.expectedElements
stmt.setLong(1, entry.getKey()); // filtertype.expectedElements
stmt.setDouble(2, entry.getValue()); // filtertype.targetFpp
stmt.setString(3, pattern); // filtertype.pattern
stmt.executeUpdate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public void saveFilter(final Boolean overwrite) {
);
filter.writeTo(baos);
InputStream is = new ByteArrayInputStream(baos.toByteArray());
stmt.setInt(1, Integer.parseInt(partitionID)); // bloomfilter.partition_id
stmt.setInt(2, (int) selectedExpectedNumOfItems); // filtertype.expectedElements
stmt.setLong(1, Long.parseLong(partitionID)); // bloomfilter.partition_id
stmt.setLong(2, selectedExpectedNumOfItems); // filtertype.expectedElements
stmt.setDouble(3, selectedFpp); // filtertype.targetFpp
stmt.setString(4, pattern); // filtertype.pattern
stmt.setBlob(5, is); // bloomfilter.filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,6 @@ private Row generatedRow(SortedMap<Long, Double> filterMap, List<String> tokens)
Assertions.assertDoesNotThrow(() -> {
bf.writeTo(baos);
});
return RowFactory.create("1", baos.toByteArray());
return RowFactory.create("9999999999", baos.toByteArray());
}
}

0 comments on commit ed694e8

Please sign in to comment.