Zoltán Borók-Nagy created IMPALA-15815:
------------------------------------------
Summary: Calcite planner rejects AVG/STDDEV/VARIANCE(BOOLEAN)
Key: IMPALA-15815
URL: https://issues.apache.org/jira/browse/IMPALA-15815
Project: IMPALA
Issue Type: Bug
Components: Frontend
Reporter: Zoltán Borók-Nagy
The original planner accepts AVG, STDDEV and VARIANCE on a BOOLEAN argument and
returns DOUBLE:
{code:sql}
SELECT avg(bool_col), stddev(bool_col), variance(bool_col) FROM
functional.alltypes;
{code}
With PLANNER=CALCITE and FALLBACK_PLANNER=NONE, analysis fails:
{noformat}
Cannot apply 'AVG' to arguments of type 'AVG(<BOOLEAN>)'. Supported form(s):
'AVG(<NUMERIC>)'
{noformat}
STDDEV and VARIANCE fail the same way. This is the same gap as IMPALA-15695 for
SUM. Extending its fix in {{ImpalaTypeCoercionImpl.builtinFunctionCoercion()}}
to {{SqlKind.AVG_AGG_FUNCTIONS}} should give matching DOUBLE results.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)