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

Function FindPhysicalRange

cpp/src/arrow/util/ree_util.h:93–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91/// \return a pair of physical offset and physical length
92template <typename RunEndCType>
93std::pair<int64_t, int64_t> FindPhysicalRange(const RunEndCType* run_ends,
94 int64_t run_ends_size, int64_t length,
95 int64_t offset) {
96 const int64_t physical_offset =
97 FindPhysicalIndex<RunEndCType>(run_ends, run_ends_size, 0, offset);
98 // The physical length is calculated by finding the offset of the last element
99 // and adding 1 to it, so first we ensure there is at least one element.
100 if (length == 0) {
101 return {physical_offset, 0};
102 }
103 const int64_t physical_index_of_last = FindPhysicalIndex<RunEndCType>(
104 run_ends + physical_offset, run_ends_size - physical_offset, length - 1, offset);
105
106 assert(physical_index_of_last < run_ends_size - physical_offset);
107 return {physical_offset, physical_index_of_last + 1};
108}
109
110/// \brief Uses binary-search to calculate the number of physical values (and
111/// run-ends) necessary to represent the logical range of values from

Callers 4

VisitMethod · 0.70
TEST_PFunction · 0.50
DetectNullGeometryFunction · 0.50

Calls

no outgoing calls

Tested by 1

TEST_PFunction · 0.40