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

Benjamin Becker updated DRILL-67:
---------------------------------

    Attachment: DRILL-70-feedback.diff

Hi Alexandre,

I reviewed DRILL-70.patch.txt, and would like to suggest that the addRecord() 
implementations could be a little more concise going forward.

My understanding is that, in general, the output type should be an integer 
unless the input contains a decimal value (for min/max, perhaps the rule could 
be 'output is an integer unless min or max is a decimal'?).  I think the best 
way to implement this is with a flag which indicates the output type; akin to 
the current 'integer' boolean.

You could also accumulate integer and decimal values separately, then combine 
in eval().  This would avoid the branch on 'integer' in addRecord().

I've included a simple patch for MinAggregator (DRILL-70-feedback.diff) to 
better illustrate my suggestions.  That said, I don't think its necessary to 
change the existing min/max/avg functions, though I would advise using this 
approach going forward.

Best,
Ben
                
> Add Min, Max, avg and others Aggregated function
> ------------------------------------------------
>
>                 Key: DRILL-67
>                 URL: https://issues.apache.org/jira/browse/DRILL-67
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Alexandre Beche
>            Priority: Trivial
>              Labels: patch
>         Attachments: DRILL-67.patch.txt, DRILL-70-feedback.diff, 
> DRILL-70.patch.txt
>
>
> This proposed improvement is to add the MIN(), MAX() and AVG() function to 
> the list of the aggregated function.
> SumAggregator will be used as an example.
> Others function could be added

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to