| 570 | } |
| 571 | |
| 572 | void 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 | |
| 592 | void StructVal::ReserveMemory(FunctionContext* ctx) { |
| 593 | assert(ctx != nullptr); |
nothing calls this directly
no test coverage detected