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

Function columnGoType

plugins/destination/mssql/queries/types.go:111–144  ·  view source on GitHub ↗

columnGoType has to be in sync with SQLType

(dataType arrow.DataType)

Source from the content-addressed store, hash-verified

109
110// columnGoType has to be in sync with SQLType
111func columnGoType(dataType arrow.DataType) reflect.Type {
112 switch dataType.(type) {
113 case *arrow.BooleanType:
114 return reflect.TypeOf(true)
115
116 case *arrow.Uint8Type:
117 return reflect.TypeOf(uint8(0))
118 case *arrow.Int8Type, *arrow.Int16Type: // no special int8 type, upscale
119 return reflect.TypeOf(int16(0))
120 case *arrow.Uint16Type, *arrow.Int32Type: // no special uint16 type, upscale
121 return reflect.TypeOf(int32(0))
122 case *arrow.Uint32Type, *arrow.Int64Type: // no special uint32 type, upscale
123 return reflect.TypeOf(int64(0))
124 case *arrow.Uint64Type: // we store this as int64, although it may produce overflow and negative numbers
125 return reflect.TypeOf(int64(0))
126
127 case *arrow.Float32Type:
128 return reflect.TypeOf(float32(0))
129 case *arrow.Float64Type:
130 return reflect.TypeOf(float64(0))
131
132 case *arrow.LargeStringType, *arrow.StringType, *types.InetType, *types.MACType:
133 return reflect.TypeOf("")
134
135 case arrow.BinaryDataType, *arrow.FixedSizeBinaryType, *types.UUIDType:
136 return reflect.TypeOf([]byte{})
137
138 case *arrow.TimestampType:
139 return reflect.TypeOf(time.Time{})
140
141 default:
142 return reflect.TypeOf("")
143 }
144}

Callers 1

tableTransformerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected