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

ASF GitHub Bot commented on DRILL-6479:
---------------------------------------

Ben-Zvi opened a new pull request #1311: DRILL-6479: Support EMIT for the Hash 
Aggr
URL: https://github.com/apache/drill/pull/1311
 
 
   The EMIT IterOutput functions both like OK and like NONE (w/o the final 
cleanup). Most of the changes for Hash-Aggr involve adapting that operator's 
state-machine for the new EMIT state -- first set a special local flag 
"handleEmit" to remember that EMIT was seen, then start working like an OK 
(i.e., process the current incoming), and afterwards start working like a NONE 
- i.e., return the results downstream.
   
     In several code places the special flag needs to be checked: 
   (1) Do not set "build complete".
   (2) Produce output in the batch (similar to "build complete").
   (3) After emitting, need to get the next incoming batch (in doWork() ).
   (4) After handling like OK, switch to like NONE.
   (5) When needs to return EMIT, instead of OK.
   
   Also the cases of empty input are handled. In outputCurrentBatch(), create 
and return an empty incoming batch. Also delayedSetup() may need to be called 
later if the initial input (before first EMITs) was empty.
   
   Two unit tests were added: One with regular group by, and the other using 
distinct (and null input).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Support for EMIT outcome in Hash Aggregate
> ------------------------------------------
>
>                 Key: DRILL-6479
>                 URL: https://issues.apache.org/jira/browse/DRILL-6479
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Execution - Relational Operators
>            Reporter: Boaz Ben-Zvi
>            Assignee: Boaz Ben-Zvi
>            Priority: Major
>             Fix For: 1.14.0
>
>
> With the new Lateral and Unnest -- if a Hash-Aggregate operator is present in 
> the sub-query, then it needs to handle the EMIT outcome correctly. This means 
> that when a EMIT is received then perform the aggregation operation on the 
> records buffered so far and produce the output with it. After handling an 
> EMIT the Hash-Aggr should refresh it's state and a continue to work on the 
> next batches of incoming records unless an EMIT is seen again.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to