ITPub博客

首页 > 应用开发 > Java > Hive shell 命令

Hive shell 命令

Java 作者:ii_chengzi 时间:2019-09-19 16:17:48 1 删除 编辑

 连接 hive shell

  直接输入 hive

   1、显示表

  hive> show tables; 

  OK 

  test 

  Time taken: 0.17 seconds, Fetched: 1 row(s)

   2、创建表

  hive> create table test(key string); 

  OK 

  Time taken: 0.265 seconds

  3、创建分区表:

  hive> create table logs(ts bigint,line string) partitioned by (dt String,country String);

  4、加载分区表数据:

  hive> load data local inpath '/home/Hadoop/input/file1' into table logs partition (dt='2014-03-11',country='CN');

   5、展示表中有多少分区:

  hive> show partitions logs; 

http://shenzhen.offcn.com/

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/31543790/viewspace-2657592/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2018-06-26

  • 博文量
    264
  • 访问量
    342583