io.substrait.relation.Project 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.type.Type;
import io.substrait.type.TypeCreator;
import java.util.List;
import java.util.stream.Stream;
import org.immutables.value.Value;
@Value.Immutable
public abstract class Project extends SingleInputRel implements HasExtension {
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Project.class);
public abstract List getExpressions();
@Override
public Type.Struct deriveRecordType() {
Type.Struct initial = getInput().getRecordType();
return TypeCreator.of(initial.nullable())
.struct(
Stream.concat(
initial.fields().stream(), getExpressions().stream().map(Expression::getType)));
}
@Override
public O accept(RelVisitor visitor) throws E {
return visitor.visit(this);
}
public static ImmutableProject.Builder builder() {
return ImmutableProject.builder();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy