Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.
Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.
Note
A new version of the Databricks SQL API is now available. See Update to the latest Databricks SQL API version. To perform operations on new Databricks SQL queries, see queries
command group.
The queries-legacy
command group within the Databricks CLI allows you to perform get, create, update, and delete operations on legacy query definitions.
databricks queries-legacy create
Create a new query definition. Queries created with this endpoint belong to the authenticated user making the request.
The data_source_id
field specifies the ID of the SQL warehouse to run this query against. You can use the data-sources command to see a complete list of available SQL warehouses. Or you can copy the data_source_id
from an existing query.
Note
You cannot add a visualization until you create the query.
databricks queries-legacy create [flags]
Options
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
databricks queries-legacy delete
Move a query to the trash. Trashed queries immediately disappear from searches and list views, and they cannot be used for alerts. The trash is deleted after 30 days.
databricks queries-legacy delete QUERY_ID [flags]
Arguments
QUERY_ID
The ID of the query to delete
Options
databricks queries-legacy get
Get a query object definition along with contextual permissions information about the currently authenticated user.
databricks queries-legacy get QUERY_ID [flags]
Arguments
QUERY_ID
The ID of the query to get
Options
databricks queries-legacy list
Get a list of queries. Optionally, this list can be filtered by a search term.
Important
Running this command concurrently 10 or more times could result in throttling, service degradation, or a temporary ban.
databricks queries-legacy list [flags]
Options
--order string
Name of query attribute to order by.
--page int
Page number to retrieve.
--page-size int
Number of queries to return per page.
--q string
Full text search term.
databricks queries-legacy restore
Restore a query that has been moved to the trash. A restored query appears in list views and searches. You can use restored queries for alerts.
databricks queries-legacy restore QUERY_ID [flags]
Arguments
QUERY_ID
The ID of the query to restore
Options
databricks queries-legacy update
Modify a query definition.
Note
You cannot undo this operation.
databricks queries-legacy update QUERY_ID [flags]
Arguments
QUERY_ID
The ID of the query to update
Options
--data-source-id string
Data source ID maps to the ID of the data source used by the resource and is distinct from the warehouse ID.
--description string
General description that conveys additional information about this query such as usage notes.
--json JSON
The inline JSON string or the @path to the JSON file with the request body.
--name string
The title of this query that appears in list views, widget headings, and on the query page.
--query string
The text of the query to be run.
--run-as-role RunAsRole
Sets the Run as role for the object. Supported values: owner
, viewer
Global flags
--debug
Whether to enable debug logging.
-h
or --help
Display help for the Databricks CLI or the related command group or the related command.
--log-file
string
A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.
--log-format
format
The log format type, text
or json
. The default value is text
.
--log-level
string
A string representing the log format level. If not specified then the log format level is disabled.
-o, --output
type
The command output type, text
or json
. The default value is text
.
-p, --profile
string
The name of the profile in the ~/.databrickscfg
file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT
is used.
--progress-format
format
The format to display progress logs: default
, append
, inplace
, or json
-t, --target
string
If applicable, the bundle target to use