amorynan commented on code in PR #17330:
URL: https://github.com/apache/doris/pull/17330#discussion_r1125816894


##########
be/src/vec/data_types/data_type_map.cpp:
##########
@@ -172,21 +166,18 @@ Status DataTypeMap::from_string(ReadBuffer& rb, IColumn* 
column) const {
         // {"aaa": 1, "bbb": 20}, need to handle key slot and value slot to 
make key column arr and value arr
         // skip "{"
         ++rb.position();
-        auto& keys_arr = 
reinterpret_cast<ColumnArray&>(map_column->get_keys());
-        ColumnArray::Offsets64& key_off = keys_arr.get_offsets();
-        auto& values_arr = 
reinterpret_cast<ColumnArray&>(map_column->get_values());
-        ColumnArray::Offsets64& val_off = values_arr.get_offsets();
-
-        IColumn& nested_key_column = keys_arr.get_data();
+        ColumnArray::Offsets64& map_off = map_column->get_offsets();
+        IColumn& nested_key_column = map_column->get_keys();
         DCHECK(nested_key_column.is_nullable());
-        IColumn& nested_val_column = values_arr.get_data();
+        IColumn& nested_val_column = map_column->get_values();
         DCHECK(nested_val_column.is_nullable());
 
         size_t element_num = 0;
         while (!rb.eof()) {
             StringRef key_element(rb.position(), rb.count());
             bool has_quota = false;
             if (!next_slot_from_string(rb, key_element, has_quota)) {
+                map_column->pop_back(element_num);

Review Comment:
   I think this called after key_type/value_type from_string , because this 
function will add element to nested column, here i do not add element ,so call 
pop_back for whole key, val to keep same offsets here



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to