public static void input(NullableLongState state, Object value, long initialStateValue, BinaryFunctionInterface inputFunction, BinaryFunctionInterface combineFunction) { if (state.isNull()) { state.setNull(false); state.setLong(initialStateValue); } state.setLong((long) inputFunction.apply(state.getLong(), value)); }
@Override public void deserialize(Block block, int index, NullableLongState state) { state.setNull(false); state.setLong(BIGINT.getLong(block, index)); } }
public static void input(Type type, NullableLongState state, Block block, int position) { if (!state.isNull()) { return; } state.setNull(false); state.setLong(type.getLong(block, position)); }
public static void combine(NullableLongState state, NullableLongState otherState) { if (!state.isNull()) { return; } state.setNull(false); state.setLong(otherState.getLong()); }
public static void combine(NullableLongState state, NullableLongState otherState, BinaryFunctionInterface inputFunction, BinaryFunctionInterface combineFunction) { if (state.isNull()) { state.setNull(false); state.setLong(otherState.getLong()); return; } state.setLong((long) combineFunction.apply(state.getLong(), otherState.getLong())); }
@CombineFunction public static void combine(@AggregationState NullableLongState state, @AggregationState NullableLongState otherState) { if (state.isNull()) { state.setNull(false); state.setLong(otherState.getLong()); return; } state.setLong(BigintOperators.add(state.getLong(), otherState.getLong())); }
@InputFunction public static void input(@AggregationState NullableLongState state, @SqlType(StandardTypes.BIGINT) long value) { state.setLong(state.getLong() + value); state.setNull(false); }
@InputFunction public static void sum(NullableLongState state, @SqlType(INTERVAL_DAY_TO_SECOND) long value) { state.setNull(false); state.setLong(BigintOperators.add(state.getLong(), value)); }
@CombineFunction public static void combine(@AggregationState NullableLongState state, @AggregationState NullableLongState otherState) { if (state.isNull()) { state.setNull(otherState.isNull()); state.setLong(otherState.getLong()); } else if (!otherState.isNull()) { state.setLong(state.getLong() & otherState.getLong()); } }
@CombineFunction public static void combine(@AggregationState NullableLongState state, @AggregationState NullableLongState otherState) { if (state.isNull()) { state.setNull(otherState.isNull()); state.setLong(otherState.getLong()); } else if (!otherState.isNull()) { state.setLong(state.getLong() | otherState.getLong()); } }
public static void combine(NullableLongState state, NullableLongState otherState) { state.setNull(state.isNull() && otherState.isNull()); state.setLong(state.getLong() + otherState.getLong()); }
@InputFunction public static void sum(@AggregationState NullableLongState state, @SqlType(StandardTypes.BIGINT) long value) { state.setNull(false); state.setLong(BigintOperators.add(state.getLong(), value)); }
@CombineFunction public static void combine(@AggregationState NullableLongState state, @AggregationState NullableLongState scratchState) { state.setLong(state.getLong() + scratchState.getLong()); state.setNull(state.isNull() && scratchState.isNull()); }