How should I Bulk Insert data with Dictionary(array) model props? #146
Replies: 3 comments
-
|
I am sorry I cut out all sensitive information from the example. So in the stack trace System.DateTime is mentioned. The issue is not with the DateTime cause I had no problems with it in my previous Bulk Insertions which had no Dictionary or Array in my model. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, based on this message: My first suspicion is that there's a mismatch in terms of the ordering of the columns in the table vs the data provided to BulkCopy. So it's expecting a Dictionary but getting a DateTime. Perhaps it would a good idea in the future to be able to simply pass an object to the BulkCopy and have it intelligently match columns to properties, that seems like it would be useful in your case? |
Beta Was this translation helpful? Give feedback.
-
|
Oh, also: you can provide the columns in the order you want when creating the BulkCopy object, like this: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So I can`t understand how to properly bulk insert data which has Dictionary in its model, for example:
It is said in the docs that ClickHouse supports Map and Array. I created the table like this:
I created wrapper around the click house functionlity so I don`t have to copy paste connection string code:
this method comes from the wrapper class:
But when I try to bulk insert:
I get the following exception:
I need this Map in the model, so I don`t have to create extra fields for prices in different currencies like Price_EUR or Price_RUB.
I haven`t found any info on the net and I hope you can tell me how I can do that?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions