[Optimize] Optimize cpu consumption when importing parquet files (#6782)

Remove part of dynamic_cast, reduce the overhead caused by type conversion,
and probably reduce the cpu consumption of parquet file import by about 10%
This commit is contained in:
Zhengguo Yang
2021-10-03 12:14:35 +08:00
committed by GitHub
parent fb7fc27a0a
commit 7297b275f1
10 changed files with 64 additions and 59 deletions

View File

@ -471,7 +471,7 @@ bool EsScanNode::get_disjuncts(ExprContext* context, Expr* conjunct,
}
TExtInPredicate ext_in_predicate;
std::vector<TExtLiteral> in_pred_values;
InPredicate* pred = dynamic_cast<InPredicate*>(conjunct);
InPredicate* pred = static_cast<InPredicate*>(conjunct);
ext_in_predicate.__set_is_not_in(pred->is_not_in());
if (Expr::type_without_cast(pred->get_child(0)) != TExprNodeType::SLOT_REF) {
return false;
@ -612,7 +612,8 @@ bool EsScanNode::to_ext_literal(PrimitiveType slot_type, void* value, TExtLitera
case TYPE_LARGEINT: {
node_type = (TExprNodeType::LARGE_INT_LITERAL);
TLargeIntLiteral large_int_literal;
large_int_literal.__set_value(LargeIntValue::to_string(*reinterpret_cast<__int128*>(value)));
large_int_literal.__set_value(
LargeIntValue::to_string(*reinterpret_cast<__int128*>(value)));
literal->__set_large_int_literal(large_int_literal);
break;
}