Open
Labels
api-diagnosticsArea: public API shape, error reporting, logging, metrics, tracingenhancementjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)
Description
Use case
Download binary files from CH
Describe the solution you'd like
Implement
-
Class - ResultSetImpl
Method - getBinaryStream(String columnLabel) -
Class - ResultSetImpl
Method - getBlob(String columnLabel)
Describe the alternatives you've considered
QuerySettings querySettings = new QuerySettings();
querySettings.setFormat(ClickHouseFormat.RawBLOB);
QueryResponse queryResponse = connection.unwrap(ConnectionImpl.class)
.getClient()
.query("select ...", querySettings)
.get();
Additional context
Metadata
Metadata
Assignees
Labels
api-diagnosticsArea: public API shape, error reporting, logging, metrics, tracingenhancementjdbcModule: the JDBC driver (jdbc-v2; with legacy: the v1 driver)
Activity
chernser commentedon Sep 2, 2025
Good day, @AndrewRazumovskiy !
Thank you for your suggestion!
Would you please describe your use-case?
Thanks!
AndrewRazumovskiy commentedon Sep 3, 2025
I store raw binary files in CH (png, pdf, txt, excel), and I want to download them as is, in binary mode
chernser commentedon Sep 3, 2025
@AndrewRazumovskiy
Thank you for the response!
Do you need
Blobfor some framework?However method
com.clickhouse.jdbc.ResultSetImpl#getBytes(int)orcom.clickhouse.jdbc.ResultSetImpl#getBinaryStream(int)is more straightforward option because has less wrapping classes. I assume there is a column ofStringtype that you want to retrieve.AndrewRazumovskiy commentedon Sep 3, 2025
ResultSetImpl#getBytes throws "Column is not of array type"
ResultSetImpl#getBinaryStream returns "BinaryStream is not yet supported" (v0.9.1)
AndrewRazumovskiy commentedon Sep 3, 2025
I tried to use jooq, but in the end fall back to native java
chernser commentedon Sep 3, 2025