cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

Query Hash missing

FatemaMalu
New Contributor II

From the following Databricks API  /api/2.0/preview/sql/queries query_hash is missing from the actual response.

But the sample response mentioned in the API documentation has it.

{
  "count": 0,
  "page": 0,
  "page_size": 0,
  "results": [
    {
      "id": "dee5cca8-1c79-4b5e-a711-e7f9d241bdf6",
      "parent": "folders/2025532471912059",
      "latest_query_data_id": "46697357-0db7-47dd-ae4c-850f5b060287",
      "name": "Orders by month by customer",
      "description": "Summarizes total order dollars for customers in the Europe/Asia region.",
      "query": "SELECT field FROM table WHERE field = {{ param }}",
      "query_hash": "string",
      "is_archived": true,
      "is_draft": true,
      "updated_at": "2021-01-07T20:29:24.289Z",
      "created_at": "2020-12-15T18:39:15.837Z",
      "data_source_id": "0c205e24-5db2-4940-adb1-fb13c7ce960b",
      "options": {
        "moved_to_trash_at": "2019-08-24T14:15:22Z",
        "parameters": [
          {
            "title": "string",
            "name": "string",
            "type": "text",
            "value": {}
          }
        ]
      },
      "tags": [
        "string"
      ],
      "is_safe": false,
      "user_id": 899619779028913,
      "last_modified_by_id": 0,
      "visualizations": [
        {
          "id": "string",
          "type": "string",
          "name": "string",
          "description": "string",
          "options": {},
          "updated_at": "2019-08-24T14:15:22Z",
          "created_at": "2019-08-24T14:15:22Z"
        }
      ],
      "is_favorite": true,
      "user": {
        "id": 0,
        "name": "string",
        "email": "user@example.com"
      },
      "last_modified_by": {
        "id": 0,
        "name": "string",
        "email": "user@example.com"
      },
      "can_edit": true,
      "permission_tier": "CAN_VIEW",
      "run_as_role": "viewer"
    }
  ]
}

 

2 REPLIES 2

Kaniz_Fatma
Community Manager
Community Manager

Hi @FatemaMalu, Did you try the other fields, such as the id field to uniquely identify a query and its associated metadata?

Hi @Kaniz_Fatma, I did try fetching uniquely using the id field as well, couldn't get query_hash.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group