Removing special characters using Hive

2019-09-06 14:54发布

问题:

I have data stored in Cassandra 1.2 as shown below. There is special character under sValue - highlighted as bold. How can I use hive function to remove this ?

Date | Timestam | payload_Timestamp | actDate | actHour | actMinute | sDesc | sName | sValue ---------------------------------+--------------------------------------+--------------------------+----------------------+----------------------+------------------------+---------------------------+--------------------------------+--------------------- 2014-06-25 00:00:00-0400 | 2014-06-25 08:31:23-0400 | 2014-06-25 08:31:23-0400 | 06-25-2014 | 8 | 31 | lable | /t1/t2/100/200/11/99 | 2743326591.03\x00

回答1:

You can use regexp_replace() function.

More details available on https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF



标签: hive hiveql