5. Lakehouse and warehouses
The Lakehouse is Groundzero's managed store for analytic tables. You register an S3 bucket as a warehouse, then create databases and tables in it, run SQL, export results, protect sensitive data and back databases up, all from the Lakehouse page.
This chapter is about using the Lakehouse page. For the SQL itself (statements, data types, creating and changing tables, time travel, maintenance and worked examples) see the Lakehouse runtime guide.
Open Lakehouse in the top navigation bar. The left rail has Warehouses and Saved Queries. The rail starts collapsed to icons; use the toggle at the bottom to expand it.
| Term | Meaning |
|---|---|
| Warehouse | An S3 bucket you have registered. Use its name as the catalog name in SQL. |
| Database | A group of tables inside a warehouse. |
| Table | A table stored in the open Iceberg format. You refer to it as database.table. |
| Session | A query engine started just for you, for one warehouse. SQL does not run until you start one. |
| Data policy | A row filter and column masks that apply to every read of a table. |
| Table Access Manager | Allow and deny rules for one table, per user or group. |
| I want to... | Go to |
|---|---|
| Register a bucket | "Create a warehouse" |
| Run my first query | "Start a session", then "Run a query" |
| Get all rows of a large result | "Export a result" |
| Reuse a query | "Save and reuse queries" |
| Hide personal data from some readers | "Protect a table with a data policy" |
| See who ran what | "Review the audit log" |
| Keep a copy of a database | "Back up and restore a database" |
Permissions in short#
An administrator grants permissions in Access Manager. The creator of a warehouse automatically gets All on it.
| To do this | You need |
|---|---|
| See a warehouse in the list | List or All on the warehouse |
| Create or delete a warehouse | Create or Delete (or All) on warehouses |
| Create or drop a database | CreateDatabase or DropDatabase (or All) on the warehouse |
| Run SQL | The matching action on the warehouse, database and table (see "Why a statement is refused") |
| Open a table's data policy | Select on the database; All to save it |
| Open Table Access Manager | All on the database |
Create a warehouse#
Outcome: an S3 bucket that Groundzero can store tables in. Open Warehouses.

The list has a Search... box, Copy Lakehouse URL, Create Warehouse and a table with Name, Created by, Created Date and an Actions menu. If nothing exists you see "No warehouses to show".
- Create the S3 bucket in AWS first. Its name must be
gz-lakehouse-<name>. -
Click Create Warehouse. The dialog says "Register an S3 bucket as a lakehouse warehouse."

The Create Warehouse dialog with the generated bucket policy. -
Fill in the three fields.
Field Example Rule Warehouse name sales-warehouseLetters, digits and single hyphens; starts with a letter; no underscore Bucket name gz-lakehouse-salesStarts with gz-lakehouse-Region ap-south-1The AWS region of the bucket 
An invalid name is flagged immediately. -
Click Copy policy next to Bucket policy and add that policy to the bucket's permissions in AWS. It lets Groundzero use the bucket. Do this before you click Create. You see "Policy is copied to clipboard successfully".
-
Click Create. It turns on once all three fields are valid.

The completed form; the policy refers to the new bucket.
You see "Warehouse created successfully" and the warehouse appears in the list.

If it does not appear, check the name and your Create permission.
Other warehouse actions#
Open the "..." menu on a row.

- Copy Policy copies the bucket policy again for that warehouse.
-
Delete asks "Are you sure you want to delete this warehouse <name> ?". Choose Yes; you see "Deleted successfully.".

The confirmation names the warehouse. A warehouse that still has databases, tables or views cannot be deleted:

A non-empty warehouse is protected. You see "Warehouse cannot be deleted while it contains resources. Delete its namespaces, tables, and views first.". The built-in
auditdatabase does not block deletion. -
Copy Lakehouse URL (on the page header) copies the lakehouse host name. Paste it into the Lakehouse URL field of a Groundzero Lakehouse connection (see the Data source connections chapter). If it reads "Lakehouse URL is not available yet", wait a moment.
Open a warehouse and start a session#
Click a warehouse name to open its workspace.

The left column has the compute selector, the session button, the database tree, Schedules and Backups. The right side has the query tabs and the editor.
Start a session#
Outcome: a running query engine for you, so that Run query works.
- Open the Compute list. Each option shows its memory and vCPU. Choose one. If you have no permission to use compute, the control reads "Insufficient Permission" and is disabled.
-
Set Minimum Workers with the minus and plus buttons. The default is 2; more workers help with large scans.

The Compute list and the Minimum Workers stepper. -
Click the green Start lakehouse session button. If you have not chosen a compute you see "please select Compute".

While the session starts, the button shows a spinner. -
Wait for "Session started successfully". The button turns red and reads Stop lakehouse session, and Run query is on.

A running session: the compute is locked and Stop is available.
What to know about sessions:
- Starting can take up to 3 minutes. If it takes longer you see "Session start failed (200)"; try again, or choose a larger compute.
- Leaving the page and coming back within 30 minutes keeps your running session.
- A session stops by itself after 30 minutes without use. You then see "The lakehouse session is not reachable. Start the session and try again." Start it again.
- Click Stop lakehouse session when you are done ("Session stopped successfully"). This releases the compute.
Browse databases, tables and columns#
Expand Databases in the tree to see databases (the built-in audit database comes first), then Tables and Columns. Columns are shown as <column> (<type>). Hover a node and click Open row actions for its menu.

| Node | Menu items |
|---|---|
| Databases | Import Schema, Restore Database, Mark stale backups failed |
| A database | Properties, Export schema, Backup Database, Restore Database |
| A table | Add table on cursor, Properties, Data policy, Table Access Manager |
audit.logs |
Open audit logs |


The refresh icon beside the breadcrumb reloads the tree. The editor also suggests names from the tree as you type.
Export schema downloads schema.txt, a list of the columns of every table in the database (no data). Import Schema does the reverse: choose a schema file and a Database Name, and Groundzero creates the database with one empty table for each entry. Existing tables are skipped.

Run a query#
Outcome: a result you can read, page through and export. You need a running session.
- Use the first query tab, or click + for another ("Query 2", and so on).
- Type your SQL. Always write tables as
database.table, for examplesales.orders. Autocomplete suggests warehouse, database, table and column names. -
Click Run query.

Typing a query in the editor tab. -
While it runs, Messages shows "Executing Query..." and Run query becomes a red Stop query. A pill shows how long it has run.
-
When it finishes, the Results tab opens with the rows and the pill shows how long the response took.

A result: type-labelled columns, a row count and paging controls. -
Messages shows "Query executed successfully." Statements that return no rows, such as creating a table, show only this message. A query with no matching rows shows "No rows to display".

The Messages tab after a successful run.
The buttons at the right of the tab strip are: the Groundzero code assistant, Toggle lakehouse output pane, Format SQL, Run query or Stop query, and Save query.
Unsaved queries are lost on reload
Query tabs live only in your browser tab. Use Save query to keep one.
Use block comments
Line breaks are removed before a query runs, so a -- comment would hide everything after it. Write comments as /* ... */.
Format SQL tidies the query in the active tab.

Long-running queries#
-
A query that takes longer than about a minute keeps running in the background. Messages reads "Still running. Results load here when the query finishes." and the results appear by themselves when it is done.

A detached query shows its running state. -
Stop query cancels it ("Query stopped.").
- A query is stopped after 30 minutes ("Query ran longer than 30 minutes and was stopped.").
- A session runs up to 4 queries at once. Otherwise you see "This session is already running 4 queries. Wait for one to finish or stop it, then run this query again."
Why a statement is refused#
| You see | Cause | Fix |
|---|---|---|
| 'Use' keyword not allowed. Use fully qualified table names. | You wrote USE <db> |
Write database.table instead |
| Use fully qualified table names. | A table was written without its database | Add the database |
| Following namespaces specified in the query does not exist: ... | The database does not exist | Check the name in the tree |
| Access denied: Unable to parse query for authorization. | The SQL could not be understood | Check the syntax |
| You do not have All or Select permission (or Update, Insert, and so on) | You lack that permission | Ask an administrator |
| Table access blocked by protected policy: <db>.<table> | The table's policy uses Block raw reads | Ask the table owner |
| Column access denied by masking policy | The column's mask is deny |
Do not select that column |
| Masked columns cannot be used in WHERE clauses | A masked column cannot be filtered or sorted on | Filter on another column |
| Access to audit.logs table is restricted to Admin group members. | Only administrators read the audit log | Ask an administrator |
| Audit logs can only be queried. Modifications are not permitted. | You tried to change audit.logs |
Do not change it |
| The system audit database cannot be dropped. | You tried to drop audit |
Do not drop it |



Other messages in Messages: "An error occurred while running the query. Please try again", "Lost contact with the session. Retrying…", "The session no longer has this query. Run it again."
Permissions work at three levels: the warehouse, the database and the table. CREATE DATABASE needs CreateDatabase; DROP DATABASE needs DropDatabase; reading needs Select; UPDATE, DELETE, MERGE, TRUNCATE and INSERT OVERWRITE need Update; CREATE TABLE needs CreateTable. An explicit deny always wins.
Read and export a result#
Read the grid#
Each column shows its name and data type. Drag a header to reorder columns. Right-click a header for Autosize this column, Autosize all columns, Auto-align columns and Reset column order. The grid has no sort or filter; add ORDER BY or WHERE to your query. Very wide results load the first 300 columns and more as you scroll right.
Page through a large result#

| Control | What it does |
|---|---|
| Row count | The total, for example "1,284,310 rows" |
| Rows per page | 50, 100, 500, 1000 or 10000 (default 10000) |
Page n / total, previous, next |
Move between pages |
| Download current page as CSV | Saves the rows on this page |
| Export | Saves every row; appears only for results over 100,000 rows |
For a very large result, paging past the first 100,000 rows first needs the full result to be prepared; you see "Preparing the full result for paging. Pages load here when it is ready."
Download one page as CSV#
Click Download current page as CSV. The file is named query_<date>.csv. You see "CSV downloaded successfully".
Export a result#
Outcome: one file with every row.
-
Click Export and choose CSV or Parquet.

The Export menu offers CSV and Parquet. -
Wait while the toolbar shows "Preparing CSV file". Stop export cancels.

An export being prepared. -
When ready, the toolbar shows a download link with the file name and size. Click it to save the file. The link works for one hour; export again after that.

The finished export is a download link.
If the export fails, the reason appears in red beside Retry export.
| You see | What to do |
|---|---|
| This export is larger than 5 GB... | Add a filter, select fewer columns, or keep the result in the lakehouse with CREATE TABLE . |
| This result is too large to page through or export here (limit: 50,000,000 rows or 20 GiB)... | Add a filter, or save it as a table with CREATE TABLE . |
| Preparing the full result took too long and was stopped... | Narrow the query and try again |
| Deep paging and export aren't available for this warehouse... | Ask an administrator to check the bucket's encryption settings |
| Could not get access to the warehouse bucket for this result. Try again in a moment. | Try again |
Exports follow data policies: masked values and filtered rows are the same as in the grid. Every export is recorded in the audit log.
Limits to know#
| Item | Limit |
|---|---|
| Rows you can page through at once | 100,000 per query (more after the full result is prepared) |
| Largest result you can page or export | 50,000,000 rows or 20 GiB |
| Largest single export file | 5 GB |
| One query | 30 minutes; 4 at a time per session |
| Session | Starts within 3 minutes; stops after 30 idle minutes |
| Export link | 1 hour; the exported file is deleted after 1 day |
Save and reuse queries#
Outcome: a named query you can open later from any session.
- In the editor, click Save query.
-
In Save As, check the Name (it starts as the tab name) and save.

The Save As dialog.
You see "Query saved successfully" and the tab takes the saved name. Saving again under the same name is refused with "Key already exists."
Open Saved Queries in the left rail to see your queries.

- Click a name to open its warehouse with the SQL in a tab. Start a session before you run it.
-
Rename asks for a Query Name ("Query renamed successfully").

Rename shows the current name. -
Delete asks for confirmation. The list shows only your own queries.
Look at a table's details#
Table menu > Properties opens a Properties tab.

The bottom of the tab has three parts.
-
Table Properties: database, table, partitioning, last update, row count, size, file count, creation details, compression and more. Click the Snapshot History cell to read the 10 most recent snapshots. A snapshot is a saved version of the table at one moment.

The Snapshot History viewer. -
Schema: each column with its data type and Governance tags. The tag dialog works as described in the Data catalog chapter.

Governance tags per column. -
Sample Data: the first 10 rows. Administrators only.

Sample data preview. Warning
Data policies do not apply to Sample Data. Only administrators can see it.
Keep a table fast (administrators)#
The top of the Properties tab has maintenance panels, for administrators only.
| Panel | What you can do |
|---|---|
| Description | Edit the table comment ("Description updated successfully!") |
| Compaction | Switch Automatic compaction on, or run a one-off job. Choose a Strategy (Binpack or Sort) and other options. You see "Compaction process initiated successfully!" |
| Storage | Switch Storage optimization on, or choose a Compression codec (zstd, snappy, gzip) and Object storage layout. You see "Storage optimization running in background..." |
Compaction joins many small files into fewer large ones, which makes queries faster. The Lakehouse runtime guide explains when to use each option.
Look at a database#
Database menu > Properties shows the number of tables, the total size and a Table Sizes list. The delete icon (Delete database) needs a running session, the DropDatabase permission and an empty database ("Delete its tables and views first."). The audit database cannot be deleted.

Protect a table with a data policy#
Outcome: readers see only the rows and columns they should. A data policy is a rule set attached to one table. It filters rows and masks column values for every read: the editor, exports and saved queries.
Open the table menu > Data policy. You need Select on the database to open it and All to save.

The dialog has three kinds of rule.
Control access to the table#
- Protected access: Policy only (default) applies your filters and masks. Block raw reads stops any SQL read of the table; you see "Table access blocked by protected policy: <db>.<table>".
- Base row filter: a condition added to every read for everyone, for example
region = 'EU'. You can use${user},${site},${groups}and${attr.<name>}to tailor it per reader. Click a chip under Available columns to add a column name. A filter that is not valid SQL is refused with "Invalid row filter SQL: <filter>".
Mask columns#
Click Add mask, choose the Column and the Mask type, then set Show and Replacement if the type needs them.
| Mask | What a reader sees |
|---|---|
full |
**** (or your replacement) for text; empty (NULL) for other types |
partial |
The first few characters (Show, default 3), then the replacement (default ***) |
hash |
A one-way code in place of the value |
null |
Empty (NULL) |
deny |
The query fails with "Column access denied by masking policy" |
unmask |
Cancels a base mask for one user or group |
A masked column cannot be used to filter, group, sort or join. SELECT * cannot be used on a table with masks when the query has several tables, joins or subqueries. If a masked column name exists in several tables you see "Ambiguous unqualified masked column '<name>'; qualify it" and need to write table.column.
Give a user or group their own rules#
Click User, Group or Default to add a rule with its own Rule row filter and masks. The rule's filter is added to the base filter. Use unmask to let that reader see a masked column; where several masks apply, the strictest wins. A user or group rule needs a name ("User and group rules need a name before saving").
Save, upload and restore versions#
- Save stores the policy ("Data policy saved"). Disable policy switches it off ("Data policy disabled"). Cancel closes the dialog.
- JSON to save shows the policy as text; Upload loads a policy from a file; Copy copies it.
- Version history lists every saved version, newest first. Restore brings one back ("Policy version restored").
Every save, disable and restore is a new version and is audited. Policies cover the editor, exports and saved queries, but not Sample Data.
Tip
Use Block raw reads for tables nobody should read directly. Use masks and row filters when different people should see different parts.
Allow or deny a table to users and groups#
Outcome: only chosen people can run chosen actions on one table. Open the table menu > Table Access Manager. You need All on the database.

- Choose an Action: Select, Insert, Update, Alter, Drop or All.
- Choose Allow or Deny.
- Choose Users or Groups, then move names from Available to Selected.
Rules inherited from the database are shown, and a deny on the table can override them. Every add or remove saves at once ("Table access rule added", "Table access rule removed"). A deny always wins. Table rules have no version history.
Review the audit log#
Outcome: see who ran which statement, when, and whether it worked. Administrators only; others see "Unauthorized access".
-
Expand
audit> Tables >logs, then choose Open audit logs.
The audit log: time, user, operation, status, database, table and duration for every statement. -
Choose how far back to look in Audit log range (7 days by default, 30, 90 or All) and how many rows per page in Audit page size.
-
Click any cell to open a details drawer with the full statement, the error if it failed, and timings.

The details drawer for a failed statement.
Other buttons: Refresh audit logs, Download current audit logs page as CSV, Compact audit logs and Rewrite audit files (housekeeping for the log itself).
The log records every statement run in a session, failures with status FAILED and the error, and every export. New rows can take about half a minute to appear; refresh later if one is missing.
Back up and restore a database#
Back up a database#
- Database menu > Backup Database.
-
Type a Backup Name: 3 to 50 letters, digits or underscores, starting with a letter.

The Backup Database dialog. -
Confirm. "Database backup created successfully!" means the backup has started. It continues in the background and shows Running until it finishes. If the name is rejected you see only "Database backup creation failed!"; check the name rule.
Expand Backups to see each database's backups with a status. A backup's menu offers Properties (name, database, size, files, creation time) and Delete.

Back up on a schedule#
Expand Schedules to see each database as ENABLED, DISABLED or NOT SET. A database's menu offers Schedule Backup (or Edit Schedule), Pause Schedule or Resume Schedule, and Delete Schedule.

The form asks for a Backup Name, Retention (days) (1 to 30), Start time, Start date and Repeat (Hourly, Daily, Weekly with Days, Monthly with Dates, or Yearly). Times follow your browser's time zone. Saving a schedule for a database that already has one replaces it. Deleting a schedule keeps the backups already made.
Restore a database#
Outcome: a new database made from a backup.
- Open the database menu (or the Databases menu) > Restore Database.
-
Choose Select Backup, then type a Target Database Name (letters, digits and underscores).

Restore creates a new target database from a backup. -
Confirm. You see "Database restoration started!". Refresh the tree when it finishes to see the new database.
If a backup stays Running for hours, use Mark stale backups failed on the Databases menu. It marks backups that have run for over 3 hours as failed.
Tips#
Tip
Start a session before you need it and choose enough Minimum Workers for big scans. Stop it when you are done.
Tip
For a result bigger than 100,000 rows, filter it or keep it in the lakehouse with CREATE TABLE . instead of exporting it.
Tip
Always write database.table, and use /* */ for comments.
Troubleshooting#
| Symptom | Cause | Fix |
|---|---|---|
| Run query is greyed out | No session is running, or no query tab is open | Choose a compute and start a session |
| "please select Compute" | You clicked Start without a compute | Choose one first |
| "The lakehouse session is not reachable..." | The session stopped (idle or stopped by you) | Start it again |
| "Session start failed (200)" | The session was not ready in 3 minutes | Retry, with a larger compute or more workers |
Nothing happens after a -- comment |
Comments hide the rest of the query | Use /* */ |
| No Export button | The result is under 100,000 rows | Use Download current page as CSV |
| An export link no longer works | Links last one hour | Export again |
| A new warehouse is missing from the list | The name is a duplicate, or you lack Create |
Check both |
| "Unauthorized access" on the audit log | Administrators only | Ask an administrator |
| A new statement is missing from the audit log | The log updates every half minute or so | Refresh later |
Related#
- Lakehouse runtime guide: SQL reference, tables, time travel, maintenance and worked examples.
- Data source connections: the Groundzero Lakehouse connection used by datasets and ETL jobs.
- Data catalog: warehouses, databases, tables and columns with tags and descriptions.
- Data lineage: shows lakehouse tables as assets.