CREATE DESCRIPTOR_SOURCE

Syntax

CREATE DESCRIPTOR_SOURCE
    descriptor_source_name
WITH (descriptor_source_parameter = value [, ...]);

Description

Creates Descriptor(s) from the schemas available in the Descriptor source file. When creating a Descriptor Source in DeltaStream, the Descriptor Source is parsed and all schemas are extracted and created as separate descriptors for the user. These descriptors can then be used to set serialization format for Topic.

Supports Protocol Buffer descriptors.

Arguments

descriptor_source_name

Name of the Descriptor Source to be imported. For case-sensitive names, the name must be wrapped in double quotes, otherwise, the lowercased name will be used.

WITH (descriptor_source_parameter = value [, …​ ])

This clause specifies the Descriptor Source Parameters.

Descriptor Source Parameters

Parameter NameDescription

file

Required. Specifies a local filesystem path to import the descriptor(s) from. Type: String

Valid values: A valid file path in the current user's local filesystem.

Examples

Create a new Descriptor Source from local file

The following creates a Descriptor Source from the ProtoBuf descriptors file /descriptors/pageviews.desc on the local filesystem and gives it a recognizable name pageviews for reference from a Topic:

<no-db>/<no-store># CREATE DESCRIPTOR_SOURCE pageviews WITH ( 'file' = '/descriptors/pageviews.desc' );
<no-db>/<no-store># LIST DESCRIPTOR_SOURCES;
    Name    |   Tags   |   Type   |  Owner   |      Created at      |      Updated at       
------------+----------+----------+----------+----------------------+-----------------------
  pageviews | protobuf | protobuf | sysadmin | 2023-02-10T18:43:24Z | 2023-02-10T18:43:24Z  

Once the Descriptor Source is imported, all its ProtoBuf descriptors descriptors are extracted and are made available in the LIST DESCRIPTORS command:

<no-db>/<no-store># LIST DESCRIPTORS;
           Name           
--------------------------
  pageviews.PageviewsKey  
  pageviews.Pageviews     

Last updated