diff --git a/be/src/io/fs/hdfs_file_writer.cpp b/be/src/io/fs/hdfs_file_writer.cpp index 40c3c59dcd..fe68d1363d 100644 --- a/be/src/io/fs/hdfs_file_writer.cpp +++ b/be/src/io/fs/hdfs_file_writer.cpp @@ -64,8 +64,15 @@ Status HdfsFileWriter::close() { LOG(WARNING) << ss.str(); return Status::InternalError(ss.str()); } - hdfsCloseFile(_hdfs_fs->_fs_handle->hdfs_fs, _hdfs_file); + + result = hdfsCloseFile(_hdfs_fs->_fs_handle->hdfs_fs, _hdfs_file); _hdfs_file = nullptr; + if (result != 0) { + std::string err_msg = hdfs_error(); + return Status::InternalError( + "Write hdfs file failed. (BE: {}) namenode:{}, path:{}, err: {}", + BackendOptions::get_localhost(), _hdfs_fs->_fs_name, _path.string(), err_msg); + } return Status::OK(); }