MCPcopy Create free account
hub / github.com/brimdata/super / newVector

Method newVector

runtime/vcache/primitive.go:110–136  ·  view source on GitHub ↗
(loader *loader)

Source from the content-addressed store, hash-verified

108}
109
110func (p *primitive) newVector(loader *loader) vector.Any {
111 switch typ := p.meta.Typ.(type) {
112 case *super.TypeOfUint8, *super.TypeOfUint16, *super.TypeOfUint32, *super.TypeOfUint64:
113 return vector.NewUint(typ, p.load(loader).([]uint64))
114 case *super.TypeOfInt8, *super.TypeOfInt16, *super.TypeOfInt32, *super.TypeOfInt64, *super.TypeOfDuration, *super.TypeOfTime:
115 return vector.NewInt(typ, p.load(loader).([]int64))
116 case *super.TypeOfFloat16, *super.TypeOfFloat32, *super.TypeOfFloat64:
117 return vector.NewFloat(typ, p.load(loader).([]float64))
118 case *super.TypeOfBool:
119 return vector.NewBool(p.load(loader).(bitvec.Bits))
120 case *super.TypeOfBytes:
121 return vector.NewBytes(p.load(loader).(vector.BytesTable))
122 case *super.TypeOfString:
123 return vector.NewString(p.load(loader).(vector.BytesTable))
124 case *super.TypeOfIP:
125 return vector.NewIP(p.load(loader).([]netip.Addr))
126 case *super.TypeOfNet:
127 return vector.NewNet(p.load(loader).([]netip.Prefix))
128 case *super.TypeOfType:
129 return vector.NewTypeValue(p.load(loader).(vector.BytesTable))
130 case *super.TypeEnum:
131 return vector.NewEnum(typ, p.load(loader).([]uint64))
132 case *super.TypeOfNull:
133 return vector.NewNull(p.length())
134 }
135 panic(fmt.Errorf("internal error: vcache.loadPrimitive got unknown type %#v", p.meta.Typ))
136}

Callers 1

projectMethod · 0.95

Calls 13

loadMethod · 0.95
lengthMethod · 0.95
NewUintFunction · 0.92
NewIntFunction · 0.92
NewFloatFunction · 0.92
NewBoolFunction · 0.92
NewBytesFunction · 0.92
NewStringFunction · 0.92
NewIPFunction · 0.92
NewNetFunction · 0.92
NewTypeValueFunction · 0.92
NewEnumFunction · 0.92

Tested by

no test coverage detected