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

shampoo liu edited comment on CALCITE-5348 at 11/5/22 5:21 PM:
---------------------------------------------------------------

[~julianhyde] I have tested the branch and it works very well .

It seems that tow method bellow are unused.  Do you consider to remove them ?
https://github.com/julianhyde/calcite/blob/935dffc2d9c9a274a114ae0886eaabc63a2c6dd9/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java#L5367
https://github.com/julianhyde/calcite/blob/935dffc2d9c9a274a114ae0886eaabc63a2c6dd9/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java#L5395



was (Author: shpodg):
[~julianhyde] I have tested the branch and it works very well .

It seems that tow method bellow are unused.  Are you consider to remove them ?
https://github.com/julianhyde/calcite/blob/935dffc2d9c9a274a114ae0886eaabc63a2c6dd9/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java#L5367
https://github.com/julianhyde/calcite/blob/935dffc2d9c9a274a114ae0886eaabc63a2c6dd9/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java#L5395


> The defaultNullCollation configuration can't take effect for over
> -----------------------------------------------------------------
>
>                 Key: CALCITE-5348
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5348
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.32.0
>            Reporter: shampoo liu
>            Priority: Major
>
> The connection configuration  string defaultNullCollation=LOW can't take 
> effect for order by in over clause. 
> After debug, I found that the  convertSortExpression in 
> SqlToRelConverter.convertOver was changed to bb::sortToRex and the 
> bb::sortToRex didn't read default configuration.
> [https://github.com/apache/calcite/blob/c945b7f49b99538748c871557f6ac80957be2b6e/core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java#L2247]
>  
> Also, The corresponding test case is incorrect at  
> org.apache.calcite.test.SqlToRelConverterTest#testUserDefinedOrderByOver .
> sql :
> {code:java}
> select deptno,rank() over(partition by empno order by deptno) 
>   from emp 
>   order by row_number() over(partition by empno order by deptno) {code}
> correct result
> {code:java}
> LogicalProject(DEPTNO=[$0], EXPR$1=[$1])
>   LogicalSort(sort0=[$2], dir0=[ASC-nulls-first])
>     LogicalProject(DEPTNO=[$7], EXPR$1=[RANK() OVER (PARTITION BY $0 ORDER BY 
> $7 NULLS FIRST)], EXPR$2=[ROW_NUMBER() OVER (PARTITION BY $0 ORDER BY $7 
> NULLS FIRST)])
>       LogicalTableScan(table=[[CATALOG, SALES, EMP]]) {code}
> but was 
> {code:java}
> LogicalProject(DEPTNO=[$0], EXPR$1=[$1])
>   LogicalSort(sort0=[$2], dir0=[ASC-nulls-first])
>     LogicalProject(DEPTNO=[$7], EXPR$1=[RANK() OVER (PARTITION BY $0 ORDER BY 
> $7)], EXPR$2=[ROW_NUMBER() OVER (PARTITION BY $0 ORDER BY $7)])
>       LogicalTableScan(table=[[CATALOG, SALES, EMP]]) {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to