MCPcopy Create free account
hub / github.com/apache/arrow / PhysicalToLogical

Method PhysicalToLogical

cpp/src/arrow/compute/kernels/chunked_internal.cc:97–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97Status ChunkedIndexMapper::PhysicalToLogical() {
98 std::vector<int64_t> chunk_offsets(chunk_lengths_.size());
99 {
100 int64_t offset = 0;
101 for (int64_t i = 0; i < static_cast<int64_t>(chunk_lengths_.size()); ++i) {
102 chunk_offsets[i] = offset;
103 offset += chunk_lengths_[i];
104 }
105 }
106
107 const int64_t num_indices = static_cast<int64_t>(indices_.size());
108 CompressedChunkLocation* physical_begin =
109 reinterpret_cast<CompressedChunkLocation*>(indices_.data());
110 for (int64_t i = 0; i < num_indices; ++i) {
111 const auto loc = physical_begin[i];
112 DCHECK_LT(loc.chunk_index(), chunk_offsets.size());
113 DCHECK_LT(loc.index_in_chunk(),
114 static_cast<uint64_t>(chunk_lengths_[loc.chunk_index()]));
115 indices_[i] =
116 chunk_offsets[loc.chunk_index()] + static_cast<int64_t>(loc.index_in_chunk());
117 }
118
119 return Status::OK();
120}
121
122} // namespace arrow::compute::internal

Callers 2

SortInternalMethod · 0.80
SortInternalMethod · 0.80

Calls 5

chunk_indexMethod · 0.80
index_in_chunkMethod · 0.80
OKFunction · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected