[fix](json function) Fix the slow performance of get_json_path when processing JSONB (#24631)

When processing JSONB, automatically convert to jsonb_extract_string
This commit is contained in:
Chenyang Sun
2023-09-27 21:17:39 +08:00
committed by GitHub
parent 732f821c15
commit 68087f6c82
7 changed files with 628 additions and 2 deletions

View File

@ -273,6 +273,10 @@ struct GetJsonNumberType {
using ColumnType = typename NumberType::ColumnType;
using Container = typename ColumnType::Container;
static DataTypes get_variadic_argument_types_impl() {
return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>()};
}
static void get_json_impl(rapidjson::Value*& root, const std::string_view& json_string,
const std::string_view& path_string, rapidjson::Document& document,
typename NumberType::T& res, UInt8& null_map) {
@ -526,6 +530,9 @@ struct GetJsonString {
res_offsets);
}
}
static DataTypes get_variadic_argument_types_impl() {
return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>()};
}
};
template <int flag>