Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for polling the status of presto queries, decoupling it from collection of results (fixing #63). Apologies on taking so long to get to it... life / etc.
Changes:
PrestoResult
and merged its functionality withPrestoQuery
. Keeping both led to some weird logic loops as each tried to keep the other up to date once polling was added.PrestoQuery.fetch
a private methodPrestoQuery._fetch
, since calling it directly leads to the iterator not being in sync.PrestoQuery
object cache the query results, otherwise there is some weird behaviour whereby if you stop iterating over the rows, you throw away all of the rows left over in the last retrieved chunk.fetchone
/fetchmany
relationship so thatfetchone
is a special case offetchmany
(because the changes above allow multiple iterators to be created over time, so long as there is only one at time, and in this way we don't create a new generator for every row).I have tested this against a presto cluster, and it works nicely for me. The unit tests appear to be failing for some reason, but I'm not convinced it is caused by this patch.