UPDATE TOPIC

Syntax

UPDATE TOPIC
    topic_name
    [IN STORE store_name]
[WITH (topic_parameter = value [, ...])];

Description

Updates a Topic with new Topic Parameters. Only logical-layer parameters of a Topic may be updated after it's been created. Logical-layer parameters are the ones that allow DeltaStream to operate on the Topic. For updating physical-layer parameters, a Topic must be recreated. See DROP TOPIC and CREATE TOPIC.

Arguments

topic_name

The name of the existing Topic to update. For case-sensitive names, the name must be wrapped in double quotes, otherwise, the lowercased name will be used.

IN STORE store_name

Optionally, update the Topic in a specific Store. For case-sensitive names, the name must be wrapped in double quotes, otherwise, the lowercased name will be used.

WITH (topic_parameter = value [, …​])

Optionally, this clause specifies Topic Parameters.

Topic Parameters

Parameter NameDescription

key.descriptor

A qualified Descriptor name used to decode a record's key, if applicable. Clear the Descriptor by specifying 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. Clear the Descriptor by specifying NULL. Required: No Default value: None Type: String Valid values: See LIST DESCRIPTORS

Examples

Add Descriptors to a Topic

The following updates the key and value descriptors for the Topic transactions in the user's default Store, demostore:

demodb.public/demostore# SHOW DESCRIPTORS;
         Name
----------------------
  pb.pageviews_key
  pb.pageviews_value

demodb.public/demostore# UPDATE TOPIC transactions WITH ( 'key.descriptor' = pb.transactions_key, 'value.descriptor' = pb.transactions_value );
demodb.public/demostore# DESCRIBE TOPIC transactions;
       Name       | Partitons | Replicas |     Key descriptor     |    Value descriptor    
------------------+-----------+----------+------------------------+------------------------
   transactions   |         1 |        2 |   pb.transactions_key  | pb.transactions_value  

Remove Descriptors from a Topic

The following sets the key and value descriptors for the Topic transactions in the user's default Store to be NULL:

demodb.public/demostore# UPDATE TOPIC transactions WITH ( 'key.descriptor' = NULL, 'value.descriptor' = NULL );
demodb.public/demostore# DESCRIBE TOPIC transactions;
      Name     | Partitons | Replicas | Key descriptor | Value descriptor  
---------------+-----------+----------+----------------+-------------------
  transactions |         1 |        2 |                |                   

Add value Descriptor to Topic in a specific Store

The following sets the value Descriptor for the Topic xActs in a specific Store, OtherStore:

demodb.public/demostore# SHOW DESCRIPTORS;
         Name
----------------------
  pb.pageviews_value

demodb.public/demostore# UPDATE TOPIC "xActs" IN STORE "OtherStore" WITH ( 'value.descriptor' = pb.pageviews_value );
demodb.public/demostore# DESCRIBE TOPIC "xActs" IN STORE "OtherStore";
    Name   | Partitons | Replicas | Key Descriptor |    Value Descriptor    
-----------+-----------+----------+----------------+------------------------
   xActs   |         1 |        2 |                |   pb.pageviews_value  

Last updated