You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as Roaring64NavigableMap and only when cardinality <= 32
as Roaring64NavigableMap
Roaring64NavigableMap
only when cardinality <= 32
Y
Usage
// use JDBC interface - NOT recommended before 0.3.1try (PreparedStatementstatement = connection.prepareStatement("insert into my_bitmap_table values(..., ?, ...)")) {
...
// RoaringBitmap bitmap = RoaringBitmap.bitmapOf(1,2,3,...);s.setObject(index++, ClickHouseBitmap.wrap(bitmap, ClickHouseDataType.UInt32));
...
// the actual SQL in 0.3.0 will be something like below, which is also why batch insertion does not work...// insert into my_bitmap_table values(..., bitmapBuild([toUInt32(1),toUInt32(3),toUInt32(3),...]) ...)s.execute();
}
// use extended API - recommended in 0.3.0try (ClickHouseStatementstatement = connection.createStatement()) {
statement.sendRowBinaryStream("insert into my_bitmap_table", newClickHouseStreamCallback() {
publicvoidwriteTo(ClickHouseRowBinaryStreamstream) throwsIOException {
...
// RoaringBitmap bitmap = RoaringBitmap.bitmapOf(1,2,3,...);// In addition to RoaringBitmap, you can pass:// ImmutableRoaringBitmap, MutableRoaringBitmap and even Roaring64NavigableMapstream.writeBitmap(ClickHouseBitmap.wrap(bitmap, ClickHouseDataType.UInt32));
...
}
});
}
This method will generate a large size sql script, isn't it written directly insert into a bitmap object?
If so, how should I write a bitmap object with a large cardinality...
This method will generate a large size sql script, isn't it written directly insert into a bitmap object? If so, how should I write a bitmap object with a large cardinality...
I guess you're using JDBC API which wii generate a large SQL as you said - you should use extended API. Behind the scene, in most cases, it's just about how to use input function and/or external/temp table.
Starting 0.3.2, the situation has changed: 1) extended API is replaced by new Java client; and 2) you can load bitmap or use it as a query parameter using standard JDBC API. Please take a look at examples at here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Usage