上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 39 下一页
摘要: select regexp_replace(str,'[^\\u4e00-\\u9fa5]','') as str1 from ( select 'test测试test' as str ) t ; 阅读全文
posted @ 2018-07-25 16:00 chenzechao 阅读(950) 评论(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 阅读(364) 评论(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 阅读(967) 评论(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 阅读(673) 评论(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 阅读(5954) 评论(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 阅读(163) 评论(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 阅读(15978) 评论(0) 推荐(0)
摘要: 测试环境 Hive 1.2.1000.2.6.0.3-8 阅读全文
posted @ 2018-07-16 16:32 chenzechao 阅读(560) 评论(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 阅读(229) 评论(0) 推荐(0)
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 39 下一页