This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new a73792e62f9 [opt](file-scanner) print current path when encountering 
error (#34365) (#34524)
a73792e62f9 is described below

commit a73792e62f994e01a4fb1e2708eb40ebff31d82d
Author: Mingyu Chen <morning...@163.com>
AuthorDate: Wed May 8 16:21:41 2024 +0800

    [opt](file-scanner) print current path when encountering error (#34365) 
(#34524)
---
 be/src/vec/exec/scan/vfile_scanner.cpp | 11 ++++++++++-
 be/src/vec/exec/scan/vfile_scanner.h   |  2 ++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/be/src/vec/exec/scan/vfile_scanner.cpp 
b/be/src/vec/exec/scan/vfile_scanner.cpp
index dc4d643a80d..3a6c9ff7eb7 100644
--- a/be/src/vec/exec/scan/vfile_scanner.cpp
+++ b/be/src/vec/exec/scan/vfile_scanner.cpp
@@ -240,6 +240,15 @@ Status VFileScanner::open(RuntimeState* state) {
     return Status::OK();
 }
 
+Status VFileScanner::_get_block_impl(RuntimeState* state, Block* block, bool* 
eof) {
+    Status st = _get_block_wrapped(state, block, eof);
+    if (!st.ok()) {
+        // add cur path in error msg for easy debugging
+        return std::move(st.prepend("cur path: " + 
get_current_scan_range_name() + ". "));
+    }
+    return st;
+}
+
 // For query:
 //                              [exist cols]  [non-exist cols]  [col from 
path]  input  output
 //                              A     B    C  D                 E
@@ -259,7 +268,7 @@ Status VFileScanner::open(RuntimeState* state) {
 // _fill_columns_from_path      -     -    -  -                 x              
  x      -
 // _fill_missing_columns        -     -    -  x                 -              
  x      -
 // _convert_to_output_block     -     -    -  -                 -              
  -      x
-Status VFileScanner::_get_block_impl(RuntimeState* state, Block* block, bool* 
eof) {
+Status VFileScanner::_get_block_wrapped(RuntimeState* state, Block* block, 
bool* eof) {
     do {
         if (_cur_reader == nullptr || _cur_reader_eof) {
             RETURN_IF_ERROR(_get_next_reader());
diff --git a/be/src/vec/exec/scan/vfile_scanner.h 
b/be/src/vec/exec/scan/vfile_scanner.h
index 5261337f000..0344b04fc1c 100644
--- a/be/src/vec/exec/scan/vfile_scanner.h
+++ b/be/src/vec/exec/scan/vfile_scanner.h
@@ -84,6 +84,8 @@ public:
 protected:
     Status _get_block_impl(RuntimeState* state, Block* block, bool* eof) 
override;
 
+    Status _get_block_wrapped(RuntimeState* state, Block* block, bool* eof);
+
     Status _get_next_reader();
 
     // TODO: cast input block columns type to string.


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

Reply via email to