v.23.2New Feature
Add regexpExtract Function for Compatibility with Spark's REGEXP_EXTRACT
Add new functionregexpExtract, like spark functionREGEXP_EXTRACTfor compatibility. It is similar to the existing functionextract. #46469 (李扬).
Why it matters
This feature provides compatibility with Spark'sREGEXP_EXTRACT function, allowing users to perform regex extraction in a familiar manner. It complements the existing extract function by offering an alternative syntax and behavior for extracting substrings using regular expressions, improving interoperability and user experience for those migrating or integrating with Spark.How to use it
Use theregexpExtract function in your SQL queries by specifying the source string, the regular expression pattern, and the capture group index you want to extract. For example:SELECT regexpExtract(column_name, 'pattern', group_index) FROM table_name;