我在服务器 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'
);
在超集中
但是外表只出现在切片部分。在 SQL 实验室选项卡中,
谁知道如何让外部表出现在 SQL lab 选项卡中?
操作系统:Mac 64 位
最佳答案
另一种解决方案是将您的数据同步到 PostgreSQL 数据库。
我们在这里组装了一个开源平台来做到这一点 https://github.com/pajachiet/mongo_sql_analytics_platform
关于postgresql - 如何对接MongoDB和Superset BI并导入实时数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46823671/