#include "functor_json.h" #include "functioncolumn.h" #include "constantcolumn.h" using namespace execplan; #include "rowgroup.h" using namespace rowgroup; #include "joblisttypes.h" using namespace joblist; #include "jsonhelpers.h" using namespace funcexp::helpers; namespace funcexp { CalpontSystemCatalog::ColType Func_json_array_append::operationType( FunctionParm& fp, CalpontSystemCatalog::ColType& /*resultType*/) { return fp[0]->data()->resultType(); } string Func_json_array_append::getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull, execplan::CalpontSystemCatalog::ColType& /*type*/) { const auto& js = fp[0]->data()->getStrVal(row, isNull); if (isNull) return ""; const CHARSET_INFO* cs = getCharset(fp[0]); json_engine_t jsEg; const uchar* arrEnd; size_t strRestLen; string retJS; retJS.reserve(js.length() + padding); initJSPaths(paths, fp, 1, 2); #if MYSQL_VERSION_ID >= 120100 int jsEg_stack[JSON_DEPTH_LIMIT]; initJsonArray(&jsEg.stack, sizeof(int), &jsEg_stack); for (size_t i=0; i