MCPcopy Index your code
hub / github.com/uber/aresdb / PostprocessAsHLLData

Method PostprocessAsHLLData

query/aql_postprocessor.go:165–183  ·  view source on GitHub ↗

PostprocessAsHLLData serializes the query result into HLLData format. It will also release the device memory after serialization.

()

Source from the content-addressed store, hash-verified

163// PostprocessAsHLLData serializes the query result into HLLData format. It will also release the device memory after
164// serialization.
165func (qc *AQLQueryContext) PostprocessAsHLLData() ([]byte, error) {
166 oopkContext := qc.OOPK
167 if oopkContext.ResultSize == 0 {
168 return []byte{}, nil
169 }
170
171 dataTypes := make([]memCom.DataType, len(oopkContext.Dimensions))
172 reverseDicts := make(map[int][]string)
173
174 var timeDimensions []int
175 for dimIndex, ast := range oopkContext.Dimensions {
176 dataTypes[dimIndex], reverseDicts[dimIndex] = queryCom.GetDimensionDataType(ast), qc.getEnumReverseDict(dimIndex, ast)
177 if qc.Query.Dimensions[dimIndex].IsTimeDimension() {
178 timeDimensions = append(timeDimensions, dimIndex)
179 }
180 }
181
182 return qc.SerializeHLL(dataTypes, reverseDicts, timeDimensions)
183}
184
185// getEnumReverseDict returns the enum reverse dict of a ast node if it's a VarRef node, otherwise it will return
186// a nil slice.

Callers 1

ProcessQueryMethod · 0.95

Calls 3

getEnumReverseDictMethod · 0.95
SerializeHLLMethod · 0.95
IsTimeDimensionMethod · 0.80

Tested by

no test coverage detected