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

Method executeImpl

src/Functions/coverage.cpp:127–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 return std::make_shared<DataTypeArray>(std::make_shared<DataTypeUInt64>());
126 }
127 ColumnPtr executeImpl(const ColumnsWithTypeAndName &, const DataTypePtr &, size_t input_rows_count) const override
128 {
129 auto column = ColumnUInt64::create();
130 auto & data = column->getData();
131#if defined(__ELF__) && !defined(OS_FREEBSD)
132 const auto name_refs = getCurrentCoveredNameRefs();
133 size_t map_size = DB::getCoverageMapSize();
134 size_t matches = DB::countCoverageMatches(name_refs);
135 auto [non_empty, zero_line, first_info] = DB::diagCoverageRegions(name_refs);
136 data.push_back(static_cast<UInt64>(name_refs.size()));
137 data.push_back(static_cast<UInt64>(map_size));
138 data.push_back(static_cast<UInt64>(matches));
139 data.push_back(static_cast<UInt64>(non_empty)); // regions with non-empty file
140 data.push_back(static_cast<UInt64>(zero_line)); // regions with line_start==0
141 data.push_back(static_cast<UInt64>(first_info)); // file_len<<32|line_start of first match
142#else
143 data.push_back(0);
144 data.push_back(0);
145 data.push_back(0);
146 data.push_back(0);
147 data.push_back(0);
148 data.push_back(0);
149#endif
150 auto offsets = ColumnArray::ColumnOffsets::create(1, data.size());
151 auto array = ColumnArray::create(std::move(column), std::move(offsets));
152 return ColumnConst::create(std::move(array), input_rows_count);
153 }
154};
155
156REGISTER_FUNCTION(CoverageLines)

Callers

nothing calls this directly

Calls 8

getCoverageMapSizeFunction · 0.85
countCoverageMatchesFunction · 0.85
diagCoverageRegionsFunction · 0.85
createFunction · 0.70
getDataMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected