| 788 | } |
| 789 | |
| 790 | Status HdfsTextScanner::CopyBoundaryField(FieldLocation* data, MemPool* pool) { |
| 791 | bool needs_escape = data->len < 0; |
| 792 | int copy_len = needs_escape ? -data->len : data->len; |
| 793 | int64_t total_len = copy_len + boundary_column_.len(); |
| 794 | char* str_data = reinterpret_cast<char*>(pool->TryAllocateUnaligned(total_len)); |
| 795 | if (UNLIKELY(str_data == nullptr)) { |
| 796 | string details = Substitute("HdfsTextScanner::CopyBoundaryField() failed to allocate " |
| 797 | "$0 bytes.", total_len); |
| 798 | return pool->mem_tracker()->MemLimitExceeded(state_, details, total_len); |
| 799 | } |
| 800 | memcpy(str_data, boundary_column_.buffer(), boundary_column_.len()); |
| 801 | memcpy(str_data + boundary_column_.len(), data->start, copy_len); |
| 802 | data->start = str_data; |
| 803 | data->len = needs_escape ? -total_len : total_len; |
| 804 | return Status::OK(); |
| 805 | } |
| 806 | |
| 807 | void HdfsTextScanner::WritePartialTuple(FieldLocation* fields, int num_fields) { |
| 808 | for (int i = 0; i < num_fields; ++i) { |
nothing calls this directly
no test coverage detected