You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "zinking (via GitHub)" <gi...@apache.org> on 2023/09/13 07:35:48 UTC
[GitHub] [arrow] zinking opened a new pull request, #37690: GH-37626: [Java][Cpp] support using existing java file system
zinking opened a new pull request, #37690:
URL: https://github.com/apache/arrow/pull/37690
<!--
Thanks for opening a pull request!
If this is your first pull request you can find detailed information on how
to contribute here:
* [New Contributor's Guide](https://arrow.apache.org/docs/dev/developers/guide/step_by_step/pr_lifecycle.html#reviews-and-merge-of-the-pull-request)
* [Contributing Overview](https://arrow.apache.org/docs/dev/developers/overview.html)
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}
In the case of PARQUET issues on JIRA the title also supports:
PARQUET-${JIRA_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
-->
### Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
when using the dataset api to repeatedly read chunks of file, FileSystem instances are created every time. causing performance degrade.
### What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
to reuse existing filesystem passed from java context.
### Are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
-->
tested on my local integration. as there seems no end to end dataset testing in the base
### Are there any user-facing changes?
NO
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please uncomment the line below and explain which changes are breaking.
-->
<!-- **This PR includes breaking changes to public APIs.** -->
<!--
Please uncomment the line below (and provide explanation) if the changes fix either (a) a security vulnerability, (b) a bug that caused incorrect or invalid data to be produced, or (c) a bug that causes a crash (even when the API contract is upheld). We use this to highlight fixes to issues that may affect users without their knowledge. For this reason, fixing bugs that cause errors don't count, since those are usually obvious.
-->
<!-- **This PR contains a "Critical Fix".** -->
--
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
[GitHub] [arrow] lidavidm commented on pull request #37690: GH-37626: [Java][Cpp] support using existing java file system
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #37690:
URL: https://github.com/apache/arrow/pull/37690#issuecomment-1717489478
I think what we'd want is to add a FileSystem parameter to FileSystemDatasetFactory::Make or FileSystemFactoryOptions, instead of a global.
--
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
[GitHub] [arrow] lidavidm commented on pull request #37690: GH-37626: [Java][Cpp] support using existing java file system
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #37690:
URL: https://github.com/apache/arrow/pull/37690#issuecomment-1717553465
Ah, sorry. In that case it should be named something less Java-specific and should probably be typed `std::shared_ptr<FileSystem>`? You can use [`PathFromUri`](https://github.com/apache/arrow/blob/4fac528e2ee9c4efce453420275cbaf0b3b6adb0/cpp/src/arrow/filesystem/filesystem.h#L192) to validate that the filesystem is compatible with the given 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
[GitHub] [arrow] lidavidm commented on a diff in pull request #37690: GH-37626: [Java][Cpp] support using existing java file system
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #37690:
URL: https://github.com/apache/arrow/pull/37690#discussion_r1327583560
##########
cpp/src/arrow/dataset/discovery.h:
##########
@@ -192,6 +192,10 @@ struct FileSystemFactoryOptions {
".",
"_",
};
+
+ /// when java context have a file system reference to be used
+ // then use this file system reference in the context
+ std::shared_ptr<void> file_system_java = nullptr;
Review Comment:
I don't think this needs to be Java-specific at all.
This should be `shared_ptr<FileSystem>`.
##########
cpp/src/arrow/dataset/discovery.cc:
##########
@@ -217,7 +217,7 @@ Result<std::shared_ptr<DatasetFactory>> FileSystemDatasetFactory::Make(
// ARROW-12481.
std::string internal_path;
ARROW_ASSIGN_OR_RAISE(std::shared_ptr<fs::FileSystem> filesystem,
- fs::FileSystemFromUri(uri, &internal_path))
+ fs::FileSystemFromUriAndFs(uri, &internal_path, options.file_system_java))
Review Comment:
I think what you would do is, if a filesystem is provided, call FileSystem::PathFromUri to set `internal_path`. If it succeeds, then proceed, else raise an error.
--
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
[GitHub] [arrow] zinking commented on pull request #37690: GH-37626: [Java][Cpp] support using existing java file system
Posted by "zinking (via GitHub)" <gi...@apache.org>.
zinking commented on PR #37690:
URL: https://github.com/apache/arrow/pull/37690#issuecomment-1717506351
> I think what we'd want is to add a FileSystem parameter to FileSystemDatasetFactory::Make or FileSystemFactoryOptions, instead of a global.
hmm, maybe just the naming, it is a field in FileSystemFactoryOptions and then passed down not a global variable.
--
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-37626: [Java][Cpp] support using existing java file system [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37690:
URL: https://github.com/apache/arrow/pull/37690#issuecomment-2501737938
:warning: GitHub issue #37626 **has no components**, please add labels for components.
--
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
[GitHub] [arrow] zinking commented on a diff in pull request #37690: GH-37626: [Java][Cpp] support using existing java file system
Posted by "zinking (via GitHub)" <gi...@apache.org>.
zinking commented on code in PR #37690:
URL: https://github.com/apache/arrow/pull/37690#discussion_r1337071558
##########
cpp/src/arrow/dataset/discovery.cc:
##########
@@ -217,7 +217,7 @@ Result<std::shared_ptr<DatasetFactory>> FileSystemDatasetFactory::Make(
// ARROW-12481.
std::string internal_path;
ARROW_ASSIGN_OR_RAISE(std::shared_ptr<fs::FileSystem> filesystem,
- fs::FileSystemFromUri(uri, &internal_path))
+ fs::FileSystemFromUriAndFs(uri, &internal_path, options.file_system_java))
Review Comment:
sounds correct, will do later
--
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
[GitHub] [arrow] github-actions[bot] commented on pull request #37690: GH-37626: [Java][Cpp] support using existing java file system
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37690:
URL: https://github.com/apache/arrow/pull/37690#issuecomment-1717103641
:warning: GitHub issue #37626 **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] GH-37626: [Java][Cpp] support using existing java file system [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #37690:
URL: https://github.com/apache/arrow/pull/37690#issuecomment-3601517763
Thank you for your contribution. Unfortunately, this pull request has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label or comment below, or this PR will be closed in 14 days. Feel free to re-open this if it has been closed in error. If you do not have repository permissions to reopen the PR, please tag a maintainer.
--
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-37626: [Java][Cpp] support using existing java file system [arrow]
Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic commented on PR #37690:
URL: https://github.com/apache/arrow/pull/37690#issuecomment-3676071079
Closing this now that the Java implementation has moved to: https://github.com/apache/arrow-java
--
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-37626: [Java][Cpp] support using existing java file system [arrow]
Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic closed pull request #37690: GH-37626: [Java][Cpp] support using existing java file system
URL: https://github.com/apache/arrow/pull/37690
--
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