Using Views

On this page:

Views are virtual tables comprised of rows and columns of an actual table, as defined by a SQL query. Each time you access the view, the query re-executes, giving you the most up-to-date result. In this way views improve efficiency because you are essentially querying the base table directly, rather than via your analytics tool. When you run a query against a view, it just fetches – that is, it examines the metadata, resolves itself, and executes. The schema of the view derives from the schema of the underlying query.

Views are helpful when you have simple SQL statements, such as limiting the number of columns to expose and possibly add filters on other columns. One example: filtering out test accounts so an analyst or data scientist doesn’t get bad data because they inadvertently included those test accounts.

Other common use cases:

  • Dimensional enrichment – create a view when joining a dimension table with a fact table
  • CDC – write a window statement as a live query against the data, giving you a view that always shows the latest commit version

In the Tabular UI you can see

  • views you created via an engine (typically Trino or Apache Spark)
  • the SQL used to create the view

As with Iceberg, in Tabular you can access a view regardless of which engine you used to create it.

More details about views on the Apache Iceberg documentation site.

Working with Views

In Tabular you can see all views at a glance, and drill down into individual views to see more details and make minor changes to the view.

To access all views

  • Navigate to the database you want.

The overview within a database displays tables and views. Views are marked with a “V”.

To access individual view details

  • Click a view to display that view’s Overview page. This page displays information about a view’s schema, description, and so on.

Tip     A “V” displays in the overview page title as an identifier to help distinguish it from the table overview page.

To see and copy the SQL that created the view

  • From the View Overview page click SQL. Copy the SQL by clicking Copy SQL.

To configure which roles can access this view

  • From the View Overview page, click Access Controls. The access controls for views work the same way as they do elsewhere in Tabular. View access controls are in addition to whatever the level of access controls is for the underlying table. You can use the access controls here to create stricter access limits on that view than for the underlying table.

You must have access to both the view and the underlying table to use the view.

To change the description of this view

  • From the View Overview page, click Settings.

To view, modify, or delete properties of the view

  • From the View Overview page, click Settings.

To rename or drop a view

  • From the View Overview page, click the three-dot menu and select the option you want.

Note     If the underlying table changes – for example, if a column is added or dropped – the view will fail and must be re-created.

View properties table

Iceberg views have properties you can use to configure view behavior. Below is an overview of currently available view properties.

write.metadata.compression-codecgzipMetadata compression codec: none or gzip
version.history.num-entries10Controls the number of versions to retain
commit.retry.num-retriesFalseControls whether a SQL dialect is allowed to be dropped during a replace operation
replace.drop-dialect.allowed4Number of times to retry a commit before failing
commit.retry.min-wait-ms100Minimum time in milliseconds to wait before retrying a commit
commit.retry.max-wait-ms60000 (1 min.)Maximum time in milliseconds to wait before retrying a commit (30 min)Total retry timeout period in milliseconds for a commit