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

Function SampleInt96

cpp/src/parquet/arrow/generate_encoding_fuzz_corpus.cc:138–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136using Int96Vector = std::vector<Int96>;
137
138Result<std::vector<Int96Vector>> SampleInt96() {
139 auto rag = random::RandomArrayGenerator(/*seed=*/42);
140 std::vector<Int96Vector> all_data;
141
142 for (const auto size : {50, 5000}) {
143 // The max value is chosen so that the nanoseconds component remains
144 // smaller than kNanosecondsPerDay.
145 auto ints = rag.Int32(size * 3, /*min=*/0, /*max=*/20000);
146 const Int96* int96_data = reinterpret_cast<const Int96*>(
147 checked_cast<const Int32Array&>(*ints).raw_values());
148 all_data.push_back(Int96Vector(int96_data, int96_data + size));
149 }
150 return all_data;
151}
152
153Status DoMain(const std::string& out_dir) {
154 ARROW_ASSIGN_OR_RAISE(auto dir_fn, internal::PlatformFilename::FromString(out_dir));

Callers

nothing calls this directly

Calls 3

Int32Method · 0.80
push_backMethod · 0.80
raw_valuesMethod · 0.45

Tested by

no test coverage detected