Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize ColumnVector::insertMany and ColumnVector::insertManyFrom #55714

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Columns/ColumnVector.h
Expand Up @@ -154,6 +154,17 @@ class ColumnVector final : public COWHelper<ColumnVectorHelper, ColumnVector<T>>
data.push_back(assert_cast<const Self &>(src).getData()[n]);
}

void insertManyFrom(const IColumn & src, size_t position, size_t length) override
{
ValueType v = assert_cast<const Self &>(src).getData()[position];
data.resize_fill(data.size() + length, v);
}

void insertMany(const Field & field, size_t length) override
{
data.resize_fill(data.size() + length, static_cast<T>(field.get<T>()));
}

void insertData(const char * pos, size_t) override
{
data.emplace_back(unalignedLoad<T>(pos));
Expand Down