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

Method AllocateStringValWithLenCheck

be/src/udf/udf.cc:572–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570}
571
572void StringVal::AllocateStringValWithLenCheck(FunctionContext* ctx, uint64_t str_len,
573 StringVal* res) {
574 if (UNLIKELY(str_len > StringVal::MAX_LENGTH)) {
575 ctx->SetError("String length larger than allowed limit of 1 GB character data.");
576 res->len = 0;
577 res->is_null = true;
578 } else {
579 res->ptr = ctx->impl()->AllocateForResults(str_len);
580 if (UNLIKELY(res->ptr == nullptr && str_len > 0)) {
581#ifndef IMPALA_UDF_SDK_BUILD
582 assert(!ctx->impl()->state()->GetQueryStatus().ok());
583#endif
584 res->len = 0;
585 res->is_null = true;
586 } else {
587 res->len = str_len;
588 }
589 }
590}
591
592void StructVal::ReserveMemory(FunctionContext* ctx) {
593 assert(ctx != nullptr);

Callers

nothing calls this directly

Calls 6

AllocateForResultsMethod · 0.80
implMethod · 0.80
SetErrorMethod · 0.45
okMethod · 0.45
GetQueryStatusMethod · 0.45
stateMethod · 0.45

Tested by

no test coverage detected