Compass views

Compass views function similarly to the standard roles that views play in traditional databases. A view functions like a virtual table that derives its data from multiple objects referenced in its create view statement. The data is extracted from the underlying objects at query execution time. After a view is created, it can then be queried by name the same way one would query a table. A view name can appear in a join, an inline view, a Common Table Expression, a subquery, or a select expression. Create view statements themselves can be arbitrarily complex. Hence, the usage of views simplifies the construction of complex queries.

Views can be created (CREATE VIEW), updated (ALTER VIEW) and deleted (DROP VIEW). These view statements are supported equally in Compass UI, Compass API, and the JDBC driver.

You can see View metadata in the Data Catalog UI and is also accessible through these tables:

  • information_schema.views
  • information_schema.view_table_usage
  • information_schema.view_column_usage

Additionally, view names can be seen mixed with table names in information_schema.tables and view columns can be seen mixed with table columns in information_schema.columns.

For troubleshooting guidelines, see Troubleshooting Compass queries