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

[FLINK-34108][table] Add built-in URL_ENCODE and URL_DECODE function. #24773

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

superdiaodiao
Copy link

@superdiaodiao superdiaodiao commented May 12, 2024

What is the purpose of the change

issue: https://issues.apache.org/jira/browse/FLINK-34108

This is an implementation of URL_ENCODE and URL_DECODE

  1. URL_ENCODE: Translates a string into 'application/x-www-form-urlencoded' format using a specific encoding scheme(UTF-8).
  2. URL_DECODE: Decodes a string in 'application/x-www-form-urlencoded' format using a specific encoding scheme(UTF-8).

Brief change log

  1. URL_ENCODE
  • Syntax:
    url_encode(url)

  • Arguments:
    url: a string represents a URL

  • Returns:
    translates a string into 'application/x-www-form-urlencoded' format using a specific encoding scheme(UTF-8), will be null if input is null or encode failed.

  • Examples:

url = 'https://flink.apache.org/'
SQL: url_encode(url)
TableAPI: url.urlEncode()

output: 'https%3A%2F%2Fflink.apache.org%2F'
  1. URL_DECODE
  • Syntax:
    url_decode(value)

  • Arguments:
    value: a URL encoded

  • Returns:
    decodes a string in 'application/x-www-form-urlencoded' format using a specific encoding scheme(UTF-8), will be null if input is null or decode failed.

  • Examples:

value = 'https%3A%2F%2Fflink.apache.org%2F'
SQL: url_decode(value)
TableAPI: value.urlDecode()

output: 'https://flink.apache.org/'

Verifying this change

  • This change added tests in UrlFunctionITCase.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
  • The serializers: (no)
  • The runtime per-record code paths (performance sensitive): (no)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? (docs)

@flinkbot
Copy link
Collaborator

flinkbot commented May 12, 2024

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@superdiaodiao
Copy link
Author

@flinkbot run azure

@snuyanzin
Copy link
Contributor

Thanks for your contribution @superdiaodiao ,
I left some comments

also ci is failed and i tend to think it is related to your changes in python code, could you please have a look?

@superdiaodiao
Copy link
Author

Thanks for your contribution @superdiaodiao , I left some comments

also ci is failed and i tend to think it is related to your changes in python code, could you please have a look?

Thanks for your review, it helps a lot.
I will continue to check the python part.

@superdiaodiao
Copy link
Author

@flinkbot run azure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants