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

Function implicit_zero

src/Common/examples/average.cpp:135–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133
134
135Float NO_INLINE implicit_zero(const PODArray<UInt8> & keys, const PODArray<Float> & values)
136{
137 Arena arena;
138 FixedImplicitZeroHashMap<UInt8, StatePtr> map;
139
140 size_t size = keys.size();
141 for (size_t i = 0; i < size; ++i)
142 {
143 StatePtr & place = map[keys[i]];
144 if (unlikely(!place))
145 place = new (arena.alloc<State>()) State();
146
147 place->add(values[i]);
148 }
149
150 return map[0] ? map[0]->result() : 0;
151}
152
153
154template <typename Key, typename Mapped>

Callers 1

mainEntryExampleAverageFunction · 0.85

Calls 3

sizeMethod · 0.45
addMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected