Skip to content

[FLINK-35963][table] Add REGEXP_SUBSTR function#25146

Closed
dylanhz wants to merge 1 commit into
apache:masterfrom
dylanhz:FLINK-35963
Closed

[FLINK-35963][table] Add REGEXP_SUBSTR function#25146
dylanhz wants to merge 1 commit into
apache:masterfrom
dylanhz:FLINK-35963

Conversation

@dylanhz

@dylanhz dylanhz commented Aug 2, 2024

Copy link
Copy Markdown
Contributor

What is the purpose of the change

Add REGEXP_SUBSTR function.
Examples:

> SELECT REGEXP_SUBSTR('Steven Jones and Stephen Smith are the best players', 'Ste(v|ph)en');
 Steven
> SELECT REGEXP_SUBSTR('Mary had a little lamb', 'Ste(v|ph)en');
 NULL

Brief change log

FLINK-35963

Verifying this change

RegexpFunctionsITCase#regexpSubstrTestCases

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): (yes)
  • 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

flinkbot commented Aug 2, 2024

Copy link
Copy Markdown
Collaborator

CI report:

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

@luotianyou349

Copy link
Copy Markdown

Wow!

Comment on lines +39 to +45
private static final ThreadLocalCache<String, Pattern> REGEXP_PATTERN_CACHE =
new ThreadLocalCache<String, Pattern>() {
@Override
public Pattern getNewInstance(String key) {
return Pattern.compile(key);
}
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Share cache among all regexp functions.

@dylanhz dylanhz closed this Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants