操作信息和口令
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;