[ https://issues.apache.org/jira/browse/FLINK-8255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16466383#comment-16466383 ]
ASF GitHub Bot commented on FLINK-8255: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/5961#discussion_r186527205 --- Diff: flink-streaming-java/src/main/java/org/apache/flink/streaming/util/typeutils/FieldAccessor.java --- @@ -157,15 +156,15 @@ public T set(T record, F fieldValue) { SimpleTupleFieldAccessor(int pos, TypeInformation<T> typeInfo) { --- End diff -- accessing fields in a `Row` will fail because `Row` does not extend `Tuple`. For a proper fix, we would need a `RowFieldAccessor` and use that one when we deal with a `DataStream<Row>`. We would then need to add the `RowFieldAccessor` to the `FieldAccessorFactory`. > Key expressions on named row types do not work > ---------------------------------------------- > > Key: FLINK-8255 > URL: https://issues.apache.org/jira/browse/FLINK-8255 > Project: Flink > Issue Type: Bug > Components: DataSet API, DataStream API > Affects Versions: 1.4.0, 1.5.0 > Reporter: Timo Walther > Assignee: Sergey Nuyanzin > Priority: Major > > The following program fails with a {{ClassCastException}}. It seems that key > expressions and rows are not tested well. We should add more tests for them. > {code} > final StreamExecutionEnvironment env = > StreamExecutionEnvironment.getExecutionEnvironment(); > TypeInformation[] types = new TypeInformation[] {Types.INT, Types.INT}; > String[] fieldNames = new String[]{"id", "value"}; > RowTypeInfo rowTypeInfo = new RowTypeInfo(types, fieldNames); > env.fromCollection(Collections.singleton(new Row(2)), rowTypeInfo) > .keyBy("id").sum("value").print(); > env.execute("Streaming WordCount"); > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)