Back to Materialize

Hex

doc/user/content/serve-results/bi-tools/hex.md

1232.2 KB
Original Source

This guide walks you through the steps required to use the collaborative data notebook Hex with Materialize.

Create an integration

  1. Sign in to Hex.

  2. Go to an existing project or create a new one.

  3. Go to {{% icons/hex_data_sources %}}Data Sources > +Add > Create data connection... > Materialize.

  4. Search and click the Materialize option.

  5. Enter the connection fields as follows:

    FieldValue
    NameMaterialize.
    DescriptionA description you prefer.
    Host & PortMaterialize host name, and 6875 for the port.
    Databasematerialize
    Authentication typeChoose the Password option.
    UsernameMaterialize user.
    PasswordApp-specific password.
  6. Click the Create connection button.

Configure a custom cluster

{{% include-from-yaml data="examples/alter_cluster" name="configure-cluster" %}}

Execute and visualize a query

  1. Create a new SQL cell.

  2. Inside the cell, select the new Materialize connection and paste the following query:

    mzsql
    SELECT
        number,
        row_num
    FROM (
        SELECT
            power(series_number, 2) AS number,
            row_number()
                OVER
                (ORDER BY series_number ASC, series_number DESC)
            AS row_num
        FROM (
            SELECT generate_series(0, 1000) AS series_number
        ) AS subquery
    );
    

    This query generates a series of 1000 numbers squared and assigns row numbers to each.

  3. Click the {{% icons/hex_run %}} Run button.

  4. Inside the cell, click the Chart button and configure as follows:

    1. In the X Axis options, select the row_num column.
    2. In the Y Axis options, select the number column.

For more information about Hex and data connections, visit their documentation.