-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fixed the handling of empty directories in TrinoHudiStorage. #26897
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
base: master
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR refactors TrinoHudiStorage’s listing methods to conform with Hudi’s API: it now explicitly checks for path existence before listing and returns empty collections for empty directories, only throwing errors when the path is truly missing. Class diagram for updated TrinoHudiStorage listing methodsclassDiagram
class TrinoHudiStorage {
+boolean createDirectory(StoragePath path)
+List<StoragePathInfo> listDirectEntries(StoragePath path)
+List<StoragePathInfo> listDirectEntries(StoragePath path, StoragePathFilter filter)
+List<StoragePathInfo> listFiles(StoragePath path)
}
TrinoHudiStorage --> FileSystem : uses
TrinoHudiStorage --> FileIterator : uses
TrinoHudiStorage --> StoragePathInfo : returns
TrinoHudiStorage --> StoragePath : parameter
TrinoHudiStorage --> StoragePathFilter : parameter (filtered listing)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We failed to fetch pull request #26897.
You can try again by commenting this pull request with @sourcery-ai review
, or contact us for help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test?
Please follow our commit message guideline: https://trino.io/development/process.html#pull-request-and-commit-guidelines-
|
Description
The current implementation throws an error for empty directories, which does not conform to the specifications defined here and here.
With this change, it returns an empty list if the directory is empty and throws an error only if the directory does not exist.
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text: