Presto临时设置session超时时间

耀灵2年前技术文章1027

全局默认超时时间为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


相关文章

CDH实操--客户端安装

CDH实操--客户端安装

概述安装CDH客户端,主要是方便在CDH部署节点以外,通过客户端的方式连接CDH上的hdfs,hive和hbase服务1、安装jdk(适配CDH即可,一般1.8)2、获取安装包3、部署安装包把安装包解...

Linux运维工具

1.1 查看进程占用带宽情况 - NethogsNethogs 是一个终端下的网络流量监控工具可以直观的显示每个进程占用的带宽。1.2 硬盘读取性能测试 - IOZoneIOZone 是一款 Linu...

切换不同的网络访问同一个业务报错"network error"

切换不同的网络访问同一个业务报错"network error"

问题现象:业务:xxx,使用谷歌浏览器登陆之后,访问“商品档案”模块,会提示“network error”报错内容,但是切换到其他浏览器测试是可以正常访问的,同时,在使用谷歌浏览器访问的情况下,如果切...

oracle开启关闭归档

一、开启归档1.开启前准备:备份spfileCreate pfile='d:pfileSID.ora' from spfile;OS上创建归档目录:+DATA_DG/arch设置归档路径:alter...

Nginx实现数据库端口转发

一、需求客户想要将IDC服务器的数据库端口暴漏在公网上,然后其他业务来调数据库接口。为了保证安全,只开放指定的公网ip访问。二、逻辑设计由于客户的IDC服务器与云ECS服务器通过专线打通,所以只需要在...

Ranger-hase插件部署

Ranger-hase插件部署

解压插件tar -zxf  ranger-2.3.0-hbase-plugin.tar.gz -C /opt修改配置vi install.properties 内容如下:POLICY_MGR_URL=...

发表评论    

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