SQL Execution
Run SQL queries, inspect table schemas, and manage warehouse connections.
Example prompts
Section titled “Example prompts”“Show me the top 10 customers by revenue from the sales table”
“What columns and types does catalog.schema.orders have?”
“Run these three queries in parallel and combine the results”
execute_sql
Section titled “execute_sql”Description: Execute SQL query on Databricks warehouse. Auto-selects warehouse if not provided.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
sql_query | str | Yes | — |
warehouse_id | str | No | — |
catalog | str | No | — |
schema | str | No | — |
timeout | int | No | — |
query_tags | str | No | — |
output_format | str | No | — |
execute_sql_multi
Section titled “execute_sql_multi”Description: Execute multiple SQL statements with dependency-aware parallelism. Independent queries run in parallel.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
sql_content | str | Yes | — |
warehouse_id | str | No | — |
catalog | str | No | — |
schema | str | No | — |
timeout | int | No | — |
max_workers | int | No | — |
query_tags | str | No | — |
output_format | str | No | — |
get_table_stats_and_schema
Section titled “get_table_stats_and_schema”Description: Get schema and stats for tables. table_stat_level: NONE (schema only), SIMPLE (default, +row count), DETAILED (+cardinality/min/max/histograms).
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
catalog | str | Yes | — |
schema | str | Yes | — |
table_names | List[str] | No | — |
table_stat_level | str | No | — |
warehouse_id | str | No | — |
get_volume_folder_details
Section titled “get_volume_folder_details”Description: Get schema/stats for data files in Volume folder. format: parquet/csv/json/delta/file.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
volume_path | str | Yes | — |
format | str | No | — |
table_stat_level | str | No | — |
warehouse_id | str | No | — |
manage_warehouse
Section titled “manage_warehouse”Description: Manage SQL warehouses: list, get_best.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
action | str | No | — |