how to replace characters in hive?

后端 未结 5 1138
-上瘾入骨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条回答
  •  醉酒成梦
    2020-12-05 14:20

    select translate(description,'\\t','') from myTable;
    

    Translates the input string by replacing the characters present in the from string with the corresponding characters in the to string. This is similar to the translate function in PostgreSQL. If any of the parameters to this UDF are NULL, the result is NULL as well. (Available as of Hive 0.10.0, for string types)

    Char/varchar support added as of Hive 0.14.0

提交回复
热议问题