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

Function UnpackValues

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

Source from the content-addressed store, hash-verified

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