For example, you should not be checking the status field to find out if you need to wait longer for a query. As the Presto owners suggest:
The status field is only for displaying to humans as a hint about the query's state on the server. It is not in sync in the query state from the client's perspective and must not be used to determine whether the query is finished.
Your code doesn't look like it follows what the Presto owners have dictated as the best way to interact with it via HTTP:
https://github.com/prestodb/presto/wiki/HTTP-Protocol
For example, you should not be checking the
status
field to find out if you need to wait longer for a query. As the Presto owners suggest:Instead, the code should be checking for a 503.