Drill 是否支持 FILTER WHERE?
Does Drill support FILTER WHERE?
考虑以下查询:
SELECT
COUNT(*) unfiltered,
COUNT(*) FILTER (WHERE a."Id" <= 5) AS filtered
FROM db.example."Articles" a
这应该return类似于:
unfiltered | filtered
456 | 5
但是 Apache Drill returns:
unfiltered | filtered
456 | 456
Apparently FILTER WHERE does not work. Is it bug or feature? If it's not supported, why Drill does not throw any error when parsing this SQL?
使用 Drill 1.16.0
感谢您指出这个问题。是的,我们不支持这个,我们至少应该抛出一个异常而不是返回错误的结果。我为此问题创建了一张 Jira 票证:DRILL-7421
考虑以下查询:
SELECT
COUNT(*) unfiltered,
COUNT(*) FILTER (WHERE a."Id" <= 5) AS filtered
FROM db.example."Articles" a
这应该return类似于:
unfiltered | filtered
456 | 5
但是 Apache Drill returns:
unfiltered | filtered
456 | 456
Apparently FILTER WHERE does not work. Is it bug or feature? If it's not supported, why Drill does not throw any error when parsing this SQL?
使用 Drill 1.16.0
感谢您指出这个问题。是的,我们不支持这个,我们至少应该抛出一个异常而不是返回错误的结果。我为此问题创建了一张 Jira 票证:DRILL-7421