fix(spark): align parse_url empty FILE path#21969
Open
kumarUjjawal wants to merge 2 commits intoapache:mainfrom
Open
fix(spark): align parse_url empty FILE path#21969kumarUjjawal wants to merge 2 commits intoapache:mainfrom
kumarUjjawal wants to merge 2 commits intoapache:mainfrom
Conversation
Contributor
Author
|
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Which issue does this PR close?
Rationale for this change
parse_urlin the Spark function library did not match Spark for some empty path URL cases. In particular, absolute URLs with no explicit path were treated as if they had/because the URL parser normalizes the path.Also handles
parse_url(..., 'PATH')now returns/for an explicit root path likehttp://example.com/.parse_url(..., 'QUERY', key)now returns the raw query value, so percent-encoded values likex%20yare not decoded tox y.What changes are included in this PR?
This PR keeps the existing URL parser, but adjusts
FILEextraction so parser-normalized/is treated as empty only when the original URL had no path after the authority.It also adds regression coverage for
parse_urlandtry_parse_url, including the boundary between a missing path and an explicit root path.Are these changes tested?
Yes
Are there any user-facing changes?
parse_urlandtry_parse_urlnow match Spark more closely for empty path FILE results. There is no public API change.