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

Function AlmostAllNullValues

cpp/src/arrow/util/int_util_test.cc:98–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96
97template <typename T>
98std::vector<std::pair<std::vector<T>, std::vector<uint8_t>>> AlmostAllNullValues(
99 int n_values, T null_value, T non_null_value) {
100 std::vector<std::pair<std::vector<T>, std::vector<uint8_t>>> vectors;
101 vectors.reserve(n_values);
102 for (int i = 0; i < n_values; ++i) {
103 std::vector<T> values(n_values, null_value);
104 std::vector<uint8_t> valid_bytes(n_values, 0);
105 values[i] = non_null_value;
106 valid_bytes[i] = 1;
107 vectors.push_back({std::move(values), std::move(valid_bytes)});
108 }
109 return vectors;
110}
111
112template <typename T>
113std::vector<std::vector<T>> AlmostAllZeros(int n_values, T nonzero_value) {

Callers

nothing calls this directly

Calls 2

push_backMethod · 0.80
reserveMethod · 0.45

Tested by

no test coverage detected