Skip to main content

materialized_tables

Creates, updates, deletes, gets or lists a materialized_tables resource.

Overview

Namematerialized_tables
TypeResource
Idconfluent.sql.materialized_tables

Fields

The following fields are returned by SELECT queries:

The requested Materialized Table.

NameDatatypeDescription
namestringThe user-provided name of the resource, unique within this environment. (pattern: ^[a-zA-Z0-9]([a-zA-Z0-9_-]*[a-zA-Z0-9])?$, example: high-value-orders)
environment_idstringThe unique identifier for the environment.
organization_idstring (uuid)The unique identifier for the organization.
api_versionstringAPIVersion defines the schema version of this representation of a resource. (sql/v1) (example: sql/v1)
kindstringKind defines the object this REST resource represents. (MaterializedTable)
metadataobjectObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
specobjectThe specifications of the Materialized Table.
statusobjectThe status of the Materialized Table.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_sqlv1_materialized_tableselectorganization_id, environment_id, kafka_cluster_id, table_nameRetrieve a specific Materialized Table by name.
list_sqlv1_materialized_tablesselectorganization_id, environment_idpage_size, page_tokenRetrieve a sorted and paginated list of all materialized tables.
create_sqlv1_materialized_tableinsertorganization_id, environment_id, kafka_cluster_id, api_version, kind, metadata, name, organization_id, environment_id, specCreate a new Materialized Table.
update_sqlv1_materialized_tablereplaceorganization_id, environment_id, kafka_cluster_id, table_name, api_version, kind, metadata, name, organization_id, environment_id, specMake a request to update a Materialized Table's mutable fields.
Mutable fields include: query, stopped, compute_pool_id, principal, columns, watermark, constraints and table_options.
delete_sqlv1_materialized_tabledeleteorganization_id, environment_id, kafka_cluster_id, table_nameDelete a specific Materialized Table by name.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
environment_idstringThe unique identifier for the environment.
kafka_cluster_idstringThe unique identifier for the database.
organization_idstring (uuid)The unique identifier for the organization
table_namestringThe unique identifier for the Materialized Table
page_sizeinteger (int32)A pagination size for collection requests.
page_tokenstringAn opaque pagination token for collection requests.

SELECT examples

Retrieve a specific Materialized Table by name.

SELECT
name,
environment_id,
organization_id,
api_version,
kind,
metadata,
spec,
status
FROM confluent.sql.materialized_tables
WHERE organization_id = '{{ organization_id }}' -- required
AND environment_id = '{{ environment_id }}' -- required
AND kafka_cluster_id = '{{ kafka_cluster_id }}' -- required
AND table_name = '{{ table_name }}' -- required
;

INSERT examples

Create a new Materialized Table.

INSERT INTO confluent.sql.materialized_tables (
name,
spec,
organization_id,
environment_id,
kafka_cluster_id
)
SELECT
'{{ name }}' /* required */,
'{{ spec }}' /* required */,
'{{ organization_id }}',
'{{ environment_id }}',
'{{ kafka_cluster_id }}'
RETURNING
name,
environment_id,
organization_id,
api_version,
kind,
metadata,
spec,
status
;

REPLACE examples

Make a request to update a Materialized Table's mutable fields.
Mutable fields include: query, stopped, compute_pool_id, principal, columns, watermark, constraints and table_options.

REPLACE confluent.sql.materialized_tables
SET
name = '{{ name }}',
spec = '{{ spec }}'
WHERE
organization_id = '{{ organization_id }}' --required
AND environment_id = '{{ environment_id }}' --required
AND kafka_cluster_id = '{{ kafka_cluster_id }}' --required
AND table_name = '{{ table_name }}' --required
AND name = '{{ name }}' --required
AND spec = '{{ spec }}' --required
RETURNING
name,
environment_id,
organization_id,
api_version,
kind,
metadata,
spec,
status;

DELETE examples

Delete a specific Materialized Table by name.

DELETE FROM confluent.sql.materialized_tables
WHERE organization_id = '{{ organization_id }}' --required
AND environment_id = '{{ environment_id }}' --required
AND kafka_cluster_id = '{{ kafka_cluster_id }}' --required
AND table_name = '{{ table_name }}' --required
;