hive常用命令总结

hive简介

hive 是一个大数据仓库分析工具,它可以使用类似sql语句的方式操作集群上的数据文件。 

转述一段官网的描述: 
The Apache Hive™ data warehouse software facilitates reading, writing, and managing large datasets residing in distributed storage and queried using SQL syntax. 
 
 
Built on top of Apache Hadoop™, Hive provides the following features: 
 
Tools to enable easy access to data via SQL, thus enabling data warehousing tasks such as extract/transform/load (ETL), reporting, and data analysis. 
A mechanism to impose structure on a variety of data formats 
Access to files stored either directly in Apache HDFS™ or in other data storage systems such as Apache HBase™ 
Query execution via Apache Tez™, Apache Spark™, or MapReduce 
Procedural language with HPL-SQL 
Sub-second query retrieval via Hive LLAP, Apache YARN and Apache Slider 
 
hive官网wiki 
https://cwiki.apache.org/confluence/display/Hive/Home 
 
hive架构、工作原理 
http://blog.csdn.net/u010330043/article/details/51225021 
 
hive sql语句的解析执行过程 
http://blog.csdn.net/jojo52013145/article/details/19206559


hive sql常见语句

1、创建表

内表

 
 
 
  1. create table aa(col1 string,col2 int) partitioned by(statdate int) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'


外表

 
 
 
  1. create external table bb(col1 string, col2 int) partitioned by(statdate int) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' location '/user/gaofei.lu/';
2、查看表
 
 
 
  1. show create table aa;
3、导入表数据
 
 
 
  1. 本地数据:load data local inpath ' /home/gaofei.lu/aa.txt' into table aa partition(statdate=20170403)
  2. hdfs上数据:load data inpath '/user/gaofei.lu/aa.txt' into table bb partition(statdate=20170403)
4、修改表属性
 
 
 
  • 2
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值