You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by "Rakesh (JIRA)" <ji...@apache.org> on 2017/05/03 13:28:04 UTC

[jira] [Created] (DRILL-5467) Issue with column alias

Rakesh created DRILL-5467:
-----------------------------

             Summary: Issue with column alias
                 Key: DRILL-5467
                 URL: https://issues.apache.org/jira/browse/DRILL-5467
             Project: Apache Drill
          Issue Type: Bug
    Affects Versions: 1.10.0
            Reporter: Rakesh


The column alias is not always correctly used in output. When columns as calculated in nested table, the outer most project doesn't show the column alias correctly:

SELECT `Custom_SQL_Query`.`Bucket` AS `Bucket`,
  SUM(`Custom_SQL_Query`.`male`) AS `sum_male`
FROM (SELECT first_name as `Bucket`, salary as `num`, case when gender = 'M' then 1 else 0 end as male, case when gender = 'F' then 1 else 0 end as female FROM cp.`employee.json`) `Custom_SQL_Query`
GROUP BY `Custom_SQL_Query`.`Bucket`

Here 'sum_male' appears as $f1 instead



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)