eldenmoon commented on code in PR #66204:
URL: https://github.com/apache/doris/pull/66204#discussion_r3672298215
##########
be/src/exprs/function/cast/variant_v2/cast_variant_to_array.cpp:
##########
@@ -138,16 +194,67 @@ Status cast_variant_to_array(FunctionContext* context,
const ColumnVariantV2& so
(!forced_nulls.empty() && forced_nulls.size() != rows)) {
return Status::InvalidArgument("Invalid Variant V2 input shape for
ARRAY CAST");
}
+
+ DataTypePtr leaf_type = remove_nullable(target_type);
+ while (leaf_type->get_primitive_type() == TYPE_ARRAY) {
+ leaf_type =
+ remove_nullable(assert_cast<const
DataTypeArray&>(*leaf_type).get_nested_type());
+ }
+ if (leaf_type->get_primitive_type() == TYPE_VARIANT &&
+ dynamic_cast<const DataTypeVariantV2*>(leaf_type.get()) == nullptr) {
+ return Status::InvalidArgument(
+ "Variant V2 ARRAY CAST does not support legacy Variant
targets");
+ }
+
if (source.is_typed()) {
- *output = make_all_null_column(target_type, rows);
+ if (!is_string_type(source.typed_type()->get_primitive_type())) {
Review Comment:
这个文件不应该修改, Variant里的String Cast成ARRAY不应该特殊处理, 如果需要应该修改case , 比如`CAST(CAST(V
as STRING) AS ARRAY<T>)`
--
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]