how to replace characters in hive?

后端 未结 5 1124
-上瘾入骨i
-上瘾入骨i 2020-12-05 13:56

I have a string column description in a hive table which may contain tab characters \'\\t\', these characters are however messing some views when c

5条回答
  •  -上瘾入骨i
    2020-12-05 14:37

    regexp_replace UDF performs my task. Below is the definition and usage from apache Wiki.

    regexp_replace(string INITIAL_STRING, string PATTERN, string REPLACEMENT):
    

    This returns the string resulting from replacing all substrings in INITIAL_STRING that match the java regular expression syntax defined in PATTERN with instances of REPLACEMENT,

    e.g.: regexp_replace("foobar", "oo|ar", "") returns fb

提交回复
热议问题