github-actions[bot] commented on code in PR #63322:
URL: https://github.com/apache/doris/pull/63322#discussion_r3254617911
##########
be/src/format/json/new_json_reader.cpp:
##########
@@ -1139,6 +1139,16 @@ Status
NewJsonReader::_simdjson_write_data_to_column(simdjson::ondemand::value&
}
auto primitive_type = type_desc->get_primitive_type();
+ if (_is_load && primitive_type == TYPE_VARIANT) {
+ std::string_view json_str = simdjson::to_json_string(value);
+ Slice slice {json_str.data(), json_str.size()};
+ auto variant_options = _serde_options;
+ variant_options.variant_read_raw_json = true;
+
RETURN_IF_ERROR(data_serde->deserialize_one_cell_from_json(*data_column_ptr,
slice,
+
variant_options));
+ return Status::OK();
Review Comment:
This early return skips the common nullable-column tail at lines 1326-1329,
so a non-null value loaded into a nullable `VARIANT` column inserts one row
into the nested `ColumnVariant` but never appends `0` to the `ColumnNullable`
null map. A normal stream load into a schema like the new regression table (`v
variant ... NULL`) will leave the nullable column with mismatched
nested/null-map sizes, which can trip consistency checks or corrupt later
reads. Please keep the raw-Variant branch on the existing path that reaches the
final null-map append, or append the null-map entry before returning, and add a
nullable Variant stream-load case that validates the column remains consistent.
--
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]