I think ClickHouseBinaryFormatReader should also extends Iterator or Stream interface, that will make handle large result set very easy to use Java Stream API.
Code example
Maybe this will be a use case:
QueryResponse response = this.client.query("select * from mytable").get();
ClickHouseBinaryFormatReader reader = client.newBinaryFormatReader(response);
// if ClickHouseBinaryFormatReader extends Stream, we can use
reader.map(....).filter(...)
// if ClickHouseBinaryFormatReader extends Iterator, we can use
StreamSupport.stream(Spliterators.spliteratorUnknownSize(reader, 0), false).map(...).filter(...)
Describe your feedback
I think ClickHouseBinaryFormatReader should also extends
Iterator
orStream
interface, that will make handle large result set very easy to use Java Stream API.Code example
Maybe this will be a use case:
Thanks.