[feature-wip](array-type) array_contains support more nested data types (#9170)

Co-authored-by: cambyzju <zhuxiaoli01@baidu.com>
This commit is contained in:
camby
2022-05-13 12:42:40 +08:00
committed by GitHub
parent 34e64fbea9
commit 650e3a6ba0
15 changed files with 465 additions and 184 deletions

View File

@ -70,6 +70,10 @@ size_t type_index_to_data_type(const std::vector<std::any>& input_types, size_t
desc.type = doris_udf::FunctionContext::TYPE_LARGEINT;
type = std::make_shared<DataTypeInt128>();
return 1;
case TypeIndex::Float32:
desc.type = doris_udf::FunctionContext::TYPE_FLOAT;
type = std::make_shared<DataTypeFloat32>();
return 1;
case TypeIndex::Float64:
desc.type = doris_udf::FunctionContext::TYPE_DOUBLE;
type = std::make_shared<DataTypeFloat64>();
@ -84,7 +88,7 @@ size_t type_index_to_data_type(const std::vector<std::any>& input_types, size_t
return 1;
case TypeIndex::Date:
desc.type = doris_udf::FunctionContext::TYPE_DATE;
type = std::make_shared<DataTypeDateTime>();
type = std::make_shared<DataTypeDate>();
return 1;
case TypeIndex::Array: {
desc.type = doris_udf::FunctionContext::TYPE_ARRAY;
@ -152,6 +156,9 @@ bool insert_cell(MutableColumnPtr& column, DataTypePtr type_ptr, const std::any&
} else if (type.is_int128()) {
auto value = std::any_cast<ut_type::LARGEINT>(cell);
column->insert_data(reinterpret_cast<char*>(&value), 0);
} else if (type.is_float32()) {
auto value = std::any_cast<ut_type::FLOAT>(cell);
column->insert_data(reinterpret_cast<char*>(&value), 0);
} else if (type.is_float64()) {
auto value = std::any_cast<ut_type::DOUBLE>(cell);
column->insert_data(reinterpret_cast<char*>(&value), 0);