Closed adolfosp closed 1 year ago
Hi. I would not expect this to be a bug in the library - BulkCopy insertion is checked as part of test suite. Do you call MoveNext
or Skip
on the iterator by any chance? Can you try to create a minimum reproducible example?
In this example, I used the last version of the library
Example: https://github.com/adolfosp/Issue-319-ClickHouse.Client.git
Checked your code - your issue is here:
while (reader.Read())
await bulkCopyInterface.WriteToServerAsync(reader);
You are reading the first row before passing the reader to ClickHouseBulkCopy
. BulkCopy
then reads the rest of the reader and your cycle finishes after 1 iteration
BulkCopy
class will call the Read
method by itself (implicitly via AsEnumerable
extension), you don't need to call Read
yourself.
@DarkWanderer Thanks a lot for your help. It worked for me
Hi @DarkWanderer
First of all thanks for creating this ClickHouse client library. I have one problem when I am going to insert rows by bulk. Always the first row doesn't insert in the database. I was debugging this library and the enumerator. MoveNext () always get the second line as the first value to enumerator.Current. Is it a me problem ? Or is it a library problem ?
Class: ClickHouseBulkCopy Package Version: 6.6.0