diff --git a/be/src/vec/exec/format/orc/vorc_reader.cpp b/be/src/vec/exec/format/orc/vorc_reader.cpp index 9c016a4565e4e8..e2ba3a57be8c9a 100644 --- a/be/src/vec/exec/format/orc/vorc_reader.cpp +++ b/be/src/vec/exec/format/orc/vorc_reader.cpp @@ -261,7 +261,9 @@ Status OrcReader::_create_file_reader() { if (_io_ctx && _io_ctx->should_stop && _err_msg == "stop") { return Status::EndOfFile("stop"); } - if (_err_msg.find("No such file or directory") != std::string::npos) { + // one for fs, the other is for oss. + if (_err_msg.find("No such file or directory") != std::string::npos || + _err_msg.find("NoSuchKey") != std::string::npos) { return Status::NotFound(_err_msg); } return Status::InternalError("Init OrcReader failed. reason = {}", _err_msg); diff --git a/be/src/vec/exec/scan/vfile_scanner.cpp b/be/src/vec/exec/scan/vfile_scanner.cpp index 3ef07c50b64b3d..e066905895e6a2 100644 --- a/be/src/vec/exec/scan/vfile_scanner.cpp +++ b/be/src/vec/exec/scan/vfile_scanner.cpp @@ -939,13 +939,19 @@ Status VFileScanner::_get_next_reader() { } COUNTER_UPDATE(_file_counter, 1); - if (init_status.is() || init_status.is()) { - // The VFileScanner for external table may try to open not exist files, - // Because FE file cache for external table may out of date. - // So, NOT_FOUND for VFileScanner is not a fail case. - // Will remove this after file reader refactor. + // The VFileScanner for external table may try to open not exist files, + // Because FE file cache for external table may out of date. + // So, NOT_FOUND for VFileScanner is not a fail case. + // Will remove this after file reader refactor. + if (init_status.is()) { COUNTER_UPDATE(_empty_file_counter, 1); continue; + } else if (init_status.is()) { + if (config::ignore_not_found_file_in_external_table) { + COUNTER_UPDATE(_not_found_file_counter, 1); + continue; + } + return Status::InternalError("failed to find reader, err: {}", init_status.to_string()); } else if (!init_status.ok()) { return Status::InternalError("failed to init reader, err: {}", init_status.to_string()); }