ClickHouse.Client
ClickHouse.Client copied to clipboard
How can I use Bulk insertion in a table with nested columns
How can send nested columns values?
It gives this error when I send the list as an object array below:
ClickHouse.Client.Copy.ClickHouseBulkCopySerializationException: Error when serializing data ---> System.InvalidCastException: Unable to cast object of type 'System.Collections.Generic.List1[System.Object[]]' to type 'System.Runtime.CompilerServices.ITuple'.
at ClickHouse.Client.Types.TupleType.Write(ExtendedBinaryWriter writer, Object value)
at ClickHouse.Client.Copy.ClickHouseBulkCopy.<PushBatch>d__28.MoveNext()
--- End of inner exception stack trace ---
at ClickHouse.Client.Copy.ClickHouseBulkCopy.<PushBatch>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at ClickHouse.Client.Copy.ClickHouseBulkCopy.<WriteToServerAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()`
Hi,
Could you please provide an example table structure and data you expect to insert?
@mucahitimre This may sound silly, but double check the table (and the schema of the table) you're attempting to insert into. I was getting a similar error because I forgot to ALTER my table.