imay commented on a change in pull request #1629: Enable parsing columns from 
file path for Broker Load (#1582)
URL: https://github.com/apache/incubator-doris/pull/1629#discussion_r313232621
 
 

 ##########
 File path: be/src/exec/broker_scanner.cpp
 ##########
 @@ -489,18 +504,18 @@ bool BrokerScanner::line_to_src_tuple(const Slice& line) 
{
         return false;
     }
 
-    for (int i = 0; i < values.size(); ++i) {
+    int file_column_index = 0;
+    for (int i = 0; i < _src_slot_descs.size(); ++i) {
         auto slot_desc = _src_slot_descs[i];
-        const Slice& value = values[i];
-        if (slot_desc->is_nullable() && is_null(value)) {
-            _src_tuple->set_null(slot_desc->null_indicator_offset());
-            continue;
+        auto iter = _columns_from_path.find(slot_desc->col_name());
+        if (iter != _columns_from_path.end()) {
+            std::string partitioned_field = iter->second;
+            const Slice value = Slice(partitioned_field.c_str(), 
partitioned_field.size());
 
 Review comment:
   What you reference `partitioned_field` is a temporary variable. It is not 
valid out of code block.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to