Skip to content

SQL Execution

Run SQL queries, inspect table schemas, and manage warehouse connections.

“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”


Description: Execute SQL query on Databricks warehouse. Auto-selects warehouse if not provided.

Parameters:

ParameterTypeRequiredDescription
sql_querystrYes
warehouse_idstrNo
catalogstrNo
schemastrNo
timeoutintNo
query_tagsstrNo
output_formatstrNo

Description: Execute multiple SQL statements with dependency-aware parallelism. Independent queries run in parallel.

Parameters:

ParameterTypeRequiredDescription
sql_contentstrYes
warehouse_idstrNo
catalogstrNo
schemastrNo
timeoutintNo
max_workersintNo
query_tagsstrNo
output_formatstrNo

Description: Get schema and stats for tables. table_stat_level: NONE (schema only), SIMPLE (default, +row count), DETAILED (+cardinality/min/max/histograms).

Parameters:

ParameterTypeRequiredDescription
catalogstrYes
schemastrYes
table_namesList[str]No
table_stat_levelstrNo
warehouse_idstrNo

Description: Get schema/stats for data files in Volume folder. format: parquet/csv/json/delta/file.

Parameters:

ParameterTypeRequiredDescription
volume_pathstrYes
formatstrNo
table_stat_levelstrNo
warehouse_idstrNo

Description: Manage SQL warehouses: list, get_best.

Parameters:

ParameterTypeRequiredDescription
actionstrNo