Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

SEA: Reduce network calls for synchronous commands#633

Merged
varun-edachali-dbx merged 8 commits into
sea-migrationdatabricks/databricks-sql-python:sea-migrationfrom
sea-optimise-successdatabricks/databricks-sql-python:sea-optimise-successCopy head branch name to clipboard
Jul 19, 2025
Merged

SEA: Reduce network calls for synchronous commands#633
varun-edachali-dbx merged 8 commits into
sea-migrationdatabricks/databricks-sql-python:sea-migrationfrom
sea-optimise-successdatabricks/databricks-sql-python:sea-optimise-successCopy head branch name to clipboard

Conversation

@varun-edachali-dbx
Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Refactor

Description

In execute_command we first send the execute request to the server, following which, if the request is synchronous, we poll for the request state until it is no longer in the pending state. Following this, we make an additional GET request to the server to get the final request information. There are two areas of improvement:

  • if the request is small and completes execution (i.e., reaches the SUCCEEDED state) within the wait_timeout, then we need not poll for completion or make another GET request to the server. We can immediately construct our ResultSet with the provided response.
  • While we poll for the request state, if the state reaches SUCCEEDED then the response is accompanied by the response data that we need to construct the ResultSet. We need not make another GET request to the server after we are done polling and can instead utilise the last response provided.

How is this tested?

  • Unit tests
  • E2E Tests
  • Manually
  • N/A

Related Tickets & Documents

N/A

Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
@varun-edachali-dbx varun-edachali-dbx marked this pull request as ready for review July 10, 2025 02:12
Copy link
Copy Markdown
Contributor

@jayantsing-db jayantsing-db left a comment

Choose a reason for hiding this comment

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

Some questions inline.

Comment thread src/databricks/sql/backend/sea/models/responses.py
Comment thread src/databricks/sql/backend/sea/backend.py Outdated
Comment thread src/databricks/sql/backend/sea/backend.py Outdated
Comment thread src/databricks/sql/backend/sea/backend.py Outdated
Comment thread src/databricks/sql/backend/sea/backend.py Outdated
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
@varun-edachali-dbx varun-edachali-dbx merged commit 8fbca9d into sea-migration Jul 19, 2025
23 checks passed
@varun-edachali-dbx varun-edachali-dbx mentioned this pull request Jul 22, 2025
5 tasks
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.