ClickHouse / clickhouse-cpp

C++ client library for ClickHouse
Apache License 2.0
305 stars 159 forks source link

Question: Fetching while processing. #334

Closed andersc closed 1 year ago

andersc commented 1 year ago

Hi.

I'm using the client -> Select method fetching a large amount of data. Is there a method for getting the data as it's being downloaded to the client. As of right now I query the database and have to wait for 14 seconds for the data. Then the lambda is triggered giving me all blocks. For me it would be beneficial to get each block of data as it's beeing retrieved.

Thanks for helping.

/A

Enmk commented 1 year ago

Hi @andersc ! Right now callback is triggered for each received block, you can either aggregate those or pass to some sort of handler in your code (typically by copying Block instance, it is safe).

andersc commented 1 year ago

@Enmk thanks for the clarification, what you say is correct. I did my time-measure at the wrong part of the code.

Will close.

Thanks for your responce.

/A