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

Method CopyBoundaryField

be/src/exec/text/hdfs-text-scanner.cc:790–805  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788}
789
790Status 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
807void HdfsTextScanner::WritePartialTuple(FieldLocation* fields, int num_fields) {
808 for (int i = 0; i < num_fields; ++i) {

Callers

nothing calls this directly

Calls 7

SubstituteFunction · 0.85
OKFunction · 0.85
TryAllocateUnalignedMethod · 0.80
lenMethod · 0.45
MemLimitExceededMethod · 0.45
mem_trackerMethod · 0.45
bufferMethod · 0.45

Tested by

no test coverage detected