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

Function InitDictValues

cpp/src/parquet/test_util.h:190–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188
189template <typename T>
190void InitDictValues(int num_values, int num_dicts, std::vector<T>& values,
191 std::vector<uint8_t>& buffer) {
192 int repeat_factor = num_values / num_dicts;
193 InitValues<T>(num_dicts, values, buffer);
194 // add some repeated values
195 for (int j = 1; j < repeat_factor; ++j) {
196 for (int i = 0; i < num_dicts; ++i) {
197 std::memcpy(&values[num_dicts * j + i], &values[i], sizeof(T));
198 }
199 }
200 // computed only dict_per_page * repeat_factor - 1 values < num_values
201 // compute remaining
202 for (int i = num_dicts * repeat_factor; i < num_values; ++i) {
203 std::memcpy(&values[i], &values[i - num_dicts * repeat_factor], sizeof(T));
204 }
205}
206
207template <>
208inline void InitDictValues<bool>(int num_values, int num_dicts, std::vector<bool>& values,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected