Myracle opened a new pull request, #27577:
URL: https://github.com/apache/flink/pull/27577

   ## What is the purpose of the change
   
   This pull request adds a new built-in function `REGEXP_SPLIT` to Flink SQL 
and Table API, which splits a string by a regular expression pattern and 
returns an array of substrings. This function is commonly available in other 
SQL engines (e.g., Spark, Presto, Hive) and provides users with more powerful 
string manipulation capabilities using regex patterns.
   
   ## Brief change log
   
   - Added `REGEXP_SPLIT` function definition in `BuiltInFunctionDefinitions` 
with proper input/output type strategies
   - Implemented `RegexpSplitFunction` as a scalar function with regex pattern 
caching for performance optimization
   - Added `regexpSplit()` method to `BaseExpressions` for Table API support
   - Added comprehensive test cases in `RegexpFunctionsITCase` covering various 
scenarios including null handling, empty regex, invalid regex patterns, and 
edge cases
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - Added integration tests in `RegexpFunctionsITCase` that cover:
     - Basic regex split functionality (e.g., splitting by digit patterns 
`[0-9]+`)
     - Null input handling (both null string and null pattern)
     - Empty regex pattern (split by each character)
     - Multi-character delimiter regex patterns (e.g., `[,;|]`)
     - Whitespace regex patterns (e.g., `\\s+`)
     - No match scenarios (returns original string as single-element array)
     - Invalid regex pattern handling (returns null)
     - Input validation errors for non-string type inputs
     - SQL signature validation errors
   
   ## 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** (`BaseExpressions` is `@PublicEvolving`, added 
`regexpSplit()` method)
   - The serializers: **no**
   - The runtime per-record code paths (performance sensitive): **no** (new 
function only, with pattern caching for optimization)
   - 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? **JavaDocs** (function usage 
examples are documented in `RegexpSplitFunction` class JavaDoc)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to