Do not report ERROR when sample rate equals 100

This commit is contained in:
ZenoWang
2024-02-06 14:49:31 +00:00
committed by ob-robot
parent 1f1d5c08ae
commit c8ef409bf3
3710 changed files with 486984 additions and 3083329 deletions

View File

@ -54,19 +54,14 @@ int ObExprJsonRemove::calc_result_typeN(ObExprResType& type,
return ret;
}
static int remove_from_json(ObJsonPath *path_node, ObIJsonBase *child)
static int remove_from_json(ObJsonPath *path_node, ObIJsonBase *parent)
{
INIT_SUCC(ret);
// remove item in hits
ObJsonPathBasicNode* last_node = path_node->last_path_node();
// get node to be removed
ObJsonNodeType type;
ObIJsonBase* parent = nullptr;
if (OB_FAIL(child->get_parent(parent)) || OB_ISNULL(parent)) {
// may be null parent
ret = OB_SUCCESS;
} else if (FALSE_IT(type = parent->json_type())) {
} else if (type == ObJsonNodeType::J_OBJECT && last_node->get_node_type() == JPN_MEMBER) {
ObJsonNodeType type = parent->json_type();
if (type == ObJsonNodeType::J_OBJECT && last_node->get_node_type() == JPN_MEMBER) {
ObPathMember member = last_node->get_object();
ObString key(member.len_, member.object_name_);
if (OB_FAIL(parent->object_remove(key))) {
@ -125,7 +120,7 @@ int ObExprJsonRemove::eval_json_remove(const ObExpr &expr, ObEvalCtx &ctx, ObDat
} else if (json_path->path_node_cnt() == 0) {
ret = OB_ERR_JSON_VACUOUS_PATH;
LOG_USER_ERROR(OB_ERR_JSON_VACUOUS_PATH);
} else if (OB_FAIL(json_doc->seek(*json_path, json_path->path_node_cnt(), true, false, hits))) {
} else if (OB_FAIL(json_doc->seek(*json_path, json_path->path_node_cnt() - 1, true, false, hits))) {
LOG_WARN("json seek failed", K(path_data->get_string()), K(ret));
} else if (hits.size() == 0){
continue;