In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you the "sample analysis of hive script", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "sample analysis of hive script" this article.
#! / bin/sh
Date_yes=$1
If [! ${date_yes}]; then
Date_yes= `date-d "- 1 days" + "% Y%m%d" `
Fi
Echo ${date_yes}
Date_bef_yes= `date-d "${date_yes}-1 day" + "% Y%m%d" `
Date_bef_7= `date-d "${date_yes}-7 day" + "% Y%m%d" `
Echo ${date_bef_yes} ${date_bef_7}
Remote_host= "hadoop@192.168.1.27"
Sour_addr= "/ home/data/superhero/"
Local_addr= "/ data/superhero"
Data_base= "superhero_bi"
Ser= "\",\ "
Map1= "\",\ "
Map2= "\":\ "
Ios= "ios"
Pub= "pub"
Rsync-arvzP ${remote_host}: ${sour_addr} / viso_config/*_$ {date_yes} / data/superhero/bi_tool/viso_config/ & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / reg_act/act_$ {date_yes} ${local_addr} / act/act_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / reg_act/reg_$ {date_yes} ${local_addr} / reg/reg_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / log_redis/info_$ {date_yes} ${local_addr} / info/info_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / log_redis/all_pet_$ {date_yes} ${local_addr} / pet/all_pet_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / log_redis/equip_$ {date_yes} ${local_addr} / equip/equip_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / log_redis/item_$ {date_yes} ${local_addr} / item/item_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / log_redis/card_$ {date_yes} ${local_addr} / card/card_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / log_redis/card_super_step_$ {date_yes} ${local_addr} / super_step/card_super_step_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / log_redis/all_scores_$ {date_yes} ${local_addr} / scores/all_scores_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / paylog/paylog_$ {date_yes} ${local_addr} / paylog/paylog_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / action_log/action_log_$ {date_yes} ${local_addr} / action_log/action_log_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / reg_act/mix_hc_$ {date_yes} ${local_addr} / mix_hc/mix_hc_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / reg_act/ios_hc_$ {date_yes} ${local_addr} / ios_hc/ios_hc_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / log_redis/vip_info_$ {date_yes} ${local_addr} / vip_info/vip_info_$ {date_yes} & &\
# rsync-progress arvzP ${remote_host}: ${sour_addr} / spendlog/spendlog_$ {date_yes} ${local_addr} / spendlog/spendlog_$ {date_yes} & &\
Hive-S-e "
Use ${data_base}
Load data inpath'{local_addr} / paylog/paylog_$ {date_yes} 'overwrite into table ${data_base} .raw _ paylog partition (ds='$ {date_yes}')
Insert overwrite table mid_paylog_all_ext partition (ds='$ {date_bef_yes}') select order_id,admin,gift_coin,level,old_coin,order_coin,order_money,order_time,platform_2,product_id,raw_data,reason,scheme_id,user_id from mid_paylog_all where ds='$ {date_bef_yes}'
Insert overwrite table mid_paylog_all_ext partition (ds='$ {date_yes}') select order_id,admin,gift_coin,level,old_coin,order_coin,order_money,order_time,platform_2,product_id,raw_data,reason,scheme_id,user_id from raw_paylog where ds='$ {date_yes}'
Insert overwrite table mid_paylog_all partition (ds='$ {date_yes}') select order_id,admin,gift_coin,level,old_coin,order_coin,order_money,order_time,platform_2,product_id,raw_data,reason,scheme_id,user_id from mid_paylog_all_ext
Insert overwrite table mid_gs_user partition (ds='$ {date_yes}') select distinct user_id from mid_paylog_all where ds='$ {date_yes} 'and lower (platform_2) =' admin_test'
Alter table mid_paylog_all_ext drop partition (ds='$ {date_bef_yes}')
Alter table mid_paylog_all_ext drop partition (ds='$ {date_yes}')
Alter table mid_paylog_all drop partition (ds='$ {date_bef_7}')
"
Hive-S-e "
Use ${data_base}
Load data inpath'{local_addr} / act/act_$ {date_yes} 'overwrite into table ${data_base} .raw _ act partition (ds='$ {date_yes}')
"
Hive-S-e "
Use ${data_base}
Load data inpath'{local_addr} / reg/reg_$ {date_yes} 'overwrite into table ${data_base} .raw _ reg partition (ds='$ {date_yes}')
"
Hive-S-e "
Use ${data_base}
Load data inpath'{local_addr} / info/info_$ {date_yes} 'overwrite into table ${data_base} .raw _ info partition (ds='$ {date_yes}')
Insert overwrite table mid_info_all_ext partition (ds='$ {date_bef_yes}') select uid,account,nick,platform_2,device,create_time,fresh_time,vip_level,level,zhandouli,food,metal,energy,nengjing,zuanshi,qiangnengzhichen,chaonengzhichen,xingdongli,xingling,jinbi,lianjingshi,shenen,gaojishenen,gaojinengjing,jingjichangdianshu from mid_info_all where ds='$ {date_bef_yes}'
Insert overwrite table mid_info_all_ext partition (ds='$ {date_yes}') select uid,account,nick,platform_2,device,create_time,fresh_time,vip_level,level,zhandouli,food,metal,energy,nengjing,zuanshi,qiangnengzhichen,chaonengzhichen,xingdongli,xingling,jinbi,lianjingshi,shenen,gaojishenen,gaojinengjing,jingjichangdianshu from raw_info where ds='$ {date_yes}'
Insert overwrite table mid_info_all partition (ds='$ {date_yes}') select t.uidretemt.nickformwriting 2parting t.devicerecovert.createroomtimetimeretemt.devicePartitutemlevelscort.zhandouligradt.food.metalt.energymemt.nengjingjing t.zuanshijet.angnengzhichen.chaengzhichen.xingdonglijjing.xingling.jingjonglim.xingling.jinjingshishi.jinjingshirem.shenen.gaojishenen.gaojengjing T.jingjichangdianshu from (select *, row_number () over (distribute by uid sort by fresh_time desc) as rn from mid_info_all_ext) t where t.rn
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.