Hive常用命令

本文介绍了Hive的常用命令,包括通过Hive命令行进行数据库和表的操作,如查看数据库、创建与删除数据库、使用指定数据库。同时,详细讲解了表的操作,如创建内部表、分区表、外部表,并探讨了在线上环境中如何高效创建分区表。此外,还提到了beeline的使用,以及一些基本的Hive服务和shell命令。
摘要由CSDN通过智能技术生成

hive命令行

  • hive --help

    --config       hive配置文件路径
    --service      hive 服务
    --auxpath      添加jar包(多个jar包用:分割)
    
  • hive --service help

    Service List: beeline cli help hiveburninclient hiveserver2 hiveserver hwi jar lineage metastore metatool orcfiledump rcfilecat schemaTool version
    Parameters parsed:
      --auxpath : Auxillary jars
      --config : Hive configuration directory
      --service : Starts specific service/component. cli is default
    Parameters used:
      HADOOP_HOME or HADOOP_PREFIX : Hadoop install directory
      HIVE_OPT : Hive options
    For help on a particular service:
      ./hive --service serviceName --help
    Debug help:  ./hive --debug --help
    
  • hive --service cli(相当于直接执行hive) 具体服务

    hive --service cli --help (相当于直接执行hive -h)
        -e      直接执行hql语句 
        -v      输出hql语句
        -S      屏蔽执行过程
        -f      执行hql文件
        -i      执行一个文件
        -d      用户自定义变量
        --hivevar   用户自定义变量
    
  • hive cli更多功能

    • 直接执行shell 命令
      hive> ! pwd;
      
    • 直接执行hsdf 命令
      hive> df -ls;
      
    • 显示数据库
      hive> set hive.cli.print.current.db=true;
      
    • 显示字段名
      hive> set hive.cli.print.header=true;
      
  • 启动hive服务

    启动web GUI
    nohup hive --service hwi > /dev/null 2>&1 &		
    http://master:9999/hwi
    
    启动元数据
    nohup  hive --service metastore > /dev/null 2>&1 &		
    
     启动远程服务接口
    nohup hive --service hiveserver2 > /de
  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值