[ 
https://issues.apache.org/jira/browse/FLINK-19006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Flink Jira Bot updated FLINK-19006:
-----------------------------------
    Labels: auto-deprioritized-major stale-minor  (was: 
auto-deprioritized-major)

I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help 
the community manage its development. I see this issues has been marked as 
Minor but is unassigned and neither itself nor its Sub-Tasks have been updated 
for 180 days. I have gone ahead and marked it "stale-minor". If this ticket is 
still Minor, please either assign yourself or give an update. Afterwards, 
please remove the label or in 7 days the issue will be deprioritized.


> project transformation does not support conversion to Tuple25 type
> ------------------------------------------------------------------
>
>                 Key: FLINK-19006
>                 URL: https://issues.apache.org/jira/browse/FLINK-19006
>             Project: Flink
>          Issue Type: Improvement
>          Components: API / DataStream
>    Affects Versions: 1.11.1
>            Reporter: ming li
>            Priority: Minor
>              Labels: auto-deprioritized-major, stale-minor
>
> In the {{DataStream#project}} method, it will judge whether the length of 
> {{fieldIndexes}} is between 1 and {{Tuple.MAX_ARITY-1}}, and then call 
> {{projectTupleXX}} according to the length of {{fieldIndexes}}. This limits 
> the maximum length of {{Tuple}} to 24.
> {code:java}
> protected StreamProjection(DataStream<IN> dataStream, int[] fieldIndexes) {
>    if (!dataStream.getType().isTupleType()) {
>       throw new RuntimeException("Only Tuple DataStreams can be projected");
>    }
>    if (fieldIndexes.length == 0) {
>       throw new IllegalArgumentException("project() needs to select at least 
> one (1) field.");
>    } else if (fieldIndexes.length > Tuple.MAX_ARITY - 1) {
>       throw new IllegalArgumentException(
>             "project() may select only up to (" + (Tuple.MAX_ARITY - 1) + ") 
> fields.");
>    }
>    int maxFieldIndex = (dataStream.getType()).getArity();
>    for (int i = 0; i < fieldIndexes.length; i++) {
>       Preconditions.checkElementIndex(fieldIndexes[i], maxFieldIndex);
>    }
>    this.dataStream = dataStream;
>    this.fieldIndexes = fieldIndexes;
> }{code}
> This problem also appears in {{ProjectOperator}}.
> {code:java}
> public Projection(DataSet<T> ds, int[] fieldIndexes) {
>    if (!(ds.getType() instanceof TupleTypeInfo)) {
>       throw new UnsupportedOperationException("project() can only be applied 
> to DataSets of Tuples.");
>    }
>    if (fieldIndexes.length == 0) {
>       throw new IllegalArgumentException("project() needs to select at least 
> one (1) field.");
>    } else if (fieldIndexes.length > Tuple.MAX_ARITY - 1) {
>       throw new IllegalArgumentException(
>          "project() may select only up to (" + (Tuple.MAX_ARITY - 1) + ") 
> fields.");
>    }
>    int maxFieldIndex = ds.getType().getArity();
>    for (int fieldIndexe : fieldIndexes) {
>       Preconditions.checkElementIndex(fieldIndexe, maxFieldIndex);
>    }
>    this.ds = ds;
>    this.fieldIndexes = fieldIndexes;
> }{code}
> I think the length we limit should be 1 to {{Tuple.MAX_ARITY}} instead of 1 
> to {{Tuple.MAX_ARITY-1}}.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to