Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-7841: [C++] Use ${HADOOP_HOME}/lib/native/ to find libhdfs.so again #6424

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion cpp/src/arrow/io/hdfs_internal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ void AppendEnvVarFilename(const char* var_name,
}
}

void AppendEnvVarFilename(const char* var_name, const char* suffix,
std::vector<PlatformFilename>* filenames) {
auto maybe_env_var = GetEnvVarNative(var_name);
if (maybe_env_var.ok()) {
auto maybe_env_var_with_suffix =
PlatformFilename(std::move(*maybe_env_var)).Join(suffix);
if (maybe_env_var_with_suffix.ok()) {
filenames->emplace_back(std::move(*maybe_env_var_with_suffix));
}
}
}

void InsertEnvVarFilename(const char* var_name,
std::vector<PlatformFilename>* filenames) {
auto maybe_env_var = GetEnvVarNative(var_name);
Expand All @@ -142,7 +154,7 @@ Result<std::vector<PlatformFilename>> get_potential_libhdfs_paths() {
ARROW_ASSIGN_OR_RAISE(auto search_paths, MakeFilenameVector({"", "."}));

// Path from environment variable
AppendEnvVarFilename("HADOOP_HOME", &search_paths);
AppendEnvVarFilename("HADOOP_HOME", "lib/native", &search_paths);
AppendEnvVarFilename("ARROW_LIBHDFS_DIR", &search_paths);

// All paths with file name
Expand Down