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

Method DsKllStringify

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

Source from the content-addressed store, hash-verified

335}
336
337StringVal DataSketchesFunctions::DsKllStringify( FunctionContext* ctx,
338 const StringVal& serialized_sketch) {
339 if (serialized_sketch.is_null || serialized_sketch.len == 0) return StringVal::null();
340 try {
341 auto sketch = datasketches::kll_sketch<float>::deserialize(serialized_sketch.ptr,
342 serialized_sketch.len);
343 string str = sketch.to_string(false, false);
344 StringVal dst(ctx, str.size());
345 memcpy(dst.ptr, str.c_str(), str.size());
346 return dst;
347 } catch (const std::exception& e) {
348 LogSketchDeserializationError(ctx, e);
349 return StringVal::null();
350 }
351}
352
353}

Callers

nothing calls this directly

Calls 4

deserializeFunction · 0.85
to_stringMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected