【问题标题】:Dynamic dataset url in Apache Superset with Apache Drill使用 Apache Drill 在 Apache Superset 中的动态数据集 url
【发布时间】:2022-01-26 10:15:00
【问题描述】:

我通过 sqlalchemy-drill 将 Apache Superset 与 apache Drill 连接起来。 这是连接:

"type": "http",
"cacheResults": true,
"connections": {
  "get": {
  "url": "http://localhost:5500/",
  "method": "GET",
  "headers": null,
  "authType": "none",
  "userName": null,
  "password": null,
  "postBody": null,
  "params": null,
  "dataPath": null,
  "requireTail": true,
  "inputType": "json",
  "xmlDataLevel": 1
  }
},
"timeout": 5,
"proxyType": "direct",
"enabled": true

在 Superset 中我获取数据:

SELECT * FROM api.get.`link`

但在 api 中,我需要通过“link/1”、“link/2”等动态 url 获取数据。 我正在尝试使用 Jinja 模板将 urla 参数插入查询:

SELECT * FROM api.get.{{ url_param('url') }}

然后在仪表板中使用诸如“http://localhost:8088/superset/dashboard/1/?url=link/1”之类的url来访问参数?但它不起作用。

有没有办法使用动态url从Superset访问api?

【问题讨论】:

    标签: apache-superset apache-drill


    【解决方案1】:

    需要将 superset_config.py 中的 ENABLE_TEMPLATE_PROCESSING 设置为 TRUE 即可

    【讨论】:

      猜你喜欢
      • 2020-01-29
      • 1970-01-01
      • 2023-03-10
      • 1970-01-01
      • 2021-05-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-09-10
      相关资源
      最近更新 更多