[jira] [Updated] (CALCITE-6128) RelBuilder.sortLimit should compose offset and fetch

2023-11-22 Thread ASF GitHub Bot (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6128?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ASF GitHub Bot updated CALCITE-6128:

Labels: pull-request-available  (was: )

> RelBuilder.sortLimit should compose offset and fetch
> 
>
> Key: CALCITE-6128
> URL: https://issues.apache.org/jira/browse/CALCITE-6128
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
>  Labels: pull-request-available
> Fix For: 1.37.0
>
>
> The {{RelBuilder.sortLimit}} method should compose offset and fetch. If I 
> call {{RelBuilder.sort}} to set sort with an offset, then call 
> {{RelBuilder.offsetLimit}} to set a fetch, it currently creates two 
> {{LogicalSort}} nodes but should create just one.
> For example,
> {code:java}
> b.scan("EMP")
> .sortLimit(2, -1, b.field("DEPTNO"))
> .limit(-1, 3)
> .build()
> {code}
> should generate the plan
> {noformat}
> LogicalSort(sort0=[$7], dir0=[ASC], offset=[2], fetch=[3])
>   LogicalTableScan(table=[[scott, EMP]])
> {noformat}
> but instead generates
> {noformat}
> LogicalSort(fetch=[3])
>   LogicalSort(sort0=[$7], dir0=[ASC], offset=[2])
> LogicalTableScan(table=[[scott, EMP]])
> {noformat}



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


[jira] [Updated] (CALCITE-6128) RelBuilder.sortLimit should compose offset and fetch

2023-11-21 Thread Julian Hyde (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6128?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Hyde updated CALCITE-6128:
-
Fix Version/s: 1.37.0

> RelBuilder.sortLimit should compose offset and fetch
> 
>
> Key: CALCITE-6128
> URL: https://issues.apache.org/jira/browse/CALCITE-6128
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
> Fix For: 1.37.0
>
>
> The {{RelBuilder.sortLimit}} method should compose offset and fetch. If I 
> call {{RelBuilder.sort}} to set sort with an offset, then call 
> {{RelBuilder.offsetLimit}} to set a fetch, it currently creates two 
> {{LogicalSort}} nodes but should create just one.
> For example,
> {code:java}
> b.scan("EMP")
> .sortLimit(2, -1, b.field("DEPTNO"))
> .limit(-1, 3)
> .build()
> {code}
> should generate the plan
> {noformat}
> LogicalSort(sort0=[$7], dir0=[ASC], offset=[2], fetch=[3])
>   LogicalTableScan(table=[[scott, EMP]])
> {noformat}
> but instead generates
> {noformat}
> LogicalSort(fetch=[3])
>   LogicalSort(sort0=[$7], dir0=[ASC], offset=[2])
> LogicalTableScan(table=[[scott, EMP]])
> {noformat}



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


[jira] [Updated] (CALCITE-6128) RelBuilder.sortLimit should compose offset and fetch

2023-11-21 Thread Julian Hyde (Jira)


 [ 
https://issues.apache.org/jira/browse/CALCITE-6128?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Hyde updated CALCITE-6128:
-
Description: 
The {{RelBuilder.sortLimit}} method should compose offset and fetch. If I call 
{{RelBuilder.sort}} to set sort with an offset, then call 
{{RelBuilder.offsetLimit}} to set a fetch, it currently creates two 
{{LogicalSort}} nodes but should create just one.

For example,
{code:java}
b.scan("EMP")
.sortLimit(2, -1, b.field("DEPTNO"))
.limit(-1, 3)
.build()
{code}
should generate the plan
{noformat}
LogicalSort(sort0=[$7], dir0=[ASC], offset=[2], fetch=[3])
  LogicalTableScan(table=[[scott, EMP]])
{noformat}
but instead generates
{noformat}
LogicalSort(fetch=[3])
  LogicalSort(sort0=[$7], dir0=[ASC], offset=[2])
LogicalTableScan(table=[[scott, EMP]])
{noformat}

  was:The {{RelBuilder.sortLimit}} method should compose offset and fetch. If I 
call {{RelBuilder.sort}} to set sort with an offset, then call 
{{RelBuilder.offsetLimit}} to set a fetch, it currently creates two 
{{LogicalSort}} nodes but should create just one.


> RelBuilder.sortLimit should compose offset and fetch
> 
>
> Key: CALCITE-6128
> URL: https://issues.apache.org/jira/browse/CALCITE-6128
> Project: Calcite
>  Issue Type: Improvement
>Reporter: Julian Hyde
>Assignee: Julian Hyde
>Priority: Major
>
> The {{RelBuilder.sortLimit}} method should compose offset and fetch. If I 
> call {{RelBuilder.sort}} to set sort with an offset, then call 
> {{RelBuilder.offsetLimit}} to set a fetch, it currently creates two 
> {{LogicalSort}} nodes but should create just one.
> For example,
> {code:java}
> b.scan("EMP")
> .sortLimit(2, -1, b.field("DEPTNO"))
> .limit(-1, 3)
> .build()
> {code}
> should generate the plan
> {noformat}
> LogicalSort(sort0=[$7], dir0=[ASC], offset=[2], fetch=[3])
>   LogicalTableScan(table=[[scott, EMP]])
> {noformat}
> but instead generates
> {noformat}
> LogicalSort(fetch=[3])
>   LogicalSort(sort0=[$7], dir0=[ASC], offset=[2])
> LogicalTableScan(table=[[scott, EMP]])
> {noformat}



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