Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangstar333 committed May 23, 2024
1 parent 08c8184 commit ea82a8d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions be/src/vec/functions/function_fake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,25 @@ struct FunctionFakeBaseImpl {

struct FunctionExplode {
static DataTypePtr get_return_type_impl(const DataTypes& arguments) {
DCHECK(is_array(arguments[0])) << arguments[0]->get_name() << " not supported";
return make_nullable(
check_and_get_data_type<DataTypeArray>(arguments[0].get())->get_nested_type());
auto remove_nullable_arg = remove_nullable(arguments[0]);
DCHECK(is_array(remove_nullable_arg))
<< remove_nullable_arg->get_name() << " not supported";
return make_nullable(check_and_get_data_type<DataTypeArray>(remove_nullable_arg.get())
->get_nested_type());
}
static std::string get_error_msg() { return "Fake function do not support execute"; }
};

// explode map: make map k,v as struct field
struct FunctionExplodeMap {
static DataTypePtr get_return_type_impl(const DataTypes& arguments) {
DCHECK(is_map(arguments[0])) << arguments[0]->get_name() << " not supported";
auto remove_nullable_arg = remove_nullable(arguments[0]);
DCHECK(is_map(remove_nullable_arg)) << remove_nullable_arg->get_name() << " not supported";
DataTypes fieldTypes(2);
fieldTypes[0] = check_and_get_data_type<DataTypeMap>(arguments[0].get())->get_key_type();
fieldTypes[1] = check_and_get_data_type<DataTypeMap>(arguments[0].get())->get_value_type();
fieldTypes[0] =
check_and_get_data_type<DataTypeMap>(remove_nullable_arg.get())->get_key_type();
fieldTypes[1] =
check_and_get_data_type<DataTypeMap>(remove_nullable_arg.get())->get_value_type();
return make_nullable(std::make_shared<vectorized::DataTypeStruct>(fieldTypes));
}
static std::string get_error_msg() { return "Fake function do not support execute"; }
Expand Down

0 comments on commit ea82a8d

Please sign in to comment.