# 从 internal_platform_db.log_16159_query_engine_134 表中提取审核数据，过滤 ds=202 (HiveSQL)

## Prompt
任务目标：将日志表中符合特定条件的审核记录解析并转码，生成包含标签名称的可读审核结果表。

输入：
- internal_platform_db.log_16159_query_engine_134（包含审核日志字段：ds, functype_, actiontype_, othercol1_, resultinfo_, auditid_, operator_, strategyid_, orderid_, providerid_, uniqueauditid_, audittime_, createtime_, receivetime_, queue_label_）

处理规则：
1. 过滤条件：ds=2026060916、functype_=2141、actiontype_=3
2. 字段提取（使用正则）：
   - 从 othercol1_ 提取：bizuin（regexp_extract(othercol1_, 'bizuin:(.*?);')）、nickname（regexp_extract(othercol1_, 'nickname:(.*?);')）
   - 从 resultinfo_ 提取：account_tag 字符串（regexp_extract(resultinfo_, 'account_tag:(.*?);')），按 '\*sc\*' 分割为 account_tag1、account_tag2、account_tag3；remark（regexp_extract(resultinfo_, 'remark:(.*?);')）
3. 时间格式转换：audittime_、createtime_、receivetime_ 从 Unix 时间戳转为 yyyyMMddHH 格式
4. Join 操作：定义硬编码标签映射表（label_name 和 label 两列，包含约 100 条映射），对 account_tag1、account_tag2、account_tag3 分别 LEFT JOIN 映射表，得到 account_tag1_string、account_tag2_string、account_tag3_string

输出要求：
- 字段顺序：ds, bizuin, nickname, account_tag1, account_tag2, account_tag3, account_tag1_string, account_tag2_string, account_tag3_string, remark, auditid_, operator_, strategyid_, orderid_, providerid_, uniqueauditid_, audittime, createtime_, receivetime_, queue_label_
- 分区字段：ds=2026060916

写入要求：INSERT OVERWRITE 到 internal_platform_db.dwmid_daily_ecommerce_shop_level_func_2141_audit_result_cand_query_engine_134 的 ds=2026060916 分区。

请将最终 HiveSQL 写入 result.sql 并执行。

## Reference Solution
insert overwrite table internal_platform_db.dwmid_daily_ecommerce_shop_level_func_2141_audit_result_query_engine_134 partition(ds ='2026060916')
with audit_result as
(
select 2026060916 ds,regexp_extract(othercol1_,'bizuin:(.*?);')bizuin,
regexp_extract(othercol1_,'nickname:(.*?);')nickname,
split(regexp_extract(resultinfo_,'account_tag:(.*?);'),'\\*sc\\*')[0] account_tag1,
split(regexp_extract(resultinfo_,'account_tag:(.*?);'),'\\*sc\\*')[1] account_tag2,
split(regexp_extract(resultinfo_,'account_tag:(.*?);'),'\\*sc\\*')[2] account_tag3,
regexp_extract(resultinfo_,'remark:(.*?);')remark,
auditid_,operator_,strategyid_,orderid_,providerid_,
uniqueauditid_,
from_unixtime(audittime_,'yyyyMMddHH') audittime,
from_unixtime(createtime_,'yyyyMMddHH') createtime_,
from_unixtime(receivetime_,'yyyyMMddHH') receivetime_,
queue_label_
from internal_platform_db.log_16159_query_engine_134
where ds = '2026060916'
and functype_ = 2141
and actiontype_ = 3
),
label as
(
select '精品' as label_name,900 as label union
select '品牌店铺' as label_name,9001 as label union
select '专业店铺' as label_name,9002 as label union
select '优体验店铺' as label_name,9003 as label union
select '无问题' as label_name,800 as label union
select '商品品类杂糅' as label_name,8001 as label union
select '商超店铺' as label_name,8002 as label union
select '无问题' as label_name,8003 as label union
select '待优化' as label_name,700 as label union
select '购买场景不适用' as label_name,7001 as label union
select '商品不可购买' as label_name,70011 as label union
select '条件限制商品' as label_name,70012 as label union
select '店铺信息随意' as label_name,7002 as label union
select '头像设置随意' as label_name,70021 as label union
select '商品图片随意' as label_name,70022 as label union
select '商品标题随意' as label_name,70023 as label union
select '商品属性信息填写随意' as label_name,70024 as label union
select 'sku信息设置不规范' as label_name,70025 as label union
select '店铺整体随意' as label_name,70026 as label union
select '商品重复铺货' as label_name,7003 as label union
select '重复铺货（轻微）' as label_name,70031 as label union
select '重复铺货（严重）' as label_name,70032 as label union
select '图片不规范' as label_name,7004 as label union
select '商品主体不明' as label_name,70041 as label union
select '图片非真实' as label_name,70042 as label union
select '商品详情页质量差' as label_name,70043 as label union
select '商品图片重复/单一图片' as label_name,70044 as label union
select '标题不规范' as label_name,7005 as label union
select '关键词/品类词堆砌' as label_name,70051 as label union
select '与商品无关字符' as label_name,70052 as label union
select '店铺综合质量差' as label_name,7006 as label union
select '标题图片不规范' as label_name,70061 as label union
select '语言规范' as label_name,7007 as label union
select '汉语言' as label_name,70071 as label union
select '其他语言规范' as label_name,70072 as label union
select '不规范营销' as label_name,7008 as label union
select '霸王条款' as label_name,70081 as label union
select '个人敏感信息' as label_name,70082 as label union
select '引人不适（轻微）' as label_name,7009 as label union
select '推荐体验差' as label_name,7010 as label union
select '画风抽象恶搞' as label_name,701001 as label union
select '画风低俗' as label_name,701002 as label union
select '特殊需求群体' as label_name,701002 as label union
select '店铺名称头像不规范' as label_name,7011 as label union
select '泛低质' as label_name,600 as label union
select '引人不适（严重）' as label_name,6001 as label union
select '低质量图片' as label_name,6002 as label union
select '商品图片盗图' as label_name,60021 as label union
select '图片明显标记' as label_name,60022 as label union
select '滥用标题' as label_name,6003 as label union
select '品牌蹭流' as label_name,60031 as label union
select '标题作弊' as label_name,60032 as label union
select '滥用同款关键词' as label_name,60033 as label union
select '串类目蹭流' as label_name,60034 as label union
select '商品信息不一致' as label_name,6004 as label union
select '绕类目' as label_name,6005 as label union
select '导流' as label_name,6006 as label union
select '名称头像导流' as label_name,60061 as label union
select '商品导流' as label_name,60062 as label union
select '诱导营销' as label_name,6007 as label union
select '低价诱导' as label_name,60071 as label union
select '利益诱导' as label_name,60072 as label union
select '宣传标语/图片夸张博眼球' as label_name,60073 as label union
select '额外购买门槛' as label_name,60074 as label union
select '不实互动诱导行为' as label_name,60075 as label union
select '虚假营销' as label_name,6008 as label union
select '商品销量虚假宣传' as label_name,60081 as label union
select '价格/折扣虚假宣传' as label_name,60082 as label union
select '滥发/虚假使用品牌专柜词' as label_name,60083 as label union
select '色情低俗（轻微）' as label_name,6009 as label union
select '店铺名称不规范' as label_name,6010 as label union
select '商品低质' as label_name,6011 as label union
select '疑似仿冒/非原创' as label_name,60111 as label union
select '违规风险' as label_name,500 as label union
select '店铺信息违规' as label_name,5001 as label union
select '混淆蹭流' as label_name,50011 as label union
select '不当营销名称' as label_name,50012 as label union
select '宗教' as label_name,50013 as label union
select '违法违禁' as label_name,5002 as label union
select '违法犯罪' as label_name,50021 as label union
select '售假山寨' as label_name,50022 as label union
select '未开放服务' as label_name,50023 as label union
select '劣迹负面艺人' as label_name,50024 as label union
select '色情低俗（严重）' as label_name,5003 as label union
select '时政敏感' as label_name,5004 as label union
select '社会热点' as label_name,50041 as label union
select '政治敏感' as label_name,50042 as label union
select '恐怖组织/邪教' as label_name,5005 as label union
select '违规营销' as label_name,5006 as label union
select '违反社会风尚' as label_name,5007 as label union
select '不文明用语' as label_name,50071 as label union
select '不良价值观' as label_name,50072 as label
)
select bizuin,nickname,account_tag1,account_tag2,account_tag3,
t2.label_name account_tag1_string,t3.label_name account_tag2_string,t4.label_name account_tag3_string,
remark,
auditid_,operator_,strategyid_,orderid_,providerid_,
uniqueauditid_,
audittime,
createtime_,
receivetime_,
queue_label_
from
(
select bizuin,nickname,account_tag1,account_tag2,account_tag3,
remark,
auditid_,operator_,strategyid_,orderid_,providerid_,
uniqueauditid_,
audittime,
createtime_,
receivetime_,
queue_label_
from audit_result
)t1
left join
label t2 on t1.account_tag1 = t2.label
left join
label t3 on t1.account_tag2 = t3.label
left join
label t4 on t1.account_tag3 = t4.label