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

Method PhysicalToLogical

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

Source from the content-addressed store, hash-verified

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

Callers 2

SortInternalMethod · 0.80
SortInternalMethod · 0.80

Calls 4

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

Tested by

no test coverage detected