We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Below is the code snippet in Java trying to use bitmap as a query parameter:
try (ClickHouseConnection conn = newConnection(new Properties()); PreparedStatement stmt = conn.prepareStatement( "SELECT bitmapContains(my_bitmap, toUInt32(1)) as v1, bitmapContains(my_bitmap, toUInt32(2)) as v2 from ext_table")) { ClickHouseRequest<?> request = stmt.unwrap(ClickHouseRequest.class); request.addExternal(ClickHouseExternalTable.builder().name("ext_table") .columns("my_bitmap AggregateFunction(groupBitmap,UInt32)").format(ClickHouseFormat.RowBinary) .content(new ByteArrayInputStream(ClickHouseBitmap.wrap(1, 3, 5).toBytes())).build()); ResultSet rs = stmt.executeQuery(); Assert.assertTrue(rs.next()); Assert.assertEquals(rs.getInt(1), 1); Assert.assertEquals(rs.getInt(2), 0); Assert.assertFalse(rs.next()); }
Unfortunately it didn't work because of below check. Is it just a parsing error should be fixed or it's a limitation of external table by design?
ClickHouse/src/Core/ExternalTable.cpp
Lines 57 to 61 in b7fb21e
The text was updated successfully, but these errors were encountered:
Workaround in JDBC:
try (ClickHouseConnection conn = newConnection(new Properties()); PreparedStatement stmt = conn.prepareStatement( "SELECT bitmapContains(my_bitmap, toUInt32(1)) as v1, bitmapContains(my_bitmap, toUInt32(2)) as v2 from {tt 'ext_table'}")) { stmt.setObject(1, ClickHouseExternalTable.builder().name("ext_table") .columns("my_bitmap AggregateFunction(groupBitmap,UInt32)") .format(ClickHouseFormat.RowBinary) // optional as it's same as default .content(new ByteArrayInputStream(ClickHouseBitmap.wrap(1, 3, 5).toBytes())) .asTempTable() // necessary because of this parsing error .build()); ResultSet rs = stmt.executeQuery(); Assert.assertTrue(rs.next()); Assert.assertEquals(rs.getInt(1), 1); Assert.assertEquals(rs.getInt(2), 0); Assert.assertFalse(rs.next()); }
Sorry, something went wrong.
No branches or pull requests
Below is the code snippet in Java trying to use bitmap as a query parameter:
Unfortunately it didn't work because of below check. Is it just a parsing error should be fixed or it's a limitation of external table by design?
ClickHouse/src/Core/ExternalTable.cpp
Lines 57 to 61 in b7fb21e
The text was updated successfully, but these errors were encountered: