imay commented on a change in pull request #1447: Fix bug that BE crashs when 
insert null value to the not null column
URL: https://github.com/apache/incubator-doris/pull/1447#discussion_r301428707
 
 

 ##########
 File path: be/src/exec/olap_table_sink.cpp
 ##########
 @@ -640,14 +640,25 @@ void OlapTableSink::_convert_batch(RuntimeState* state, 
RowBatch* input_batch, R
 #else
                     state->append_error_msg_to_file("", ss.str());
 #endif
-                    continue;
+                    exist_null_value_for_not_null_col = true;
+                    break;
                 }
             }
             void* slot = dst_tuple->get_slot(slot_desc->tuple_offset());
             RawValue::write(src_val, slot, slot_desc->type(), 
_output_batch->tuple_data_pool());
         }
+
+        if (!exist_null_value_for_not_null_col) {
+            if (output_batch->add_row() != RowBatch::INVALID_ROW_INDEX) {
+                commit_rows++;
+                output_batch->get_row(i)->set_tuple(0, dst_tuple);
 
 Review comment:
   If one row is skipped, `get_row(i)` will get a wrong result. I think you 
should what you get is add_row()'s return value

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