Skip to main content

SQL Studio

sql-studio

Purpose

SQL Studio provides a direct SQL query interface for exploring and analyzing platform data using Trino.

Users can write SQL queries against the platform's Lakehouse, browse available schemas and tables, export results, and visualize query output — all without leaving the dashboard.


User Interface Overview

The SQL Studio page is organized into two main panels:

  • Lakehouse Explorer (left panel) — Schema and table browser
  • Query Editor (right panel) — SQL editor with action toolbar, results table, and visualization

Lakehouse Explorer

The left panel displays the available data catalog:

  • Browse catalogs, schemas, and tables
  • View column names and data types
  • Click on a table to auto-insert a SELECT query snippet into the editor

This helps users discover available datasets without memorizing table names.

The explorer refreshes automatically after syncing or ingesting new tables.


Query Editor

The main panel contains:

  • Action Toolbar — Buttons for data ingestion, syncing, exporting, and query execution
  • SQL Input — A code editor for writing SQL queries
  • Status Badges — Live query ID, trace ID, and Trino connection status indicators
  • Results Table — Paginated output of query results
  • Query Visualizer — Interactive bar chart based on query output
  • Explain Plan — Distributed execution plan display

Action Toolbar

The toolbar provides the following actions:

ActionDescription
Ingest & SyncScans Object Storage for raw files (CSV, Parquet, JSON), converts them to Delta Lake format, and registers them in the Trino catalog — a single-click data pipeline
Export CSVDownload query results as a CSV file
Export JSONDownload query results as a JSON file
ExplainShow the distributed execution plan for the current query
RunExecute the current SQL query
Next PageLoad the next page of results (for large result sets with paginated output)
CancelCancel a currently running query

A Dagster sensor also runs this pipeline automatically every 30 seconds in the background, so new files uploaded to Object Storage are detected and converted without manual intervention.


Status Badges

After executing a query, the toolbar displays:

BadgeDescription
queryIdThe unique Trino query identifier for the current execution
traceIdThe distributed trace ID for debugging
Trino: onlineIndicates the Trino cluster is reachable (hover to see the node version)
Trino: unreachableIndicates the Trino cluster cannot be reached

What Users Can Do

Run SQL Queries

  1. Type a SQL query in the editor
  2. Click Run
  3. Results appear in the paginated table below

Queries run against Trino, which connects to the platform's data catalog including Delta Lake tables, Parquet files, and CSV datasets stored in Object Storage.

For large result sets, Trino returns data in pages. Click Next Page to load additional batches. Use Cancel to stop a long-running query.

Browse the Lakehouse

Use the Lakehouse Explorer on the left to:

  • Navigate through catalogs and schemas
  • View table structures and column types
  • Click a table name to generate a sample query

Ingest & Sync New Data

The Ingest & Sync button provides a one-click pipeline for making raw data queryable:

  1. Click Ingest & Sync
  2. The platform scans Object Storage for raw files (CSV, Parquet)
  3. Files are automatically converted to Delta Lake format
  4. Resulting Delta tables are registered in the Trino catalog
  5. The Lakehouse Explorer refreshes to show the new tables

A toast notification reports the number of files scanned, converted, and any errors encountered.

Export Results

After running a query:

  • Click Export CSV to download results as a comma-separated file
  • Click Export JSON to download results as a JSON array

Visualize Results

SQL Studio includes a built-in bar chart visualizer:

  1. Run a query that returns data
  2. Select the X-axis column from the dropdown
  3. Optionally select a Y-axis column
  4. Choose an aggregation mode (Count or Sum)
  5. The chart renders automatically

This provides immediate graphical insight without external tools.

Explain Queries

Click Explain to view the distributed execution plan. This shows how Trino will process the query, including splits, stages, and data movement between nodes. The plan is displayed in a monospace panel alongside the chart visualizer.


Query Examples

List all tables

SHOW TABLES FROM delta.default;

Query a Delta table

SELECT * FROM delta.bucket_name.file_name LIMIT 100;

Official Reference