Share via


queries command group

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.

The queries command group within the Databricks CLI allows you to perform get, create, update, and delete operations on queries. A query is a Databricks SQL object that includes the target SQL warehouse, query text, name, description, tags, and parameters. See Access and manage saved queries.

databricks queries create

Create a query.

databricks queries create [flags]

Options

--auto-resolve-display-name

    If true, automatically resolve query display name conflicts.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

databricks queries delete

Move a query to the trash. Trashed queries immediately disappear from searches and list views, and cannot be used for alerts. You can restore a trashed query through the UI. A trashed query is permanently deleted after 30 days.

databricks queries delete ID [flags]

Arguments

ID

    The ID of the query to delete

Options

Global flags

databricks queries get

Get a query.

databricks queries get ID [flags]

Arguments

ID

    The ID of the query to get

Options

Global flags

databricks queries list

List queries accessible to the user, ordered by creation time.

Important

Running this command concurrently 10 or more times could result in throttling, service degradation, or a temporary ban.

databricks queries list [flags]

Options

--page-size int

    Number of queries to return per page

--page-token string

    Token for pagination

Global flags

databricks queries update

Update a query.

databricks queries update ID UPDATE_MASK [flags]

Arguments

ID

    The ID of the query to update

UPDATE_MASK

    The field mask must be a single string, with multiple fields separated by commas (no spaces). The field path is relative to the resource object, using a dot (.) to navigate sub-fields (e.g., author.given_name). Specification of elements in sequence or map fields is not allowed, as only the entire collection field can be specified. Field names must exactly match the resource field names.

    An asterisk field mask (*) indicates full replacement. It's recommended to always explicitly list the fields being updated and avoid using wildcards, as it can lead to unintended results if the API changes in the future.

Options

--auto-resolve-display-name

    If true, automatically resolve alert display name conflicts.

--json JSON

    The inline JSON string or the @path to the JSON file with the request body.

Global flags

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