[ 
https://issues.apache.org/jira/browse/HIVE-13063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15166622#comment-15166622
 ] 

Jason Dere commented on HIVE-13063:
-----------------------------------

So Hive already has regexp_replace(), is there a need for a replace() function?

As for CHAR(), it looks like this can also work, but it is not at all 
intuitive. Hive could probably use a function for this.
decode(unhex(hex(ascii('a'))), 'US-ASCII');

Looks like almost half of the Hive unit tests failed .. I wonder if it might be 
related to the use of char() as the function name rather than chr(). We'll need 
to look into the failures, unfortunately the testReport is already gone from 
the precommit tests.

> Create UDFs for CHAR and REPLACE 
> ---------------------------------
>
>                 Key: HIVE-13063
>                 URL: https://issues.apache.org/jira/browse/HIVE-13063
>             Project: Hive
>          Issue Type: Improvement
>          Components: HiveServer2
>    Affects Versions: 1.2.0
>            Reporter: Alejandro Fernandez
>            Assignee: Alejandro Fernandez
>             Fix For: 2.1.0
>
>         Attachments: HIVE-13063.master.patch, Screen Shot 2016-02-17 at 
> 7.20.57 PM.png, Screen Shot 2016-02-17 at 7.21.07 PM.png
>
>
> Create UDFS for these functions.
> CHAR: convert n where n : [0, 256) into the ascii equivalent as a varchar. If 
> n is less than 0 or greater than 255, return the empty string. If n is 0, 
> return null.
> REPLACE: replace all substrings of 'str' that match 'search' with 'rep'.
> Example. SELECT REPLACE('Hack and Hue', 'H', 'BL');
> Equals 'BLack and BLue'"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to