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

@ -97,7 +97,7 @@ int ObExprJsonLength::calc(ObEvalCtx &ctx, const ObDatum &data1, ObDatumMeta met
// handle data2(path text)
if (OB_SUCC(ret) && OB_LIKELY(!is_null)) {
if (OB_ISNULL(data2)) { // have no path
res_len = j_base->member_count();
res_len = j_base->element_count();
} else { // handle json path
ObObjType type2 = meta2.type_;
if (type2 == ObNullType) { // null should display "NULL"
@ -108,17 +108,15 @@ int ObExprJsonLength::calc(ObEvalCtx &ctx, const ObDatum &data1, ObDatumMeta met
ObJsonPath *j_path = NULL;
if (OB_FAIL(ObTextStringHelper::read_real_string_data(*allocator, *data2, meta2, has_lob_header2, j_path_text))) {
LOG_WARN("fail to get real data.", K(ret), K(j_path_text));
} else if (OB_FAIL(ObJsonExprHelper::find_and_add_cache(path_cache, j_path, j_path_text, 1, true))) {
} else if (OB_FAIL(ObJsonExprHelper::find_and_add_cache(path_cache, j_path, j_path_text, 1, false))) {
LOG_USER_ERROR(OB_ERR_INVALID_JSON_PATH);
LOG_WARN("fail to parse json path", K(ret), K(type2), K(j_path_text));
} else if (OB_FAIL(j_base->seek(*j_path, j_path->path_node_cnt(), true, false, hit))) {
} else if (OB_FAIL(j_base->seek(*j_path, j_path->path_node_cnt(), true, true, hit))) {
LOG_WARN("fail to seek json node", K(ret), K(j_path_text));
} else if (hit.size() == 0) { // not found node by path, display "NULL"
} else if (hit.size() != 1) { // not found node by path, display "NULL"
is_null = true;
} else if (hit.size() > 1) {
res_len = hit.size();
} else {
res_len = hit[0]->member_count();
res_len = hit[0]->element_count();
}
}
}