[FEAT MERGE] JSON/XML phase2 and JSON Partial Update

Co-authored-by: Carrot-77 <1012982871@qq.com>
Co-authored-by: wu-xingying <729224612@qq.com>
This commit is contained in:
shadowao
2024-04-12 10:46:02 +00:00
committed by ob-robot
parent fbfcd0feaa
commit 4afa70a218
254 changed files with 55981 additions and 10150 deletions

View File

@ -14,6 +14,7 @@
#define USING_LOG_PREFIX SQL_ENG
#include "ob_expr_json_array_append.h"
#include "share/ob_json_access_utils.h"
#include "sql/engine/expr/ob_expr_json_func_helper.h"
using namespace oceanbase::common;
@ -32,6 +33,16 @@ ObExprJsonArrayAppend::ObExprJsonArrayAppend(ObIAllocator &alloc)
{
}
ObExprJsonArrayAppend::ObExprJsonArrayAppend(
ObIAllocator &alloc,
ObExprOperatorType type,
const char *name,
int32_t param_num,
ObValidForGeneratedColFlag valid_for_generated_col,
int32_t dimension) : ObFuncExprOperator(alloc, type, name, param_num, valid_for_generated_col, dimension)
{
}
ObExprJsonArrayAppend::~ObExprJsonArrayAppend()
{
}
@ -86,7 +97,7 @@ int ObExprJsonArrayAppend::eval_json_array_append(const ObExpr &expr, ObEvalCtx
common::ObArenaAllocator &temp_allocator = tmp_alloc_g.get_allocator();
ObIJsonBase *j_base = NULL;
bool is_null = false;
ObJsonBaseVector hit;
ObJsonSeekResult hit;
if (expr.datum_meta_.cs_type_ != CS_TYPE_UTF8MB4_BIN) {
ret = OB_ERR_INVALID_JSON_CHARSET;
@ -176,7 +187,7 @@ int ObExprJsonArrayAppend::eval_json_array_append(const ObExpr &expr, ObEvalCtx
ObString raw_bin;
if (is_null) {
res.set_null();
} else if (OB_FAIL(j_base->get_raw_binary(raw_bin, &temp_allocator))) {
} else if (OB_FAIL(ObJsonWrapper::get_raw_binary(j_base, raw_bin, &temp_allocator))) {
LOG_WARN("failed: get json raw binary", K(ret));
} else if (OB_FAIL(ObJsonExprHelper::pack_json_str_res(expr, ctx, res, raw_bin))) {
LOG_WARN("fail to pack json result", K(ret));