Commit dd6b275
authored
feat(nested): Simplify constructing nested ClickHouse value (#11205)
Requires cloudquery/plugin-sdk#948
#### Benchmarks
Performed by the following command in `typeconv/ch/values` dir:
```sh
go test \
-test.run=BenchmarkFromArray \
-test.bench=BenchmarkFromArray \
-test.count 10 -test.benchmem -test.benchtime 10000x
```
<details><summary>Before this update</summary>
```
goos: darwin
goarch: arm64
pkg: github.com/cloudquery/cloudquery/plugins/destination/clickhouse/typeconv/ch/values
BenchmarkFromArray-10 10000 465316 ns/op 508005 B/op 7044 allocs/op
BenchmarkFromArray-10 10000 442365 ns/op 508002 B/op 7044 allocs/op
BenchmarkFromArray-10 10000 434197 ns/op 508006 B/op 7044 allocs/op
BenchmarkFromArray-10 10000 430641 ns/op 508006 B/op 7044 allocs/op
BenchmarkFromArray-10 10000 406410 ns/op 507999 B/op 7044 allocs/op
BenchmarkFromArray-10 10000 429302 ns/op 508002 B/op 7044 allocs/op
BenchmarkFromArray-10 10000 399611 ns/op 508005 B/op 7044 allocs/op
BenchmarkFromArray-10 10000 425171 ns/op 508004 B/op 7044 allocs/op
BenchmarkFromArray-10 10000 423713 ns/op 508007 B/op 7044 allocs/op
BenchmarkFromArray-10 10000 413656 ns/op 508006 B/op 7044 allocs/op
PASS
ok github.com/cloudquery/cloudquery/plugins/destination/clickhouse/typeconv/ch/values 108.016s
```
</details>
<details><summary>After this update</summary>
```
goos: darwin
goarch: arm64
pkg: github.com/cloudquery/cloudquery/plugins/destination/clickhouse/typeconv/ch/values
BenchmarkFromArray-10 10000 326041 ns/op 235184 B/op 4512 allocs/op
BenchmarkFromArray-10 10000 310762 ns/op 235187 B/op 4512 allocs/op
BenchmarkFromArray-10 10000 324254 ns/op 235182 B/op 4512 allocs/op
BenchmarkFromArray-10 10000 320649 ns/op 235188 B/op 4512 allocs/op
BenchmarkFromArray-10 10000 326467 ns/op 235183 B/op 4512 allocs/op
BenchmarkFromArray-10 10000 310552 ns/op 235189 B/op 4512 allocs/op
BenchmarkFromArray-10 10000 310553 ns/op 235188 B/op 4512 allocs/op
BenchmarkFromArray-10 10000 313457 ns/op 235187 B/op 4512 allocs/op
BenchmarkFromArray-10 10000 327252 ns/op 235185 B/op 4512 allocs/op
BenchmarkFromArray-10 10000 312083 ns/op 235188 B/op 4512 allocs/op
PASS
ok github.com/cloudquery/cloudquery/plugins/destination/clickhouse/typeconv/ch/values 97.273s
```
</details>1 parent dc00994 commit dd6b275
11 files changed
Lines changed: 84 additions & 51 deletions
File tree
- plugins/destination/clickhouse
- typeconv
- arrow/values
- ch/values
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | | - | |
| 57 | + | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
14 | | - | |
15 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
16 | 22 | | |
17 | 23 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 24 | + | |
22 | 25 | | |
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | | - | |
11 | 9 | | |
12 | 10 | | |
13 | 11 | | |
| |||
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 25 | + | |
32 | 26 | | |
33 | 27 | | |
34 | 28 | | |
| |||
50 | 44 | | |
51 | 45 | | |
52 | 46 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 35 | + | |
41 | 36 | | |
42 | 37 | | |
43 | 38 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 12 | + | |
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
0 commit comments