MCPcopy Create free account
hub / github.com/ByConity/ByConity / getVectorString

Function getVectorString

src/Statistics/AutoStatsTaskLogHelper.cpp:20–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20static inline std::vector<String> getVectorString(const ColumnPtr & col_base, UInt64 row)
21{
22 auto col = static_cast<const ColumnArray *>(col_base.get());
23 auto data_col = static_cast<const ColumnString *>(col->getDataPtr().get());
24 auto offsets_col = static_cast<const ColumnArray::ColumnOffsets *>(col->getOffsetsPtr().get());
25
26 auto offset = offsets_col->getElement(row);
27 auto prev_offset = row == 0 ? 0 : offsets_col->getElement(row - 1);
28 auto size = offset - prev_offset;
29
30 std::vector<String> result;
31 result.reserve(size);
32 for (auto i = prev_offset; i < offset; ++i)
33 result.emplace_back(data_col->getDataAt(i));
34
35 return result;
36}
37
38static inline Float64 getFloat64(const ColumnPtr & col_base, UInt64 row)
39{

Callers 1

batchReadTaskLogFunction · 0.85

Calls 5

getElementMethod · 0.80
getMethod · 0.45
reserveMethod · 0.45
emplace_backMethod · 0.45
getDataAtMethod · 0.45

Tested by

no test coverage detected