linux常用命令总结

一:常用sql

1)查看分区

hadoop fs -ls /hive/warehouse/managed/dwd_data.db/dwd_gen_track_oneapp_log_df 

2)添加分区

alter table dwd_gen_track_oneapp_log_df add partition(partition_date = '2019-10-24'); 添加分区

3)删除分区

alter table dwd_gen_track_oneapp_log_df drop partition(pt='2019-10-22');删除分区

4)杀死yarn进程

yarn application -kill application_1571219160975_3186      杀死yarn进程

5)查看分区

show partitions 表名   查看分区

6)删除表数据

truncate table 表名		删除表数据

7)外部表转内部表

alter table tableA set TBLPROPERTIES('EXTERNAL'='false') 外部表转内部表

8)查看表结构的详细信息

desc formatted table;

9)删除表

DROP TABLE IF EXISTS table;	删除表

10)本地导入到hive

load data local inpath '/222.csv'  into table dw_test1;  本地导入到hive

11)添加语句

INSERT OVERWRITE table 新表名  partition(partition_date = '2019-10-24') select * from default.旧表名 where w_upd_dt < '2019-10-25 00:00:00.0';

12)检查是否有串行

select * from default.表名 where  length(nvl(cast(last_mdf_dt as string),''))=0  limit 1;

13)当前数据库

select current_database()

二:spark命令

1)spark-shell

cat so_log1.scala | spark-shell \
--name empty_test \
--conf spark.driver.memory=2g \
--conf spark.executer.memory=2g \
--conf spark.executer.cores=4 \
--conf spark.executer.instances=2 \
--conf spark.kryoserializer.buffer.max=512m \
--conf spark.dynamicAllocation.enabled=false \
--conf spark.sql.shuffle.partitions=100 \
--conf spark.driver.maxResultSize=4g \
--conf spark.broadcast.blockSize=100m \
>> so_log1.txt

2)spark-submit

bin/spark2-submit --class WoobooOrderStreamingKafka  --master yarn --executor-memory 2G --total-executor-cores 2 /taskJar/spark-wooboo-1.0.jar 2>&1 | tee /submit.log

三:tumx的使用

安装tmux:yum install tmux

新建会话:tmux new -s aaa

查看会话:tmux ls

进入会话:tmux a -t aaa

断开会话:tmux detach

关闭会话:tmux kill-session -t aaa

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值