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

Function formatWithDataValue

query/common/dimval.go:104–118  ·  view source on GitHub ↗

formatWithDataValue formats value with given type

(valuePtr unsafe.Pointer, dataType memCom.DataType)

Source from the content-addressed store, hash-verified

102
103// formatWithDataValue formats value with given type
104func formatWithDataValue(valuePtr unsafe.Pointer, dataType memCom.DataType) *string {
105 formatted := memCom.DataValue{
106 Valid: true,
107 DataType: dataType,
108 OtherVal: valuePtr,
109 }.ConvertToHumanReadable(dataType)
110 if formatted == nil {
111 return nil
112 }
113 if result, ok := formatted.(string); !ok {
114 return nil
115 } else {
116 return &result
117 }
118}
119
120// GetDimensionStartOffsets calculates the value and null starting position for given dimension inside dimension vector
121// dimIndex is the ordered index of given dimension inside the dimension vector

Callers 1

ReadDimensionFunction · 0.85

Calls 1

Tested by

no test coverage detected