In Google BigQuery API, what is the default timeout for a query response?

。_饼干妹妹 提交于 2020-06-16 03:41:30

问题


In Google BigQuery API, what is the default timeout for a query response?

In other words, how long does it wait by default until the response returns null for an incomplete job.


回答1:


The documentation for timeoutMs in the jobs.query says:

[Optional] How long to wait for the query to complete, in milliseconds, before the request times out and returns. Note that this is only a timeout for the request, not the query. If the query takes longer to run than the timeout value, the call returns without any results and with the 'jobComplete' flag set to false. You can call GetQueryResults() to wait for the query to complete and read the results. The default value is 10000 milliseconds (10 seconds).

If I understand correctly, though, I think you're asking how long a query can execute before timing out. We limit query execution to six hours (at the time of this writing), though I don't know if that's explicitly documented somewhere. In general, though, queries shouldn't take nearly that long to run.

If you want to impose a stricter timeout on query completion, you could use the jobs.cancel API after a specific amount of elapsed time, though note that you will still be charged for execution of the query.



来源:https://stackoverflow.com/questions/40160472/in-google-bigquery-api-what-is-the-default-timeout-for-a-query-response

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!