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

Method Bytes

value.go:131–150  ·  view source on GitHub ↗

Bytes returns v's BSUP representation.

()

Source from the content-addressed store, hash-verified

129
130// Bytes returns v's BSUP representation.
131func (v Value) Bytes() scode.Bytes {
132 if x, ok := v.native(); ok {
133 switch v.Type().ID() {
134 case IDUint8, IDUint16, IDUint32, IDUint64:
135 return EncodeUint(x)
136 case IDInt8, IDInt16, IDInt32, IDInt64, IDDuration, IDTime:
137 return EncodeInt(int64(x))
138 case IDFloat16:
139 return EncodeFloat16(float32(math.Float64frombits(x)))
140 case IDFloat32:
141 return EncodeFloat32(float32(math.Float64frombits(x)))
142 case IDFloat64:
143 return EncodeFloat64(math.Float64frombits(x))
144 case IDBool:
145 return EncodeBool(x != 0)
146 }
147 panic(v.Type())
148 }
149 return v.bytes()
150}
151
152func (v Value) IsContainer() bool {
153 return IsContainerType(v.Type())

Callers 15

EncodeMethod · 0.95
ContainerIterMethod · 0.95
RecordIterMethod · 0.95
IsMissingMethod · 0.95
IsQuietMethod · 0.95
EqualMethod · 0.95
WalkMethod · 0.95
nthMethod · 0.95
AsStringMethod · 0.95
AsTimeMethod · 0.95
underMethod · 0.95
TestMultipleSuperValuesFunction · 0.95

Calls 10

nativeMethod · 0.95
TypeMethod · 0.95
bytesMethod · 0.95
EncodeUintFunction · 0.85
EncodeIntFunction · 0.85
EncodeFloat16Function · 0.85
EncodeFloat32Function · 0.85
EncodeFloat64Function · 0.85
EncodeBoolFunction · 0.85
IDMethod · 0.65

Tested by 9

TestMultipleSuperValuesFunction · 0.76
runOneBoomerangFunction · 0.36
TestValidFunction · 0.36
TestInvalidFunction · 0.36
TestWriteSimpleFunction · 0.36
runCasesHelperFunction · 0.36
roundtripFunction · 0.36
TestCSUPBatchBugFunction · 0.36