今天开发过程中遇到一个问题
想使用regexp_replace()函数来将字段中的分号替换成 逗号
代码如下:
SELECT regexp_replace(baidu_lat_lng,";",",") as baidu_lat_lng FROM ods_land_info_df_test;
报错信息:
后来百度发现,原来hive对分号的识别问题
所以我们以后遇到可以使用分号的二进制来[ " 73" ] 代替
修正后的代码
SELECt baidu_lat_lng, regexp_replace(baidu_lat_lng," 73",",") FROM ods_land_info_df_test大家以后注意避免才坑!!!


![Hive中分号[ ; ]报错问题 Hive中分号[ ; ]报错问题](http://www.mshxw.com/aiimages/31/326847.png)
