hive 导入csv

1:元数据格式

2:创建表: 

TABLE `pj_inventoryzb` (
  id string,
  mxid string,
  spmc string,
  ggxh string,
  spsl string,
  dj decimal(31,18),
  je decimal(31,18),
  hsbz decimal(31,18),
  fphxz string,
  fpmxxh string
) row format serde 'org.apache.hadoop.hive.serde2.OpenCSVSerde' with SERDEPROPERTIES ("separatorChar"=",","quotechar"="\"")
STORED AS TEXTFILE;

3:加载数据:

load data local inpath '/application/pj_inventoryzb.csv' overwrite into table pj_inventoryzb;

猜你喜欢

转载自blog.csdn.net/lucklilili/article/details/103975517