MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / getDistribution

Function getDistribution

src/QueryPipeline/narrowPipe.cpp:16–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14{
15 using Distribution = VectorWithMemoryTracking<size_t>;
16 Distribution getDistribution(size_t from, size_t to)
17 {
18 Distribution distribution(from);
19
20 for (size_t i = 0; i < from; ++i)
21 distribution[i] = i % to;
22
23 std::shuffle(distribution.begin(), distribution.end(), thread_local_rng);
24 return distribution;
25 }
26}
27
28void narrowPipe(Pipe & pipe, size_t width)

Callers 1

narrowPipeFunction · 0.85

Calls 3

shuffleFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected