其中,各字段代表含义如下:
• Owner(表的属主)。
• Project:表所属的项目空间。
• CreateTime:创建时间。
• LastDDLTime:最后一次DDL *** 作时间。
• LastModifiedTime:表中的数据最后一次被改动的时间。
• InternalTable:表示被描述的对象是表,总是显示YES。
• Size:表数据所占存储容量压缩后的大小,压缩比一般为5倍,单位Byte。
• Native Columns:非分区列的信息,包括列名、类型和备注。
• Partition Columns:分区列信息,包括分区名、类型和备注。
• Extended Info:外部表StorageHandler 、Location等信息。
FAILED: ODPS-0123144: Fuxi job failed - WorkerRestart errCode:9,errMsg:SigKill(OOM), usually caused by OOM(out of memory).看 logviw 发现 在map 阶段出现 oom
```
with userdaystat as (
select * from sync_mongo_box.extract_source__userdaystat
WHERE pt = '${bdate}' and (total_cash >0 or total_flash >0)
)
INSERT OVERWRITE TABLE odps_product_box_subsidy_detail_top100 PARTITION(pt='${bdate}' )
SELECT user_id
,DOUBLE(extract_cash_back)
,'提现3元奖励'
,'extract_cash_back'
FROM userdaystat
WHERE pt = '${bdate}'
ORDER BY extract_cash_back DESC
LIMIT 100
UNION ALL
SELECT user_id
,DOUBLE(family_flash)
,'家族奖励'
,'family_flash'
FROM userdaystat
WHERE pt = '${bdate}'
ORDER BY family_flash DESC
LIMIT 100
UNION ALL
SELECT user_id
,DOUBLE(master_recall_flash)
,'唤醒徒弟奖励'
,'master_recall_flash'
FROM userdaystat
WHERE pt = '${bdate}'
ORDER BY master_recall_flash DESC
LIMIT 100
UNION ALL
SELECT user_id
,DOUBLE(recall_apprentice_flash)
,'被唤醒奖励'
,'recall_apprentice_flash'
FROM userdaystat
WHERE pt = '${bdate}'
ORDER BY recall_apprentice_flash DESC
LIMIT 100
UNION ALL
SELECT user_id
,DOUBLE(master_benefit_flash)
,'师父奖励'
,'master_benefit_flash'
FROM userdaystat
WHERE pt = '${bdate}'
ORDER BY master_benefit_flash DESC
LIMIT 100
UNION ALL
SELECT user_id
,DOUBLE(share_income_flash)
,'晒收入奖励'
,'share_income_flash'
FROM userdaystat
WHERE pt = '${bdate}'
ORDER BY share_income_flash DESC
.... etc.....
UNION ALL
SELECT user_id
,DOUBLE(total_cash)
,'总补贴现金'
,'total_cash'
FROM userdaystat
WHERE pt = '${bdate}'
ORDER BY total_cash DESC
LIMIT 100
```
大量 的 UNION ALL ,子查询读入数据过多 减少 子查询 的数据读入量
```
with userdaystat as (
select * from sync_mongo_box.extract_source__userdaystat
WHERE pt = '${bdate}'
)
INSERT OVERWRITE TABLE odps_product_box_subsidy_detail_top100 PARTITION(pt='${bdate}' )
SELECT user_id
,DOUBLE(extract_cash_back)
,'提现3元奖励'
,'extract_cash_back'
FROM userdaystat
WHERE pt = '${bdate}' and extract_cash_back is not null
ORDER BY extract_cash_back DESC
LIMIT 100
UNION ALL
SELECT user_id
,DOUBLE(family_flash)
,'家族奖励'
,'family_flash'
FROM userdaystat
WHERE pt = '${bdate}' and family_flash is not null
ORDER BY family_flash DESC
LIMIT 100
UNION ALL
....etc....
FROMuserdaystat
WHERE pt = '${bdate}' and total_flash is not null
ORDER BY total_flash DESC
LIMIT 100
UNION ALL
SELECT user_id
,DOUBLE(total_cash)
,'总补贴现金'
,'total_cash'
FROM userdaystat
WHERE pt = '${bdate}' and total_cash is not null
ORDER BY total_cash DESC
LIMIT 100
```
为每个 子查询 减少读入数据量 ,添加 对应字段 is not null 。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)