[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

@ -171,7 +171,7 @@ bool ExprContext::is_nullable() {
return false;
}
void* ExprContext::get_value(Expr* e, TupleRow* row) {
void* ExprContext::get_value(Expr* e, TupleRow* row, int precision, int scale) {
switch (e->_type.type) {
case TYPE_NULL: {
return nullptr;
@ -274,6 +274,30 @@ void* ExprContext::get_value(Expr* e, TupleRow* row) {
_result.decimalv2_val = DecimalV2Value::from_decimal_val(v);
return &_result.decimalv2_val;
}
case TYPE_DECIMAL32: {
doris_udf::Decimal32Val v = e->get_decimal32_val(this, row);
if (v.is_null) {
return nullptr;
}
_result.int_val = v.val;
return &_result.int_val;
}
case TYPE_DECIMAL64: {
doris_udf::Decimal64Val v = e->get_decimal64_val(this, row);
if (v.is_null) {
return nullptr;
}
_result.bigint_val = v.val;
return &_result.bigint_val;
}
case TYPE_DECIMAL128: {
doris_udf::Decimal128Val v = e->get_decimal128_val(this, row);
if (v.is_null) {
return nullptr;
}
_result.large_int_val = v.val;
return &_result.large_int_val;
}
case TYPE_ARRAY: {
doris_udf::CollectionVal v = e->get_array_val(this, row);
if (v.is_null) {