flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-26939][Table SQL/API] Add TRANSLATE supported in SQL & Table API

Open zzzzzzzs opened this issue 2 years ago • 4 comments

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)

zzzzzzzs avatar Jul 22 '22 08:07 zzzzzzzs

CI report:

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

flinkbot avatar Jul 22 '22 08:07 flinkbot

@flinkbot run azure

zzzzzzzs avatar Jul 23 '22 05:07 zzzzzzzs

@snuyanzin Could you please help to review this PR in your free time? Thanks.

zzzzzzzs avatar Mar 31 '23 09:03 zzzzzzzs