suneet-s opened a new pull request #10043:
URL: https://github.com/apache/druid/pull/10043


   ### Description
   
   This function is similar to `regexp_replace` functions offered by other 
databases like
   postgres and oracle.
   
   This function unlocks a few use-cases
   
   * Name rearrangement
   
   If a column stores the name as first last, but you would prefer the report
   to be displayed as last, first
   
   `SELECT REGEXP_REPLACE('John Doe','(.*) (.*)','$2, $1');`
   
   * String removal
   
   If you'd prefer to replace a string that matches a pattern - for example
   email addresses that might be in a text column, you can replace the pattern
   with generic text so that queries don't accidentally leak data.
   
   `SELECT DISTINCT REGEXP_REPLACE(diffUrl, 'diff=\d*', 'diff=****'`) from 
wikipedia`
   
   This PR has:
   - [ ] been self-reviewed.
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked 
related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in 
[licenses.yaml](https://github.com/apache/druid/blob/master/licenses.yaml)
   - [ ] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [ ] added unit tests or modified existing tests to cover new code paths, 
ensuring the threshold for [code 
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
 is met.
   - [ ] added integration tests.
   - [x] been tested in a test Druid cluster.
   


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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to