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

Aleksey Plekhanov updated IGNITE-28925:
---------------------------------------
    Labels: ise  (was: )

> Calcite engine. SortAggregateNode can call downstream().end() twice
> -------------------------------------------------------------------
>
>                 Key: IGNITE-28925
>                 URL: https://issues.apache.org/jira/browse/IGNITE-28925
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Aleksey Plekhanov
>            Assignee: Aleksey Plekhanov
>            Priority: Major
>              Labels: ise
>
> Requested rows count is not reset on downstream end, this can lead to 
> assertions when invariant "not waiting rows, but got rows or end event" is 
> validated.
> For example:
> {code:java}
> sql("CREATE TABLE t(a INTEGER PRIMARY KEY, b INTEGER) WITH 
> template=replicated," + atomicity());
> for (int i = 0; i < 512; i++)
>     sql("INSERT INTO t VALUES (?, ?)", i, i);
> assertQuery("SELECT t1.a FROM t AS t1 JOIN (SELECT a, count(a) FROM t GROUP 
> BY a) AS t2 ON t1.a = t2.a")
>     .resultSize(512)
>     .check(); {code}
> Fails with:
> {noformat}
> Caused by: java.lang.AssertionError
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.MergeJoinNode.endRight(MergeJoinNode.java:216)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.MergeJoinNode$2.end(MergeJoinNode.java:165)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.SortAggregateNode.end(SortAggregateNode.java:167)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.processNextBatch(ScanNode.java:203)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanStorageNode.processNextBatch(ScanStorageNode.java:70)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.push(ScanNode.java:142)
> {noformat}
> First time MergeJoinNode is ended on {{SortAggregateNode.end -> 
> SortAggregateNode.doPush -> MergeJoinNode.pushRight -> MergeJoinNode.join -> 
> MergeJoinNode.tryToRequestInputs -> SortAggregateNode.request}}  
> Second time MergeJoinNode is ended in the same {{SortAggregateNode.end}} call 
> after {{SortAggregateNode.doPush}}
>  



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

Reply via email to