io.substrait.expression.WindowBound 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.expression;
import org.immutables.value.Value;
@Value.Enclosing
public interface WindowBound {
interface WindowBoundVisitor {
R visit(Preceding preceding);
R visit(Following following);
R visit(CurrentRow currentRow);
R visit(Unbounded unbounded);
}
R accept(WindowBoundVisitor visitor);
CurrentRow CURRENT_ROW = ImmutableWindowBound.CurrentRow.builder().build();
Unbounded UNBOUNDED = ImmutableWindowBound.Unbounded.builder().build();
@Value.Immutable
abstract class Preceding implements WindowBound {
public abstract long offset();
public static Preceding of(long offset) {
return ImmutableWindowBound.Preceding.builder().offset(offset).build();
}
@Override
public R accept(WindowBoundVisitor visitor) {
return visitor.visit(this);
}
}
@Value.Immutable
abstract class Following implements WindowBound {
public abstract long offset();
public static Following of(long offset) {
return ImmutableWindowBound.Following.builder().offset(offset).build();
}
@Override
public R accept(WindowBoundVisitor visitor) {
return visitor.visit(this);
}
}
@Value.Immutable
abstract class CurrentRow implements WindowBound {
@Override
public R accept(WindowBoundVisitor visitor) {
return visitor.visit(this);
}
}
@Value.Immutable
abstract class Unbounded implements WindowBound {
@Override
public R accept(WindowBoundVisitor visitor) {
return visitor.visit(this);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy