Java源码示例:org.apache.flink.api.java.operators.ProjectOperator
示例1
/**
* Applies a Project transformation on a {@link Tuple} {@link DataSet}.
*
* <p><b>Note: Only Tuple DataSets can be projected using field indexes.</b>
*
* <p>The transformation projects each Tuple of the DataSet onto a (sub)set of fields.
*
* <p>Additional fields can be added to the projection by calling {@link ProjectOperator#project(int[])}.
*
* <b>Note: With the current implementation, the Project transformation looses type information.</b>
*
* @param fieldIndexes The field indexes of the input tuple that are retained.
* The order of fields in the output tuple corresponds to the order of field indexes.
* @return A ProjectOperator that represents the projected DataSet.
*
* @see Tuple
* @see DataSet
* @see ProjectOperator
*/
public <OUT extends Tuple> ProjectOperator<?, OUT> project(int... fieldIndexes) {
return new Projection<>(this, fieldIndexes).projectTupleX();
}
示例2
/**
* Applies a Project transformation on a {@link Tuple} {@link DataSet}.
*
* <p><b>Note: Only Tuple DataSets can be projected using field indexes.</b>
*
* <p>The transformation projects each Tuple of the DataSet onto a (sub)set of fields.
*
* <p>Additional fields can be added to the projection by calling {@link ProjectOperator#project(int[])}.
*
* <b>Note: With the current implementation, the Project transformation looses type information.</b>
*
* @param fieldIndexes The field indexes of the input tuple that are retained.
* The order of fields in the output tuple corresponds to the order of field indexes.
* @return A ProjectOperator that represents the projected DataSet.
*
* @see Tuple
* @see DataSet
* @see ProjectOperator
*/
public <OUT extends Tuple> ProjectOperator<?, OUT> project(int... fieldIndexes) {
return new Projection<>(this, fieldIndexes).projectTupleX();
}
示例3
/**
* Applies a Project transformation on a {@link Tuple} {@link DataSet}.
*
* <p><b>Note: Only Tuple DataSets can be projected using field indexes.</b>
*
* <p>The transformation projects each Tuple of the DataSet onto a (sub)set of fields.
*
* <p>Additional fields can be added to the projection by calling {@link ProjectOperator#project(int[])}.
*
* <b>Note: With the current implementation, the Project transformation looses type information.</b>
*
* @param fieldIndexes The field indexes of the input tuple that are retained.
* The order of fields in the output tuple corresponds to the order of field indexes.
* @return A ProjectOperator that represents the projected DataSet.
*
* @see Tuple
* @see DataSet
* @see ProjectOperator
*/
public <OUT extends Tuple> ProjectOperator<?, OUT> project(int... fieldIndexes) {
return new Projection<>(this, fieldIndexes).projectTupleX();
}