Skip to content

Commit eb90aa2

Browse files
authored
fix(deps): Update module github.com/marcboeker/go-duckdb to v1.8.5 (#20504)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/marcboeker/go-duckdb](https://redirect.github.com/marcboeker/go-duckdb) | require | minor | `v1.7.0` -> `v1.8.5` | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>marcboeker/go-duckdb (github.com/marcboeker/go-duckdb)</summary> ### [`v1.8.5`](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.8.4...v1.8.5) [Compare Source](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.8.4...v1.8.5) ### [`v1.8.4`](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.8.3...v1.8.4) [Compare Source](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.8.3...v1.8.4) ### [`v1.8.3`](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.8.2...v1.8.3) [Compare Source](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.8.2...v1.8.3) ### [`v1.8.2`](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.8.1...v1.8.2) [Compare Source](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.8.1...v1.8.2) ### [`v1.8.1`](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.8.0...v1.8.1) [Compare Source](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.8.0...v1.8.1) ### [`v1.8.0`](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.7.1...v1.8.0) [Compare Source](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.7.1...v1.8.0) ### [`v1.7.1`](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.7.0...v1.7.1) [Compare Source](https://redirect.github.com/marcboeker/go-duckdb/compare/v1.7.0...v1.7.1) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://redirect.github.com/renovatebot/renovate).
1 parent bd2367f commit eb90aa2

File tree

3 files changed

+46
-34
lines changed

3 files changed

+46
-34
lines changed

plugins/destination/duckdb/client/read.go

Lines changed: 40 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func reverseTransformArray(dt arrow.DataType, arr arrow.Array) arrow.Array {
102102
switch dt := dt.(type) {
103103
case *types.UUIDType:
104104
return array.NewExtensionArrayWithStorage(dt, arr.(*array.FixedSizeBinary))
105-
case *types.InetType, *types.MACType, *types.JSONType:
105+
case *types.InetType, *types.MACType:
106106
return reverseTransformFromString(dt, arr.(*array.String))
107107
case *arrow.Uint16Type:
108108
return reverseTransformUint16(arr.(*array.Uint32))
@@ -117,7 +117,7 @@ func reverseTransformArray(dt arrow.DataType, arr arrow.Array) arrow.Array {
117117
// We save date types as Timestamp
118118
return reverseTransformDate64(arr.(*array.Timestamp))
119119
case *arrow.StructType:
120-
if sarr, ok := arr.(*array.String); ok {
120+
if sarr, ok := arr.(*array.Binary); ok {
121121
return reverseTransformStruct(dt, sarr)
122122
}
123123

@@ -138,7 +138,7 @@ func reverseTransformArray(dt arrow.DataType, arr arrow.Array) arrow.Array {
138138
))
139139
case arrow.ListLikeType: // also handles maps
140140
if mapdt, ok := dt.(*arrow.MapType); ok {
141-
if sarr, ok := arr.(*array.String); ok {
141+
if sarr, ok := arr.(*array.Binary); ok {
142142
return reverseTransformMap(mapdt, sarr)
143143
}
144144
}
@@ -151,9 +151,39 @@ func reverseTransformArray(dt arrow.DataType, arr arrow.Array) arrow.Array {
151151
// we use data offset for list like as the `ListValues` can be a larger array (happens when slicing)
152152
arr.Data().Offset(),
153153
))
154-
155-
case *arrow.BinaryType, *arrow.LargeBinaryType:
156-
return reverseTransformFromBinary(dt, arr.(*array.Binary))
154+
case *types.JSONType:
155+
jsonArray := arr.(*array.Binary)
156+
jsonBuilder := types.NewJSONBuilder(memory.DefaultAllocator)
157+
for i := 0; i < jsonArray.Len(); i++ {
158+
if arr.IsNull(i) {
159+
jsonBuilder.AppendNull()
160+
} else {
161+
jsonBuilder.AppendBytes(jsonArray.Value(i))
162+
}
163+
}
164+
return jsonBuilder.NewJSONArray()
165+
case *arrow.BinaryType:
166+
binaryArray := arr.(*array.Binary)
167+
binaryBuilder := array.NewBinaryBuilder(memory.DefaultAllocator, dt)
168+
for i := 0; i < binaryArray.Len(); i++ {
169+
if binaryArray.IsNull(i) {
170+
binaryBuilder.AppendNull()
171+
} else {
172+
binaryBuilder.Append(binaryArray.Value(i))
173+
}
174+
}
175+
return binaryBuilder.NewLargeBinaryArray()
176+
case *arrow.LargeBinaryType:
177+
largeBinaryArray := arr.(*array.Binary)
178+
largeBinaryBuilder := array.NewBinaryBuilder(memory.DefaultAllocator, dt)
179+
for i := 0; i < largeBinaryArray.Len(); i++ {
180+
if largeBinaryArray.IsNull(i) {
181+
largeBinaryBuilder.AppendNull()
182+
} else {
183+
largeBinaryBuilder.Append(largeBinaryArray.Value(i))
184+
}
185+
}
186+
return largeBinaryBuilder.NewLargeBinaryArray()
157187
default:
158188
return reverseTransformFromString(dt, arr.(*array.String))
159189
}
@@ -174,45 +204,30 @@ func reverseTransformFromString(dt arrow.DataType, arr *array.String) arrow.Arra
174204
return builder.NewArray()
175205
}
176206

177-
func reverseTransformFromBinary(dt arrow.DataType, arr array.BinaryLike) arrow.Array {
178-
builder := array.NewBuilder(memory.DefaultAllocator, dt)
179-
for i := 0; i < arr.Len(); i++ {
180-
if arr.IsNull(i) {
181-
builder.AppendNull()
182-
continue
183-
}
184-
if err := builder.AppendValueFromString(arr.ValueStr(i)); err != nil {
185-
panic(fmt.Errorf("failed to append from value %q: %w", arr.ValueStr(i), err))
186-
}
187-
}
188-
189-
return builder.NewArray()
190-
}
191-
192-
func reverseTransformStruct(dt *arrow.StructType, arr *array.String) arrow.Array {
207+
func reverseTransformStruct(dt *arrow.StructType, arr *array.Binary) arrow.Array {
193208
bldr := array.NewStructBuilder(memory.DefaultAllocator, dt)
194209
defer bldr.Release()
195210
for i := 0; i < arr.Len(); i++ {
196211
if arr.IsNull(i) {
197212
bldr.AppendNull()
198213
continue
199214
}
200-
if err := bldr.AppendValueFromString(arr.Value(i)); err != nil {
215+
if err := bldr.AppendValueFromString(arr.ValueString(i)); err != nil {
201216
panic(err)
202217
}
203218
}
204219
return bldr.NewStructArray()
205220
}
206221

207-
func reverseTransformMap(dt *arrow.MapType, arr *array.String) arrow.Array {
222+
func reverseTransformMap(dt *arrow.MapType, arr *array.Binary) arrow.Array {
208223
bldr := array.NewMapBuilder(memory.DefaultAllocator, dt.KeyType(), dt.ItemType(), dt.KeysSorted)
209224
defer bldr.Release()
210225
for i := 0; i < arr.Len(); i++ {
211226
if arr.IsNull(i) {
212227
bldr.AppendNull()
213228
continue
214229
}
215-
if err := bldr.AppendValueFromString(arr.Value(i)); err != nil {
230+
if err := bldr.AppendValueFromString(arr.ValueString(i)); err != nil {
216231
panic(err)
217232
}
218233
}

plugins/destination/duckdb/go.mod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ require (
88
github.com/cloudquery/codegen v0.3.25
99
github.com/cloudquery/plugin-sdk/v4 v4.77.0
1010
github.com/google/uuid v1.6.0
11-
github.com/marcboeker/go-duckdb v1.7.0
11+
github.com/marcboeker/go-duckdb v1.8.5
1212
github.com/rs/zerolog v1.33.0
1313
)
1414

1515
require (
1616
github.com/adrg/xdg v0.5.3 // indirect
1717
github.com/andybalholm/brotli v1.1.1 // indirect
1818
github.com/apache/arrow/go/v13 v13.0.0-20230731205701-112f94971882 // indirect
19-
github.com/apache/arrow/go/v14 v14.0.2 // indirect
2019
github.com/apache/thrift v0.21.0 // indirect
2120
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
2221
github.com/aws/aws-sdk-go-v2 v1.36.3 // indirect
@@ -43,6 +42,7 @@ require (
4342
github.com/ghodss/yaml v1.0.0 // indirect
4443
github.com/go-logr/logr v1.4.2 // indirect
4544
github.com/go-logr/stdr v1.2.2 // indirect
45+
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
4646
github.com/goccy/go-json v0.10.5 // indirect
4747
github.com/golang/snappy v0.0.4 // indirect
4848
github.com/google/flatbuffers v25.2.10+incompatible // indirect
@@ -60,7 +60,6 @@ require (
6060
github.com/mattn/go-isatty v0.0.20 // indirect
6161
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect
6262
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect
63-
github.com/mitchellh/mapstructure v1.5.0 // indirect
6463
github.com/oapi-codegen/runtime v1.1.1 // indirect
6564
github.com/pierrec/lz4/v4 v4.1.22 // indirect
6665
github.com/pmezard/go-difflib v1.0.0 // indirect

plugins/destination/duckdb/go.sum

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ github.com/apache/arrow-go/v18 v18.2.0 h1:QhWqpgZMKfWOniGPhbUxrHohWnooGURqL2R2Gg
77
github.com/apache/arrow-go/v18 v18.2.0/go.mod h1:Ic/01WSwGJWRrdAZcxjBZ5hbApNJ28K96jGYaxzzGUc=
88
github.com/apache/arrow/go/v13 v13.0.0-20230731205701-112f94971882 h1:mFDZW1FQk9yndPvxScp7RpcOpdSHaqcgBWO7sDlx4S8=
99
github.com/apache/arrow/go/v13 v13.0.0-20230731205701-112f94971882/go.mod h1:W69eByFNO0ZR30q1/7Sr9d83zcVZmF2MiP3fFYAWJOc=
10-
github.com/apache/arrow/go/v14 v14.0.2 h1:N8OkaJEOfI3mEZt07BIkvo4sC6XDbL+48MBPWO5IONw=
11-
github.com/apache/arrow/go/v14 v14.0.2/go.mod h1:u3fgh3EdgN/YQ8cVQRguVW3R+seMybFg8QBQ5LU+eBY=
1210
github.com/apache/thrift v0.21.0 h1:tdPmh/ptjE1IJnhbhrcl2++TauVjy242rkV/UzJChnE=
1311
github.com/apache/thrift v0.21.0/go.mod h1:W1H8aR/QRtYNvrPeFXBtobyRkd0/YVhTc6i07XIAgDw=
1412
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
@@ -80,6 +78,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
8078
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
8179
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
8280
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
81+
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
82+
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
8383
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
8484
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
8585
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
@@ -121,8 +121,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
121121
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
122122
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
123123
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
124-
github.com/marcboeker/go-duckdb v1.7.0 h1:c9DrS13ta+gqVgg9DiEW8I+PZBE85nBMLL/YMooYoUY=
125-
github.com/marcboeker/go-duckdb v1.7.0/go.mod h1:WtWeqqhZoTke/Nbd7V9lnBx7I2/A/q0SAq/urGzPCMs=
124+
github.com/marcboeker/go-duckdb v1.8.5 h1:tkYp+TANippy0DaIOP5OEfBEwbUINqiFqgwMQ44jME0=
125+
github.com/marcboeker/go-duckdb v1.8.5/go.mod h1:6mK7+WQE4P4u5AFLvVBmhFxY5fvhymFptghgJX6B+/8=
126126
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
127127
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
128128
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
@@ -133,8 +133,6 @@ github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 h1:AMFGa4R4MiIpsp
133133
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY=
134134
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8DFdX7uMikMLXX4oubIzJF4kv/wI=
135135
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
136-
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
137-
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
138136
github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro=
139137
github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg=
140138
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=

0 commit comments

Comments
 (0)