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

Function arrowToDuckDB

plugins/destination/duckdb/client/types.go:44–85  ·  view source on GitHub ↗
(dt arrow.DataType)

Source from the content-addressed store, hash-verified

42}
43
44func arrowToDuckDB(dt arrow.DataType) string {
45 switch dt := dt.(type) {
46 case *arrow.StructType, *arrow.MapType:
47 return "json"
48 case arrow.ListLikeType:
49 return arrowToDuckDB(dt.Elem()) + "[]"
50 case *arrow.BooleanType:
51 return "boolean"
52 case *arrow.Int8Type:
53 return "tinyint"
54 case *arrow.Int16Type:
55 return "smallint"
56 case *arrow.Int32Type:
57 return "integer"
58 case *arrow.Int64Type:
59 return "bigint"
60 case *arrow.Uint8Type:
61 return "uinteger"
62 case *arrow.Uint16Type:
63 return "uinteger"
64 case *arrow.Uint32Type:
65 return "uinteger"
66 case *arrow.Uint64Type:
67 return "ubigint"
68 case *arrow.Float32Type:
69 return "float"
70 case *arrow.Float64Type:
71 return "double"
72 case *arrow.BinaryType:
73 return "blob"
74 case *arrow.LargeBinaryType:
75 return "blob"
76 case *types.UUIDType:
77 return "uuid"
78 case *types.JSONType:
79 return "json"
80 case *arrow.Date32Type, *arrow.Date64Type, *arrow.TimestampType:
81 return "timestamp"
82 default:
83 return "varchar"
84 }
85}
86
87func duckDBToArrow(t string) arrow.DataType {
88 switch {

Callers 5

transformTypeForWritingFunction · 0.85
transformArrayFunction · 0.85
normalizeColumnsMethod · 0.85
autoMigrateTableMethod · 0.85
duckDBTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected