DarkWanderer / ClickHouse.Client

.NET client for ClickHouse
MIT License
315 stars 62 forks source link

ClickHouseBulkCopy sends additional empty request if BatchSize equals to rows collection length #403

Closed DmitryZhelnin closed 7 months ago

DmitryZhelnin commented 10 months ago

In this while cycle hasMore variable actually means that previous read was successful but not that there is more data to read.

https://github.com/DarkWanderer/ClickHouse.Client/blob/babcce5009669761b8b02311c5e9b358ef1ffdff/ClickHouse.Client/Copy/ClickHouseBulkCopy.cs#L176-L187

so when BatchSize equals to the size of provided collection new request with empty stream is created (in outer do/while loop) and sent to the server.

DarkWanderer commented 10 months ago

Hi. Thanks for report - looks like ClickHouseBulkCopy is due for a minor rewrite

DarkWanderer commented 7 months ago

Fixed in latest version