Reduce redundant calls to setNull in DoubleSumAggregation
@@ -32,9 +32,14 @@ public final class DoubleSumAggregation
@InputFunction
public static void sum(@AggregationState NullableDoubleState state, @SqlType(StandardTypes.DOUBLE) double value)
{
+ if (state.isNull()) {
state.setNull(false);
+ state.setDouble(value);
+ }
+ else {
state.setDouble(state.getDouble() + value);
}
+ }
@CombineFunction
public static void combine(@AggregationState NullableDoubleState state, @AggregationState NullableDoubleState otherState)
