07 2018 档案

该文被密码保护。
posted @ 2018-07-30 16:04 chenzechao 阅读(1) 评论(0) 推荐(0) 编辑
摘要:### 切换到脚本所在目录bin=$(cd `dirname $0`;pwd) cd ${bin} ### 删除文件名乱码文件 find . -inum 16482370 -exec mv {} ppp \; ### 打印指定行数 sed -n '777172,793920p' kafkaconnect.log 阅读全文
posted @ 2018-07-25 16:02 chenzechao 阅读(128) 评论(0) 推荐(0) 编辑
摘要:select regexp_replace(str,'[^\\u4e00-\\u9fa5]','') as str1 from ( select 'test测试test' as str ) t ; 阅读全文
posted @ 2018-07-25 16:00 chenzechao 阅读(931) 评论(0) 推荐(0) 编辑
摘要:1 ### 模板脚本存放路径(无需修改) 2 cd /tmp/fix_data/tmp_wjj_20180322_01 3 ### 脚本名称 4 script=tmp_wjj_20180322_01 5 ### 开始日期(包括当月/天) 6 etl_dt_start='2017-09-01' 7 ### 结束日期(不包括当月/天) 8 etl_dt_end='2016-12-... 阅读全文
posted @ 2018-07-25 15:58 chenzechao 阅读(360) 评论(0) 推荐(0) 编辑
摘要:1 -- 从本地文件加载数据: 2 LOAD DATA LOCAL INPATH '/home/hadoop/input/ncdc/micro-tab/sample.txt' OVERWRITE INTO TABLE records; 3 load data local inpath '/home/hive/partitions/files' into table logs partitio... 阅读全文
posted @ 2018-07-25 15:50 chenzechao 阅读(962) 评论(0) 推荐(0) 编辑
摘要:1 -- 同步HDFS数据(shell执行) 2 hadoop distcp \ 3 -Dmapred.job.queue.name=queue_name \ 4 -update \ 5 -skipcrccheck hdfs://hdfs01/user/hive/warehouse/db_name1.db/table_name \ 6 /user/hive/warehouse/db_name... 阅读全文
posted @ 2018-07-25 14:34 chenzechao 阅读(667) 评论(0) 推荐(0) 编辑
摘要:1 -- 设置hive的计算引擎为spark 2 set hive.execution.engine=spark; 3 4 -- 修复分区 5 set hive.msck.path.validation=ignore; 6 msck repair table sub_ladm_app_click_day_cnt; 7 8 -- 打印表头 9 set hive.cli.p... 阅读全文
posted @ 2018-07-25 14:31 chenzechao 阅读(5934) 评论(0) 推荐(0) 编辑
摘要:1 create database target_db; 2 drop table target_db.kylin_account; 3 dfs -rm -r /tmp/kylin_account; 4 export table default.kylin_account to '/tmp/kylin_account'; 5 import table target_db.kylin_ac... 阅读全文
posted @ 2018-07-24 17:53 chenzechao 阅读(157) 评论(0) 推荐(0) 编辑
摘要:1 -- 计算指定日期本周的第一天和最后一天 2 select 3 day 4 ,dayofweek(day) as dw1 5 ,date_add(day,1 - dayofweek(day)) ... 阅读全文
posted @ 2018-07-19 16:48 chenzechao 阅读(15870) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2018-07-18 11:27 chenzechao 阅读(130) 评论(0) 推荐(0) 编辑
摘要:测试环境 Hive 1.2.1000.2.6.0.3-8 阅读全文
posted @ 2018-07-16 16:32 chenzechao 阅读(552) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2018-07-10 15:21 chenzechao 阅读(238) 评论(0) 推荐(0) 编辑
摘要:1 drop table work_day_tbl; 2 create table work_day_tbl ( 3 day string comment '日期' 4 ,week int comment '周一1,周日7' 5 ,work_day i... 阅读全文
posted @ 2018-07-10 10:12 chenzechao 阅读(224) 评论(0) 推荐(0) 编辑
摘要:ROWS BETWEEN含义,也叫做WINDOW子句: PRECEDING:往前 FOLLOWING:往后 CURRENT ROW:当前行 UNBOUNDED:起点 UNBOUNDED PRECEDING 表示从前面的起点 UNBOUNDED FOLLOWING:表示到后面的终点 AVG(pv) O 阅读全文
posted @ 2018-07-10 10:05 chenzechao 阅读(252) 评论(0) 推荐(0) 编辑
摘要:1 %sql 2 select 3 t3.* 4 from ( 5 select 6 t2.* 7 ,row_number() over(partition by t2.pt order by t2.pv) as rn2 8 from ( 9 select 10 t1.co... 阅读全文
posted @ 2018-07-09 11:42 chenzechao 阅读(1234) 评论(0) 推荐(0) 编辑
摘要:hive存在两种锁,共享锁Shared (S)和互斥锁Exclusive (X) 其中只触发s锁的操作可以并发的执行,只要有一个操作对表或者分区出发了x锁,则该表或者分区不能并发的执行作业。 阅读全文
posted @ 2018-07-04 16:24 chenzechao 阅读(422) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示