From 2e5f9813d68f7cd5769ae1b0ac6912912dc5d053 Mon Sep 17 00:00:00 2001 From: Socrates Date: Thu, 29 Jan 2026 20:57:13 +0800 Subject: [PATCH 1/2] Guard HDFS init when Java support disabled --- be/src/io/fs/hdfs/hdfs_mgr.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/be/src/io/fs/hdfs/hdfs_mgr.cpp b/be/src/io/fs/hdfs/hdfs_mgr.cpp index e9b4315507c685..efada84810e108 100644 --- a/be/src/io/fs/hdfs/hdfs_mgr.cpp +++ b/be/src/io/fs/hdfs/hdfs_mgr.cpp @@ -23,6 +23,7 @@ #include #include +#include "common/config.h" #include "common/kerberos/kerberos_ticket_mgr.h" #include "common/logging.h" #include "io/fs/err_utils.h" @@ -126,6 +127,13 @@ void HdfsMgr::_cleanup_loop() { Status HdfsMgr::get_or_create_fs(const THdfsParams& hdfs_params, const std::string& fs_name, std::shared_ptr* fs_handler) { +#ifdef USE_HADOOP_HDFS + if (!config::enable_java_support) { + return Status::InternalError( + "hdfs file system is not enabled, you can change be config enable_java_support to " + "true."); + } +#endif uint64_t hash_code = _hdfs_hash_code(hdfs_params, fs_name); // First check without lock From a142e6d6c180b971fb85167fcd41de37b389a178 Mon Sep 17 00:00:00 2001 From: Socrates Date: Thu, 29 Jan 2026 21:27:17 +0800 Subject: [PATCH 2/2] Use InvalidArgument for disabled Java support --- be/src/io/fs/hdfs/hdfs_mgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/io/fs/hdfs/hdfs_mgr.cpp b/be/src/io/fs/hdfs/hdfs_mgr.cpp index efada84810e108..73228a35622b6b 100644 --- a/be/src/io/fs/hdfs/hdfs_mgr.cpp +++ b/be/src/io/fs/hdfs/hdfs_mgr.cpp @@ -129,7 +129,7 @@ Status HdfsMgr::get_or_create_fs(const THdfsParams& hdfs_params, const std::stri std::shared_ptr* fs_handler) { #ifdef USE_HADOOP_HDFS if (!config::enable_java_support) { - return Status::InternalError( + return Status::InvalidArgument( "hdfs file system is not enabled, you can change be config enable_java_support to " "true."); }