[feature] Support pre-aggregation for quantile type (#8234)

Add a new column-type to speed up the approximation of quantiles.
1. The  new column-type is named `quantile_state` with fixed aggregation function `quantile_union`, which stores the intermediate results of pre-aggregated approximation calculations for quantiles.
2. support pre-aggregation of new column-type and quantile_state related functions.
This commit is contained in:
spaces-x
2022-03-24 09:11:34 +08:00
committed by GitHub
parent 36c85d2f06
commit bea9a7ba4f
67 changed files with 1498 additions and 153 deletions

View File

@ -142,6 +142,7 @@ Expr::Expr(const TypeDescriptor& type)
case TYPE_HLL:
case TYPE_OBJECT:
case TYPE_STRING:
case TYPE_QUANTILE_STATE:
_node_type = (TExprNodeType::STRING_LITERAL);
break;
@ -199,6 +200,7 @@ Expr::Expr(const TypeDescriptor& type, bool is_slotref)
case TYPE_VARCHAR:
case TYPE_HLL:
case TYPE_OBJECT:
case TYPE_QUANTILE_STATE:
case TYPE_STRING:
_node_type = (TExprNodeType::STRING_LITERAL);
break;
@ -687,6 +689,7 @@ doris_udf::AnyVal* Expr::get_const_val(ExprContext* context) {
case TYPE_VARCHAR:
case TYPE_HLL:
case TYPE_OBJECT:
case TYPE_QUANTILE_STATE:
case TYPE_STRING: {
_constant_val.reset(new StringVal(get_string_val(context, nullptr)));
break;