vahid-sohrabloo/chconn

Looking for a fast way to convert normal array to chconn column

harryhan1989 opened this issue · 2 comments

i'm working on large data calculation for clickhouse.
i found this lib is very cool and fast.
i'm reading large rows columns from clickhouse using chconn, time consuming about 850ms,after calculation, it will write back to clickhouse, but this library only accept column type, so i must loop each go array and assign to new column type, it will take a lot of time(about 450ms),i tried the column type Fill method, but it not working as expect(string,date,float64 to decimal64).is there any fast way to convert normal array to chconn column.
may be 1.18 generic type will solve this problem(actually, i think the convertion is totally unnecessary),look forward to your new generic version coming.
following is my current convert code, i'm using map to store dynamic arrays
image
image

Good point. I'll add it to the new version. something like AppendSlice
Also, AppendP is only for the nullable columns. You can use Append.

@harryhan1989 I released v2. can you test it?