cgivre opened a new pull request, #2762:
URL: https://github.com/apache/drill/pull/2762

   # [DRILL-8402](https://issues.apache.org/jira/browse/DRILL-8402): Add 
REGEXP_EXTRACT Function
   
   ## Description
   Adds `regexp_extract` functions to Drill.
   
   ## Documentation
   This PR adds support for `regexp_extract(<text>, <pattern>)` which returns 
an array of text corresponding with the capturing groups in the regex.  It also 
includes `regexp_extract(<text>, <pattern>, <index>)` which returns the text of 
a specific capturing group.
   
   ```sql
   SELECT regexp_extract('123-456-789', '([0-9]{3})-([0-9]{3})-([0-9]{3})');
   +---------------------+
   |       EXPR$0        |
   +---------------------+
   | ["123","456","789"] |
   +---------------------+
   
   SELECT regexp_extract('123-456-789', '([0-9]{3})-([0-9]{3})-([0-9]{3})', 0);
   +-------------+
   |   EXPR$0    |
   +-------------+
   | 123-456-789 |
   +-------------+
   
   SELECT regexp_extract('123-456-789', '([0-9]{3})-([0-9]{3})-([0-9]{3})', 3);
   +--------+
   | EXPR$0 |
   +--------+
   | 789    |
   +--------+
   ```
   
   
   ## Testing
   Added unit tests.
   


-- 
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: dev-unsubscr...@drill.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to