1 -- 从本地文件加载数据:
2 LOAD DATA LOCAL INPATH '/home/hadoop/input/ncdc/micro-tab/sample.txt' OVERWRITE INTO TABLE records;
3 load data local inpath '/home/hive/partitions/files' into table logs partition (dt='2017-08-01',country='GB');

 

1 -- 数据导出
2 beeline -u jdbc:hive2://ip:port -n username -p password --verbose=true --outputformat=dsv -e "
3 select * from table_name
4 " > table_name.dsv

 

 1 -- 导出数据
 2 insert overwrite local directory '/tmp/table_name/'
 3 row format delimited fields terminated by ',' 
 4 select * from table_name;
 5 
 6 hive -e "
 7 set mapred.job.queue.name=queue_name;
 8 set hive.cli.print.header=true;
 9 use db_name;
10 select * from table_name;" > table_name.txt

 

相关文章:

  • 2021-09-05
  • 2022-12-23
  • 2021-08-01
  • 2021-07-24
  • 2022-02-17
  • 2021-10-21
  • 2022-01-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2021-10-09
  • 2021-06-18
  • 2022-12-23
  • 2021-07-11
相关资源
相似解决方案