# Imply

## Prerequisites

1. WarpStream account - get access to WarpStream by registering [here](https://console.warpstream.com/signup).
2. Imply account - get access to Imply by registering [here](https://signup.imply.io/get-started).
3. A WarpStream cluster is up and running.

## Step 1: Create a topic in your WarpStream cluster

Obtain the Bootstrap Broker from the WarpStream console by navigating to your cluster and clicking the Connect tab. If you don't have SASL credentials, you can also [create a set of credentials](https://docs.warpstream.com/warpstream/kafka/manage-security/sasl-authentication#creating-credentials) from the console.

Store these values as environment variables for easy reference:

```bash
export BOOTSTRAP_HOST=<YOUR_BOOTSTRAP_BROKER> \
SASL_USERNAME=<YOUR_SASL_USERNAME> \
SASL_PASSWORD=<YOUR_SASL_PASSWORD>;
```

Then, if you don't already have an available topic, create one using the WarpStream CLI or in the UI, then follow **Step 2**:

{% code overflow="wrap" %}

```bash
warpstream kcmd -bootstrap-host $BOOTSTRAP_HOST -tls -username $SASL_USERNAME -password $SASL_PASSWORD -type create-topic -topic imply_demo
```

{% endcode %}

You should see the following output in your Terminal:

`Created topic imply_demo.`

## Step 2: Produce some records

Using the WarpStream CLI, produce several messages to your topic:

{% code overflow="wrap" %}

```bash
warpstream kcmd -bootstrap-host $BOOTSTRAP_HOST -tls -username $SASL_USERNAME -password $SASL_PASSWORD -type produce -topic clickhouse_demo --records '{"action": "click", "user_id": "user_0", "page_id": "home"},,{"action": "hover", "user_id": "user_0", "page_id": "home"},,{"action": "scroll", "user_id": "user_0", "page_id": "home"},,{"action": "click", "user_id": "user_1", "page_id": "home"},,{"action": "click", "user_id": "user_1", "page_id": "home"},,{"action": "click", "user_id": "user_2", "page_id": "home"}'
```

{% endcode %}

Note that the WarpStream CLI uses double commas (`,,)` as a delimiter between JSON records.

## Step 3: Connect Imply to WarpStream

In the Imply dashboard, navigate to "S**ources**" and then click "**Create source**" from the option in the upper right and find/select "**Kafka/MSK**":

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2Fgit-blob-8824a73e029fc5aa3d24a2006aeb4c3df4740c8b%2Fimage.png?alt=media" alt=""><figcaption><p>Imply Dashboard</p></figcaption></figure>

Fill in the connection information as indicated below:

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2Fgit-blob-d71ca86efe90844cd17ad5a9f53d0027f9072f9f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## Step 4: Ingest data from WarpStream to Imply

With the connection created, you'll want to now select the source to insert data into a table. On the "**Sources**" page, click on the three-dot (...) menu for the source, and select "**Insert data**", as seen below:

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2Fgit-blob-7b4264b7141c626b5373f93edba9a6a4974a84f0%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Name the table, in this case, "**orders**":

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2Fgit-blob-fa992d985bb0262b7f4eddb14f1f6fc76e1aac20%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

We select our source from this next screen; in this case, we named it "**Warp\_Orders**," and then click "**Next ->**":

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2Fgit-blob-874bc23a965ebd9d2f68c3eea3d0974dfe79804f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Imply will provide a preview of your data, names, and types. It will try to infer the input format and layout from the data, but you can force it by selecting the "**Input format**".

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2Fgit-blob-ee35bf82ed1c3554a29f059b964d38035684e82f%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

The final step before ingestion allows you to make any last-minute changes to how you are going to read the topics and what the destination table is like. Once you have finished with these settings, then click "**Start ingestion**":

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2Fgit-blob-b7458d9a331c672aaa0090ddc580079f80c36ab3%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## Step 5: Query and visualize your data in Imply

Once your data is loaded, you can use any of the Imply features to build data cubes, dashboards, reports, or even SQL commands, as seen below. This example joins the data imported from two topics, "**customers**" and "**orders**," which have a joining field of "**customerId**":

<figure><img src="https://77315434-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjB7FxO8ty4EXO4HsQP4E%2Fuploads%2Fgit-blob-08bd8996b52105507ba47acc46119eeb8f1a4bad%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

## Next Steps

Congratulations! You've set up a stream processing pipeline between WarpStream and Imply and performed a basic SQL query. This is just the beginning of what is possible.

Next, check out the WarpStream docs for configuring the [WarpStream Agent](https://docs.warpstream.com/warpstream/agent-setup/deploy), or review the [Imply docs](https://docs.imply.io/) to learn more about what can be done with WarpStream and Imply!
