MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / transformRecord

Function transformRecord

plugins/destination/duckdb/client/transform.go:10–21  ·  view source on GitHub ↗
(sc *arrow.Schema, rec arrow.RecordBatch)

Source from the content-addressed store, hash-verified

8)
9
10func transformRecord(sc *arrow.Schema, rec arrow.RecordBatch) arrow.RecordBatch {
11 cols := make([]arrow.Array, rec.NumCols())
12 for i := 0; i < int(rec.NumCols()); i++ {
13 col := rec.Column(i)
14 if _, isList := col.DataType().(arrow.ListLikeType); isList && sc.Field(i).Type.ID() == arrow.STRING {
15 cols[i] = transformToStringArray(col)
16 continue
17 }
18 cols[i] = transformArray(col)
19 }
20 return array.NewRecordBatch(sc, cols, rec.NumRows())
21}
22
23func transformArray(arr arrow.Array) arrow.Array {
24 if arrow.TypeEqual(arr.DataType(), transformTypeForWriting(arr.DataType())) {

Callers 1

writeTMPFileFunction · 0.70

Calls 3

transformToStringArrayFunction · 0.85
transformArrayFunction · 0.85
IDMethod · 0.45

Tested by

no test coverage detected