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

Method Resize

be/src/udf/udf.cc:550–570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

548}
549
550bool StringVal::Resize(FunctionContext* ctx, int new_len) noexcept {
551 if (new_len <= len) {
552 len = new_len;
553 return true;
554 }
555
556 if (UNLIKELY(new_len > StringVal::MAX_LENGTH)) {
557 ctx->SetError("String length larger than allowed limit of 1 GB character data.");
558 len = 0;
559 is_null = true;
560 return false;
561 }
562 auto* new_ptr = ctx->impl()->AllocateForResults(new_len);
563 if (new_ptr != nullptr) {
564 memcpy(new_ptr, ptr, len);
565 ptr = new_ptr;
566 len = new_len;
567 return true;
568 }
569 return false;
570}
571
572void StringVal::AllocateStringValWithLenCheck(FunctionContext* ctx, uint64_t str_len,
573 StringVal* res) {

Callers 3

Utf8CaseConversionFunction · 0.45
ReplaceMethod · 0.45
ToStringValMethod · 0.45

Calls 3

AllocateForResultsMethod · 0.80
implMethod · 0.80
SetErrorMethod · 0.45

Tested by

no test coverage detected