Presto临时设置session超时时间

耀灵4个月前技术文章129

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


相关文章

单节点Kafka部署并开启Kerberos配置

安装Kerberosserver节点安装kerberos相关软件yum install -y krb5-server krb5-workstation krb5-libs修改配置文件krb5.conf...

python-日志分析

1、概述生产中会生成大量的系统日志、应用程序日志、安全日志等等日志,通过对日志的分析可以了解服务器的负载、健康状况,可以分析客户的分布情况、客户的行为,甚至基于这些分析可以做出预测。一般采集流程:日志...

Elasticsearch数据规划

1.1 为什么数据规划很重要任何系统都有一套更为适用的规则或者其系统规格,前期的详细设计能为我们后期维护优化节约大量的精力。在我们实际的经验中,发现大部分问题(分片严重超规格,单个分片超大,索引map...

mysql 导出 csv 参数 secure_file_priv 设置

mysql 导出 csv 参数 secure_file_priv 设置

一、功能secure_file_priv 参数是用来限制数据导入和导出操作的效果,例如由LOAD data和SELECT…INTO OUTFILE语句和LOAD_FILE()函数。只有具有“FILE”...

kafka单条消息过大导致线上OOM

1 线上问题kafka生产者罢工,停止生产,生产者内存急剧升高,导致程序几次重启。查看日志,发现Produce程序爆异常kafka.common.MessageSizeTooLargeExceptio...

oracle设置归档路径和格式

1.归档文件格式设置说明:设置归档日志名称格式:alter system set log_archive_format='arch_%t_%s_%r.arc' scope=spfile sid='*'...

发表评论    

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