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

Function SpacedCompress

cpp/src/arrow/util/spaced_internal.h:37–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35/// \return The size of spaced buffer.
36template <typename T>
37inline int SpacedCompress(const T* src, int num_values, const uint8_t* valid_bits,
38 int64_t valid_bits_offset, T* output) {
39 int num_valid_values = 0;
40
41 arrow::internal::SetBitRunReader reader(valid_bits, valid_bits_offset, num_values);
42 while (true) {
43 const auto run = reader.NextRun();
44 if (run.length == 0) {
45 break;
46 }
47 std::memcpy(output + num_valid_values, src + run.position, run.length * sizeof(T));
48 num_valid_values += static_cast<int32_t>(run.length);
49 }
50
51 return num_valid_values;
52}
53
54/// \brief Relocate values according to a validity bitmap, to the right
55///

Callers

nothing calls this directly

Calls 1

NextRunMethod · 0.45

Tested by

no test coverage detected