csun5285 commented on code in PR #69812:
URL: https://github.com/apache/doris/pull/69812#discussion_r4410380786
##########
be/src/exec/common/variant_util.cpp:
##########
@@ -1233,8 +1234,25 @@ Status
VariantCompactionUtil::get_extended_compaction_schema(
output_schema,
paths_set_info));
// 3. get the subpaths
- get_subpaths(column->variant_max_subcolumns_count(),
extended_info.path_to_none_null_values,
- paths_set_info);
+ // A count of 0 means no limit under V1 and no dynamic subcolumn under
V2, whose paths all
+ // stay in the sparse column(s).
+ if (column->variant_max_subcolumns_count() > 0 ||
+ column->variant_serialize_type() ==
VariantSerializeTypePB::VARIANT_SERIALIZE_V1) {
+ get_subpaths(column->variant_max_subcolumns_count(),
+ extended_info.path_to_none_null_values,
paths_set_info);
+ } else {
+ // Every input path of a V2 count-0 column is in the sparse
column(s) or typed. Nothing
+ // would carry a materialized dynamic subcolumn into the output,
so its data would be lost.
+ for (const auto& [path, _] :
extended_info.path_to_none_null_values) {
+ if (!extended_info.sparse_paths.contains(path) &&
Review Comment:
ok,i will add this check
--
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]