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

Method DsCpcStringify

be/src/exprs/datasketches-functions-ir.cc:131–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131StringVal DataSketchesFunctions::DsCpcStringify(
132 FunctionContext* ctx, const StringVal& serialized_sketch) {
133 if (serialized_sketch.is_null || serialized_sketch.len == 0) return StringVal::null();
134 try {
135 auto sketch = datasketches::cpc_sketch::deserialize(serialized_sketch.ptr,
136 serialized_sketch.len);
137 string str = sketch.to_string();
138 StringVal dst(ctx, str.size());
139 memcpy(dst.ptr, str.c_str(), str.size());
140 return dst;
141 } catch (const std::exception& e) {
142 LogSketchDeserializationError(ctx, e);
143 return StringVal::null();
144 }
145}
146
147StringVal DataSketchesFunctions::DsCpcUnionF(FunctionContext* ctx,
148 const StringVal& first_serialized_sketch, const StringVal& second_serialized_sketch) {

Callers

nothing calls this directly

Calls 4

deserializeFunction · 0.85
to_stringMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected