haruki-830 opened a new pull request, #4491:
URL: https://github.com/apache/flink-cdc/pull/4491

   #### Summary
   
   This commit adds support for five additional Flink SQL regular expression 
functions in YAML Transform: `REGEXP_EXTRACT`, `REGEXP_EXTRACT_ALL`, 
`REGEXP_COUNT`, `REGEXP_INSTR`, and `REGEXP_SUBSTR`.
   
   The functions use Java regular expression syntax and align with Flink SQL 
semantics for NULL values, invalid patterns, capture groups, and no-match cases.
   
   #### Key Changes
   
   1. Additional Regular Expression Functions
   - Added implementations for the five missing regular expression functions.
   - Supports capture group indexes in `REGEXP_EXTRACT` and 
`REGEXP_EXTRACT_ALL`.
   - Uses the expected no-match behavior:
     - `REGEXP_EXTRACT` and `REGEXP_SUBSTR` return NULL.
     - `REGEXP_EXTRACT_ALL` returns an empty array.
     - `REGEXP_COUNT` and `REGEXP_INSTR` return 0.
   - Invalid regular expressions and invalid capture group indexes return NULL.
   
   2. YAML Transform Integration
   - Registered the new functions in the Transform SQL operator table.
   - Added return type inference for `ARRAY<STRING>` from `REGEXP_EXTRACT_ALL`.
   - Verified that `REGEXP_EXTRACT_ALL` works correctly in YAML Transform 
projections.
   - Existing `REGEXP_REPLACE` behavior remains unchanged.
   
   3. Test Coverage
   - Added unit tests covering NULL arguments, invalid patterns, no matches, 
capture groups, and invalid group indexes.
   - Added parser tests for function registration and expression translation.
   - Added projection tests covering the runtime conversion of 
`REGEXP_EXTRACT_ALL` results.
   
   4. Documentation
   - Documented the five new functions in both English and Chinese Transform 
documentation.
   
   #### JIRA Reference
   
   [https://issues.apache.org/jira/browse/FLINK-40239](url)


-- 
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