presto-geospatial/src/main/java/io/prestosql/plugin/geospatial/aggregation/GeometryUnionAgg.java/GeometryUnionAgg/combine
class GeometryUnionAgg:    @CombineFunction
    public static void combine(@AggregationState GeometryState state, @AggregationState GeometryState otherState)
    {
        if (state.getGeometry() == null) {
            state.setGeometry(otherState.getGeometry());
        }
        else if (otherState.getGeometry() != null && !otherState.getGeometry().isEmpty()) {
            state.setGeometry(state.getGeometry().union(otherState.getGeometry()));
        }
    }