如何在 Redash 中配置 Apache Ignite

How to configure Apache Ignite in Redash

我需要在 Redash 中为 BI 仪表板配置 Apache ignite,但不知道如何做,因为在 Redash 中没有对 ignite 的直接支持。

可以使用 Python 查询 运行ner,stand-alone installs 可用。它允许您 运行 任意 Python 代码,您可以在其中通过 JDBC.

查询 Apache Ignite

首先,将redash.query_runner.python查询运行添加到settings.py

并安装 Python JDBC 桥接模块和依赖项:

sudo apt-get install python-setuptools
sudo apt-get install python-jpype
sudo easy_install JayDeBeApi

然后在 VM 重启后你应该添加 Python 数据源(你可能需要调整模块路径):

然后您实际上可以 运行 查询(您还需要提供 Apache Ignite 核心 JAR 和 JDBC 连接字符串):

import jaydebeapi
conn = jaydebeapi.connect('org.apache.ignite.IgniteJdbcThinDriver', 'jdbc:ignite:thin://localhost', {}, '/home/ubuntu/.m2/repository/org/apache/ignite/ignite-core/2.3.2/ignite-core-2.3.2.jar')
curs = conn.cursor()
curs.execute("select c.Id, c.CreDtTm from TABLE.Table c")
data = curs.fetchall()

result = {"columns": [], "rows": []}
add_result_column(result, "Id", "Identifier", "string")
add_result_column(result, "CreDtTm", "Create Date-Time", "integer")

for d in data:
        add_result_row(result, {"Id": d[0], "CreDtTm": d[1]})

不幸的是,Redash 中没有对 JDBC 的直接支持(据我所知),因此需要所有样板文件。