Use LindormTable with Redash

Updated at:

Redash is an open-source BI tool that provides web-based database querying and data visualization. This topic explains how to connect Redash to LindormTable.

Prerequisites

You have installed Redash.

Install the plugin

  • If you deploy Redash using a Docker image, you must use the /app directory in the redash_server, redash_scheduler, redash_adhoc_worker, and redash_scheduled_worker containers as the $REDASH_SETUP_FOLDER.

    1. Download the Lindorm.png and lindorm.py files from the redash repository.

    2. Copy the Lindorm.png file to the $REDASH_SETUP_FOLDER/client/app/assets/images/db-logos/ and $REDASH_SETUP_FOLDER/client/dist/images/db-logos/ directories.

    3. Copy the lindorm.py file to the $REDASH_SETUP_FOLDER/redash/query_runner/ directory.

    4. Add the following line to the $REDASH_SETUP_FOLDER/redash/settings/__init__.py file.

      default_query_runners = [
        'redash.query_runner.athena',
        'redash.query_runner.big_query',
        ........
        'redash.query_runner.uptycs',
        'redash.query_runner.lindorm',      # Add this line
      ]
    5. Restart Redash.

  • If you deploy Redash from source code, set $REDASH_SETUP_FOLDER as the root directory of the code.

Configure a data source

  1. Log on to Redash.

  2. Click the settings icon Redash设置图标 in the upper-right corner of the page.

  3. On the Data Sources tab, click New data source.

  4. On the New data source page, click the Lindorm icon.

  5. Specify the Lindorm endpoint, port, username, and password.

    Note

    Use the CQL endpoint and port.

  6. Click Create.

    You can click Test Connection to test the connection.

Example

This example creates a line chart that displays temperature changes over time in different cities. The table uses the following columns: temp (temperature), local_time (measurement time), city, and id.

CREATE TABLE log.temp
(
    local_time timestamp,
    temp int,
    id int,
    city text,
    primary key ((id))
)
  1. In the query editor, run the following CQL statement.

    SELECT city, temp, local_time FROM temp
  2. The query result table contains three columns, city, temp, and local_time, and about 10 rows of data, showing the temperature values (such as 14.00, 5.00, 13.00, 17.00, 21.00, 29.00, and 27.00) and corresponding timestamps (with the date as 18/05/21 and the time from 07:09 to 07:38) for the cities of Shanghai, Beijing, and Hangzhou.

  3. Click New Visualization.

    Set X Column to local_time, Y Columns to temp, and Group by to city.