Commit 3b429c21 by jinfeng.wang

fix

parent 17383879
......@@ -28,8 +28,8 @@ base_dir="s3://mob-emr-test/dataplatform/DataWareHouse/data/dwh/dim_package_tags
sql="INSERT OVERWRITE DIRECTORY '${base_dir}/${date_path}'
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
SELECT DISTINCT * FROM
(SELECT a.package_name,a.platform,b.tag_type,b.first_tag,b.second_tag,b.comment_cn
SELECT package_name, platform, tag_type,first_tag, second_tag, COLLECT_SET(comment) FROM
(SELECT a.package_name,a.platform,b.tag_type,b.first_tag,b.second_tag,b.comment_cn comment
FROM (SELECT package_name,lower(platform) platform,feat_id
FROM dev.app_tag
LATERAL VIEW EXPLODE(SPLIT(REGEXP_REPLACE(REGEXP_REPLACE(SUBSTRING(category,2,LENGTH(category) - 2),'\"',''),' ',''),',')) featTable AS feat_id) a
......@@ -38,7 +38,7 @@ sql="INSERT OVERWRITE DIRECTORY '${base_dir}/${date_path}'
SELECT c.package_name,c.platform,c.tag_type,c.first_tag,c.second_tag,c.comment
FROM dwh.dim_package_tags c LEFT JOIN dev.app_tag d ON LOWER(c.package_name) = LOWER(d.package_name)
WHERE d.package_name IS NULL
) package_tags
) package_tags GROUP BY package_name, platform, tag_type,first_tag, second_tag
"
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