flink
flink copied to clipboard
[FLINK-26939][Table SQL/API] Add TRANSLATE supported in SQL & Table API
What is the purpose of the change
Add translate(expr, from, to)
SQL function.
Examples:
> SELECT translate('AaBbCc', 'abc', '123');
A1B2C3
> SELECT translate('AaBbCc', 'abc', '1');
A1BC
> SELECT translate('AaBbCc', 'abc', '');
ABC
Brief change log
- Add translate method to SqlFunctionUtils.java
- Add related expression, convert rule, and code gen.
Verifying this change
This change is already covered by existing tests, such as ScalarFunctionsTest#testTranslate.
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)
CI report:
- 623ef1791ef16a72ec1a69f2df638190300985e0 Azure: FAILURE
Bot commands
The @flinkbot bot supports the following commands:-
@flinkbot run azure
re-run the last Azure build
@flinkbot run azure
@snuyanzin Could you please help to review this PR in your free time? Thanks.