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

Function MakeCompressibleData

cpp/src/arrow/util/compression_test.cc:47–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47std::vector<uint8_t> MakeCompressibleData(int data_size) {
48 std::string base_data =
49 "Apache Arrow is a cross-language development platform for in-memory data";
50 int nrepeats = static_cast<int>(1 + data_size / base_data.size());
51
52 std::vector<uint8_t> data(base_data.size() * nrepeats);
53 for (int i = 0; i < nrepeats; ++i) {
54 std::memcpy(data.data() + i * base_data.size(), base_data.data(), base_data.size());
55 }
56 data.resize(data_size);
57 return data;
58}
59
60// Check roundtrip of one-shot compression and decompression functions.
61void CheckCodecRoundtrip(std::unique_ptr<Codec>& c1, std::unique_ptr<Codec>& c2,

Callers 1

TEST_PFunction · 0.70

Calls 3

resizeMethod · 0.80
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected