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

Method Compare

memstore/common/data_value.go:223–237  ·  view source on GitHub ↗

Compare compares two value wrapper.

(v2 DataValue)

Source from the content-addressed store, hash-verified

221
222// Compare compares two value wrapper.
223func (v1 DataValue) Compare(v2 DataValue) int {
224 if !v1.Valid || !v2.Valid {
225 return CompareBool(v1.Valid, v2.Valid)
226 }
227 if v1.IsBool {
228 return CompareBool(v1.BoolVal, v2.BoolVal)
229 }
230 if v1.CmpFunc != nil {
231 return v1.CmpFunc(v1.OtherVal, v2.OtherVal)
232 }
233 if IsArrayType(v1.DataType) {
234 return CompareArray(v1.DataType, v1.OtherVal, v2.OtherVal)
235 }
236 return 0
237}
238
239// ConvertToHumanReadable convert DataValue to meaningful golang data types
240func (v1 DataValue) ConvertToHumanReadable(dataType DataType) interface{} {

Callers 12

updateAssignmentHashMethod · 0.80
getChangedBaseRowMethod · 0.80
readMethod · 0.80
mergeRecursiveMethod · 0.80
LessMethod · 0.80
SetDataValueMethod · 0.80
EqualsMethod · 0.80
SliceByValueMethod · 0.80
vector_test.goFile · 0.80
lookupSQLExprMethod · 0.80

Calls 3

CompareBoolFunction · 0.85
IsArrayTypeFunction · 0.85
CompareArrayFunction · 0.85

Tested by

no test coverage detected