天下事有难易乎?为之,则难者亦易矣;不为,则易者亦难矣。

hive对表信息查询:查看表结构、表分区等操作口令

itzoo 7175次浏览 0个评论

操作信息和口令

1.查询数据库

# show databases;

2.查询表列表

# show tables;

3.模糊查询表

# show tables like ‘*name*’;

4.查看表的结构

# desc formatted 数据库.表名;

# desc 数据库名.表名;

5.查看表分区信息

# show partitions 数据库名.表名;

6.Load添加数据到表中

先创建表结构

create table 数据库.表名(
url string
)
row format delimited FIELDS TERMINATED BY ‘\t’

通过load 添加数据到表中

load data local inpath ‘/home/proripc/data/temp_mate_network_url.txt’ (overwrite) into table 数据库.表名;

7.查看执行中的应用程序

# yarn application -list | grep 队列名

8.杀掉运行中的程序

# hadoop fs -kill job_201403041453_58315

9.将执行完的数据保存到指定位置

insert overwrite local directory ‘/home/proripc/data/4g_dpi_info’ row format delimited FIELDS TERMINATED BY ‘\t’

select fd.* from dpiqixinbstl.dpi_info_4g fd;

10.查看perl进程

# ps -ef | grep perl

11.复制表结构

CREATE TABLE tmp.person_sum2 LIKE tmp.person_sum;

 


ITZOO版权所有丨如未注明 , 均为原创丨转载请注明来自IT乐园 ->hive对表信息查询:查看表结构、表分区等操作口令
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址