[
https://issues.apache.org/jira/browse/FLINK-3702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15434758#comment-15434758
]
ASF GitHub Bot commented on FLINK-3702:
---------------------------------------
Github user ggevay commented on a diff in the pull request:
https://github.com/apache/flink/pull/2094#discussion_r76040566
--- Diff:
flink-core/src/main/java/org/apache/flink/api/java/typeutils/PojoTypeInfo.java
---
@@ -317,7 +308,39 @@ public int getFieldIndex(String fieldName) {
return new PojoSerializer<T>(getTypeClass(), fieldSerializers,
reflectiveFields, config);
}
-
+
+ @Override
+ @PublicEvolving
+ public <F> FieldAccessor<T, F> getFieldAccessor(String fieldExpression,
ExecutionConfig config) {
+
+ FieldAccessor.FieldExpressionDecomposition decomp =
FieldAccessor.decomposeFieldExpression(fieldExpression);
+
+ // get field
+ PojoField field = null;
+ TypeInformation<?> fieldType = null;
+ for (int i = 0; i < fields.length; i++) {
+ if (fields[i].getField().getName().equals(decomp.head))
{
+ field = fields[i];
+ fieldType = fields[i].getTypeInformation();
+ break;
+ }
+ }
+ if (field == null) {
+ throw new InvalidFieldReferenceException("Unable to
find field \""+decomp.head+"\" in type "+this+".");
+ }
+
+ if(decomp.tail == null) {
--- End diff --
a0939f7762fa5ac71e5975a36fc31c39fd0cf5dd
> DataStream API PojoFieldAccessor doesn't support nested POJOs
> -------------------------------------------------------------
>
> Key: FLINK-3702
> URL: https://issues.apache.org/jira/browse/FLINK-3702
> Project: Flink
> Issue Type: Improvement
> Components: DataStream API
> Affects Versions: 1.0.0
> Reporter: Robert Metzger
> Assignee: Gabor Gevay
>
> The {{PojoFieldAccessor}} (which is used by {{.sum(String)}} and similar
> methods) doesn't support nested POJOs right now.
> As part of FLINK-3697 I'll add a check for a nested POJO and fail with an
> exception.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)