github-actions[bot] commented on code in PR #66196:
URL: https://github.com/apache/doris/pull/66196#discussion_r3670443022


##########
be/test/core/column/column_variant_test.cpp:
##########
@@ -3610,6 +3610,14 @@ TEST_F(ColumnVariantTest, subcolumn_finalize_and_insert) 
{
     array_subcolumn.finalize();
 }
 
+TEST(ColumnVariantNestedGroupTypeTest, nullable_array_element_is_recognized) {

Review Comment:
   [P1] Please exercise the conflict-policy behavior, not only the helper. The 
reported regression is that this predicate used to bypass 
`Subcolumn::insert_range_from`/`finalize`, but this test would still pass if 
the merge kept the wrong LCT, discarded the NestedGroup row, or ignored the 
ERROR policy. Add a focused merge test with an actual `NESTED_TYPE` value and a 
scalar in both source/destination orders, asserting that the default policy 
preserves the NestedGroup value and defaults only the scalar; also cover 
`variant_nested_group_discard_scalar_on_conflict=false` throwing in both orders.



##########
be/src/core/column/column_variant.cpp:
##########
@@ -142,6 +142,9 @@ size_t get_number_of_dimensions(const IDataType& type) {
 // which indicates NG-originated array<object> data.
 bool is_nested_group_type(const DataTypePtr& type) {
     auto base = get_base_type_of_array(type);
+    if (get_number_of_dimensions(*type) > 0) {

Review Comment:
   [P1] Preserve regular-array rows when the NG type becomes the LCT. If the 
destination already contains a mixed `Array<Jsonb>` and the source is 
`NESTED_TYPE`, this newly true result makes `resolve_ng_type_conflict()` select 
the NG type and leave the old array part in place; `Subcolumn::finalize()` then 
sees an NG/non-NG mismatch and inserts defaults for every old row. Reversing 
the inputs instead reaches the same-dimensional array cast at lines 392-424 and 
preserves the values, so hierarchical/materialized merges become 
order-dependent. Distinguish genuine scalar conflicts from regular arrays 
during resolution/finalization, and cover both input orders.



-- 
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]

Reply via email to