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

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


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

commit b25ad74000e16984bdf8c17c9fffa71b524c70dc
Author: Mingyu Chen <morning...@163.com>
AuthorDate: Tue Apr 30 23:58:03 2024 +0800

    [opt](file-scanner) print current path when encountering error (#34365)
    
    Like this:
    ```
    mysql> select * from text_deflate;
    ERROR 1105 (HY000): errCode = 2, detailMessage = 
(172.21.0.101)[CANCELLED][INTERNAL_ERROR]cur path: 
hdfs://ns/usr/hive/warehouse/yytest.db/text_deflate/test2.snappy. Compressed 
file has been truncated, which is not allowed
    ```
---
 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 4763c863bec..64d8f85560c 100644
--- a/be/src/vec/exec/scan/vfile_scanner.cpp
+++ b/be/src/vec/exec/scan/vfile_scanner.cpp
@@ -290,6 +290,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
@@ -309,7 +318,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 {
         RETURN_IF_CANCELLED(state);
         if (_cur_reader == nullptr || _cur_reader_eof) {
diff --git a/be/src/vec/exec/scan/vfile_scanner.h 
b/be/src/vec/exec/scan/vfile_scanner.h
index 60a72c3a701..bdaefc595e3 100644
--- a/be/src/vec/exec/scan/vfile_scanner.h
+++ b/be/src/vec/exec/scan/vfile_scanner.h
@@ -88,6 +88,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