1.在test数据库下创建表格

hive> create table vod_record_all( 
> watch_time date,
> device_id string,
> program_id string,
> program_name string,program_type string,
> watch_duration bigint,
> program_ProviderName string)
> ROW FORMAT DELIMITED
> FIELDS TERMINATED BY ' '
> STORED AS TEXTFILE;

其中文件记录的格式是以空格的形式分隔的。

2.本地系统加载文件数据

hive> load data local inpath '/ftp/www/data/vodall.txt' into table vod_record_all; 

若是分区表的话,需要指定导入的分区,如: 

hive> load data local inpath '/ftp/www/data/vodall.txt' into table vod_record_all partition(statedate=20150310);

 

 程序猿必读

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-12-05
  • 2021-12-01
  • 2022-12-23
  • 2022-01-14
猜你喜欢
  • 2022-02-22
  • 2021-07-04
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案