postgresql - 如何对接MongoDB和Superset BI并导入实时数据?

标签 postgresql flask-sqlalchemy apache-superset

我在服务器 122.xxx.xxx.xxx 上有一个 mongodb。 mongodb版本是3.4.1。 我被要求将来自 MongoDB 的实时数据汇集到超集 BI 中,以创建各种仪表板。

我试过以下方法:

使用外部数据包装器 mongodb + multicorn + yam_fdw o 在 postgresql 中创建外部表

在 Postgresql 控制台中:

CREATE EXTENSION multicorn;

CREATE SERVER mongodb_proxy_server FOREIGN DATA WRAPPER multicorn OPTIONS (wrapper 'yam_fdw.Yamfdw');

CREATE FOREIGN TABLE event_warnings ( 
"_id" varchar OPTIONS (type 'ObjectId'),
"ID" varchar, "Point" varchar,
"Start_Time" timestamptz, "Stop_Time" timestamptz, "Area" varchar,
"Value" float, "Station" varchar, "Device" varchar, "Warning_Type" varchar,
"Warning_Upper_Limit" float, "Warning_Lower_Limit" float,
"Warning_Method" int
)

SERVER mongodb_proxy_server OPTIONS ( 
db 'XXX', collection 'event_warnings', 
host '122.XXX.XXX.XXX', port '27017', user 'username', password 'password'
);

在超集中

Successfully load the data

但是外表只出现在切片部分。在 SQL 实验室选项卡中,

No foreign table appears

谁知道如何让外部表出现在 SQL lab 选项卡中?

操作系统:Mac 64 位

最佳答案

另一种解决方案是将您的数据同步到 PostgreSQL 数据库。

我们在这里组装了一个开源平台来做到这一点 https://github.com/pajachiet/mongo_sql_analytics_platform

关于postgresql - 如何对接MongoDB和Superset BI并导入实时数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46823671/

相关文章:

mysql - 如何从postgresql中的同一行中找到最小最大值

sql - 按顺序对所有行进行编号

postgresql - Docker-compose:将 Celery 绑定(bind)到 Postgres 数据库

flask - 如何使用外键替换为其值的API端点?

python - 无法安装 apache superset ubuntu 18.04 甚至 ubuntu 16.04

java - 如果我的数据库(postgres)中已经存在用户名,我如何检查(java)?

python - flask 棉花糖表序列化失败

mysql - 如何将本地 mysql 数据库连接到 MacBook Pro 中的 Apache 超集?

python - Apache 超集主题和样式

postgresql - 如何将纯 SQL 文件转换为压缩的 pgdump 文件?