1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-785 Implement DISTRIBUTED JSON functions

The following functions are created:
Create function JSON_VALID and test cases
Create function JSON_DEPTH and test cases
Create function JSON_LENGTH and test cases
Create function JSON_EQUALS and test cases
Create function JSON_NORMALIZE and test cases
Create function JSON_TYPE and test cases
Create function JSON_OBJECT and test cases
Create function JSON_ARRAY and test cases
Create function JSON_KEYS and test cases
Create function JSON_EXISTS and test cases
Create function JSON_QUOTE/JSON_UNQUOTE and test cases
Create function JSON_COMPACT/DETAILED/LOOSE and test cases
Create function JSON_MERGE and test cases
Create function JSON_MERGE_PATCH and test cases
Create function JSON_VALUE and test cases
Create function JSON_QUERY and test cases
Create function JSON_CONTAINS and test cases
Create function JSON_ARRAY_APPEND and test cases
Create function JSON_ARRAY_INSERT and test cases
Create function JSON_INSERT/REPLACE/SET and test cases
Create function JSON_REMOVE and test cases
Create function JSON_CONTAINS_PATH and test cases
Create function JSON_OVERLAPS and test cases
Create function JSON_EXTRACT and test cases
Create function JSON_SEARCH and test cases

Note:
Some functions output differs from MDB because session variables that affects functions output,e.g JSON_QUOTE/JSON_UNQUOTE
This depends on MCOL-5212
This commit is contained in:
Ziy1-Tan
2022-06-23 10:49:29 +08:00
parent b5d8e0324b
commit cdd41f05f3
82 changed files with 8645 additions and 2 deletions

View File

@ -21,7 +21,7 @@
*
*
****************************************************************************/
#include "functor_json.h"
#include <boost/thread/mutex.hpp>
#include "funcexp.h"
@ -143,6 +143,39 @@ FuncExp::FuncExp()
fFuncMap["isnottrue"] = new Func_IsNotTrue();
fFuncMap["isfalse"] = new Func_IsFalse();
fFuncMap["isnotfalse"] = new Func_IsNotFalse();
fFuncMap["json_array"] = new Func_json_array();
fFuncMap["json_array_append"] = new Func_json_array_append();
fFuncMap["json_array_insert"] = new Func_json_array_insert();
fFuncMap["json_contains"] = new Func_json_contains();
fFuncMap["json_contains_path"] = new Func_json_contains_path();
fFuncMap["json_compact"] = new Func_json_format(Func_json_format::COMPACT);
fFuncMap["json_depth"] = new Func_json_depth();
fFuncMap["json_equals"] = new Func_json_equals();
fFuncMap["json_exists"] = new Func_json_exists();
fFuncMap["json_extract"] = new Func_json_extract();
fFuncMap["json_format"] = new Func_json_format();
fFuncMap["json_insert"] = new Func_json_insert();
fFuncMap["json_keys"] = new Func_json_keys();
fFuncMap["json_length"] = new Func_json_length();
fFuncMap["json_loose"] = new Func_json_format(Func_json_format::LOOSE);
fFuncMap["json_merge"] = new Func_json_merge();
fFuncMap["json_merge_patch"] = new Func_json_merge_patch();
fFuncMap["json_merge_preserve"] = new Func_json_merge();
fFuncMap["json_normalize"] = new Func_json_normalize();
fFuncMap["json_object"] = new Func_json_object();
#ifdef MYSQL_GE_1009
fFuncMap["json_overlaps"] = new Func_json_overlaps();
#endif
fFuncMap["json_query"] = new Func_json_query();
fFuncMap["json_quote"] = new Func_json_quote();
fFuncMap["json_remove"] = new Func_json_remove();
fFuncMap["json_replace"] = new Func_json_insert(Func_json_insert::REPLACE);
fFuncMap["json_search"] = new Func_json_search();
fFuncMap["json_set"] = new Func_json_insert(Func_json_insert::SET);
fFuncMap["json_type"] = new Func_json_type();
fFuncMap["json_unquote"] = new Func_json_unquote();
fFuncMap["json_valid"] = new Func_json_valid();
fFuncMap["json_value"] = new Func_json_value();
fFuncMap["last_day"] = new Func_last_day();
fFuncMap["lcase"] = new Func_lcase(); // dlh
fFuncMap["least"] = new Func_least(); // dlh