英文:
How to query across multiple databases in Apache Superset?
问题
我需要根据SQL查询显示图表,但我必须编写查询来连接来自不同数据库的表格。在Apache Superset中是否有任何方法可以做到这一点?
我查看了Trino,但想知道是否有更好的方法,因为我们在Kubernetes上运行Superset,而且我们必须在我们的Kubernetes集群中部署Trino。
英文:
I need to display charts based on SQL queries, but I have to write queries to join tables which are from different databases. Is there anyway I can do it in Apache Superset ?
I looked into Trino, but wondering if there is a better way as we are running Superset on kubernettes and we have to deploy Trino in our kubernettes cluster.
答案1
得分: 1
我认为目前您无法同时查询多个数据库。
一种解决方法是在主查询中使用类似于Postgres dblink函数的方式来从远程数据库检索数据。
另一种解决方法是:(1)创建一个视图(材料化视图)或(2)在主数据库上生成一个带有所需数据的外部表。然后,您可以只从一个数据库查询并使用Superset过滤器。
英文:
I think currently you can't query more than one DB at once.
A workaround would be to use something similar to Postgres dblink function on your main query to retrieve data from a remote DB.
Another solutions would be to (1) create a view (materialized view) or (2) to generate a foreign table on your main DB with required data from the remote DB.
Then, you can query only from one DB and use Superset filters.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论