io.substrait.relation.ConsistentPartitionWindow Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
Create a well-defined, cross-language specification for data compute operations
package io.substrait.relation;
import io.substrait.expression.Expression;
import io.substrait.expression.Expression.SortField;
import io.substrait.expression.FunctionArg;
import io.substrait.expression.FunctionOption;
import io.substrait.expression.WindowBound;
import io.substrait.extension.SimpleExtension;
import io.substrait.type.Type;
import io.substrait.type.TypeCreator;
import java.util.List;
import java.util.stream.Stream;
import org.immutables.value.Value;
@Value.Immutable
@Value.Enclosing
public abstract class ConsistentPartitionWindow extends SingleInputRel implements HasExtension {
public abstract List getWindowFunctions();
public abstract List getPartitionExpressions();
public abstract List getSorts();
@Override
protected Type.Struct deriveRecordType() {
Type.Struct initial = getInput().getRecordType();
return TypeCreator.of(initial.nullable())
.struct(
Stream.concat(
initial.fields().stream(),
getWindowFunctions().stream().map(WindowRelFunctionInvocation::outputType)));
}
@Override
public O accept(RelVisitor visitor) throws E {
return visitor.visit(this);
}
public static ImmutableConsistentPartitionWindow.Builder builder() {
return ImmutableConsistentPartitionWindow.builder();
}
@Value.Immutable
public abstract static class WindowRelFunctionInvocation {
public abstract SimpleExtension.WindowFunctionVariant declaration();
public abstract List arguments();
public abstract List options();
public abstract Type outputType();
public abstract Expression.AggregationPhase aggregationPhase();
public abstract Expression.AggregationInvocation invocation();
public abstract WindowBound lowerBound();
public abstract WindowBound upperBound();
public abstract Expression.WindowBoundsType boundsType();
public static ImmutableConsistentPartitionWindow.WindowRelFunctionInvocation.Builder builder() {
return ImmutableConsistentPartitionWindow.WindowRelFunctionInvocation.builder();
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy