CREATE ENTITY fully_qualified_entity_name[IN STORE store_name][WITH (entity_parameter = value [, ...])];
Description
This command creates a new entity supported by a Store. Use these entities to host s created through DDL or Query.
To list the entities created by this command, use LIST ENTITIES.
Arguments
fully_qualified_entity_name
The full name of the entity to create.
IN STORE store_name
Optionally, this creates the entity in the specified store. If the name is case sensitive you must wrap it in double quotes; otherwise the system uses the lowercase name.
A qualified descriptor name used to decode a record's key, if applicable. Reset the descriptor by setting it to NULL.
Required: No
Default value: None
Type: String
Valid values: See LIST DESCRIPTORS.
value.descriptor
A qualified descriptor name used to decode a record's value. Reset the descriptor by setting it to NULL.
Required: No
Default value: None
Type: String
Valid values: See LIST DESCRIPTORS.
Kafka-Specific Entity Parameters
Parameters to be used if the associated Store is type KAFKA:
Parameter Name
Description
topic.partitions
The number of partitions to use when creating the entity.
Required: No
Default value: 1
Type: Integer
Valid values: [1,…]
topic.replicas
The number of replicas to use when creating the entity.
Required: No
Default value: 1
Type: Integer
Valid values: [1,…]
kafka.topic.*
A configuration specific for the topic being created — for example, Kafka Entity Configuration for Confluent Platform.
Required: No
Default value: None
Type: String
Valid values: Kafka topic configuration specific to the underlying Storetype.
Kinesis-Specific Entity Parameters
Parameters to be used if the associated Store is type KINESIS:
Parameter Name
Description
kinesis.shards
The number of shards to use when creating the entity.
Required: No
Default value: 1
Type: Integer
Valid values: [1,…]
Examples
Create a new Kafka topic with defaults
The following creates an entity called pv using the default parameters in your default store:
Create a new Kafka topic with additional topic configuration
The following creates an entity called pv_compact. It also overrides the default partitions, replicas, and cleanup.policy configuration of the Kafka topic in your default store:
Create a new Kafka topic with key and value ProtoBuf Descriptors
The following creates an entity called pageviews_pb in your default store. It also sets the key and value descriptors necessary for serializing its records:
demodb.public/demostore#LISTDESCRIPTORS;+-----------+--------------+----------+----------+-------------------------------+-------------------------------+|Name|SourceName|Type|Owner|CreatedAt|UpdatedAt|+===========+==============+==========+==========+===============================+===============================+|Pageviews|pb_value|protobuf|sysadmin|2024-07-1618:30:39+0000UTC|2024-07-1618:30:39+0000UTC|+-----------+--------------+----------+----------+-------------------------------+-------------------------------+|Pageviews|pb_key|protobuf|sysadmin|2024-07-1618:30:31+0000UTC|2024-07-1618:30:31+0000UTC||Key||||||+-----------+--------------+----------+----------+-------------------------------+-------------------------------+demodb.public/demostore#CREATEENTITYpv_pbWITH ( 'key.descriptor'=pb_key."PageviewsKey",'value.descriptor'=pb_value."Pageviews");+--------+-------+----------+------------------------------------------+|Type|Name|Command|Summary|+========+=======+==========+==========================================+|entity|pv_pb|CREATE|entity"pv_pb"wassuccessfullycreated||||| in store "demostore"|+--------+-------+----------+------------------------------------------+demodb.public/demostore#DESCRIBEENTITYpv_pb;+-------+-------------+-----------+---------------------+--------------------+-----------------------------------+|Name|Partitions|Replicas|KeyDescriptor|ValueDescriptor|Configs|+=======+=============+===========+=====================+====================+===================================+|pv_pb|1|1|pb_key.PageviewsKey|pb_value.Pageviews| { "segment.bytes":"1073741824"}|+-------+-------------+-----------+---------------------+--------------------+-----------------------------------+
Create a new entity in Kinesis Store with Kinesis parameters
The following creates an entity called pv_kinesis in the store named kinesis_store with 3 shards:
demodb.public/demostore#CREATEENTITYpv_kinesisINSTOREkinesis_storeWITH ('kinesis.shards'=3);+--------+------------+----------+-----------------------------------------------+|Type|Name|Command|Summary|+========+============+==========+===============================================+|entity|pv_kinesis|CREATE|entity"pv_kinesis"wassuccessfullycreated||||| in store "kinesis_store"|+--------+------------+----------+-----------------------------------------------+