Hive之——支持CSV格式

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/l1028386804/article/details/88617808

转载请注明出处:https://blog.csdn.net/l1028386804/article/details/88617808

csv-serde下载地址:http://ogrodnek.github.io/csv-serde/
用法:

add jar path/to/csv-serde.jar;

create table my_table(a string, b string, ...)
row format serde 'com.bizo.hive.serde.csv.CSVSerde'
stored as textfile;	

自定义分隔符:

add jar path/to/csv-serde.jar;
create table my_table(a string, b string, ...)
 row format serde 'com.bizo.hive.serde.csv.CSVSerde'
 with serdeproperties (
   "separatorChar" = "\t",
   "quoteChar"     = "'",
   "escapeChar"    = "\\"
  )	  
 stored as textfile;

 

猜你喜欢

转载自blog.csdn.net/l1028386804/article/details/88617808
0条评论
添加一条新回复