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

2017-06-02 Thread ASF GitHub Bot (JIRA)

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

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

Github user asfgit closed the pull request at:

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


> 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
>  Labels: ready-to-commit
>
> 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)


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

2017-05-31 Thread Arina Ielchiieva (JIRA)

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

Arina Ielchiieva commented on DRILL-5537:
-

[~jni] thank you for code review. You are right, for example, count function 
does the same:
{noformat}
0: jdbc:drill:zk=local> explain plan for select count(1) as cnt from 
sys.version;
+--+--+
| text | json |
+--+--+
| 00-00Screen
00-01  Project(cnt=[$0])
00-02StreamAgg(group=[{}], cnt=[COUNT($0)])
00-03  Project($f0=[1])
00-04Scan(groupscan=[SystemTableScan [table=VERSION, 
distributed=false]])
{noformat}

> 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
>  Labels: ready-to-commit
>
> 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)


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

2017-05-30 Thread ASF GitHub Bot (JIRA)

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

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

Github user jinfengni commented on the issue:

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

LGTM.


> 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
>  Labels: ready-to-commit
>
> 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)


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

2017-05-30 Thread Jinfeng Ni (JIRA)

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

Jinfeng Ni commented on DRILL-5537:
---

Thanks for posting the explain plan output, [~arina]. That makes much cleaner 
to understand what's going on.

I think it makes sense to put the sum's output as the name in AggRel. I think 
count(*) or min/max is doing exactly same.   

> 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
>  Labels: ready-to-commit
>
> 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)


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

2017-05-27 Thread Arina Ielchiieva (JIRA)

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

Arina Ielchiieva commented on DRILL-5537:
-

RDBMS plugin does not have impact on DrillReduceAggregatesRule, is has impact 
on query planning. When RDBMS plugin is enabled, it adds ProjectRemoveRule.
Due to bug in DrillReduceAggregatesRule we were losing column alias when we 
were creating new aggregate call and ProjectRemoveRule was removing project 
stage since considered project trivial. With the fix when column alias is 
preserved in new aggregate call, ProjectRecordBatch does not remove project 
stage since now it does not consider project trivial (it sees that we need to 
add alias).

> 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)


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

2017-05-26 Thread Jinfeng Ni (JIRA)

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

Jinfeng Ni commented on DRILL-5537:
---

>From the change made in the PR, I'm not clear how/why the query result would 
>be impacted by an RDBMS storage plugin for the query.

{code}
select version, sum(1) as s from sys.version group by version;
{code}

Does the enabled RDBMS storage plugin have some impact on 
DrillReduceAggregatesRule.java rule? 

> 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)


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

2017-05-25 Thread ASF GitHub Bot (JIRA)

[ 
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 
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)