clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

Unable to access underlying input stream for binary formats

Open wasifaleem opened this issue 1 year ago • 3 comments

Describe the bug

When querying in binary formats, I'm unable to access underlying input stream because processor is null. As I understand it the connector doesn't support all data formats right now, but as a workaround it'd help if the underlying stream is still accessible.

Steps to reproduce

  1. Query using any binary formats like Arrow/Parquet/Avro

Expected behaviour

Code example

val clickhouseResponse = clickHouseClient.read(clickhouseNodes)
            .query("SELECT * FROM table LIMIT 10 FORMAT ArrowStream")
            .format(ClickHouseFormat.ArrowStream)
            .execute()
            .await()

Error log

java.lang.NullPointerException: Cannot invoke "com.clickhouse.data.ClickHouseDataProcessor.getInputStream()" because "this.processor" is null
	at com.clickhouse.client.ClickHouseStreamResponse.getInputStream(ClickHouseStreamResponse.java:135)

Configuration

Environment

  • Client version: com.clickhouse:clickhouse-http-client:0.4.6
  • Language version: JDK 18
  • OS: Linux

ClickHouse server

  • ClickHouse Server version: 23.2.2.20

wasifaleem avatar Jun 05 '23 09:06 wasifaleem

Hi @wasifaleem, yes the input stream should be exposed regardless the format is supported or not. It's been fixed in local but I have trouble accessing github from my laptop to commit the code. Will try again tonight.

zhicwu avatar Jun 05 '23 09:06 zhicwu

@zhicwu did we fix it?

mzitnik avatar Aug 02 '23 11:08 mzitnik

I suppose this was not fixed in the end? I am also unable to read Protobuf in 0.6.0 using the above approach. Is there a workaround?

C0mbatwombat avatar Mar 19 '24 09:03 C0mbatwombat