Skip to content

Chunk download latency#634

Merged
saishreeeee merged 22 commits into
sea-migrationfrom
chunk-latency
Jul 21, 2025
Merged

Chunk download latency#634
saishreeeee merged 22 commits into
sea-migrationfrom
chunk-latency

Conversation

@saishreeeee

@saishreeeee saishreeeee commented Jul 13, 2025

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Other

Description

Record chunk download latency
Added chunk_id to SqlExecutionEvent and ResultDownloadHandler

How is this tested?

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

Ran the query: SELECT * FROM RANGE(20000000)
Latency was recorded for 4 chunks.
The latency log for the 1st chunk:

{
  "frontend_log_event_id": "e684ff49-9026-49af-abb6-687a6a16e565",
  "context": {
    "client_context": {
      "timestamp_millis": 1752467452769,
      "user_agent": "PyDatabricksSqlConnector/4.0.5"
    }
  },
  "entry": {
    "sql_driver_log": {
      "session_id": "01f0606b-4825-118d-abd2-87f5748c7dd3",
      "system_configuration": {
        "driver_version": "4.0.5",
        "os_name": "Darwin",
        "os_version": "24.5.0",
        "os_arch": "arm64",
        "runtime_name": "Python 3.13.3",
        "runtime_version": "3.13.3",
        "runtime_vendor": "CPython",
        "driver_name": "Databricks SQL Python Connector",
        "char_set_encoding": "utf-8",
        "locale_name": "en_US"
      },
      "driver_connection_params": {
        "http_path": <HTTP_PATH>,
        "mode": "THRIFT",
        "host_info": {
          "host_url": <SERVER_HOSTNAME>,
          "port": 443
        },
        "auth_mech": "PAT"
      },
      "sql_statement_id": "01f0606b-4854-1f89-a0cb-d5860332ef81",
      "sql_operation": {
        "statement_type": "QUERY",
        "is_compressed": true,
        "execution_result": "EXTERNAL_LINKS",
        "chunk_id": 0
      },
      "operation_latency_ms": 15882
    }
  }
}

Related Tickets & Documents

PECOBLR-653

Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
varun-edachali-dbx and others added 2 commits July 14, 2025 09:35
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
-
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
@saishreeeee saishreeeee marked this pull request as ready for review July 14, 2025 04:46
@saishreeeee saishreeeee self-assigned this Jul 14, 2025
@saishreeeee saishreeeee requested a review from jprakash-db July 14, 2025 04:46
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Comment thread src/databricks/sql/backend/thrift_backend.py Outdated
Comment thread src/databricks/sql/cloudfetch/downloader.py Outdated
Comment thread src/databricks/sql/telemetry/latency_logger.py
Comment thread src/databricks/sql/telemetry/latency_logger.py Outdated
Comment thread src/databricks/sql/telemetry/latency_logger.py Outdated
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Comment thread src/databricks/sql/result_set.py Outdated
@vikrantpuppala

Copy link
Copy Markdown
Contributor

@jayantsing-db can you take a look, this PR adds latency logs (merges into sea-migration) as there are some refactorings that this PR leverages

Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Comment thread src/databricks/sql/client.py Outdated
Comment thread tests/unit/test_cloud_fetch_queue.py
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>

@jprakash-db jprakash-db left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks for making the changes

Comment thread src/databricks/sql/backend/thrift_backend.py
Comment thread src/databricks/sql/result_set.py Outdated
Comment thread src/databricks/sql/result_set.py
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>

@varun-edachali-dbx varun-edachali-dbx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@saishreeeee saishreeeee merged commit b57c3f3 into sea-migration Jul 21, 2025
0 checks passed
@varun-edachali-dbx varun-edachali-dbx mentioned this pull request Jul 23, 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.

4 participants