美文网首页
hive 建表 多分隔符处理

hive 建表 多分隔符处理

作者: 无来无去_A | 来源:发表于2020-04-26 23:16 被阅读0次

使用hive版本:  apache-hive-3.1.2-bin.tar.gz

linux 版本:  CentOS-7.5-x86_64-DVD-1804.iso

问题:在建表时源数据分割符是两个空格,是用建表语句指定分割符 create table course(c_id string,c_name string,t_id string) row format delimited fields terminated by '  '; 设定分割符为两个空格。但查询时hive还是按照一个空格处理的。

网上找到解决办法:

create table course(c_id string,c_name string,t_id string) ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.MultiDelimitSerDe' WITH SERDEPROPERTIES ("field.delim"="  ") ;

相关文章

网友评论

      本文标题:hive 建表 多分隔符处理

      本文链接:https://www.haomeiwen.com/subject/lcgswhtx.html