> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Databricks: Actions/run Semantic Query

> Query Databricks by metrics, dimensions and filters from your saved semantic layer, without writing SQL. Includes SDK V2 examples, schemas, and cost.

Query Databricks by metrics, dimensions and filters from your saved semantic layer, without writing SQL.

> [!NOTE]
>
> Tool ID: `databricks_run_semantic_query`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'databricks_run_semantic_query',
  {
    "credentials": {
      "host": "api.example.com",
      "warehouse_id": "warehouse_123"
    },
    "renderer_version": "v2",
    "rowLimit": 5000
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute databricks_run_semantic_query --input '{
  "credentials": {
    "host": "api.example.com",
    "warehouse_id": "warehouse_123"
  },
  "renderer_version": "v2",
  "rowLimit": 5000
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "rows": [
      {}
    ],
    "rowCount": 123,
    "limited": true,
    "columns": [
      "example"
    ],
    "statementId": "statement_123"
  },
  "meta": {}
}
```

Use `deepline describe databricks_run_semantic_query --json` for the latest machine-readable contract.

## Input reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.credentials` | `object` | No | — | — |
| `payload.renderer_version` | `"v2"` | No | `"v2"` | — |
| `payload.rowLimit` | `integer` | No | `5000` | Minimum: 1. Maximum: 100000. |
| `payload.timeoutMs` | `integer` | No | `120000` | Minimum: 1000. Maximum: 600000. |
| `payload.name` | `string` | No | — | — |
| `payload.output_df_name` | `string` | No | — | — |
| `payload.type` | `"metrics" \| "funnel" \| null` | No | — | — |
| `payload.params` | `record` | No | — | — |
| `payload.table_name` | `string` | No | — | — |
| `payload.metrics` | `array` | No | — | — |
| `payload.dimensions` | `array` | No | — | — |
| `payload.custom_dimensions` | `array` | No | — | — |
| `payload.facts` | `array` | No | — | — |
| `payload.filters` | `array` | No | — | — |
| `payload.custom_filter_expressions` | `array` | No | — | — |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "credentials": {
        "type": "object",
        "properties": {
          "host": {
            "type": "string",
            "description": "HTTPS Databricks workspace URL."
          },
          "token": {
            "type": "string",
            "description": "Databricks PAT or OAuth access token."
          },
          "client_id": {
            "type": "string",
            "description": "Databricks service-principal OAuth client ID."
          },
          "client_secret": {
            "type": "string",
            "description": "Databricks service-principal OAuth secret."
          },
          "assume_group": {
            "type": "string",
            "description": "Optional Databricks RBAC group id to assume for OAuth M2M execution."
          },
          "warehouse_id": {
            "type": "string",
            "description": "Databricks SQL warehouse ID."
          },
          "catalog": {
            "type": "string"
          },
          "schema": {
            "type": "string"
          }
        },
        "required": [
          "host",
          "warehouse_id"
        ],
        "additionalProperties": false
      },
      "renderer_version": {
        "type": "string",
        "default": "v2",
        "const": "v2"
      },
      "rowLimit": {
        "type": "integer",
        "default": 5000,
        "minimum": 1,
        "maximum": 100000
      },
      "timeoutMs": {
        "type": "integer",
        "default": 120000,
        "minimum": 1000,
        "maximum": 600000
      },
      "name": {
        "type": [
          "string",
          "null"
        ]
      },
      "output_df_name": {
        "type": [
          "string",
          "null"
        ]
      },
      "type": {
        "anyOf": [
          {
            "type": "string",
            "const": "metrics"
          },
          {
            "type": "string",
            "const": "funnel"
          },
          {
            "type": "null"
          }
        ]
      },
      "params": {
        "type": [
          "object",
          "null"
        ],
        "additionalProperties": {}
      },
      "table_name": {
        "type": "string"
      },
      "metrics": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "type": "string"
        }
      },
      "dimensions": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "type": "string"
        }
      },
      "custom_dimensions": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "type": "string"
        }
      },
      "facts": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "type": "string"
        }
      },
      "filters": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "type": "string"
        }
      },
      "custom_filter_expressions": {
        "type": [
          "array",
          "null"
        ],
        "items": {
          "type": "string"
        }
      }
    },
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | — |
| `result.data.rows` | `array` | Yes | — | — |
| `result.data.rowCount` | `integer` | Yes | — | — |
| `result.data.limited` | `boolean` | Yes | — | — |
| `result.data.columns` | `array` | Yes | — | — |
| `result.data.statementId` | `string \| null` | Yes | — | — |
| `result.data.sql` | `string` | No | — | — |
| `result.data.dataset` | `record` | No | — | — |
| `result.meta` | `record` | Yes | — | — |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "rows": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {}
            }
          },
          "rowCount": {
            "type": "integer"
          },
          "limited": {
            "type": "boolean"
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "statementId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sql": {
            "type": "string"
          },
          "dataset": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "rows",
          "rowCount",
          "limited",
          "columns",
          "statementId"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "additionalProperties": {}
      }
    },
    "required": [
      "data",
      "meta"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Databricks provider guide](https://deepline.com/docs/providers/databricks/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.