diff --git a/cpp/src/arrow/filesystem/hdfs.cc b/cpp/src/arrow/filesystem/hdfs.cc index d59b2a342d72..adb8b0d50d36 100644 --- a/cpp/src/arrow/filesystem/hdfs.cc +++ b/cpp/src/arrow/filesystem/hdfs.cc @@ -363,8 +363,14 @@ Result HdfsOptions::FromUri(const Uri& uri) { options_map.emplace(kv.first, kv.second); } + // Special case host = "default" or "hdfs://default" as stated by GH-47560. + // If given the string "default", libhdfs selects the default filesystem + // from `core-site.xml`. std::string host; - host = uri.scheme() + "://" + uri.host(); + if (uri.host() == "default") + host = uri.host(); + else + host = uri.scheme() + "://" + uri.host(); // configure endpoint const auto port = uri.port();