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

ClientHandle::insert() should not consume a block when it fails

Open gsnoff opened this issue 3 years ago • 1 comments

Currently, the insert() method of ClientHandle accepts a Block instance only by value, forcing its consumption, regardless of whether the insert operation runs successfully or not. This introduces unnecessary hassle with contents cloning (and keeping in RAM), whenever implementing repeating attempts of inserting the data.

Ideally, the Block should be taken by reference instead. Failing that, it should be returned back in the Result error value.

gsnoff avatar Mar 09 '21 12:03 gsnoff

Thanks for the advice. The implementation of this has already been pushed into this repository and will be in the next release.

suharev7 avatar Mar 28 '21 00:03 suharev7