Skip to content

Conversation

@jprakash-db
Copy link
Contributor

@jprakash-db jprakash-db commented Feb 25, 2025

Description

Polling using the async API returned the RESOURCE_NOT_FOUND error for async executed queries

Fix

Force retention of data on the server side by not returning the results in the direct results within the execute_query response

Testing

Added e2e tests

# For async operation we don't want the direct results
getDirectResults=ttypes.TSparkGetDirectResults(
maxRows=max_rows, maxBytes=max_bytes
maxRows=0 if async_op else max_rows,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of setting maxRows as 0, I would recommend not specifying the direct result object in the request altogether. This is to make the intention clear of not expecting the direct results.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have made the object None

Comment on lines +902 to 907
getDirectResults=None
if async_op
else ttypes.TSparkGetDirectResults(
maxRows=max_rows,
maxBytes=max_bytes,
),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have a linter for python driver yet? if not, could you please open an issue to community or internally?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jayantsing-db I can raise a new PR for that

with self.cursor() as cursor:
while duration < min_duration:
assert scale_factor < 512, "Detected infinite loop"
assert scale_factor < 1024, "Detected infinite loop"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For long running queries the previous upper limit of scale factor was not sufficient to run queries for atleast 5 minutes, hence increased it

@jprakash-db jprakash-db merged commit fb3e32c into release/v3.7.3 Feb 28, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants