> For the complete documentation index, see [llms.txt](https://docs.deltastream.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.deltastream.io/reference/sql-syntax/command/print-entity.md).

# PRINT ENTITY

## Syntax <a href="#synopsis" id="synopsis"></a>

```sql
PRINT ENTITY fully_qualified_entity_name
[ IN STORE store_name ]
[ WITH (streaming_print_parameter = value [, ...]) ];
```

## Description

This command retrieves the latest data for an entity in a [Data Store](/overview/core-concepts/store.md). You can only print leaf-level entities such as Snowflake Tables or Kafka topics.

`PRINT ENTITY` reads directly from the underlying entity in the current store. In Kafka-type stores, an entity corresponds to a Kafka topic. In Kinesis-type stores, an entity corresponds to a Kinesis data stream.

Unlike queries such as [`SELECT`](/reference/sql-syntax/query/select.md), `PRINT ENTITY` does not query a DeltaStream relation and does not require a sandbox.

You can print entities only if the current role has `USAGE` privileges on the store.

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

#### fully\_qualified\_entity\_name

The full name of the entity from which to print records.

#### IN STORE store\_name

Optionally, sample an entity from a specific [Data Store](/overview/core-concepts/store.md). If the name is case-sensitive, you must wrap it in double quotes; otherwise, the system uses the lowercase name.

#### WITH (streaming\_print\_parameter = value \[, ...])

Optionally, use [#streaming-print-parameters](#streaming-print-parameters "mention") to change the behavior of each printing session for the streaming stores.

### Streaming Print Parameters

| Parameter Name   | Description                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `from.beginning` | <p>A flag that indicates the operation will start reading the entity from the earliest available records. This property does not accept a value.<br></p><p><strong>Required:</strong> No<br><strong>Default value:</strong> Unset<br><strong>Type:</strong> Flag</p>                                                                                                                                                             |
| `from.timestamp` | <p>Specifies the timestamp to use to print records. The timestamp value is in epoch-milliseconds, which is measured as the number of milliseconds since <code>January 1, 1970 00:00:00.000 GMT</code>. Cannot be set with the <code>from.beginning</code> flag.<br></p><p><strong>Required:</strong> No<br><strong>Default value:</strong> None<br><strong>Type:</strong> Integer<br><strong>Valid values:</strong> \[1,...]</p> |
| `message.rate`   | <p>Specifies the number of records per second that should be printed.<br></p><p><strong>Required:</strong> No<br><strong>Default value:</strong> 5<br><strong>Type:</strong> Integer<br><strong>Valid values:</strong> \[1,...,10]</p>                                                                                                                                                                                           |

## Examples

#### Print entity with defaults

The following prints from the `pageviews` entity using the current store and default configuration:

```sh
demodb.public/demostore# PRINT ENTITY pageviews;
+---------------------+-----------------------------------------------------------------+
| key                 | value                                                           |
+=====================+=================================================================+
| {"userid":"User_1"} | {"viewtime":1660931394412,"userid":"User_1","pageid":"Page_22"} |
+---------------------+-----------------------------------------------------------------+
| {"userid":"User_6"} | {"viewtime":1660931395412,"userid":"User_6","pageid":"Page_32"} |
+---------------------+-----------------------------------------------------------------+
| {"userid":"User_1"} | {"viewtime":1660931396413,"userid":"User_1","pageid":"Page_96"} |
+---------------------+-----------------------------------------------------------------+
```

#### Print entity from a specific timestamp with a custom message rate

The following prints from the `pageviews` entity from a specific store and timestamp with a rate of 10 messages per second:

```sh
demodb.public/demostore# PRINT ENTITY "PageviewsOther" IN STORE "OtherStore" WITH ('from.timestamp' = 1660931394411, 'message.rate' = 10);
+---------------------+-----------------------------------------------------------------+
| key                 | value                                                           |
+=====================+=================================================================+
| {"userid":"User_1"} | {"viewtime":1660931394412,"userid":"User_1","pageid":"Page_22"} |
+---------------------+-----------------------------------------------------------------+
| {"userid":"User_6"} | {"viewtime":1660931395412,"userid":"User_6","pageid":"Page_32"} |
+---------------------+-----------------------------------------------------------------+
| {"userid":"User_1"} | {"viewtime":1660931396413,"userid":"User_1","pageid":"Page_96"} |
+---------------------+-----------------------------------------------------------------+
```

#### Print entity from earliest available records

The following prints from the `pageviews` entity from the store `teststore` and earliest available records:

```sh
demodb.public/demostore# PRINT ENTITY pageviews IN STORE teststore WITH ('from.beginning', 'message.rate' = 1);
+---------------------+-----------------------------------------------------------------+
| key                 | value                                                           |
+=====================+=================================================================+
| {"userid":"User_7"} | {"viewtime":11631281,"userid":"User_7","pageid":"Page_83"}      |
+---------------------+-----------------------------------------------------------------+
| {"userid":"User_1"} | {"viewtime":11631291,"userid":"User_1","pageid":"Page_50"}      |
+---------------------+-----------------------------------------------------------------+
| {"userid":"User_6"} | {"viewtime":11631301,"userid":"User_6","pageid":"Page_12"}      |
+---------------------+-----------------------------------------------------------------+
```

#### Print a Snowflake table

```sh
demodb.public/snowflake_store# PRINT ENTITY "DELTA_STREAMING"."PUBLIC".pageviews;
+-----------------+-------------+-------------+
| VIEWTIME        | USERID      | PAGEID      |
+=================+=============+=============+
| 1694124853651   | User_4      | Page_29     |
+-----------------+-------------+-------------+
| 1694124856731   | User_1      | Page_59     |
+-----------------+-------------+-------------+
| 1694124857732   | User_1      | Page_63     |
+-----------------+-------------+-------------+
```

#### Print a Databricks table

```sh
db.public/kafka_store# PRINT ENTITY cat1.schema1.pageviews IN STORE databricks_store;
+----------------------+---------+-------------+
| viewtime             | userid  | pageid      |
+======================+=========+=============+
| 1.695069562981e+12   | User_9  | Page_37     |
+----------------------+---------+-------------+
| 1.69506956402e+12    | User_7  | Page_52     |
+----------------------+---------+-------------+
| 1.695069565022e+12   | User_5  | Page_83     |
+----------------------+---------+-------------+
| 1.69506956604e+12    | User_3  | Page_85     |
+----------------------+---------+-------------+
| 1.69506956708e+12    | User_9  | Page_87     |
+----------------------+---------+-------------+
| 1.69506956816e+12    | User_6  | Page_67     |
+----------------------+---------+-------------+
| 1.695069569162e+12   | User_9  | Page_48     |
+----------------------+---------+-------------+
| 1.695069570163e+12   | User_7  | Page_35     |
+----------------------+---------+-------------+
| 1.695069571164e+12   | User_6  | Page_11     |
+----------------------+---------+-------------+
| 1.695069572165e+12   | User_8  | Page_91     |
+----------------------+---------+-------------+
```
