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

Chen Feng edited comment on PHOENIX-5793 at 6/22/20, 6:45 AM:
--------------------------------------------------------------

[~comnetwork] Sorry for late response.
 In our practice, when the result must be null, we no longer call 
future.cancel() to close the unfinished iterator. Because there would be a bug 
in BaseResultIterators.close() as follows.
{code:java}
if (future.cancel(false)) {
  cancelledWork = true;
}
else {
  // get into this branch because the future has been cancelled
  futuresToClose.add(future);
}
...
for (Future<PeekingResultIterator> future : futuresToClose) {
  PeekingResultIterator iterator = future.get();
  // meet exception because iterator.close() will be called twice.
  iterator.close();
}
{code}


was (Author: fengchen8086):
[~comnetwork] Sorry for late response.
 In our practice, when the result must be null, we no longer call 
future.cancel() to close the unfinished iterator. Because there would be a bug 
in BaseResultIterators.close() as follows.

 

 
{code:java}
if (future.cancel(false)) {
  cancelledWork = true;
}
else {
  /* get into this branch because the future has been cancelled */
  futuresToClose.add(future);
}
...
for (Future<PeekingResultIterator> future : futuresToClose) {
  PeekingResultIterator iterator = future.get();
  // we meet exception because iterator.close() will be called twice.
  iterator.close();
}
{code}
 

 

 

> Support parallel init and fast null return for SortMergeJoinPlan.
> -----------------------------------------------------------------
>
>                 Key: PHOENIX-5793
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-5793
>             Project: Phoenix
>          Issue Type: Improvement
>    Affects Versions: 5.0.0
>            Reporter: Chen Feng
>            Assignee: Chen Feng
>            Priority: Minor
>             Fix For: 5.1.0, 4.16.0
>
>         Attachments: PHOENIX-5793-v2.patch, PHOENIX-5793-v3.patch, 
> PHOENIX-5793-v4.patch, PHOENIX-5793-v5.patch, PHOENIX-5793_v1-4.x.patch
>
>
> For a join sql like A join B. The implementation of SortMergeJoinPlan 
> currently inits the two iterators A and B one by one.
> By initializing A and B in parallel, we can improve performance in two 
> aspects.
> 1) By overlapping the time in initializing.
> 2) If one child query is null, the other child query can be canceled since 
> the final result must be null.
>  



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

Reply via email to