You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "dsevilla (via GitHub)" <gi...@apache.org> on 2025/08/29 00:16:51 UTC
[PR] Fix host handling for default HDFS URI (fix for #25324 when used via `from_uri()`) [arrow]
dsevilla opened a new pull request, #47458:
URL: https://github.com/apache/arrow/pull/47458
In #25324 a fix is introduced for the python HadoopFileSystem, but it does not work if you use `from_uri()`, as it is passed to the underlying C++ implementation of the options parsing. The "default" case is not handled as in the python case, as the whole "hdfs://default" is passed to the underlying hdfs library, that expect "default" to search in $HADOOP_CONF_DIR/core-site.xml.
Thanks for opening a pull request!
Please remove this line and the above text before creating your pull request.
### Rationale for this change
In #25324 a fix is introduced for the python HadoopFileSystem, but it does not work if you use `from_uri()`, as it is passed to the underlying C++ implementation of the options parsing. The "default" case is not handled as in the python case, as the whole "hdfs://default" is passed to the underlying hdfs library, that expect "default" to search in $HADOOP_CONF_DIR/core-site.xml.
### What changes are included in this PR?
Handle the `HadoopFileSystem.from_uri()` (or `FileSystem.from_uri()` when using `hdfs://default:xxx` special HDFS URIs.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
Not exactly, but the documentation is honored for the `from_uri()` case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47560: [C++] Fix host handling for default HDFS URI [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou merged PR #47458:
URL: https://github.com/apache/arrow/pull/47458
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [C++] Fix host handling for default HDFS URI [arrow]
Posted by "dsevilla (via GitHub)" <gi...@apache.org>.
dsevilla commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3323277265
OK, the tests pass all except for a timeout in the azure connection (lasted for 56 minutes).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [C++] Fix host handling for default HDFS URI [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3307074579
I'm not sure we need to test this specifically. OTOH, the hdfs Crossbow-based CI jobs should not regress.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix host handling for default HDFS URI (fix for #25324 and #47560 when used via `from_uri()`) [arrow]
Posted by "AlenkaF (via GitHub)" <gi...@apache.org>.
AlenkaF commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3306654441
Thank you for proposing a fix!
In principle the change looks ok to me. The comment did confuse me a bit (`Special case host = "default" or "hdfs://default" as stated by #25324.`). If I understand correctly this change is only dealing with host being `default` and not `hdfs://default` also?
I am not sure how to go about testing this. cc @pitrou
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [C++] Fix host handling for default HDFS URI [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3323021633
@github-actions crossbow submit *hdfs*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47560: [C++] Fix host handling for default HDFS URI [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3324403963
:warning: GitHub issue #47560 **has been automatically assigned in GitHub** to PR creator.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix host handling for default HDFS URI (fix for #25324 when used via `from_uri()`) [arrow]
Posted by "dsevilla (via GitHub)" <gi...@apache.org>.
dsevilla commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3288777956
I added a new issue. Now this pull request fixes #47560.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47560: [C++] Fix host handling for default HDFS URI [arrow]
Posted by "dsevilla (via GitHub)" <gi...@apache.org>.
dsevilla commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3324615706
Ouch. Comment length exceeded that expected by the linter :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix host handling for default HDFS URI (fix for #25324 when used via `from_uri()`) [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3235321609
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
Thanks for opening a pull request!
If this is not a [minor PR](https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
Opening GitHub issues ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
Then could you also rename the pull request title in the following format?
GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
or
MINOR: [${COMPONENT}] ${SUMMARY}
See also:
* [Other pull requests](https://github.com/apache/arrow/pulls/)
* [Contribution Guidelines - Contributing Overview](https://arrow.apache.org/docs/developers/overview.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47560: [C++] Fix host handling for default HDFS URI [arrow]
Posted by "dsevilla (via GitHub)" <gi...@apache.org>.
dsevilla commented on code in PR #47458:
URL: https://github.com/apache/arrow/pull/47458#discussion_r2372740870
##########
cpp/src/arrow/filesystem/hdfs.cc:
##########
@@ -363,8 +363,12 @@ Result<HdfsOptions> HdfsOptions::FromUri(const Uri& uri) {
options_map.emplace(kv.first, kv.second);
}
+ // Special case host = "default" or "hdfs://default" as stated by #25324.
Review Comment:
Perfect. I added it to the PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47560: [C++] Fix host handling for default HDFS URI [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on code in PR #47458:
URL: https://github.com/apache/arrow/pull/47458#discussion_r2372629579
##########
cpp/src/arrow/filesystem/hdfs.cc:
##########
@@ -363,8 +363,12 @@ Result<HdfsOptions> HdfsOptions::FromUri(const Uri& uri) {
options_map.emplace(kv.first, kv.second);
}
+ // Special case host = "default" or "hdfs://default" as stated by #25324.
Review Comment:
Let's make the comment more explanator.
```suggestion
// 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`.
```
##########
cpp/src/arrow/filesystem/hdfs.cc:
##########
@@ -363,8 +363,12 @@ Result<HdfsOptions> HdfsOptions::FromUri(const Uri& uri) {
options_map.emplace(kv.first, kv.second);
}
+ // Special case host = "default" or "hdfs://default" as stated by #25324.
Review Comment:
Let's make the comment more explanatory.
```suggestion
// 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`.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [C++] Fix host handling for default HDFS URI [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3323029173
Revision: 4561d70bf86210ffc4a301e1f82ec09a3e633e35
Submitted crossbow builds: [ursacomputing/crossbow @ actions-2f87af1fda](https://github.com/ursacomputing/crossbow/branches/all?query=actions-2f87af1fda)
|Task|Status|
|----|------|
|test-conda-python-3.10-hdfs-2.9.2|[](https://github.com/ursacomputing/crossbow/actions/runs/17940844175/job/51016903894)|
|test-conda-python-3.10-hdfs-3.2.1|[](https://github.com/ursacomputing/crossbow/actions/runs/17940844176/job/51016903992)|
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix host handling for default HDFS URI (fix for #25324 when used via `from_uri()`) [arrow]
Posted by "dsevilla (via GitHub)" <gi...@apache.org>.
dsevilla commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3288755660
Any work on this? It is not working the "default" value of HDFS host if used in `from_uri()`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47560: [C++] Fix host handling for default HDFS URI [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3325866955
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 71293212f2006d6b224fa7d0658c1f6d51689b83.
There was 1 benchmark result indicating a performance regression:
- Commit Run on `amd64-m5-4xlarge-linux` at [2025-09-23 19:12:54Z](https://conbench.ursa.dev/compare/runs/3b50060b5a3e40f38da1ebb6d1fb268a...8d7dc34f5410479f8f0c20eef9fb8487/)
- [`partitioned-dataset-filter` (R) with dataset=dataset-taxi-parquet, language=R, query=vignette](https://conbench.ursa.dev/compare/benchmarks/068d262d9fca765d800011edfd133316...068d30d0445f72118000544a352505d2)
The [full Conbench report](https://github.com/apache/arrow/runs/51085825099) has more details. It also includes information about 1 possible false positive for unstable benchmarks that are known to sometimes produce them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [C++] Fix host handling for default HDFS URI [arrow]
Posted by "dsevilla (via GitHub)" <gi...@apache.org>.
dsevilla commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3307046484
Hello!
> Thank you for proposing a fix! In principle the change looks ok to me. The comment did confuse me a bit (`Special case host = "default" or "hdfs://default" as stated by #25324.`). If I understand correctly this change is only dealing with host being `default` and not `hdfs://default` also?
>
I think the logic goes like this:
- If the URI is `hdfs://default:0/...`, then, `uri.host()` is "default", and `uri.scheme()` is `hdfs`.
- If the URI is `default:0/...`, then again `uri.host()` is still "default", but `uri.scheme()` is empty.
Then, in either case, I leave the variable `host` (that will hold the host plus optional scheme and will be passed down to the library) as just `"default"`. This way libhdfs will see just `default:0/...`.
If the host is not "default" in any case, the old behaviour (scheme://host:porg) is maintained.
> I am not sure how to go about testing this. cc @pitrou
I am not sure, either. I will investigate, but I remember a test for `HadoopFileSystem` using "default" as a host (that works as per the other previous patch). It can be added there. I'll search for it ASAP.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47560: [C++] Fix host handling for default HDFS URI [arrow]
Posted by "pitrou (via GitHub)" <gi...@apache.org>.
pitrou commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3324831607
CI failures are unrelated, will merge.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [C++] Fix host handling for default HDFS URI [arrow]
Posted by "dsevilla (via GitHub)" <gi...@apache.org>.
dsevilla commented on PR #47458:
URL: https://github.com/apache/arrow/pull/47458#issuecomment-3322983257
@pitrou I've synched the branch just in case that precise moment the tests were failing. We'll see because as I said, the changes are so small that should not affect any CI build.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org