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

Method CastToStringVal

be/src/exprs/cast-functions-ir.cc:364–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362CAST_FLOAT_TO_STRING(DoubleVal, DoubleToBuffer, kDoubleToBufferSize);
363
364StringVal CastFunctions::CastToStringVal(FunctionContext* ctx, const TimestampVal& val) {
365 DCHECK(ctx != nullptr);
366 if (val.is_null) return StringVal::null();
367 TimestampValue tv = TimestampValue::FromTimestampVal(val);
368 const DateTimeFormatContext* format_ctx =
369 reinterpret_cast<const DateTimeFormatContext*>(
370 ctx->GetFunctionState(FunctionContext::FRAGMENT_LOCAL));
371 StringVal sv =
372 (format_ctx == nullptr) ? tv.ToStringVal(ctx) : tv.ToStringVal(ctx, *format_ctx);
373 AnyValUtil::TruncateIfNecessary(ctx->GetReturnType(), &sv);
374 return sv;
375}
376
377StringVal CastFunctions::CastToStringVal(FunctionContext* ctx, const DateVal& val) {
378 DCHECK(ctx != nullptr);

Callers

nothing calls this directly

Calls 7

FromStringFunction · 0.85
GetFunctionStateMethod · 0.80
ToStringValMethod · 0.45
IsValidMethod · 0.45
ToStringMethod · 0.45
FormatMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected