# CREATE DESCRIPTOR\_SOURCE

## Syntax

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

## Description

Creates [descriptor](/reference/sql-syntax/data-format-serialization.md#protocol-buffers-and-descriptors)(s) from the schemas available in the descriptor source file. When you create a descriptor source in DeltaStream, the system parses the descriptor source, extracts all schemas, and creates them as separate descriptors for you. You can then use these descriptors to set serialization format for [entity](/overview/core-concepts/store.md#entity).

Supports [Protocol Buffer](https://protobuf.dev/) descriptors.

### Arguments

#### descriptor\_source\_name

Name of the descriptor source to be imported. If the name is case-sensitive, you must wrap it in double quotes; otherwise, the system uses the lowercase name.

#### WITH (descriptor\_source\_parameter = value \[, …​ ])

This clause specifies the [descriptor source parameters](#descriptor-source-parameters).

### Descriptor Source Parameters

| Parameter Name | Description                                                                                                                                                                                                                                                                                                                              |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `file`         | <p>Specifies a local filesystem path from which to import the descriptor(s).<br><br><strong>Required:</strong> Yes</p><p><strong>Type:</strong> String</p><p><strong>Valid values:</strong> A valid file path in the current user's local filesystem, prefaced with <code>@</code> to be picked up as an attachment for the command.</p> |

## 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 an entity:

```sh
demodb.public/demostore# CREATE DESCRIPTOR_SOURCE employee WITH ( 'file' = '@/descriptors/employee.desc');
+-------------------+------------+------------+------------------------------------------+
|  Type             |  Name      |  Command   |  Summary                                 |
+===================+============+============+==========================================+
| descriptor_source | employee   | CREATE     | descriptor source "employee" was         |
|                   |            |            | successfully created                     |
+-------------------+------------+------------+------------------------------------------+
main_db.public/pub_demo_msk# LIST DESCRIPTOR_SOURCES;
+------------+------------+------------+------------------------------------------+------------+-------------------------------+-------------------------------+
|  Name      |  Tags      |  Type      |  Url                                     |  Owner     |  Created At                   |  Updated At                   |
+============+============+============+==========================================+============+===============================+===============================+
| employee   | []         | protobuf   | /copy/descriptor_source/0100dc20-c041-49 | sysadmin   | 2024-06-04 20:46:44 +0000 UTC | 2024-06-04 20:46:44 +0000 UTC |
|            |            |            | 64-b6b0-c83e59add419/employee            |            |                               |                               |
+------------+------------+------------+------------------------------------------+------------+-------------------------------+-------------------------------+
```

When the descriptor source is imported, all its ProtoBuf descriptors are extracted and can be listed with [LIST DESCRIPTORS](/reference/sql-syntax/command/list-descriptors.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.deltastream.io/reference/sql-syntax/ddl/create-descriptor_source.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
