Hive函数用于替换列值中的逗号 [英] Hive function to replace comma in column value

查看:1814
本文介绍了Hive函数用于替换列值中的逗号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有值为12,345的字符串列的配置单元表。有没有什么办法可以在插入这个蜂巢表时删除逗号的hive函数?

> regexp_replace(string INITIAL_STRING,string PATTERN,string REPLACEMENT)这是Hive中的一个函数。

因此,如果您要将包含逗号的表格中的数据移至新表格,您将使用:

插入到表中NEW从old中选择regexp_replace(commaColumn,',','');


I have a hive table which has String column having value as 12,345. Is there any way hive function which can remove comma during insertion in this hive table ?

解决方案

You can use regexp_replace(string INITIAL_STRING, string PATTERN, string REPLACEMENT) which is a function in Hive.

So if you are moving the data from a table that contains the comma to a new table you will use :
insert into table NEW select regexp_replace(commaColumn,',','') from OLD;

这篇关于Hive函数用于替换列值中的逗号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆