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

Method InitData

cpp/src/parquet/encoding_test.cc:2399–2415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2397 static constexpr double prefixed_probability = 0.5;
2398
2399 void InitData(int nvalues, int repeats) override {
2400 num_values_ = nvalues * repeats;
2401 input_bytes_.resize(num_values_ * sizeof(c_type));
2402 output_bytes_.resize(num_values_ * sizeof(c_type));
2403 draws_ = reinterpret_cast<c_type*>(input_bytes_.data());
2404 decode_buf_ = reinterpret_cast<c_type*>(output_bytes_.data());
2405 GeneratePrefixedData<c_type>(nvalues, draws_, &data_buffer_, prefixed_probability);
2406
2407 // add some repeated values
2408 for (int j = 1; j < repeats; ++j) {
2409 for (int i = 0; i < nvalues; ++i) {
2410 draws_[nvalues * j + i] = draws_[i];
2411 }
2412 }
2413
2414 TestEncodingBase<Type>::InitUnencodedByteArrayDataBytes();
2415 }
2416
2417 Encoding::type GetEncoding() override { return Encoding::DELTA_BYTE_ARRAY; }
2418

Callers

nothing calls this directly

Calls 2

resizeMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected