[Opt](load) Speed up the vectorized load (#12146)

* [Opt](load) Speed up the vectorized load
This commit is contained in:
HappenLee
2022-08-31 16:23:36 +08:00
committed by GitHub
parent 90c5180370
commit 573e5476dd
12 changed files with 112 additions and 64 deletions

View File

@ -26,6 +26,39 @@
namespace doris::vectorized {
Block create_block_with_nested_columns_only_args(const Block& block, const ColumnNumbers& args) {
std::set<size_t> args_set(args.begin(), args.end());
Block res;
for (auto i : args_set) {
const auto& col = block.get_by_position(i);
if (col.type->is_nullable()) {
const DataTypePtr& nested_type =
static_cast<const DataTypeNullable&>(*col.type).get_nested_type();
if (!col.column) {
res.insert({nullptr, nested_type, col.name});
} else if (auto* nullable = check_and_get_column<ColumnNullable>(*col.column)) {
const auto& nested_col = nullable->get_nested_column_ptr();
res.insert({nested_col, nested_type, col.name});
} else if (auto* const_column = check_and_get_column<ColumnConst>(*col.column)) {
const auto& nested_col =
check_and_get_column<ColumnNullable>(const_column->get_data_column())
->get_nested_column_ptr();
res.insert({ColumnConst::create(nested_col, col.column->size()), nested_type,
col.name});
} else {
LOG(FATAL) << "Illegal column for DataTypeNullable";
}
} else {
res.insert(col);
}
}
return res;
}
static Block create_block_with_nested_columns_impl(const Block& block,
const std::unordered_set<size_t>& args) {
Block res;