Hive常用命令及作用】的更多相关文章

1-创建表 -- 内部表 create table aa(col1 string,col2 int) partitioned by(statdate int) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t': -- 外部表 create external table bb(col1 string, col2 int) partitioned by(statdate int) ROW FORMAT DELIMITED FIELDS TERMINATED…
示例数据库为 db_hive 1. 创建表 create-table.sql create table if not exists db_hive.tb_user ( id int, username string comment '用户名', age int comment '年龄', address string comment '地址' ) comment '用户表' row format delimited fields terminated by ',' stored as textf…
本位为转载,原地址为:http://www.cnblogs.com/BlueBreeze/p/4232421.html #创建新表 hive> CREATE TABLE t_hive (a int, b int, c int) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'; #导入数据t_hive.txt到t_hive表 hive> LOAD DATA LOCAL INPATH '/home/cos/demo/t_hive.txt' OVERWR…
Hive 启动 ~$ hive 退出 hive>quit; --退出hive or hive> exit; --exit会影响之前的使用,所以需要下一句kill掉hadoop的进程 >hadoop job -kill jobid 选择使用哪个数据库 hive> use database_name; --使用哪个数据库 查看数据表结构 hive> describe tab_name; or desc tab_name; --查看表的结构及表的路径 查看数据库的描述及路径 hiv…
MSCK REPAIR TABLE命令主要是用来解决通过hdfs dfs -put或者hdfs api写入hive分区表的数据在hive中无法被查询到的问题.我们知道hive有个服务叫metastore,这个服务主要是存储一些元数据信息,比如数据库名,表名或者表的分区等等信息.如果不是通过hive的insert等插入语句,很多分区信息在metastore中是没有的,如果插入分区数据量很多的话,你用 ALTER TABLE table_name ADD PARTITION 一个个分区添加十分麻烦.…
1.hive模糊搜索表 show tables like '*name*'; 2.查看表结构信息  desc formatted table_name;  desc table_name; 3.查看分区信息  show partitions table_name; 4.根据分区查询数据  select table_coulm from table_name where partition_name = '2014-02-25'; 5.查看hdfs文件信息  dfs -ls /user/hive/…
1.hive支持四种数据模型 • external table ---外部表:Hive中的外部表和表很类似,但是其数据不是放在自己表所属的目录中,而是存放到别处,这样的好处是如果你要删除这个外部表,该外部表所指向的数据是不会被删除的,它只会删除外部表对应的元数据:而如果你要删除表,该表对应的所有数据包括元数据都会被删除. • table ---表,存储在HDFS的一个目录中. • partition ---分区:在Hive中,表的每一个分区对应表下的相应目录,所有分区的数据都是存储在对应的目录中…
git commit  提交一个修改 git branch branchName  新建一个branchName的分支 git merge branchName 将当前分支与branchName分支合并 git rebase branchName  将当前分支的父节点设置为branchName git reset  HEAD~1 在本地情况使用,回滚到HEAD的上一个节点 git revert HEAD  在需要提交远端的撤销使用,撤销当前的修改,会新建一个节点 git tag v0 C1  给…
[一起学Hive]之十六-Hive的WEB页面接口-HWI Apache Hive 管网 hive metrics hive常用命令整理 Hive学习之HiveServer2服务端配置与启动 启动hivemetastore  hive --service metastore 启动hiveserver2   hive --service  hiveserver2 beeline !connect jdbc:hive2://172.16.145.124:10000 hive hive 后台运行 hi…
参考:https://www.cnblogs.com/jonban/p/10779938.html Hive 启动:hive 退出:hive>quit; show databases; use  analysis; show tables; desc tab_name; --查看表的结构及表的路径 show partitions fact_measured_cft_hive ;展示表分区 fact_measured_cft_hive show create table fact_five_dat…