morningman closed pull request #425: Summary line should be wrote in spide of
the limit error number
URL: https://github.com/apache/incubator-doris/pull/425
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/be/src/exec/csv_scan_node.cpp b/be/src/exec/csv_scan_node.cpp
index da499a56..33571657 100644
--- a/be/src/exec/csv_scan_node.cpp
+++ b/be/src/exec/csv_scan_node.cpp
@@ -355,7 +355,7 @@ Status CsvScanNode::close(RuntimeState* state) {
if (state->get_normal_row_number() == 0) {
std::stringstream error_msg;
error_msg << "Read zero normal line file. ";
- state->append_error_msg_to_file("", error_msg.str());
+ state->append_error_msg_to_file("", error_msg.str(), true);
return Status(error_msg.str());
}
@@ -364,7 +364,7 @@ Status CsvScanNode::close(RuntimeState* state) {
std::stringstream summary_msg;
summary_msg << "error line: " << _error_row_number
<< "; normal line: " << _normal_row_number;
- state->append_error_msg_to_file("", summary_msg.str());
+ state->append_error_msg_to_file("", summary_msg.str(), true);
return Status::OK;
}
diff --git a/be/src/runtime/runtime_state.cpp b/be/src/runtime/runtime_state.cpp
index bb9a49bc..7e2ecf58 100644
--- a/be/src/runtime/runtime_state.cpp
+++ b/be/src/runtime/runtime_state.cpp
@@ -390,7 +390,8 @@ Status RuntimeState::create_error_log_file() {
void RuntimeState::append_error_msg_to_file(
const std::string& line,
- const std::string& error_msg) {
+ const std::string& error_msg,
+ bool is_summary) {
if (_query_options.query_type != TQueryType::LOAD) {
return;
}
@@ -411,12 +412,12 @@ void RuntimeState::append_error_msg_to_file(
// if num of printed error row exceeds the limit, and this is not a
summary message,
// return
if (_num_print_error_rows.fetch_add(1, std::memory_order_relaxed) >
MAX_ERROR_NUM
- && !line.empty()) {
+ && !is_summary) {
return;
}
std::stringstream out;
- if (line.empty()) {
+ if (is_summary) {
out << "Summary: ";
out << error_msg;
} else {
diff --git a/be/src/runtime/runtime_state.h b/be/src/runtime/runtime_state.h
index 7786722a..7a413db1 100644
--- a/be/src/runtime/runtime_state.h
+++ b/be/src/runtime/runtime_state.h
@@ -403,8 +403,9 @@ class RuntimeState {
return _error_log_file_path;
}
- // TODO(lingbin): remove this file error method after mysql error exporter
is stable.
- void append_error_msg_to_file(const std::string& line, const std::string&
error_msg);
+ // is_summary is true, means we are going to write the summary line
+ void append_error_msg_to_file(const std::string& line, const std::string&
error_msg,
+ bool is_summary = false);
int64_t num_rows_load_success() {
return _num_rows_load_success.load();
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]