Skip to content
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

refactor: Move some logic from URLFunctions.h to URIParser #11761

Closed

Conversation

kevinwilfong
Copy link
Contributor

Summary:
There's some UDFs outside of prestosql's URL functions where I'd like to reuse some of the logic I
wrote for handling URIs.

Specifically:

  • tryConsumeIPV6Address: this is generally useful for parsing IPv6 addresses
  • isMultipleInvalidSequences: this is generally useful for determining how many valid subsequences
    make up an invalid code point from tryGetUtf8CharLength.
  • extractParameter: this is generally useful for extracting the parameter from a URI's query string

This change moves those functions into URIParser where they can be reused.

Differential Revision: D66832201

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 5, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D66832201

Copy link

netlify bot commented Dec 5, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 920d11a
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/6753835334746c0008d0e691

kevinwilfong pushed a commit to kevinwilfong/velox that referenced this pull request Dec 6, 2024
…ncubator#11761)

Summary:

There's some UDFs outside of prestosql's URL functions where I'd like to reuse some of the logic I
wrote for handling URIs.

Specifically:
* tryConsumeIPV6Address: this is generally useful for parsing IPv6 addresses  
* isMultipleInvalidSequences: this is generally useful for determining how many valid subsequences
  make up an invalid code point from tryGetUtf8CharLength.
* extractParameter: this is generally useful for extracting the parameter from a URI's query string

This change moves those functions into URIParser where they can be reused.

Reviewed By: kgpai, yuandagits

Differential Revision: D66832201
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D66832201

Kevin Wilfong added 2 commits December 6, 2024 15:05
…ebookincubator#11782)

Summary:

When an IPv6 address in a URI does not end with a closing ']' and this happens at the end of the
string, the parser will enter an infinite loop.

The fix is to break out of the loop when we realize we're at the end of the string. 
tryConsumeIPV6Address is not responsible for consume the closing ']' so the caller will realize the 
issue when it attempts to consume it (this is already handled properly there).

Differential Revision: D66904149
…ncubator#11761)

Summary:

There's some UDFs outside of prestosql's URL functions where I'd like to reuse some of the logic I
wrote for handling URIs.

Specifically:
* tryConsumeIPV6Address: this is generally useful for parsing IPv6 addresses  
* isMultipleInvalidSequences: this is generally useful for determining how many valid subsequences
  make up an invalid code point from tryGetUtf8CharLength.
* extractParameter: this is generally useful for extracting the parameter from a URI's query string

This change moves those functions into URIParser where they can be reused.

Reviewed By: kgpai, yuandagits

Differential Revision: D66832201
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D66832201

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 1b5d3db.

athmaja-n pushed a commit to athmaja-n/velox that referenced this pull request Jan 10, 2025
…ncubator#11761)

Summary:
Pull Request resolved: facebookincubator#11761

There's some UDFs outside of prestosql's URL functions where I'd like to reuse some of the logic I
wrote for handling URIs.

Specifically:
* tryConsumeIPV6Address: this is generally useful for parsing IPv6 addresses
* isMultipleInvalidSequences: this is generally useful for determining how many valid subsequences
  make up an invalid code point from tryGetUtf8CharLength.
* extractParameter: this is generally useful for extracting the parameter from a URI's query string

This change moves those functions into URIParser where they can be reused.

Reviewed By: kgpai, yuandagits

Differential Revision: D66832201

fbshipit-source-id: bf10289b49ac3b0abd572f2b5a985b7758f4bee4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants