Presto临时设置session超时时间

耀灵2年前技术文章1245

全局默认超时时间为200s:

1.png

测试语句:

select 
  "t7"."__fcol_16" "__fcol_22", 
  date_trunc('month', "t7"."__fcol_21") "__fcol_24", 
  sum("t7"."__fcol_19") "__fcol_25", 
  sum("t7"."__fcol_18") "__fcol_26"
from (select 
  "t6"."__fcol_12" "__fcol_16", 
  "t6"."__fcol_13" "__fcol_17", 
  "t6"."__fcol_14" "__fcol_18", 
  "t6"."__fcol_15" "__fcol_19", 
  date_parse("t6"."__fcol_8", '%Y%m') "__fcol_21"
from (select 
  "t5"."__fcol_3" "__fcol_8", 
  "t5"."__fcol_4" "__fcol_9", 
  "t5"."__fcol_5" "__fcol_10", 
  "t5"."__fcol_6" "__fcol_11", 
  "t5"."__fcol_7" "__fcol_12", 
  "t5"."__fcol_0" "__fcol_13", 
  sum("t5"."__fcol_2") "__fcol_14", 
  count("t5"."__fcol_3") "__fcol_15"
from (select 
  "T_77486F_0"."itemname" "__fcol_0", 
  cast(cast("T_77486F_0"."fillname" as varchar) as double) "__fcol_2", 
  "T_77486F_0"."ispc_dt" "__fcol_3", 
  "T_77486F_0"."sal_head" "__fcol_4", 
  "T_77486F_0"."sal_area" "__fcol_5", 
  "T_77486F_0"."admn_rgn" "__fcol_6", 
  "T_77486F_0"."clnt_tp" "__fcol_7"
from "dm"."fact_ispc_item_cus_imp_kpi" "T_77486F_0"
where (
  "T_77486F_0"."templatename" in (
    '2021年明细表导入', '2020年明细表导入'
  )
  and "T_77486F_0"."itemname" in (
    '蒙牛堆箱陈列数量', '伊利堆箱陈列数量', '蒙牛排面总数', '伊利排面总数', '蒙牛SKU总数', '伊利SKU总数', '得分', '蒙牛堆头及端架总数', 
    '伊利堆头及端架总数'
  )
)) "t5"
group by 
  1, 
  2, 
  3, 
  4, 
  5, 
  6
) "t6") "t7"
where (
  exists (
    select 1
    from (select 
  "t3"."__fcol_13" "__fcol_16", 
  "t3"."__fcol_14" "__fcol_17", 
  "t3"."__fcol_15" "__fcol_18"
from (select 
  "t2"."__fcol_10" "__fcol_13", 
  "t2"."__fcol_12" "__fcol_14", 
  rank() over (partition by "t2"."__fcol_10" order by "t2"."__fcol_12" desc) "__fcol_15"
from (select 
  "t1"."__fcol_6" "__fcol_10", 
  date_trunc('month', "t1"."__fcol_9") "__fcol_12"
from (select 
  "t0"."__fcol_4" "__fcol_6", 
  "t0"."__fcol_5" "__fcol_7", 
  date_parse("t0"."__fcol_0", '%Y%m') "__fcol_9"
from (select 
  "T_77486F"."ispc_dt" "__fcol_0", 
  "T_77486F"."sal_head" "__fcol_1", 
  "T_77486F"."sal_area" "__fcol_2", 
  "T_77486F"."admn_rgn" "__fcol_3", 
  "T_77486F"."clnt_tp" "__fcol_4", 
  "T_77486F"."itemname" "__fcol_5"
from "dm"."fact_ispc_item_cus_imp_kpi" "T_77486F"
where (
  "T_77486F"."templatename" in (
    '2021年明细表导入', '2020年明细表导入'
  )
  and "T_77486F"."itemname" in (
    '蒙牛堆箱陈列数量', '伊利堆箱陈列数量', '蒙牛排面总数', '伊利排面总数', '蒙牛SKU总数', '伊利SKU总数', '得分', '蒙牛堆头及端架总数', 
    '伊利堆头及端架总数'
  )
)
group by 
  1, 
  2, 
  3, 
  4, 
  5, 
  6
) "t0") "t1"
where "t1"."__fcol_7" in ('得分')
group by 
  1, 
  2
) "t2") "t3"
where "t3"."__fcol_15" <= 13) "t4"
    where (
      coalesce("t7"."__fcol_16", '0') = coalesce("t4"."__fcol_16", '0')
      and coalesce("t7"."__fcol_16", '1') = coalesce("t4"."__fcol_16", '1')
      and coalesce(date_trunc('month', "t7"."__fcol_21"), timestamp '2000-01-01 00:00:00.0') = coalesce(cast("t4"."__fcol_17" as timestamp), timestamp '2000-01-01 00:00:00.0')
      and coalesce(date_trunc('month', "t7"."__fcol_21"), timestamp '2001-01-01 00:00:00.0') = coalesce(cast("t4"."__fcol_17" as timestamp), timestamp '2001-01-01 00:00:00.0')
    )
  )
  and "t7"."__fcol_17" in ('得分')
)
group by 
  1, 
  2

测试时间为:200.4s

测试结果:

2.png


临时修改超时时间:

将临时修改语句添加到sql中:

3.png

5.png

测试时间为:272.4s

测试结果:

任务运行时间超过全局配置的200s,任务正常运行成功,临时设置session超时生效

4.png


相关文章

MySQL gh-ost DDL 变更工具

MySQL gh-ost DDL 变更工具

1. MDL 锁介绍MySQL 的锁可以分为四类:MDL 锁、表锁、行锁、GAP 锁,其中除了 MDL 锁是在 Server 层加的之外,其它三种都是在 InnoDB 层加的。下面主要介绍一下:MDL...

Hbase热点现象

热点现象:HBase热点现象是指在分布式存储系统HBase中,由于数据访问不均衡而导致部分Region Server负载过重的情况。这种不均衡通常是由于某些特定的数据行或列族频繁地被访问,从而导致某个...

HAProxy

HAProxy

1、HAProxy简介  HAProxy 是一款基于 TCP(第四层)和 HTTP(第七层)应用的代理软件,它也可作为负载均衡器,而且完全免费。 借助 HAProxy,可以快速并且可靠地提供基于 TC...

flink算子优化

flink算子优化

这里先看两个任务的逻辑执行图:图一:全部打散的任务执行图图二:使用slot资源共享的任务执行图图一和图二中的两个任务是同一个任务,不同点是图一将所有的算子全部打散,在代码中使用了以下逻辑:,或者就是禁...

DBMS_SYSTEM跟踪10046

SET_SQL_TRACE_IN_SESSION只能设置level 1的10046事件--启用level 1 Trace EXEC SYS.DBMS_SYSTEM.SET_SQL_TRACE_IN_...

MySQL排障实战(一)—— 连接异常中断

MySQL排障实战(一)—— 连接异常中断

问题背景数栈数据质量模块,接入客户的数据源后,一执行就报错。报错信息:{"logInfo": {{"jobid":"1a4ebbbd&quo...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。