[feature-wip] Optimize Decimal type (#10794)

* [feature-wip](decimalv3) support decimalv3

* [feature-wip] Optimize Decimal type

Co-authored-by: liaoxin <liaoxinbit@126.com>
This commit is contained in:
Gabriel
2022-07-14 10:50:50 +08:00
committed by GitHub
parent bb0d023abd
commit 3b46242483
149 changed files with 4011 additions and 549 deletions

View File

@ -149,8 +149,24 @@ void AggregationNode::_init_hash_method(std::vector<VExprContext*>& probe_exprs)
return;
case TYPE_LARGEINT:
case TYPE_DECIMALV2:
_agg_data.init(AggregatedDataVariants::Type::int128_key, is_nullable);
case TYPE_DECIMAL32:
case TYPE_DECIMAL64:
case TYPE_DECIMAL128: {
DataTypePtr& type_ptr = probe_exprs[0]->root()->data_type();
TypeIndex idx = is_nullable ? assert_cast<const DataTypeNullable&>(*type_ptr)
.get_nested_type()
->get_type_id()
: type_ptr->get_type_id();
WhichDataType which(idx);
if (which.is_decimal32()) {
_agg_data.init(AggregatedDataVariants::Type::int32_key, is_nullable);
} else if (which.is_decimal64()) {
_agg_data.init(AggregatedDataVariants::Type::int64_key, is_nullable);
} else {
_agg_data.init(AggregatedDataVariants::Type::int128_key, is_nullable);
}
return;
}
default:
_agg_data.init(AggregatedDataVariants::Type::serialized);
}
@ -202,7 +218,7 @@ void AggregationNode::_init_hash_method(std::vector<VExprContext*>& probe_exprs)
_agg_data.init(AggregatedDataVariants::Type::serialized);
}
}
}
} // namespace doris::vectorized
Status AggregationNode::prepare(RuntimeState* state) {
SCOPED_TIMER(_runtime_profile->total_time_counter());