[Chore](storage) add debug info for TabletColumn::get_aggregate_function (#21408)

This commit is contained in:
Pxl
2023-07-03 10:02:44 +08:00
committed by GitHub
parent 124516c1ea
commit f90e8fcb26
2 changed files with 10 additions and 1 deletions

View File

@ -111,6 +111,10 @@ void MemTable::_init_agg_functions(const vectorized::Block* block) {
} else {
function =
_tablet_schema->column(cid).get_aggregate_function(vectorized::AGG_LOAD_SUFFIX);
if (function == nullptr) {
LOG(WARNING) << "column get aggregate function failed, column="
<< _tablet_schema->column(cid).name();
}
}
DCHECK(function != nullptr);

View File

@ -506,7 +506,7 @@ vectorized::AggregateFunctionPtr TabletColumn::get_aggregate_function(std::strin
std::string origin_name = TabletColumn::get_string_by_aggregation_type(_aggregation);
auto type = vectorized::DataTypeFactory::instance().create_data_type(*this);
std::string agg_name = TabletColumn::get_string_by_aggregation_type(_aggregation) + suffix;
std::string agg_name = origin_name + suffix;
std::transform(agg_name.begin(), agg_name.end(), agg_name.begin(),
[](unsigned char c) { return std::tolower(c); });
@ -515,6 +515,11 @@ vectorized::AggregateFunctionPtr TabletColumn::get_aggregate_function(std::strin
if (function) {
return function;
}
if (type->get_type_as_primitive_type() != PrimitiveType::TYPE_AGG_STATE) {
LOG(WARNING) << "get column aggregate function failed, aggregation_name=" << origin_name
<< ", column_type=" << type->get_name();
return nullptr;
}
return get_aggregate_function_union(type);
}