Aleksandr Efimov created IMPALA-15529:
-----------------------------------------
Summary: Function expressions can break GROUPING SETS parsing
Key: IMPALA-15529
URL: https://issues.apache.org/jira/browse/IMPALA-15529
Project: IMPALA
Issue Type: Bug
Reporter: Aleksandr Efimov
Reproduced with the original frontend on master at
baf1e8fe93af058d48bc468ab2d3a7b5f52ebbb3.
{code:sql}
select coalesce(b,10) as k,
grouping(coalesce(b,10)) as g,
grouping_id(coalesce(b,10)) as gid,
count(*) as n
from (select cast(null as int) b union all select 10) t
group by grouping sets
((coalesce(b,10)), (coalesce(b,10)), (), ());
{code}
Expected: the statement parses and analyzes successfully.
Actual: parsing fails. The underlying exception is a NullPointerException in
FunctionName.equals(), called from the explicit GROUPING SETS constructor in
GroupByClause.
The constructor compares expressions before function names are resolved. For
parsed function names, fn_ is still null when equals() is called.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)