yinzhijian commented on code in PR #9856:
URL: https://github.com/apache/incubator-doris/pull/9856#discussion_r890158272
##########
be/src/vec/functions/function_cast.h:
##########
@@ -1040,6 +1073,69 @@ class FunctionCast final : public IFunctionBase {
};
}
+ WrapperType create_array_wrapper(const DataTypePtr& from_type_untyped,
+ const DataTypeArray& to_type) const {
+ /// Conversion from String through parsing.
+ if (check_and_get_data_type<DataTypeString>(from_type_untyped.get())) {
+ return &ConvertImplGenericFromString<ColumnString>::execute;
+ }
+
+ const auto* from_type =
check_and_get_data_type<DataTypeArray>(from_type_untyped.get());
+
+ if (!from_type) {
+ LOG(FATAL) << "CAST AS Array can only be performed between
same-dimensional Array, "
+ "String types";
+ }
+
+ DataTypePtr from_nested_type = from_type->get_nested_type();
+
+ /// In query SELECT CAST([] AS Array(Array(String))) from type is
Array(Nothing)
Review Comment:
handle nulls with existing cast logic, same as _string_ cast to _int_.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]