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

Function UnpackValues

cpp/src/arrow/util/bpacking_test.cc:67–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65/// Convenience wrapper to unpack into a vector
66template <typename Int>
67std::vector<Int> UnpackValues(const uint8_t* packed, const UnpackOptions& opts,
68 UnpackFunc<Int> unpack) {
69 if constexpr (std::is_same_v<Int, bool>) {
70 // Using dynamic array to avoid std::vector<bool>
71 auto buffer = std::make_unique<Int[]>(opts.batch_size);
72 unpack(packed, buffer.get(), opts);
73 return std::vector<Int>(buffer.get(), buffer.get() + opts.batch_size);
74 } else {
75 std::vector<Int> out(opts.batch_size);
76 unpack(packed, out.data(), opts);
77 return out;
78 }
79}
80
81/// Use BitWriter to pack values into a vector.
82template <typename Int>

Callers 4

TestUnpackZerosMethod · 0.85
TestUnpackOnesMethod · 0.85
TestUnpackAlternatingMethod · 0.85

Calls 3

unpackFunction · 0.70
getMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected