mysql {{ filter_values()}}无法在Apache Superset上工作

e0uiprwp  于 2023-04-28  发布在  Mysql
关注(0)|答案(1)|浏览(90)

我的SQL查询是

SELECT count(ce.id) 
FROM course_enrollments ce
LEFT JOIN course_batches as cb ON cb.id = ce.course_batch_id
WHERE cb.bn_title IN ('title1') AND ce.course_completeness=100.00
AND ce.created_at between '2021-7-01' AND '2022-3-14'

我更新了此查询以进行筛选

SELECT count(ce.id) 
FROM course_enrollments ce
LEFT JOIN course_batches as cb ON cb.id = ce.course_batch_id
WHERE cb.bn_title IN {{ filter_values('title')|where_in }} AND ce.course_completeness=100.00
AND ce.created_at between '2021-7-01' AND '2022-3-14'

但是得到这样的错误

Unexpected error
Error: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{{ filter_values('title')|where_in }}\n     AND ce.course_completeness=100.00\n   ' at line 6")

语法{{ filter_values()}}在我的apache超集中不起作用。我该如何解决这个问题?
我正在使用mysql数据库并将其连接到apache超集。

nkoocmlb

nkoocmlb1#

检查您的Superset设置是否允许使用Jinja模板(在superset/www. example中,功能标志ENABLE_TEMPLATE_PROCESSING需要设置为true www.example.com 或superset_config中。py在根目录中)。

相关问题