You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2017/06/19 15:25:00 UTC

[jira] [Resolved] (PHOENIX-3958) COALESCE in GROUP BY statement where the result is an empty string fails

     [ https://issues.apache.org/jira/browse/PHOENIX-3958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Taylor resolved PHOENIX-3958.
-----------------------------------
       Resolution: Duplicate
    Fix Version/s: 4.11.0

This is a duplicate of PHOENIX-3918, but FYI in Phoenix an empty string is the same as null, so a COALESCE function with an empty string as the second argument has no effect. You might as well just do GROUP BY ColumnA.

> COALESCE in GROUP BY statement where the result is an empty string fails
> ------------------------------------------------------------------------
>
>                 Key: PHOENIX-3958
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3958
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.7.0
>         Environment: Windows Server 2012;
> Phoenix Driver: phoenix-4.7.0.2.5.0.0-1245-client.jar
>            Reporter: Tiago Correia
>            Priority: Minor
>             Fix For: 4.11.0
>
>
> If you have, for example, the statement below:
> {code:sql}
> SELECT COALESCE(ColumnA, '')
> FROM TableA
> GROUP BY COALESCE(ColumnA, '');
> {code}
> I get the error
> {noformat}
> (ERROR 1018 (42Y27): Aggregate may not contain columns not in GROUP BY. null
> {noformat}
> If I use a space {{' '}} instead of an empty string {{''}}, it starts working.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)