# DESCRIBE ENTITY

## Syntax

```sql
DESCRIBE Entity entity_name
[ IN STORE store_name ];
```

## Description

This command describes an entity in a [Data Store](/overview/core-concepts/store.md).

Entities is visible only if the current [Access Control](/overview/core-concepts/access-control.md#role) has `USAGE` privileges on the store.

### Arguments <a href="#parameters" id="parameters"></a>

#### entity\_name

This is the name of the entity to describe. If the name is case-sensitive, you must wrap it in double quotes; otherwise, the lowercase name is used.

#### IN STORE store\_name

Optionally, describe an entity in a specific store. If the name is case-sensitive, you must wrap it in double quotes; otherwise, the lowercase name is used.

## Examples

#### Describe an entity in the current Kafka store

The following describes the `pageviews` entity in the current Kafka store `demostore`:

```sh
demodb.public/demostore# DESCRIBE ENTITY pageviews;
+-----------+--------------+-------------+-----------+-----------------+-------------------+-----------+
|  Name     |  Entity Type |  Partitions |  Replicas |  Key Descriptor |  Value Descriptor |  Configs  |
+===========+==============+=============+===========+=================+===================+===========+
| pageviews | Topic        | 1           | 1         | <null>          | <null>            | {}        |
+-----------+--------------+-------------+-----------+-----------------+-------------------+-----------+
```

The entity provides the Kafka topic-specific information and the Key/Value [Descriptor](/reference/sql-syntax/data-format-serialization.md#protocol-buffers-and-descriptors) defining the serialization format of both the key and value portions of a Kafka record.

#### Describe an entity in a specific Kinesis store

The following describes the `InterestCount` entity in the Amazon Kinesis store `kinesis_main`:

```sh
demodb.public/demostore# DESCRIBE ENTITY "InterestCount" IN STORE kinesis_store;
+---------------+--------------+---------+-------------+
|  Name         |  Entity Type |  Shards |  Descriptor |
+===============+==============+=========+=============+
| InterestCount | Data Stream  | 6       | <null>      |
+---------------+--------------+---------+-------------+
```

The entity provides the Kinesis stream specific information and a [Descriptor](/reference/sql-syntax/data-format-serialization.md#protocol-buffers-and-descriptors) defining the serialization format of the Kinesis records.

#### Describe an entity with descriptors

The following describes the `pv_pb` entity in the Kafka Store called `KafkaStore2`. This entity's native format is ProtoBuf and the Key and Value descriptors assigned to it allow serialization to/from this format:

````sh
demodb.analytics/demostore# DESCRIBE ENTITY pv_pb IN STORE "KafkaStore2";
```csharp
+-------+--------------+-------------+-----------+---------------------+--------------------+-----------+
|  Name |  Entity Type |  Partitions |  Replicas |  Key Descriptor     |  Value Descriptor  |  Configs  |
+=======+==============+=============+===========+=====================+====================+===========+
| pv_pb | Topic        | 1           | 2         | pb_key.PageviewsKey | pb_value.Pageviews | {}        |
+-------+--------------+-------------+-----------+---------------------+--------------------+-----------+
````

#### Describe a Snowflake database

```sh
demodb.public/sfstore# DESCRIBE ENTITY "FLINK_STREAMING";
+-----------------+--------------+------------+-------------------------------+-----------------+--------------+-----------+
|       Name      |  Entity Type |    Type    |  Created At                   |  Retention Time |     Owner    |  Comment  |
+=================+==============+============+===============================+=================+--------------+===========+
| FLINK_STREAMING | Database     | STANDARD   | 2024-07-17 00:19:33 +0000 UTC |               1 | ACCOUNTADMIN | <null>    |
+-----------------+--------------+------------+-------------------------------+-----------------+--------------+-----------+
```

#### Describe a Snowflake table

```sh
demodb.public/sfstore# DESCRIBE ENTITY "FLINK_STREAMING"."PUBLIC"."SF_PAGEVIEWS";
+-------------------------------------+--------------+------------+-------------------------------+--------------+-------------------------------+-----------------+-------------------------------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
|                 Name                |  Entity Type |    Type    |           Created At          |     Owner    |           Last DDLAt          |  Retention Time |           Updated At          |  Comment |                                                             Columns                                                                                     |
+=====================================+==============+============+===============================+==============+===============================+=================+===============================+==========+=========================================================================================================================================================+
| FLINK_STREAMING.PUBLIC.SF_PAGEVIEWS | Table        | BASE TABLE | 2024-07-03 14:55:20 +0000 UTC | ACCOUNTADMIN | 2024-07-03 14:55:20 +0000 UTC |               1 | 2024-07-03 15:02:46 +0000 UTC | <nil>    | [{"name":"TIMESTAMP","type":"NUMBER(38,0)","nullable":true,"default":null,"primaryKey":false,"uniqueKey":false,"comment":null,"policyName":null},{...}] |
+-------------------------------------+--------------+------------+-------------------------------+--------------+-------------------------------+-----------------+-------------------------------+----------+---------------------------------------------------------------------------------------------------------------------------------------------------------+
```

#### Describe a Databricks catalog

```sh
demodb.public/databricks_store# DESCRIBE ENTITY catalog1;
+------------------+--------------+-------------------------------+-----------------------------------------+-------------------------------+-----------------------------------------+----------+
|     Name         |  Entity Type |           Created At          |                Created By               |           Updated At          |                Updated By               |  Comment |
+==================+==============+===============================+=========================================+===============================+=========================================+==========+
| catalog1         | Catalog      | 2024-02-09 22:07:14 +0000 UTC | subscriptions+databricks@deltastream.io | 2024-02-09 22:07:14 +0000 UTC | subscriptions+databricks@deltastream.io |          |
+------------------+--------------+-------------------------------+-----------------------------------------+-------------------------------+-----------------------------------------+----------+
```

#### Describe a Databricks schema

```sh
demodb.public/databricks_store# DESCRIBE ENTITY catalog1.schema1;
+------------------+--------------+-------------------------------+-------------+-------------------------------+-------------+----------+
|      Name        |  Entity Type |           Created At          | Created By  |           Updated At          | Updated By  |  Comment |
+==================+==============+===============================+=============+===============================+=============+==========+
| catalog1.schema1 | Schema       | 2024-02-13 23:43:59 +0000 UTC | sch_owner   | 2024-02-13 23:43:59 +0000 UTC | sch_owner   |          |
+------------------+--------------+-------------------------------+-------------+-------------------------------+-------------+----------+
```

#### Describe a Databricks table

```sh
demodb.public/dbx_store# DESCRIBE ENTITY catalog1.schema1.pageviews;
+----------------------------+--------------+-------------------------------+-------------+-------------------------------+-------------+----------------------+------------------------------------+---------------------------------------------------------------------------+
|            Name            |  Entity Type |           Created At          | Created By  |           Updated At          | Updated By  | Storage Location     |              Comment               |                              Columns                                      |
+============================+==============+===============================+=============+===============================+=============+======================+====================================+===========================================================================+
| catalog1.schema1.pageviews | Table        | 2024-04-10 15:24:07 +0000 UTC | tbl_owner   | 2024-04-10 15:24:07 +0000 UTC | tbl_owner   | s3://somebucket/test | {"deltastream.relation.fqn":"..."} | [{"name":"messageId","type":"string","nullable":true,"position":0},{...}] |
+----------------------------+--------------+-------------------------------+-------------+-------------------------------+-------------+----------------------+----------------------------------+-----------------------------------------------------------------------------+
```

#### Describe a Postgresql schema

```sh
demodb.public/databricks_store# DESCRIBE ENTITY db.schema1;
+-------------+--------------+-----------+
|  Name       |  Entity Type |  Owner    |
+=============+==============+===========+
| db.schema1  | Schema       | sch_owner |
+-------------+--------------+-----------+
```

#### Describe a Postgresql table

```sh
demodb.public/pgx_store# DESCRIBE ENTITY public.pageviews;
+------------------+--------------+-----------+---------------------------------------------------------------------------+
|  Name            |  Entity Type |  Owner    |  Columns                                                                  |
+==================+==============+===========+===========================================================================+
| public.pageviews | Table        | tbl_owner | [{"name":"viewtime","type":"bigint","nullable":true,"position":0},{...}]  |
+------------------+--------------+-----------+---------------------------------------------------------------------------+
```


---

# 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/command/describe-entity.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.
