You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/05/25 14:06:04 UTC

[jira] [Commented] (DRILL-5537) Display columns alias for queries with sum() when RDBMS storage plugin is enabled

    [ https://issues.apache.org/jira/browse/DRILL-5537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16024768#comment-16024768 ] 

ASF GitHub Bot commented on DRILL-5537:
---------------------------------------

GitHub user arina-ielchiieva opened a pull request:

    https://github.com/apache/drill/pull/845

    DRILL-5537: Display columns alias for queries with sum() when RDBMS s…

    …torage plugin is enabled
    
    For sum() queries DrillConvertSumToSumZero rule is applied. But during converting to new aggregate call, this call was created with name set to null, therefore column alias was lost when RDBMS storage plugin was enabled. RDBMS storage plugin was adding new rule during PHYSICAL phase - ReduceProjectRule, since project stage was omitted, column alias was lost. With this fix even if project stage is omitted, column alias still will be shown.
    
    Changes:
    1. Added old call aggregate name during new call aggregate creation in DrillConvertSumToSumZero  rule.
    2. Replaced deprecated AggregateCall constructor to `AggregateCall.create`.
    3. Minor refactoring.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/arina-ielchiieva/drill DRILL-5537

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/845.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #845
    
----
commit 5e83d6d17232d4ddbff7e11eaadecad9ef992b10
Author: Arina Ielchiieva <ar...@gmail.com>
Date:   2017-05-25T13:23:43Z

    DRILL-5537: Display columns alias for queries with sum() when RDBMS storage plugin is enabled

----


> Display columns alias for queries with sum() when RDBMS storage plugin is enabled
> ---------------------------------------------------------------------------------
>
>                 Key: DRILL-5537
>                 URL: https://issues.apache.org/jira/browse/DRILL-5537
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.10.0
>            Reporter: Arina Ielchiieva
>            Assignee: Arina Ielchiieva
>
> When [RDBMS storage plugin|https://drill.apache.org/docs/rdbms-storage-plugin/]  is enabled, alias is not displayed for column with sum function:
> {noformat}
> 0: jdbc:drill:zk=local> select version, sum(1) as s from sys.version group by version;
> +------------------+------+
> |     version      | $f1  |
> +------------------+------+
> | 1.11.0-SNAPSHOT  | 1    |
> +------------------+------+
> 1 row selected (0.444 seconds)
> {noformat}
> Other functions like avg, count are not affected.



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