> ## 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

> Querying Databricks through the stored Aero-compatible semantic layer. Includes SDK V2 guidance, input constraints, response fields, and Deepline credit cost.

Querying Databricks through the stored Aero-compatible semantic layer.

<Info>
  Tool ID: `databricks_run_semantic_query`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
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={null}
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 exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "rows": [
      {}
    ],
    "rowCount": 123,
    "limited": true,
    "columns": [
      "example"
    ],
    "statementId": "statement_123"
  },
  "meta": {}
}
```

Use `deepline tools get 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={null}
  {
    "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={null}
  {
    "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](/docs/providers/databricks/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
