Skip to content

Commit 6c43ea5

Browse files
committed
fix useless st
1 parent 44e8c28 commit 6c43ea5

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

be/src/runtime/user_function_cache.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,15 @@ UserFunctionCacheEntry::~UserFunctionCacheEntry() {
112112

113113
// delete library file if should_delete_library is set
114114
if (should_delete_library.load()) {
115+
WARN_IF_ERROR(
116+
io::global_local_filesystem()->delete_directory_or_file(lib_file),
117+
"failed to delete unzipped directory of python udf library, lib_file=" + lib_file);
118+
115119
if (type == LibType::PY_ZIP) {
116120
// For Python UDF, we need to delete both the unzipped directory and the original zip file.
117-
auto st = io::global_local_filesystem()->delete_directory_or_file(lib_file);
118-
119-
st = io::global_local_filesystem()->delete_file(lib_file + ".zip");
120-
121-
if (!st.ok()) [[unlikely]] {
122-
LOG(WARNING) << "failed to delete python udf files, lib_file=" << lib_file << ": "
123-
<< st.to_string();
124-
}
125-
126-
} else {
127-
unlink(lib_file.c_str());
121+
std::string zip_file = lib_file + ".zip";
122+
WARN_IF_ERROR(io::global_local_filesystem()->delete_directory_or_file(zip_file),
123+
"failed to delete zip file of python udf library, lib_file=" + zip_file);
128124
}
129125
}
130126
}

0 commit comments

Comments
 (0)