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

Function UnpackValues

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

Source from the content-addressed store, hash-verified

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