Files
crewAI/docs/en/tools/search-research/databricks-query-tool.mdx
Tony Kipkemboi 1a1bb0ca3d docs: Docs updates (#3459)
* docs(cli): document device-code login and config reset guidance; renumber sections

* docs(cli): fix duplicate numbering (renumber Login/API Keys/Configuration sections)

* docs: Fix webhook documentation to include meta dict in all webhook payloads

- Add note explaining that meta objects from kickoff requests are included in all webhook payloads
- Update webhook examples to show proper payload structure including meta field
- Fix webhook examples to match actual API implementation
- Apply changes to English, Korean, and Portuguese documentation

Resolves the documentation gap where meta dict passing to webhooks was not documented despite being implemented in the API.

* WIP: CrewAI docs theme, changelog, GEO, localization

* docs(cli): fix merge markers; ensure mode: "wide"; convert ASCII tables to Markdown (en/pt-BR/ko)

* docs: add group icons across locales; split Automation/Integrations; update tools overviews and links
2025-09-05 17:40:11 -04:00

82 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: Databricks SQL Query Tool
description: The `DatabricksQueryTool` executes SQL queries against Databricks workspace tables.
icon: trowel-bricks
mode: "wide"
---
# `DatabricksQueryTool`
## Description
Run SQL against Databricks workspace tables with either CLI profile or direct host/token authentication.
## Installation
```shell
uv add crewai-tools[databricks-sdk]
```
## Environment Variables
- `DATABRICKS_CONFIG_PROFILE` or (`DATABRICKS_HOST` + `DATABRICKS_TOKEN`)
Create a personal access token and find host details in the Databricks workspace under User Settings → Developer.
Docs: https://docs.databricks.com/en/dev-tools/auth/pat.html
## Example
```python Code
from crewai import Agent, Task, Crew
from crewai_tools import DatabricksQueryTool
tool = DatabricksQueryTool(
default_catalog="main",
default_schema="default",
)
agent = Agent(
role="Data Analyst",
goal="Query Databricks",
tools=[tool],
verbose=True,
)
task = Task(
description="SELECT * FROM my_table LIMIT 10",
expected_output="10 rows",
agent=agent,
)
crew = Crew(
agents=[agent],
tasks=[task],
verbose=True,
)
result = crew.kickoff()
print(result)
```
## Parameters
- `query` (required): SQL query to execute
- `catalog` (optional): Override default catalog
- `db_schema` (optional): Override default schema
- `warehouse_id` (optional): Override default SQL warehouse
- `row_limit` (optional): Maximum rows to return (default: 1000)
## Defaults on initialization
- `default_catalog`
- `default_schema`
- `default_warehouse_id`
### Error handling & tips
- Authentication errors: verify `DATABRICKS_HOST` begins with `https://` and token is valid.
- Permissions: ensure your SQL warehouse and schema are accessible by your token.
- Limits: longrunning queries should be avoided in agent loops; add filters/limits.