flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-3702) DataStream API PojoFieldAccessor doesn't support nested POJOs
Date Wed, 24 Aug 2016 11:39:22 GMT

    [ https://issues.apache.org/jira/browse/FLINK-3702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15434760#comment-15434760
] 

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_r76040578
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/TupleTypeInfoBase.java
---
    @@ -203,7 +205,26 @@ public void getFlatFields(String fieldExpression, int offset, List<FlatFieldDesc
     		TypeInformation<X> typed = (TypeInformation<X>) this.types[pos];
     		return typed;
     	}
    -	
    +
    +	@Override
    +	@PublicEvolving
    +	public <F> FieldAccessor<T, F> getFieldAccessor(int pos, ExecutionConfig
config) {
    +		return new FieldAccessor.SimpleTupleFieldAccessor<T, F>(pos, this);
    +	}
    +
    +	@Override
    +	@PublicEvolving
    +	public <F> FieldAccessor<T, F> getFieldAccessor(String fieldExpression,
ExecutionConfig config) {
    +		FieldAccessor.FieldExpressionDecomposition decomp = FieldAccessor.decomposeFieldExpression(fieldExpression);
    +		int FieldPos = this.getFieldIndex(decomp.head);
    +		if(decomp.tail == null) {
    +			return new FieldAccessor.SimpleTupleFieldAccessor<T, F>(FieldPos, this);
    +		} else {
    +			FieldAccessor<Object,F> innerAccessor = getTypeAt(FieldPos).getFieldAccessor(decomp.tail,
config);
    +			return new FieldAccessor.RecursiveTupleFieldAccessor<T, Object, F>(FieldPos,
innerAccessor);
    --- End diff --
    
    0b237300f9d8a82badb2ab0009c46fc13be64fa3


> 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)

Mime
View raw message