clickhouse-java
clickhouse-java copied to clipboard
Unable to access underlying input stream for binary formats
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
- 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
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 did we fix it?
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?