[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:
@ -246,6 +246,7 @@ void* ExprContext::get_value(Expr* e, TupleRow* row) {
|
||||
case TYPE_VARCHAR:
|
||||
case TYPE_HLL:
|
||||
case TYPE_OBJECT:
|
||||
case TYPE_QUANTILE_STATE:
|
||||
case TYPE_STRING: {
|
||||
doris_udf::StringVal v = e->get_string_val(this, row);
|
||||
if (v.is_null) {
|
||||
@ -375,7 +376,7 @@ Status ExprContext::get_const_value(RuntimeState* state, Expr& expr, AnyVal** co
|
||||
char* ptr_copy = reinterpret_cast<char*>(_pool->try_allocate(sv->len, &rst));
|
||||
if (ptr_copy == nullptr) {
|
||||
RETURN_LIMIT_EXCEEDED(_pool->mem_tracker(), state,
|
||||
"Could not allocate constant string value", sv->len, rst);
|
||||
"Could not allocate constant string value", sv->len, rst);
|
||||
}
|
||||
memcpy(ptr_copy, sv->ptr, sv->len);
|
||||
sv->ptr = reinterpret_cast<uint8_t*>(ptr_copy);
|
||||
|
||||
Reference in New Issue
Block a user