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


##########
be/src/storage/transform/block_transform.cpp:
##########
@@ -162,6 +162,13 @@ class RowStoreFillStage : public BlockTransform {
 
 BlockTransformChain build_transform_chain(const RowsetWriterContext& context) {
     if (context.write_type == DataWriteType::TYPE_COMPACTION) {
+        // A full-row MOR compaction reads the published VERSION from the 
column reader. Rebuild
+        // JSONB from that block instead of copying the original singleton's 
VERSION=0 payload.
+        if (context.tablet_schema->keys_type() == KeysType::UNIQUE_KEYS &&
+            context.tablet_schema->has_row_store_for_all_columns() &&
+            context.tablet_schema->field_index(VERSION_COL) >= 0) {
+            return BlockTransformChain 
{{std::make_shared<RowStoreFillStage>()}};

Review Comment:
   [P1] Rebuild row-store JSONB from logical VARIANT columns
   
   For a supported MOR table with a non-doc `VARIANT` column and 
`"store_row_column"="true"`, `build_basic_info()` has already expanded 
`_cur_tablet_schema` with extracted/sparse helper columns whose `unique_id` is 
`-1` (`enable_vertical_compact_variant_subcolumns` defaults to true). The new 
`RowStoreFillStage` serializes this entire temporary schema for an all-column 
row store, so the nullable/numeric/map SerDe calls `cast_set<uint16_t>(-1)` for 
a helper's JSONB key and throws `INTERNAL_ERROR`. Two ordinary singleton 
inserts containing e.g. `{"a":1}` now fail merge compaction. Rebuild from the 
original logical schema with complete VARIANT values: merely skipping the 
helper columns also loses fields because the flat-leaf reader supplies only the 
root fragment. Add a MOR VARIANT plus row-store compaction regression; the new 
compaction row-store unit fixture uses scalar columns only.



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