Skip to main content

kx_dataviews

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

Overview

Namekx_dataviews
TypeResource
Idaws.finspace.kx_dataviews

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
active_versionsarrayThe current active changeset versions of the database on the given dataview.
auto_updatebooleanThe option to specify whether you want to apply all the future additions and corrections automatically to the dataview when new changesets are ingested. The default value is false.
availability_zone_idstringThe identifier of the availability zones. (pattern: <code>^[a-zA-Z0-9-]+$</code>)
az_modestringThe number of availability zones you want to assign per volume. Currently, FinSpace only supports SINGLE for volumes. This places dataview in a single AZ. (SINGLE, MULTI)
changeset_idstringA unique identifier of the changeset that you want to use to ingest data. (pattern: <code>^[a-zA-Z0-9]+$</code>)
created_timestampstring (date-time)The timestamp at which the dataview was created in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000.
database_namestringThe name of the database where you created the dataview. (pattern: <code>^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$</code>)
dataview_namestringA unique identifier for the dataview. (pattern: <code>^[a-zA-Z0-9][a-zA-Z0-9-_]*[a-zA-Z0-9]$</code>)
descriptionstringA description of the dataview. (pattern: <code>^[a-zA-Z0-9. ]{1,1000}$</code>)
environment_idstringA unique identifier for the kdb environment, from where you want to retrieve the dataview details. (pattern: <code>.\S.</code>)
last_modified_timestampstring (date-time)The last time that the dataview was updated in FinSpace. The value is determined as epoch time in milliseconds. For example, the value for Monday, November 1, 2021 12:00:00 PM UTC is specified as 1635768000000.
read_writebooleanReturns True if the dataview is created as writeable and False otherwise.
segment_configurationsarrayThe configuration that contains the database path of the data that you want to place on each selected volume. Each segment must have a unique database path for each volume. If you do not explicitly specify any database path for a volume, they are accessible from the cluster through the default S3/object store segment.
statusstringThe status of dataview creation. CREATING – The dataview creation is in progress. UPDATING – The dataview is in the process of being updated. ACTIVE – The dataview is active. (CREATING, ACTIVE, UPDATING, FAILED, DELETING)
status_reasonstringThe error message when a failed state occurs. (pattern: <code>^[a-zA-Z0-9_-.\s]+$</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_kx_dataviewselectenvironment_id, database_name, dataview_name, regionRetrieves details of the dataview.
list_kx_dataviewsselectenvironment_id, database_name, regionnextToken, maxResultsReturns a list of all the dataviews in the database.
create_kx_dataviewinsertenvironment_id, database_name, region, dataviewName, azMode, clientTokenCreates a snapshot of kdb database with tiered storage capabilities and a pre-warmed cache, ready for mounting on kdb clusters. Dataviews are only available for clusters running on a scaling group. They are not supported on dedicated clusters.
update_kx_dataviewupdateenvironment_id, database_name, dataview_name, region, clientTokenUpdates the specified dataview. The dataviews get automatically updated when any new changesets are ingested. Each update of the dataview creates a new version, including changeset details and cache configurations
delete_kx_dataviewdeleteenvironment_id, database_name, dataview_name, clientToken, regionDeletes the specified dataview. Before deleting a dataview, make sure that it is not in use by any cluster.

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
clientTokenstringA token that ensures idempotency. This token expires in 10 minutes.
database_namestringThe name of the database whose dataview you want to delete.
dataview_namestringThe name of the dataview that you want to delete.
environment_idstringA unique identifier for the kdb environment, from where you want to delete the dataview.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to return in this request.
nextTokenstringA token that indicates where a results page should begin.

SELECT examples

Retrieves details of the dataview.

SELECT
active_versions,
auto_update,
availability_zone_id,
az_mode,
changeset_id,
created_timestamp,
database_name,
dataview_name,
description,
environment_id,
last_modified_timestamp,
read_write,
segment_configurations,
status,
status_reason
FROM aws.finspace.kx_dataviews
WHERE environment_id = '{{ environment_id }}' -- required
AND database_name = '{{ database_name }}' -- required
AND dataview_name = '{{ dataview_name }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a snapshot of kdb database with tiered storage capabilities and a pre-warmed cache, ready for mounting on kdb clusters. Dataviews are only available for clusters running on a scaling group. They are not supported on dedicated clusters.

INSERT INTO aws.finspace.kx_dataviews (
dataviewName,
azMode,
availabilityZoneId,
changesetId,
segmentConfigurations,
autoUpdate,
readWrite,
description,
tags,
clientToken,
environment_id,
database_name,
region
)
SELECT
'{{ dataviewName }}' /* required */,
'{{ azMode }}' /* required */,
'{{ availabilityZoneId }}',
'{{ changesetId }}',
'{{ segmentConfigurations }}',
{{ autoUpdate }},
{{ readWrite }},
'{{ description }}',
'{{ tags }}',
'{{ clientToken }}' /* required */,
'{{ environment_id }}',
'{{ database_name }}',
'{{ region }}'
RETURNING
auto_update,
availability_zone_id,
az_mode,
changeset_id,
created_timestamp,
database_name,
dataview_name,
description,
environment_id,
last_modified_timestamp,
read_write,
segment_configurations,
status
;

UPDATE examples

Updates the specified dataview. The dataviews get automatically updated when any new changesets are ingested. Each update of the dataview creates a new version, including changeset details and cache configurations

UPDATE aws.finspace.kx_dataviews
SET
description = '{{ description }}',
changesetId = '{{ changesetId }}',
segmentConfigurations = '{{ segmentConfigurations }}',
clientToken = '{{ clientToken }}'
WHERE
environment_id = '{{ environment_id }}' --required
AND database_name = '{{ database_name }}' --required
AND dataview_name = '{{ dataview_name }}' --required
AND region = '{{ region }}' --required
AND clientToken = '{{ clientToken }}' --required
RETURNING
active_versions,
auto_update,
availability_zone_id,
az_mode,
changeset_id,
created_timestamp,
database_name,
dataview_name,
description,
environment_id,
last_modified_timestamp,
read_write,
segment_configurations,
status;

DELETE examples

Deletes the specified dataview. Before deleting a dataview, make sure that it is not in use by any cluster.

DELETE FROM aws.finspace.kx_dataviews
WHERE environment_id = '{{ environment_id }}' --required
AND database_name = '{{ database_name }}' --required
AND dataview_name = '{{ dataview_name }}' --required
AND clientToken = '{{ clientToken }}' --required
AND region = '{{ region }}' --required
;