Skip to content

Commit

Permalink
[Fix](multi-catalog) Not throw exceptions when file not exists for qu…
Browse files Browse the repository at this point in the history
…ery of hms catalog.
  • Loading branch information
王翔宇 committed Jul 24, 2023
1 parent 19ba6be commit 8b23c58
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion be/src/io/fs/file_handle_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ HdfsFileHandle::~HdfsFileHandle() {
Status HdfsFileHandle::init(int64_t file_size) {
_hdfs_file = hdfsOpenFile(_fs, _fname.c_str(), O_RDONLY, 0, 0, 0);
if (_hdfs_file == nullptr) {
return Status::IOError("failed to open {}: {}", _fname, hdfs_error());
std::string _err_msg = hdfs_error();
if (_err_msg.find("No such file or directory") != string::npos) {
return Status::NotFound(_err_msg);
}
return Status::IOError("failed to open {}: {}", _fname, _err_msg);
}

_file_size = file_size;
Expand Down

0 comments on commit 8b23c58

Please sign in to comment.