MCPcopy Create free account
hub / github.com/PostHog/duckgres / parseStructType

Function parseStructType

duckdbservice/arrowmap/arrowmap.go:223–239  ·  view source on GitHub ↗

parseStructType parses a DuckDB STRUCT type string into an Arrow StructType.

(dbType string)

Source from the content-addressed store, hash-verified

221
222// parseStructType parses a DuckDB STRUCT type string into an Arrow StructType.
223func parseStructType(dbType string) *arrow.StructType {
224 inner := extractInnerContent(dbType)
225 parts := splitTopLevelCommas(inner)
226 fields := make([]arrow.Field, 0, len(parts))
227 for _, part := range parts {
228 name, typ := parseStructFieldDef(part)
229 if name == "" {
230 continue
231 }
232 fields = append(fields, arrow.Field{
233 Name: name,
234 Type: DuckDBTypeToArrow(typ),
235 Nullable: true,
236 })
237 }
238 return arrow.StructOf(fields...)
239}
240
241// parseMapType parses a DuckDB MAP type string into an Arrow MapType.
242func parseMapType(dbType string) *arrow.MapType {

Callers 1

DuckDBTypeToArrowFunction · 0.85

Calls 4

extractInnerContentFunction · 0.85
splitTopLevelCommasFunction · 0.85
parseStructFieldDefFunction · 0.85
DuckDBTypeToArrowFunction · 0.85

Tested by

no test coverage detected