Hive之——支持CSV格式

转载请注明出处: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;

 

你可能感兴趣的:(Hadoop,Hive,Hadoop生态)