-
Couldn't load subscription status.
- Fork 9.1k
HADOOP-19494: [ABFS] Fix Case Sensitivity Issue for hdi_isfolder metadata #7496
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,22 @@ public Map<String, List<String>> getResponseHeaders() { | |
| return connection.getHeaderFields(); | ||
| } | ||
|
|
||
| /**{@inheritDoc}*/ | ||
| @Override | ||
| public String getResponseHeaderIgnoreCase(final String headerName) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If both the children are using the same method implementation, same can be added in parent itself if it won't change in future for other children if added There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are three more implementations of AbfsHttpOperation where the implementation is different. Thats the reason I have implemented it separately for all. |
||
| Map<String, List<String>> responseHeaders = getResponseHeaders(); | ||
| if (responseHeaders == null || responseHeaders.isEmpty()) { | ||
| return null; | ||
| } | ||
| // Search for the header value case-insensitively | ||
| return responseHeaders.entrySet().stream() | ||
| .filter(entry -> entry.getKey() != null | ||
| && entry.getKey().equalsIgnoreCase(headerName)) | ||
| .flatMap(entry -> entry.getValue().stream()) | ||
| .findFirst() | ||
| .orElse(null); // Return null if no match is found | ||
| } | ||
|
|
||
| /**{@inheritDoc}*/ | ||
| public void sendPayload(byte[] buffer, int offset, int length) | ||
| throws IOException { | ||
|
|
||
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.
Yes since we already checked for null in the getHeaderNameIgnoreCase method, this repeated check may not be needed
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.
Since it was an existing line of code, I didn’t change it. However, it does make sense to remove this null check.