Editor Pane

The DataAnalyst role must be assigned to each user who needs access to the Query Editor, including SuperAdmins.

Please be sure to use it cautiously, as it provides access to read potentially sensitive data.

The Editor Pane consists of four parts:

Sheet Tabs

Sheet tabs help to add paragraphs where the user can write and execute queries. Multiple sheet tabs can be created to organize your queries. Each tab can be given a name and edited later. You can add or delete tabs, and the order of the tabs will be autosaved.

More feature

Click the kebab menu (three dots) option to access additional features. The features available are :

Keyboard Shortcuts

You can access these shortcuts by clicking on the kebab menu (three dots) option and then 'Keyboard Shortcuts' button. They can also be accessed by pressing the 'F1' key.

The following shortcuts are available for the specified actions.

ActionShortcut

Run Query

<cmd> + enter

Abort Query

<cmd> + esc

Find and Replace

<cmd> + f

Format Query

<cmd> + shift + o

Maximize/Minimize Editor

<option> + shift + m

Show/Hide Result

<option> + shift + t

Add Paragraph Above

<cmd> + shift + a

Add Paragraph Below

<cmd> + shift + b

Delete Paragraph

<cmd> + shift + d

Undo

<cmd> + z

Redo

<cmd> + shift + z

Show keyboard Shortcuts

F1

Duplicate

This feature duplicates the current tab, preserving the executed queries only. The results will not be copied to the new tab.

You can add up to 25 paragraphs in each tab.

Query Action Bar

The Query Action Bar allows you to select the catalog, database, and cluster on which you want to run the query. The selected components will remain the same for all the paragraphs in that particular sheet. You can save the queries in all the paragraphs by clicking the Save button.

Managing Paragraphs

Queries can be written, edited, and run in multiple paragraphs to organize work. You can name a each paragraph as per your requirement. You can open multiple paragraphs, by clicking on the + Add Paragraph option provided below each paragraph. There are multiple options provided in the kebab menu to customize your view of each paragraph, below are the options:

  • Hide/Show Editor: It allows you to show or hide the editor for a particular paragraph.

  • Hide/Show Output: It allows you to show or hide the query result output for a particular paragraph.

  • Maximize/Minimize Paragraph: It allows you to increase or decrease the size of the paragraph. It is beneficial to view large queries.

  • Add paragraphs above/below: It allows you to add one paragraph above or below depending on your choice.

  • Delete Paragraph: It allows you to delete the paragraph if you do not require it.

Run a Query

If the Cluster used to run the query is suspended, the user will be asked for consent to resume the Cluster before the query is run.

A query can be run from the paragraph in two ways:

  • Click the Run button

  • Press Cmd + Enter

In a single paragraph, multiple queries cannot be executed but can be written and executed selectively. Only single query will be executed.

Stop a Query

When a query is running the Run button will change to Cancel. Click Cancel to stop any running query.

Set Default LIMITs

A default LIMIT can be set to prevent inadvertently running queries without a defined LIMIT, which may incur high infrastructure costs.

To set a LIMIT, click the drop-down arrow next to the Run button and select the desired limit.

The LIMIT options are:

  1. NO LIMIT: The query will run till all results are available.

  2. LIMIT 10: The query will stop executing after the first 10 results are available.

  3. LIMIT 100: The query will stop executing after the first 100 results are available.

  4. LIMIT 1000: The query will stop executing after the first 1000 results are available.

The Query Editor will display only the first 10,000 results. To access more than 10,000 rows use an external connector.

SQL Query Editor

The SQL query text should be entered in the SQL Query Editor.

Selectively Run Queries

Although multiple queries can be written in the same paragraph, if a user wants to run only one query, simply place the cursor on the line containing the query (before the :), prior to clicking Run.

If the cursor is on the last line of the SQL Query Editor, only the last query will be run.

Queries can also be commented out using standard SQL syntax -- (single-line comments) or /* */ (multi-line comments).

Auto-Completion

As you type a query, the SQL editor suggests commands and functions, suggesting various ways to finish the command or function you've started. To select a proposal, hit the Tab key to accept it, or keep typing to dismiss the dialogue window.

Find & Replace

The Find & Replace feature can search or replace strings that match a pattern in the query text.

Open Find & Replace

Press CMD + F (MacOS) or CTRL + F (Windows) to bring up the search dialog.

Find

  • Type the string to search for in the Search for... field.

  • The search will start highlighting matches when the first character is entered.

  • Use the < and > buttons to toggle between appearances of the search string.

  • Click the All button to highlight all appearances of the search string.

Replace & Replace All

  • Click the + button to open the Replace field.

  • Type the string to search for in the Search for... field.

  • Enter the string that should replace the search string in the Replace with... field.

  • Click Replace to replace only the current selected instance of the search string, or click All to replace all instances.

  • Click the .* button to enable the RegExp search feature.

  • Enter the regular expression to search for in the Search for... field.

  • Click the Aa button to toggle on case sensitivity in search.

  • Click the \b button to toggle on Whole Word Search, this will return only complete matches to the search string.

Search in Selection

  • Click the S button to toggle on Search in Selection which only searches within the lines selected by the user.

Error Highlighting

Error highlighting helps identify and rectify errors in the queries. In case of any error, the line or query paragraph containing the error will be highlighted in the query editor.

Last updated