Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-3958

COALESCE in GROUP BY statement where the result is an empty string fails

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 4.7.0
    • 4.11.0
    • None
    • None
    • Windows Server 2012;
      Phoenix Driver: phoenix-4.7.0.2.5.0.0-1245-client.jar

    Description

      If you have, for example, the statement below:

      SELECT COALESCE(ColumnA, '')
      FROM TableA
      GROUP BY COALESCE(ColumnA, '');
      

      I get the error

      (ERROR 1018 (42Y27): Aggregate may not contain columns not in GROUP BY. null
      

      If I use a space ' ' instead of an empty string '', it starts working.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            dosaki Tiago Correia
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment