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

Function parseMapType

duckdbservice/arrowmap/arrowmap.go:242–251  ·  view source on GitHub ↗

parseMapType parses a DuckDB MAP type string into an Arrow MapType.

(dbType string)

Source from the content-addressed store, hash-verified

240
241// parseMapType parses a DuckDB MAP type string into an Arrow MapType.
242func parseMapType(dbType string) *arrow.MapType {
243 inner := extractInnerContent(dbType)
244 parts := splitTopLevelCommas(inner)
245 if len(parts) != 2 {
246 return arrow.MapOf(arrow.BinaryTypes.String, arrow.BinaryTypes.String)
247 }
248 keyType := DuckDBTypeToArrow(parts[0])
249 valueType := DuckDBTypeToArrow(parts[1])
250 return arrow.MapOf(keyType, valueType)
251}
252
253// parseDecimalParams extracts precision and scale from a type name like "DECIMAL(18,2)".
254func parseDecimalParams(typeName string) (precision, scale int) {

Callers 1

DuckDBTypeToArrowFunction · 0.85

Calls 3

extractInnerContentFunction · 0.85
splitTopLevelCommasFunction · 0.85
DuckDBTypeToArrowFunction · 0.85

Tested by

no test coverage detected