Databricks icon

Databricks

Interact with Databricks API

Databricks SQL → Execute Query

AI-generated

Summary

Execute a SQL query on a specified Databricks SQL warehouse and wait for the query to complete, returning the query results as JSON objects.

Inputs

  • Warehouse (required) — Specify the SQL warehouse to use for executing the query. You can select from a list of warehouses, enter the warehouse ID directly, or provide the warehouse URL to extract the ID.
  • Query (required) — The SQL query string to be executed on the selected SQL warehouse.

Output shape

a list of JSON objects

Each output item corresponds to a row in the query result, with keys as column names and values as the cell data. The node waits for the query execution to complete, polling up to 5 minutes timeout. If the query fails or is canceled, the node throws an error.

Examples

Example 1: Run a SQL query to retrieve the first 10 rows from a table

Select the Databricks SQL resource, choose Execute Query operation, select a SQL warehouse, and enter a SELECT query (e.g., SELECT * FROM my_table LIMIT 10). The node outputs each row as a JSON object with columns mapped to their values.

Links

Discussion