You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Pavel Tiunov (Jira)" <ji...@apache.org> on 2020/10/23 07:41:00 UTC

[jira] [Comment Edited] (ARROW-10374) [Rust] [DataFusion] Grouping by column position

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

Pavel Tiunov edited comment on ARROW-10374 at 10/23/20, 7:40 AM:
-----------------------------------------------------------------

Hey [~jorgecarleitao]! Thanks for the quick turnaround. The use case is usually to support grouping by complex expressions. 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.


was (Author: paveltiunov):
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)