[FEAT MERGE] 开源裁减颗粒度优化

Co-authored-by: nroskill <nroskill@gmail.com>
Co-authored-by: akaError <lzg020616@163.com>
Co-authored-by: yinyj17 <yinyijun92@gmail.com>
This commit is contained in:
wenxingsen
2023-08-15 02:40:25 +00:00
committed by ob-robot
parent a31e422133
commit 9b31f8aa03
378 changed files with 26718 additions and 2379 deletions

View File

@ -408,6 +408,68 @@ int ObExprObjAccess::ExtraInfo::calc(ObObj &result,
}
}
OX(result.set_extend(attr_addr, res_type.get_extend_type(), extend_size));
#ifdef OB_BUILD_ORACLE_PL
} else if (pl::ObCollectionType::INVALID_PROPERTY != property_type_) {
pl::ObPLCollection *coll = reinterpret_cast<pl::ObPLCollection*>(attr_addr);
pl::ObPLAssocArray *assoc =
(OB_NOT_NULL(coll) && coll->is_associative_array())
? static_cast<pl::ObPLAssocArray *>(coll) : NULL;
CK (OB_NOT_NULL(coll));
if (OB_SUCC(ret)) {
switch (property_type_) {
case pl::ObCollectionType::FIRST_PROPERTY: {
OZ (OB_NOT_NULL(assoc) ? assoc->first(result) : coll->first(result));
} break;
case pl::ObCollectionType::LAST_PROPERTY: {
OZ (OB_NOT_NULL(assoc) ? assoc->last(result) : coll->last(result));
} break;
case pl::ObCollectionType::PRIOR_PROPERTY: {
CK (param_array.count() > 1);
int64_t idx = param_array.count() - 1;
OZ (OB_NOT_NULL(assoc)
? assoc->prior(param_array.at(idx), result) : coll->prior(param_array.at(idx), result));
} break;
case pl::ObCollectionType::NEXT_PROPERTY: {
CK (param_array.count() > 1);
int64_t idx = param_array.count() - 1;
int64_t index_val = param_array.at(idx);
if (OB_SUCC(ret)) {
if(OB_INVALID_INDEX == param_array.at(idx)) {
if (OB_NOT_NULL(assoc)) {
OZ (assoc->next(index_val, result));
} else {
result.set_null();
}
} else {
OZ (OB_NOT_NULL(assoc) ? assoc->next(index_val, result) : coll->next(index_val, result));
}
}
} break;
case pl::ObCollectionType::EXISTS_PROPERTY: {
CK (param_array.count() > 1);
int64_t idx = param_array.count() - 1;
OZ (OB_NOT_NULL(assoc)
? assoc->exist(param_array.at(idx), result) : coll->exist(param_array.at(idx), result));
} break;
case pl::ObCollectionType::COUNT_PROPERTY: {
result.set_int(coll->get_actual_count());
} break;
case pl::ObCollectionType::LIMIT_PROPERTY: {
if (coll->is_varray()) {
pl::ObPLVArray *varr = static_cast<pl::ObPLVArray *>(coll);
CK (OB_NOT_NULL(varr));
OX (result.set_int(varr->get_capacity()));
} else {
result.set_null();
}
} break;
default: {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("invalid property type", K(ret), K(property_type_));
} break;
}
}
#endif
} else {
ObObj *datum = reinterpret_cast<ObObj*>(attr_addr);
if (ObMaxType == datum->get_type()) { //means has been deleted