github-actions[bot] commented on code in PR #62409:
URL: https://github.com/apache/doris/pull/62409#discussion_r3079460179
##########
be/src/storage/segment/variant/variant_column_reader.cpp:
##########
@@ -1205,6 +1205,13 @@ Status VariantColumnReader::init(const
ColumnReaderOptions& opts, ColumnMetaAcce
_statistics->subcolumns_non_null_size.emplace(relative_path.get_path(),
column_pb.none_null_size());
}
+ // 3.1.2 may store a flat JSON key like {"a.b": 1} as a single
PathInData part.
+ // New compaction schema and query path expect a dot-split multi-part
shape.
+ // Rebuild via the string constructor when the path has neither typed
+ // nor nested metadata, so the tree matches the new shape.
+ if (!relative_path.get_is_typed() && !relative_path.has_nested_part())
{
Review Comment:
This rewrite is too broad: it reparses every non-typed, non-nested path from
its dotted string form, so a legitimate flat key stored as parts `["a.b"]`
becomes indistinguishable from a real nested path `["a", "b"]`. Doris already
treats those as different valid structures today;
`SchemaUtilTest.has_different_structure_in_same_path_indirect` explicitly
allows `["a.b"]` and `["a", "b"]` to coexist.
A concrete failure case is a legacy rowset that contains flat key data from
`{"a.b": 1}` while another rowset contains nested data from `{"a": {"b": 2}}`.
After `init()` both paths collapse onto the same `_subcolumns_meta_info`
branch, so readers/compaction can merge or rewrite the wrong values.
The added test does not cover that case because it rewrites a single nested
path into the legacy shape and only verifies lookup success. Please add a
coexistence test and narrow the compatibility handling so it does not change
the canonical meaning of genuine flat dot-keys.
--
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]