You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Ruidong Li (JIRA)" <ji...@apache.org> on 2017/11/23 02:34:00 UTC

[jira] [Commented] (CALCITE-1710) GroupBy columns support arithmetic expression

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

Ruidong Li commented on CALCITE-1710:
-------------------------------------

Hi, I found that Mysql supports 
{{select app_id / id, app_id, id from search_app_info GROUP BY app_id + id; }}


> GroupBy columns support arithmetic expression
> ---------------------------------------------
>
>                 Key: CALCITE-1710
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1710
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: lincoln.lee
>            Assignee: Julian Hyde
>            Priority: Minor
>             Fix For: 1.14.0
>
>
> Currently only original column reference(s) and column(s) with UDF valid in group by clause  but arithmetic expression(s) not allowed,  while most RDBMS support
> like thus:
> {code}
> SELECT 
>     ColumnA + ColumnB 
> FROM T 
> GROUP BY ColumnA + ColumnB;
>   
> SELECT 
>     ColumnA + ColumnB + constant
> FROM T 
> GROUP BY ColumnA, ColumnB; 
> SELECT 
>     ColumnA % 3
> FROM T 
> GROUP BY ColumnA %3;
> {code}
> we can treat these arithmetic operators as builtin UDFs and support these kind of query, it'll be a useful feature.
> What do you think?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)