CREATE TOPIC
Syntax
Description
DeltaStream processes streaming data that is stored in streaming Store such as Apache Kafka and Amazon Kinesis. The Topic represents the data Stream entity that holds the individual data records in these streaming stores. For example, a Topic in a Kafka Store would be the Kafka topic, a Topic in a Kinesis Store would be a Kinesis data stream.
Arguments
topic_name
The name of the new Topic. For case-sensitive names, the name must be wrapped in double quotes, otherwise, the lowercased name will be used.
IN STORE store_name
Optionally, this creates the Topic in the specified Store. For case-sensitive names, the name must be wrapped in double quotes, otherwise, the lowercased name will be used.
WITH (topic_parameter = value [, …])
This clause specifies #_topic_parameters.
Topic Parameters
Parameter Name | Description |
---|---|
| A qualified https://github.com/deltastreaminc/ds-docs-gitbook/blob/main/reference/sql-syntax/ddl/broken-reference/README.md name used to decode a record's key, if applicable. Clear the Descriptor by specifying Required: No Default value: None Type: String Valid values: See LIST DESCRIPTORS. |
| A qualified https://github.com/deltastreaminc/ds-docs-gitbook/blob/main/reference/sql-syntax/ddl/broken-reference/README.md name used to decode a record's value. Clear the Descriptor by specifying Required: No Default value: None Type: String Valid values: See LIST DESCRIPTORS. |
Kafka Specific Topic Parameters
Parameters to be used if the associated Store is type KAFKA
:
Parameter Name | Description |
---|---|
| The number of partitions to use when creating the Topic. Required: No Default value: 1 Type: Integer Valid values: [1,…] |
| The number of replicas to use when creating the Topic. Required: No Default value: 1 Type: Integer Valid values: [1,…] |
Kinesis Specific Topic Parameters
Parameters to be used if the associated Store is type KINESIS
:
Parameter Name | Description |
---|---|
| The number of shards to use when creating the Topic. Required: No Default value: 1 Type: Integer Valid values: [1,…] |
Examples
Create a new Topic with defaults
The following creates a Topic called pageviews
using the default parameters in the user's default store:
Create a new Topic with key/value Descriptors
The following creates a Topic called pageviews_pb
in the user's default store. It also sets the key and value descriptors that are necessary for serializing its records:
Create a new Topic in a Kafka Store with Kafka parameters
The following creates a Topic called PageviewsKafka
in the store named KafkaStore
with 2 partitions and a replication factor of 3:
Create a new Topic in Kinesis Store with Kinesis parameters
The following creates a Topic called pageviews_kinesis
in the store named kinesis_store
with 3 shards:
Last updated