Skip to content

getBlob implementation #2558

Open
Open

Description

@AndrewRazumovskiy

Use case

Download binary files from CH

Describe the solution you'd like

Implement

  1. Class - ResultSetImpl
    Method - getBinaryStream(String columnLabel)

  2. 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

Activity

  1. chernser commented on Sep 2, 2025

    @chernser
    Contributor

    Good day, @AndrewRazumovskiy !
    Thank you for your suggestion!

    Would you please describe your use-case?

    Thanks!

  2. AndrewRazumovskiy commented on Sep 3, 2025

    @AndrewRazumovskiy
    Author

    I store raw binary files in CH (png, pdf, txt, excel), and I want to download them as is, in binary mode

  3. chernser commented on Sep 3, 2025

    @chernser
    Contributor

    @AndrewRazumovskiy

    Thank you for the response!
    Do you need Blob for some framework?

    However method com.clickhouse.jdbc.ResultSetImpl#getBytes(int) or com.clickhouse.jdbc.ResultSetImpl#getBinaryStream(int) is more straightforward option because has less wrapping classes. I assume there is a column of String type that you want to retrieve.

  4. AndrewRazumovskiy commented on Sep 3, 2025

    @AndrewRazumovskiy
    Author

    ResultSetImpl#getBytes throws "Column is not of array type"
    ResultSetImpl#getBinaryStream returns "BinaryStream is not yet supported" (v0.9.1)

  5. AndrewRazumovskiy commented on Sep 3, 2025

    @AndrewRazumovskiy
    Author

    I tried to use jooq, but in the end fall back to native java

  6. chernser commented on Sep 3, 2025

    @chernser
    Contributor

    ResultSetImpl#getBytes throws "Column is not of array type"
    ResultSetImpl#getBinaryStream returns "BinaryStream is not yet supported" (v0.9.1)
    This will be fixed in 0.9.3 (should be ready by end of this month). Here is the issue for that #2263

    I tried to use jooq, but in the end fall back to native java
    Jooq as I know is built on top of JDBC and it just adds extra layer of abstractions.
    We always recommend using clickhouse-java until JDBC is the requirement.

  7. added this to the 0.9.4 milestone on Oct 15, 2025
  8. removed this from the 0.9.5 milestone on Nov 17, 2025
  9. added this to the 0.9.6 milestone on Dec 18, 2025
  10. modified the milestones: 0.9.6, 0.9.7 on Jan 7, 2026
  11. modified the milestones: 0.9.7, 0.9.8 on Jan 21, 2026
  12. modified the milestones: 0.9.8, 0.9.9 on Mar 16, 2026
  13. modified the milestones: 0.10.0, 0.11.0 on Jul 22, 2026
  14. modified the milestones: 0.11.0, 0.12.0 on Sep 23, 2026
  15. removed this from the 0.12.0 milestone on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions