Create Materialized View

Initiates the process of creating a materialized view, reserving the view's name to prevent other views or tables from being created with that name.

For materialized view details and examples, see Materialized Views.

The response contains output parameter view_id, which is used to tag each subsequent operation (projection, union, aggregation, filter, or join) that will compose the view.

Input Parameter Description

Name Type Description
table_name string Name of the table to be created that is the top-level table of the materialized view.
options map of string to strings

Optional parameters. The default value is an empty map ( {} ).

Supported Parameters (keys) Parameter Description
collection_name Name of a collection which is to contain the newly created view. If the collection provided is non-existent, the collection will be automatically created. If empty, then the newly created table will be a top-level table.
ttl Sets the TTL of the table specified in input parameter table_name.

If true, then the materialized view specified in input parameter table_name will be persisted and will not expire unless a ttl is specified. If false, then the materialized view will be an in-memory table and will expire unless a ttl is specified otherwise. The default value is false. The supported values are:

  • true
  • false

Method by which the join can be refreshed when the data in underlying member tables have changed. The default value is manual.

Supported Values Description
manual Refresh only occurs when manually requested by calling Alter Table with an 'action' of 'refresh'
on_query For future use.
on_change If possible, incrementally refresh (refresh just those records added) whenever an insert, update, delete or refresh of input table is done. A full refresh is done if an incremental refresh is not possible.
periodic Refresh table periodically at rate specified by refresh_period
refresh_period When refresh_method is periodic, specifies the period in seconds at which refresh occurs
refresh_start_time When refresh_method is periodic, specifies the first time at which a refresh is to be done. Value is a datetime string with format 'YYYY-MM-DD HH:MM:SS'.

Output Parameter Description

Name Type Description
table_name string Value of input parameter table_name.
view_id string Value of view_id.
info map of string to strings Additional information.