Starburst Galaxy

  •  Get started

  •  Working with data

  •  Data engineering

  •  Developer tools

  •  Cluster administration

  •  Security and compliance

  •  Troubleshooting

  • Galaxy status

  •  Reference

  • Query editor basics #

    The query editor offers an interactive environment for querying data and running data management SQL statements.

    Go to the query editor from anywhere in Starburst Galaxy by clicking Query > Query editor in the navigation menu, or selecting Query data from the more_vert options menu in several locations, including the list of clusters.

    Explore the query editor #

    The query editor consists of a canvas area and the cluster explorer pane on the left. The canvas is split among several tabs that provide an editable space where you can write and run SQL statements. The cluster explorer pane lists the clusters available in your Galaxy account and their configured catalogs. The editor pane as a whole has several menus, which are described in the following sections.

    Location drop-down menus #

    The left corner above the editor pane contains drop-down menus that let you specify a cluster, catalog, and schema as default settings for SQL statements in the current editor tab. These settings are analogous to the SQL USE statement.

    The selections in these menus persist for each tab separately, and are restored when you reopen a saved query editor tab.

    If you have more than one cluster in your Starburst Galaxy account, you must select a cluster in order to activate the Run button. When you open a new tab, the cluster selection is empty and a message reminds you to select a cluster before querying.

    A green dot in the cluster drop-down menu means the specified cluster is currently running.

    Query location-drop-down-menus

    Options menu #

    To the right of the Run button is an more_vert options menu that shows the following options:

    • Show/Hide SQL docs: Opens or closes a pane containing the Starburst Galaxy SQL documentation.
    • Copy: Copies the current editor selection to the clipboard.
    • Prettify: Adds spaces, tabs, and newlines to the selected SQL statement where needed.
    • Command palette: Opens a dialog from which you can select editing commands to run at the current cursor location or run on the current editor selection. With the cursor in the editor pane, you can also press F1 to open the command palette. Press Esc to close the palette.

    Context menu #

    Each query editor tab contains a context menu you can activate in the standard ways: right-click on a right-hand configured mouse, double tap on a trackpad, and so on. The context menu allows you perform the following actions:

    • Explain query: Opens the Query explanation pane containing an explanation of the currently selected SQL statement or part of a SQL statement. This option appears when the current role has the Generative AI features account-level privilege. These features are not employed by default.
    • Run query: Executes the SQL statement that contains the cursor, the fully selected SQL statement, or the set of fully selected SQL statements.
    • Change All Occurrences: Use to search and replace a string in a long SQL statement being edited.
    • Prettify and Command palette: Works as described next in the options menu.
    • Cut, Copy, Paste: standard editing commands.
    • Command palette: Opens a dialog from which you can select editing commands to run at the current cursor location or run on the current editor selection. With the cursor in the editor pane, you can also press F1 to open the command palette. Press Esc to close the palette.

    Manage query editor tabs #

    You can create, edit, organize, and delete query editor tabs directly in the query editor. You can also manage query editor tabs in Saved queries where queries are stored under the query editor tab’s name automatically.

    Create a new tab #

    You can overwrite the contents of the current tab or organize your queries into separate tabs. To create a new tab, click the add button at the end of the tab row. Drag and drop tabs to rearrange them.

    Change a tab name #

    The default name for newly created query tabs is the date and time of creation. To rename a tab in the query editor, double-click the tab name.

    Timestamped query tabs and named query tabs persist across login sessions until the tab is closed. After the tab is closed, timestamped query tabs are stored for a particular duration of time as described in Saved queries.

    Learn more #