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

Pavel Tiunov commented on ARROW-10374:
--------------------------------------

Hey [~jorgecarleitao]! Thanks for the quick turnaround. The use case is usually 
to support grouping by complex statements. For example
{code:java}
SELECT date_trunc(convert_tz(`page_views__time_hour`, 'America/Los_Angeles'), 
'week') `page_views__time_week`, sum(`page_views__count`) `page_views__count` 
FROM page_views GROUP BY date_trunc(convert_tz(`page_views__time_hour`, 
'America/Los_Angeles'), 'week') LIMIT 10000
{code}
becomes
{code:java}
SELECT date_trunc(convert_tz(`page_views__time_hour`, 'America/Los_Angeles'), 
'week') `page_views__time_week`, sum(`page_views__count`) `page_views__count` 
FROM page_views GROUP BY 1 LIMIT 10000
{code}
Calculated columns can be pretty complex and it usually just bloats up the SQL 
significantly. I believe it's beneficial to have this feature as most of the 
modern query engines have it.

> [Rust] [DataFusion] Grouping by column position
> -----------------------------------------------
>
>                 Key: ARROW-10374
>                 URL: https://issues.apache.org/jira/browse/ARROW-10374
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Rust - DataFusion
>            Reporter: Pavel Tiunov
>            Priority: Major
>
> It would be great to have the support of grouping by column position instead 
> of grouping by exact expression. For example:
> {code:java}
> SELECT state, COUNT(*) FROM customers GROUP BY 1{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to