Commit f8bb2a3d by wangjf

fix

parent d5734c95
...@@ -15,14 +15,16 @@ sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" --connect jd ...@@ -15,14 +15,16 @@ sqoop import "-Dorg.apache.sqoop.splitter.allow_text_splitter=true" --connect jd
base_dir="s3://mob-emr-test/dataplatform/DataWareHouse/data/dwh/dim_package_tags" base_dir="s3://mob-emr-test/dataplatform/DataWareHouse/data/dwh/dim_package_tags"
sql="INSERT OVERWRITE DIRECTORY '${base_dir}/${date_path}' sql="INSERT OVERWRITE DIRECTORY '${base_dir}/${date_path}'
SELECT a.package_name,a.platform,b.tag_type,b.first_tag,b.second_tag,b.comment_cn SELECT DISTINCT * FROM
FROM (SELECT package_name,lower(platform) platform,feat_id (SELECT a.package_name,a.platform,b.tag_type,b.first_tag,b.second_tag,b.comment_cn
FROM dev.app_tag FROM (SELECT package_name,lower(platform) platform,feat_id
LATERAL VIEW EXPLODE(SPLIT(REGEXP_REPLACE(REGEXP_REPLACE(SUBSTRING(category,2,LENGTH(category) - 2),'\"',''),' ',''),',')) featTable AS feat_id) a FROM dev.app_tag
INNER JOIN dwh.dm_old2new_tag b ON a.feat_id = b.new_second_id LATERAL VIEW EXPLODE(SPLIT(REGEXP_REPLACE(REGEXP_REPLACE(SUBSTRING(category,2,LENGTH(category) - 2),'\"',''),' ',''),',')) featTable AS feat_id) a
UNION ALL INNER JOIN dwh.dm_old2new_tag b ON a.feat_id = b.new_second_id
SELECT package_name,platform,tag_type,first_tag,second_tag,comment UNION ALL
FROM dwh.dim_package_tags SELECT package_name,platform,tag_type,first_tag,second_tag,comment
FROM dwh.dim_package_tags
) package_tags
" "
hive -e "${sql}" hive -e "${sql}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment