This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new a98cb8c8bff branch-2.1: [fix](arrow-flight-sql) Fix query result is
empty and not return query error message #45023 (#45053)
a98cb8c8bff is described below
commit a98cb8c8bff41917339ef5d4d9cf5d3a22e2d37a
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Dec 6 09:27:35 2024 +0800
branch-2.1: [fix](arrow-flight-sql) Fix query result is empty and not
return query error message #45023 (#45053)
Cherry-picked from #45023
Co-authored-by: Xinyi Zou <[email protected]>
---
be/src/runtime/buffer_control_block.cpp | 20 +++++++++++++++-----
.../arrow_flight/arrow_flight_batch_reader.cpp | 2 +-
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/be/src/runtime/buffer_control_block.cpp
b/be/src/runtime/buffer_control_block.cpp
index f2ac2780c9d..f75b4601c77 100644
--- a/be/src/runtime/buffer_control_block.cpp
+++ b/be/src/runtime/buffer_control_block.cpp
@@ -294,6 +294,9 @@ Status
BufferControlBlock::get_arrow_batch(std::shared_ptr<vectorized::Block>* r
_arrow_data_arrival.wait_for(l, std::chrono::milliseconds(20));
}
+ if (!_status.ok()) {
+ return _status;
+ }
if (_is_cancelled) {
return Status::Cancelled(fmt::format("Cancelled ()",
print_id(_fragment_id)));
}
@@ -309,9 +312,12 @@ Status
BufferControlBlock::get_arrow_batch(std::shared_ptr<vectorized::Block>* r
// normal path end
if (_is_close) {
+ if (!_status.ok()) {
+ return _status;
+ }
std::stringstream ss;
_profile.pretty_print(&ss);
- VLOG_NOTICE << fmt::format(
+ LOG(INFO) << fmt::format(
"BufferControlBlock finished, fragment_id={}, is_close={},
is_cancelled={}, "
"packet_num={}, peak_memory_usage={}, profile={}",
print_id(_fragment_id), _is_close, _is_cancelled, _packet_num,
@@ -319,7 +325,7 @@ Status
BufferControlBlock::get_arrow_batch(std::shared_ptr<vectorized::Block>* r
return Status::OK();
}
return Status::InternalError(
- fmt::format("Get Arrow Batch Abnormal Ending ()",
print_id(_fragment_id)));
+ fmt::format("Get Arrow Batch Abnormal Ending (), ()",
print_id(_fragment_id), _status));
}
void BufferControlBlock::get_arrow_batch(GetArrowResultBatchCtx* ctx) {
@@ -348,10 +354,14 @@ void
BufferControlBlock::get_arrow_batch(GetArrowResultBatchCtx* ctx) {
// normal path end
if (_is_close) {
+ if (!_status.ok()) {
+ ctx->on_failure(_status);
+ return;
+ }
ctx->on_close(_packet_num);
std::stringstream ss;
_profile.pretty_print(&ss);
- VLOG_NOTICE << fmt::format(
+ LOG(INFO) << fmt::format(
"BufferControlBlock finished, fragment_id={}, is_close={},
is_cancelled={}, "
"packet_num={}, peak_memory_usage={}, profile={}",
print_id(_fragment_id), _is_close, _is_cancelled, _packet_num,
@@ -385,8 +395,8 @@ Status
BufferControlBlock::find_arrow_schema(std::shared_ptr<arrow::Schema>* arr
if (_is_close) {
return Status::RuntimeError(fmt::format("Closed ()",
print_id(_fragment_id)));
}
- return Status::InternalError(
- fmt::format("Get Arrow Schema Abnormal Ending ()",
print_id(_fragment_id)));
+ return Status::InternalError(fmt::format("Get Arrow Schema Abnormal Ending
(), ()",
+ print_id(_fragment_id), _status));
}
Status BufferControlBlock::close(Status exec_status) {
diff --git a/be/src/service/arrow_flight/arrow_flight_batch_reader.cpp
b/be/src/service/arrow_flight/arrow_flight_batch_reader.cpp
index e935aff996d..c24fcb73384 100644
--- a/be/src/service/arrow_flight/arrow_flight_batch_reader.cpp
+++ b/be/src/service/arrow_flight/arrow_flight_batch_reader.cpp
@@ -56,7 +56,7 @@ arrow::Status
ArrowFlightBatchReaderBase::_return_invalid_status(const std::stri
}
ArrowFlightBatchReaderBase::~ArrowFlightBatchReaderBase() {
- VLOG_NOTICE << fmt::format(
+ LOG(INFO) << fmt::format(
"ArrowFlightBatchReader finished, packet_seq={},
result_addr={}:{}, finistId={}, "
"convert_arrow_batch_timer={}, deserialize_block_timer={},
peak_memory_usage={}",
_packet_seq, _statement->result_addr.hostname,
_statement->result_addr.port,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]