-
Notifications
You must be signed in to change notification settings - Fork 709
[#7190] fix(catalogs): Validate and filter empty storageLocations in HadoopCatalogOperations #7238
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5cde221
fix: solve NPE at HadoopCatalogOperations
KyleLin0927 4e329a3
improvement: modify web UI default-location-name input rule
KyleLin0927 93302cc
test: add unit test
KyleLin0927 503b659
fix: modify validation logic
KyleLin0927 ed4c882
Revert "improvement: modify web UI default-location-name input rule"
KyleLin0927 84cb6ca
refactor the logic
KyleLin0927 6fa394a
modify the test
KyleLin0927 70452d3
add tests
KyleLin0927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
only need to change this line to:
if (schemaPaths.isEmpty() && (storageLocations.isEmpty() || storageLocations.values().stream().allMatch(StringUtils::isBlank)))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.
Thanks for suggestion. I applied this change, but during testing, I encountered a NullPointerException when the input storageLocations map contained a mix of valid values and blank/null values.
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.
NPE from where?
Uh oh!
There was an error while loading. Please reload this page.
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.
You may refer to the unit test I added in this PR (TestHadoopCatalogOperations.java line 1559) If I only use
if (schemaPaths.isEmpty() && (storageLocations.isEmpty() || storageLocations.values().stream().allMatch(StringUtils::isBlank)))and the storageLocations input contains both a valid entry and a blank value, it will still trigger an NPE in calculateFilesetPaths. If you think this test is not appropriate, I will remove it.
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.
let me think it over.
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.
@KyleLin0927 You can use the code from this commit and complete the tests.
mchades@926f49e