MCPcopy Create free account
hub / github.com/apache/impala / MinSerialize

Function MinSerialize

be/src/udf/uda-test.cc:117–127  ·  view source on GitHub ↗

Serialize the state into the min string

Source from the content-addressed store, hash-verified

115
116// Serialize the state into the min string
117BufferVal MinSerialize(FunctionContext* context, const BufferVal& intermediate) {
118 MinState* state = reinterpret_cast<MinState*>(intermediate);
119 if (state->value == NULL) return intermediate;
120 // Hack to persist the intermediate state's value without leaking.
121 // TODO: revisit BufferVal and design a better way to do this
122 StringVal copy_buffer(context, state->len);
123 memcpy(copy_buffer.ptr, state->value, state->len);
124 context->Free(state->value);
125 state->value = copy_buffer.ptr;
126 return intermediate;
127}
128
129// Merge is the same as Update since the serialized format is the raw input format
130void MinMerge(FunctionContext* context, const BufferVal& src, BufferVal* dst) {

Callers

nothing calls this directly

Calls 1

FreeMethod · 0.45

Tested by

no test coverage detected