[
https://issues.apache.org/jira/browse/FLINK-1040?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14206141#comment-14206141
]
ASF GitHub Bot commented on FLINK-1040:
---------------------------------------
Github user fhueske commented on a diff in the pull request:
https://github.com/apache/incubator-flink/pull/194#discussion_r20137228
--- Diff:
flink-java/src/main/java/org/apache/flink/api/java/operators/CrossOperator.java
---
@@ -163,6 +162,31 @@ public DefaultCross(DataSet<I1> input1, DataSet<I2>
input2) {
public CrossProjection<I1, I2> projectFirst(int...
firstFieldIndexes) {
return new CrossProjection<I1, I2>(input1, input2,
firstFieldIndexes, null);
}
+
+
+ /**
+ * Initiates a ProjectCross transformation and projects the
first cross input<br/>
+ * If the first cross input is a {@link Tuple} {@link DataSet},
fields can be selected by their index.
+ * If the first cross input is not a Tuple DataSet, no
parameters should be passed.<br/>
+ *
+ * Fields of the first and second input can be added by
chaining the method calls of
+ * {@link
org.apache.flink.api.java.operators.CrossOperator.ProjectCross#projectionFirst(int...)}
and
+ * {@link
org.apache.flink.api.java.operators.CrossOperator.ProjectCross#projectionSecond(int...)}.
+ *
+ * @param firstFieldIndexes If the first input is a Tuple
DataSet, the indexes of the selected fields.
+ * For a non-Tuple
DataSet, do not provide parameters.
+ * The order of fields
in the output tuple is defined by to the order of field indexes.
+ * @return A CrossProjection to complete the Cross
transformation.
+ *
+ * @see Tuple
+ * @see DataSet
+ * @see
org.apache.flink.api.java.operators.CrossOperator.CrossProjection
+ * @see
org.apache.flink.api.java.operators.CrossOperator.ProjectCross
+ */
+ public <OUT extends Tuple> ProjectCross<I1, I2, OUT>
projectionFirst(int... firstFieldIndexes) {
--- End diff --
Same here. No need for two operators that do the same thing. Just replace
the {{projectFirst()}} and {{projectSecond()}} by your changes.
> Make type() call in projections optional (or remove it)
> -------------------------------------------------------
>
> Key: FLINK-1040
> URL: https://issues.apache.org/jira/browse/FLINK-1040
> Project: Flink
> Issue Type: Improvement
> Components: Java API
> Reporter: Stephan Ewen
> Priority: Minor
> Labels: simple, starter
>
> I think the type() call should be optional. The compiler can also cast the
> data set directly and the result type is computed from the input types
> anyways.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)