public static void combine(MethodHandle methodHandle, NullableDoubleState state, NullableDoubleState otherState) { compareAndUpdateState(methodHandle, state, otherState.getDouble()); }
public static void combine(NullableDoubleState state, NullableDoubleState otherState, BinaryFunctionInterface inputFunction, BinaryFunctionInterface combineFunction) { if (state.isNull()) { state.setNull(false); state.setDouble(otherState.getDouble()); return; } state.setDouble((double) combineFunction.apply(state.getDouble(), otherState.getDouble())); }
static void write(Type type, NullableDoubleState state, BlockBuilder out) { if (state.isNull()) { out.appendNull(); } else { type.writeDouble(out, state.getDouble()); } } }
public static void combine(NullableDoubleState state, NullableDoubleState otherState) { if (!state.isNull()) { return; } state.setNull(false); state.setDouble(otherState.getDouble()); }
@Override public void serialize(NullableDoubleState state, BlockBuilder out) { if (state.isNull()) { out.appendNull(); } else { DOUBLE.writeDouble(out, state.getDouble()); } }
@CombineFunction public static void combine(@AggregationState NullableDoubleState state, @AggregationState NullableDoubleState otherState) { if (state.isNull()) { if (otherState.isNull()) { return; } state.setNull(false); state.setDouble(otherState.getDouble()); return; } if (!otherState.isNull()) { state.setDouble(state.getDouble() + otherState.getDouble()); } }
@OutputFunction(StandardTypes.REAL) public static void output(@AggregationState NullableDoubleState state, BlockBuilder out) { if (state.isNull()) { out.appendNull(); } else { REAL.writeLong(out, floatToRawIntBits((float) state.getDouble())); } } }
@InputFunction public static void sum(@AggregationState NullableDoubleState state, @SqlType(StandardTypes.REAL) long value) { state.setNull(false); state.setDouble(state.getDouble() + intBitsToFloat((int) value)); }
public static void input(NullableDoubleState state, Object value, double initialStateValue, BinaryFunctionInterface inputFunction, BinaryFunctionInterface combineFunction) { if (state.isNull()) { state.setNull(false); state.setDouble(initialStateValue); } state.setDouble((double) inputFunction.apply(state.getDouble(), value)); }
@InputFunction public static void sum(@AggregationState NullableDoubleState state, @SqlType(StandardTypes.DOUBLE) double value) { state.setNull(false); state.setDouble(state.getDouble() + value); }
private static void compareAndUpdateState(MethodHandle methodHandle, NullableDoubleState state, double value) { if (state.isNull()) { state.setNull(false); state.setDouble(value); return; } try { if ((boolean) methodHandle.invokeExact(value, state.getDouble())) { state.setDouble(value); } } catch (Throwable t) { throw internalError(t); } }
static void write(Type type, NullableDoubleState state, BlockBuilder out) { if (state.isNull()) { out.appendNull(); } else { type.writeDouble(out, state.getDouble()); } } }
@Override public void serialize(NullableDoubleState state, BlockBuilder out) { if (state.isNull()) { out.appendNull(); } else { DOUBLE.writeDouble(out, state.getDouble()); } }
@InputFunction @IntermediateInputFunction public static void sum(NullableDoubleState state, @SqlType(StandardTypes.DOUBLE) double value) { state.setNull(false); state.setDouble(state.getDouble() + value); }
public static void input(MethodHandle methodHandle, NullableDoubleState state, double value) { if (state.isNull()) { state.setNull(false); state.setDouble(value); return; } try { if ((boolean) methodHandle.invokeExact(value, state.getDouble())) { state.setDouble(value); } } catch (Throwable t) { Throwables.propagateIfInstanceOf(t, Error.class); Throwables.propagateIfInstanceOf(t, PrestoException.class); throw new PrestoException(INTERNAL_ERROR, t); } }