You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Haisheng Yuan (Jira)" <ji...@apache.org> on 2020/06/10 06:31:01 UTC

[jira] [Commented] (CALCITE-2648) Output collation of EnumerableWindow is not consistent with its implementation

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

Haisheng Yuan commented on CALCITE-2648:
----------------------------------------

Pull request: https://github.com/apache/calcite/pull/2018

> Output collation of EnumerableWindow is not consistent with its implementation
> ------------------------------------------------------------------------------
>
>                 Key: CALCITE-2648
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2648
>             Project: Calcite
>          Issue Type: Bug
>    Affects Versions: 1.17.0
>            Reporter: Hongze Zhang
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: postgresql_96_doesnt_care_to_keep_collation_for_project_over_expression.png
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Here is a case:
> {code:sql}
> select x, COUNT(*) OVER (PARTITION BY x) from (values (20), (35)) as t(x) ORDER BY x
> {code}
> Final plan:
> {code:java}
> EnumerableWindow(window#0=[window(partition {0} order by [] range between UNBOUNDED PRECEDING and UNBOUNDED FOLLOWING aggs [COUNT()])])
>   EnumerableValues(tuples=[[{ 20 }, { 35 }]])
> {code}
> Output rows:
> {code:java}
> X  |EXPR$1 |
> ---|-------|
> 35 |1      |
> 20 |1      |
> {code}
> EnumerableWindow is supposed to preserve input collations, as a result EnumerableSort is ignored. However the implementation of EnumerableWindow generates non-ordered output (when PARTITION BY clause is used).



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