Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-1101

Cannot plan exception- Union all

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Following query results in a CannotPlanException

      select emails.technology_type , emails.organization,
      emails.metric_no, emails.metric_name, emails.metric_value
      from(
      select 'emails' as technology_type ,
      b1.organization as organization,
      1 as metric_no, 'email_count' as metric_name, 2*count(distinct message_id) as metric_value
      from emails a1
      left outer join employee_table b1
      on (a1.sender_address = b1.emailid)
      where a1.event_id = 'RECEIVE'
      group by b1.organization

      union all
      select 'emails' as technology_type,
      b2.organization as organization,
      2 as metric_no, 'email_active_employee_count' as metric_name, count as metric_value
      from employee_table b2
      where b2.status = 'A'
      group by b2.organization
      ) emails;

      Attachments

        Activity

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

          People

            inramana Ramana Inukonda Nagaraj
            inramana Ramana Inukonda Nagaraj
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment