3

I have a mongodb on a server 122.xxx.xxx.xxx. The mongodb version is 3.4.1. I was asked to pool the real-time data from MongoDB to the superset BI to create various dashboards.

I have tried the following way:

Use a Foreign Data Wrapper mongodb + multicorn + yam_fdw o create a foreign table in postgresql

In Postgresql console:

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'
);

In superset

Successfully load the data

But the foreign table only appears in the slices section. In the SQL lab tab,

No foreign table appears

Anyone knows how to make the foreign table appears in the SQL lab tab ?

OS: Mac 64 bit

TylerH
  • 20,799
  • 66
  • 75
  • 101
Jessica Chen
  • 31
  • 1
  • 2

1 Answers1

1

Another solution would be to synchronize your data to a PostgreSQL database.

We assembled an open-source platform to do that here https://github.com/pajachiet/mongo_sql_analytics_platform

geecko
  • 141
  • 1
  • 3