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

Function selectFirstMatchForEachKey

src/Interpreters/DirectJoin.cpp:120–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120static void selectFirstMatchForEachKey(const IColumn::Offsets & offsets, MutableColumns & columns, NullMap & null_map)
121{
122 size_t total_rows = offsets.back();
123 IColumn::Filter filter(total_rows, 0);
124 NullMap filtered_null_map(offsets.size(), 0);
125
126 size_t offset = 0;
127 for (size_t i = 0; i < offsets.size(); ++i)
128 {
129 size_t n = offsets[i] - offsets[i - 1];
130 if (n == 0)
131 continue;
132 filtered_null_map[i] = null_map[offset];
133 filter[offset] = 1;
134 offset += n;
135 }
136
137 for (auto && col : columns)
138 col = IColumn::mutate(col->filter(filter, offsets.size()));
139 null_map = std::move(filtered_null_map);
140}
141
142JoinResultPtr DirectKeyValueJoin::joinBlock(Block block)
143{

Callers 1

joinBlockMethod · 0.85

Calls 4

mutateFunction · 0.50
backMethod · 0.45
sizeMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected