メインコンテンツまでスキップ

Trino - Query UI

Query UI is the interface that allows users to connect to Trino, browse catalogs/schemas/tables, compose and run SQL queries, view results, export data, manage query history/saved queries, and use table quick actions.

Connect to Trino

Displays the Trino connection screen before using the Query UI, in case the user does not have a session or needs to reconnect.

Query UI

Connect Query UI

  • Step 1: On the Trino Dashboard > Query Editor screen, enter your Username and Password.
  • Step 2: Click Connect to establish the connection.
  • Step 3: Once successfully connected, the system redirects to the Query Editor screen.

Query Editor

Displays the main working area of the Query UI, which includes the toolbar, catalog drawer, SQL editor, and result panel. Users can enter SQL, format queries, run queries, and manage multiple query tabs.

Compose and Run Queries

  • Step 1: In the Query Editor screen, enter your SQL query in the editor area.
  • Step 2: Click Format SQL if you need to format the query.
  • Step 3: Click Run query to submit the query to the Trino backend.
  • Step 4: Monitor the execution status in the Result Panel.

Note: If the editor is empty, the system will not execute the query or will display a validation message. Valid queries return a FINISHED status.

Manage Query Tabs

  • Step 1: Click Add tab to create a new query tab.
  • Step 2: Select the desired tab to switch the editor content and query context.
  • Step 3: Click Close tab if you want to close the current tab.

Note: Each tab should retain its respective query content and results within the scope of the session. If a tab contains unsaved content, the user should review it before closing.

Catalog Drawer

Displays the list of catalogs, schemas, tables, and columns that the user has permission to access. Users can search for objects, refresh metadata, open/close the drawer, and choose table quick actions.

Browse Metadata

  • Step 1: Open the Catalog Drawer on the left side of the screen.
  • Step 2: Select the catalog you want to view (e.g., tpch).
  • Step 3: Open the schema you want to view (e.g., tiny).
  • Step 4: Open the table you want to view to display the list of columns and data types.

Search for Objects

  • Step 1: Enter a keyword in the Find objects search box (e.g., nation).
  • Step 2: The system filters the tree structure while keeping the parent contexts (such as catalog/schema) to help the user locate the object.
  • Step 3: Clear the keyword to return to the full list or previous state.

Refresh Metadata and Toggle Drawer

  • Step 1: Click Refresh to reload the metadata.
  • Step 2: Click Close drawer to hide the catalog panel.
  • Step 3: Reopen the drawer when you need to continue browsing catalogs/schemas/tables.

Note: If the metadata fails to load, the system displays an error in the Catalog Drawer, and the user can click Refresh to retry.

Table Actions

For each table in the Catalog Drawer, users can use quick actions to preview data, generate DDL scripts, view schema/statistics, or generate SELECT queries.

Preview First 100 Rows

  • Step 1: In the Catalog Drawer, hover over or select the table you want to preview.
  • Step 2: Click Preview first 100 rows. The system runs a query in the format SELECT * FROM <table> LIMIT 100 and displays the results in the Result Panel.

Generate CREATE TABLE Script

  • Step 1: For the table you want to view the DDL for, click Generate CREATE TABLE script.
  • Step 2: The system displays the CREATE TABLE script containing the table name and the list of columns and data types.
  • Step 3: You can use the Copy action to copy the script if the UI supports it.

View Schema and Column Statistics

  • Step 1: For the table you want to view, click View schema and column statistics.
  • Step 2: The Schema tab displays the list of columns and data types.
  • Step 3: The Details tab displays estimated rows and null percentage if provided by the backend.

Note: If no statistics are available, the system displays an empty state such as No statistics available instead of an ambiguous error.

Generate SELECT Query

  • Step 1: For the table you want to query, click Generate SELECT query for this table.
  • Step 2: The system inserts a SELECT query into the editor, including the specific column list if metadata is available.
  • Step 3: Review the default LIMIT before clicking Run query.

Note: The generated SELECT query should have a default LIMIT to prevent excessively large queries.

Result Panel

The Result Panel displays the status and results of the query execution, including the query ID, status, duration, row count, result grid/code block, and copy/export buttons.

View Query Results

  • Step 1: After successfully running the query, verify the FINISHED status in the Result Panel.
  • Step 2: Check the Query ID, duration, and row count.
  • Step 3: View the data in the result grid; you can change the rows per page or navigate pages if pagination is available.
  • Step 4: Click Clear to clear the results from the UI.

Copy/Export Results

  • Step 1: Click Copy or Export Copy to copy the results in TSV format.
  • Step 2: Click CSV to download the results as a CSV file with column headers.
  • Step 3: Click JSON to download the results as a JSON array.
  • Step 4: If you need to export all results and the feature is available, select Export All -> CSV.

Note: On some platforms, the Export All -> CSV button may be disabled; users can hover over it to see the reason. If the clipboard/download is blocked by the browser, the system displays an appropriate error message.

Query History

Query History allows users to review recently run queries and saved queries. The drawer contains two tabs: Recent and Saved.

View Recent Queries

  • Step 1: Click Query History on the toolbar.
  • Step 2: Select the Recent tab.
  • Step 3: Click the query you want to reuse to load its content into the editor.

Note: The row count in history should be interpreted based on the system's display label: result rows, processed rows, or other semantics if defined.

Saved Query

Saved Query allows users to save the current query, reload saved queries, rename, or delete saved queries.

Save a Query

  • Step 1: Enter the SQL you want to save in the editor.
  • Step 2: Click Save this query on the toolbar.
  • Step 3: In the Save Query dialog, enter the query name in the Name field.
  • Step 4: Click Save to save, or click Cancel to abort.

Note: The saved query name is required. If the name is empty, the system will prevent saving and will display a validation message or disable the Save button.

Reload a Saved Query

  • Step 1: Open Query History and select the Saved tab.
  • Step 2: Click the saved query you want to reuse.
  • Step 3: The system loads the SQL content into the editor for the user to run or edit.

Rename a Saved Query

  • Step 1: In the Saved tab, select the Rename action for the query you want to update.
  • Step 2: Enter a new name in the Rename Saved Query dialog.
  • Step 3: Click Rename to save, or click Cancel to abort.

Delete a Saved Query

  • Step 1: In the Saved tab, select the Delete action for the query you want to delete.
  • Step 2: Confirm the deletion if the system displays a confirmation dialog.
  • Step 3: Once confirmed, the saved query is removed from the list.

Note: Verify carefully before deleting to avoid losing important queries.