我正在使用来自bash脚本的presto cli来提取一些简单的数据到csv。我尝试使用--client-request-timeout参数并将其设置为5s (它表示默认值为2m)。我的查询大约需要1分钟,但是我没有收到超时错误(我正在尝试查看错误的内容,以便可以在bash脚本中处理它以通知查询失败)。
我尝试在1-10秒之间切换--client-request- timeout,但无法使查询超时,并且需要一分钟才能返回。
sudo /folder/to/presto-cli --server server:8080 --catalog catalog --user user --schema some_customer --client-request-timeout 5s --execute "select val1, val2, sum(count) from table where processed=false group by val1, val2;"我希望presto-cli会给我一个错误,然后我可以在我的bash脚本中处理这个错误。
发布于 2019-05-14 16:05:53
您可以使用query_max_execution_time会话属性设置查询时间限制。
SET SESSION query_max_execution_time = '30s';您可以使用SHOW SESSION query (或looking at the source code)获取支持的会话属性列表。
对于presto-cli,使用--session arg传递以下内容:
presto-cli --session query_max_execution_time=30s ... 示例
$ presto-cli --session query_max_execution_time=15s \
--execute "select count(distinct regexp_extract(comment, '([a-zA-Z ]+)+$')) from tpch.tiny.lineitem"
Query failed: Query exceeded the maximum execution time limit of 15.00shttps://stackoverflow.com/questions/56029323
复制相似问题