io.deephaven.engine.table.impl.by.rollup.RollupAggregationOutputs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of deephaven-engine-table Show documentation
Show all versions of deephaven-engine-table Show documentation
Engine Table: Implementation and closely-coupled utilities
/**
* Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
*/
package io.deephaven.engine.table.impl.by.rollup;
import io.deephaven.api.ColumnName;
import io.deephaven.api.agg.Aggregation;
import io.deephaven.api.agg.AggregationOutputs;
import java.util.Collection;
import java.util.stream.Stream;
/**
* A visitor to get the ordered output {@link ColumnName column names} for {@link Aggregation aggregations}, including
* {@link RollupAggregation rollup aggregations}.
*/
public class RollupAggregationOutputs extends AggregationOutputs implements RollupAggregation.Visitor {
public static Stream of(Aggregation aggregation) {
return aggregation.walk(new RollupAggregationOutputs()).getOut();
}
public static Stream of(Collection extends Aggregation> aggregations) {
return aggregations.stream().flatMap(RollupAggregationOutputs::of);
}
@Override
public void visit(NullColumns nullColumns) {
out = nullColumns.resultColumns().keySet().stream().map(ColumnName::of);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy