本文整理匯總了Java中org.apache.flink.api.java.operators.ProjectOperator.Projection類的典型用法代碼示例。如果您正苦於以下問題:Java Projection類的具體用法?Java Projection怎麽用?Java Projection使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Projection類屬於org.apache.flink.api.java.operators.ProjectOperator包,在下文中一共展示了Projection類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: project
import org.apache.flink.api.java.operators.ProjectOperator.Projection; //導入依賴的package包/類
/**
* 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: project
import org.apache.flink.api.java.operators.ProjectOperator.Projection; //導入依賴的package包/類
/**
* Initiates a Project transformation on a {@link Tuple} {@link DataSet}.<br/>
* <b>Note: Only Tuple DataSets can be projected.</b></br>
* The transformation projects each Tuple of the DataSet onto a (sub)set of fields.</br>
* This method returns a {@link Projection} on which {@link Projection#types(Class)} needs to
* be called to completed the transformation.
*
* @param fieldIndexes The field indexes of the input tuples that are retained.
* The order of fields in the output tuple corresponds to the order of field indexes.
* @return A Projection that needs to be converted into a {@link org.apache.flink.api.java.operators.ProjectOperator} to complete the
* Project transformation by calling {@link Projection#types(Class)}.
*
* @see Tuple
* @see DataSet
* @see Projection
* @see org.apache.flink.api.java.operators.ProjectOperator
*/
public Projection<T> project(int... fieldIndexes) {
return new Projection<T>(this, fieldIndexes);
}