@ Override public void combine ( Aggregator < T , NumericColumnSummary < T > > otherSameType ) { NumericSummaryAggregator < T > other = ( NumericSummaryAggregator < T > ) otherSameType ; nullCount += other . nullCount ; nanCount += other . nanCount ; infinityCount += other . infinityCount ; if ( nonMissingCount == 0 ) { nonMissingCount = other . nonMissingCount ; min = other . min ; max = other . max ; sum = other . sum ; mean = other . mean ; m2 = other . m2 ; } else if ( other . nonMissingCount != 0 ) { long combinedCount = nonMissingCount + other . nonMissingCount ; min . combine ( other . min ) ; max . combine ( other . max ) ; sum . combine ( other . sum ) ; double deltaMean = other . mean . value ( ) - mean . value ( ) ; mean = mean . add ( deltaMean * other . nonMissingCount / combinedCount ) ; m2 = m2 . add ( other . m2 ) . add ( deltaMean * deltaMean * nonMissingCount * other . nonMissingCount / combinedCount ) ; nonMissingCount = combinedCount ; } }
combine two aggregations .