MCPcopy
hub / github.com/uber/aresdb / GetDataValue

Method GetDataValue

memstore/vector_party.go:172–193  ·  view source on GitHub ↗

GetDataValue returns the DataValue for the specified index. It first check validity of the value, then it check whether it's a boolean column to decide whether to load bool value or other value type. Index bound is not checked!

(offset int)

Source from the content-addressed store, hash-verified

170// boolean column to decide whether to load bool value or other value
171// type. Index bound is not checked!
172func (vp *cVectorParty) GetDataValue(offset int) common.DataValue {
173 if vp.columnMode == common.AllValuesDefault {
174 return vp.defaultValue
175 }
176
177 val := common.DataValue{
178 Valid: vp.GetValidity(offset),
179 DataType: vp.dataType,
180 }
181 if !val.Valid {
182 return val
183 }
184
185 if vp.values.DataType == common.Bool {
186 val.IsBool = true
187 val.BoolVal = vp.values.GetBool(offset)
188 return val
189 }
190 val.OtherVal = vp.values.GetValue(offset)
191 val.CmpFunc = vp.values.CmpFunc
192 return val
193}
194
195// GetDataValueByRow implements GetDataValueByRow in cVectorParty
196func (vp *cVectorParty) GetDataValueByRow(row int) common.DataValue {

Callers 5

GetDataValueByRowMethod · 0.95
SetDataValueMethod · 0.95
EqualsMethod · 0.95
SliceMethod · 0.95
DumpMethod · 0.95

Calls 3

GetValidityMethod · 0.95
GetValueMethod · 0.65
GetBoolMethod · 0.45

Tested by

no test coverage detected