amorynan commented on code in PR #17330:
URL: https://github.com/apache/doris/pull/17330#discussion_r1123978825
##########
be/src/vec/olap/olap_data_convertor.cpp:
##########
@@ -810,30 +808,52 @@ Status
OlapBlockDataConvertor::OlapColumnDataConvertorMap::convert_to_olap(
const ColumnMap* column_map, const DataTypeMap* data_type_map) {
ColumnPtr key_data = column_map->get_keys_ptr();
ColumnPtr value_data = column_map->get_values_ptr();
+ const UInt8* key_null_map = nullptr;
+ const UInt8* val_null_map = nullptr;
if (column_map->get_keys().is_nullable()) {
const auto& key_nullable_column =
assert_cast<const ColumnNullable&>(column_map->get_keys());
key_data = key_nullable_column.get_nested_column_ptr();
+ key_null_map = key_nullable_column.get_null_map_data().data();
}
if (column_map->get_values().is_nullable()) {
const auto& val_nullable_column =
assert_cast<const ColumnNullable&>(column_map->get_values());
value_data = val_nullable_column.get_nested_column_ptr();
+ val_null_map = val_nullable_column.get_null_map_data().data();
}
- ColumnWithTypeAndName key_typed_column = {key_data,
remove_nullable(data_type_map->get_keys()),
- "map.key"};
- _key_convertor->set_source_column(key_typed_column, _row_pos, _num_rows);
+ // offsets data
+ auto& offsets = column_map->get_offsets();
+ // make first offset
+ auto offsets_col = ColumnArray::ColumnOffsets::create();
+
+ _offsets.reserve(offsets.size() + 1);
+ _offsets.push_back(_row_pos);
+ _offsets.insert_assume_reserved(offsets.begin(), offsets.end());
+
+ int64_t start_index = _row_pos - 1;
+ int64_t end_index = _row_pos + _num_rows - 1;
+ auto start = offsets[start_index];
+ auto size = offsets[end_index] - start;
+
+ ColumnWithTypeAndName key_typed_column = {
+ key_data, remove_nullable(data_type_map->get_key_type()),
"map.key"};
Review Comment:
actually here is no need to remove nullable, and here make key / value
column with it's origin convertor just fine, this function should not do any
nullable determine , because base_convertor does it already.
--
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]