Package stream.nebula.operators
Class ProjectionOperator
- java.lang.Object
-
- stream.nebula.operators.Operator
-
- stream.nebula.operators.ProjectionOperator
-
public class ProjectionOperator extends Operator
ThisOperator
encodes aQuery.project(stream.nebula.expression.FieldExpression...)
operation.The
Query.project(stream.nebula.expression.FieldExpression...)
also allows to rename the attributes in the result stream, usingFieldAccessExpression.as(java.lang.String)
, as in the following code:Query query = QueryFactory.from("source_name").project( attribute("field1"), # Use original attribute name 'field1' in projected stream. attribute("field2").as("new_name")); # Rename attribute 'field2' to 'new_name' in projected stream.
-
-
Field Summary
-
Fields inherited from class stream.nebula.operators.Operator
childOperator
-
-
Constructor Summary
Constructors Constructor Description ProjectionOperator(@NonNull Operator childOperator, @NonNull FieldExpression[] attributes)
Create a newProjectOperator
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<FieldExpression>
getProjectedAttributes()
Access the list of projected attributes.-
Methods inherited from class stream.nebula.operators.Operator
getChildOperator
-
-
-
-
Constructor Detail
-
ProjectionOperator
public ProjectionOperator(@NonNull Operator childOperator, @NonNull FieldExpression[] attributes) throws java.lang.IllegalStateException
Create a newProjectOperator
.- Parameters:
childOperator
- The previous operator in the operator chain ofQuery
instance.attributes
- A variable list of projected attributes.- Throws:
java.lang.IllegalStateException
-
-
Method Detail
-
getProjectedAttributes
public java.util.List<FieldExpression> getProjectedAttributes()
Access the list of projected attributes.- Returns:
- The projected attributes specified in the call to
Query.project(stream.nebula.expression.FieldExpression...)
.
-
-