You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by twalthr <gi...@git.apache.org> on 2016/08/23 09:01:26 UTC

[GitHub] flink pull request #2094: [FLINK-3702] Make FieldAccessors support nested fi...

Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2094#discussion_r75826683
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/common/typeinfo/BasicArrayTypeInfo.java ---
    @@ -121,6 +122,18 @@ public boolean isKeyType() {
     	}
     
     	@Override
    +	@PublicEvolving
    +	public <F> FieldAccessor<T, F> getFieldAccessor(int pos, ExecutionConfig config) {
    +		return new FieldAccessor.ArrayFieldAccessor<T, F>(pos, this);
    +	}
    +
    +	@Override
    +	@PublicEvolving
    +	public <F> FieldAccessor<T, F> getFieldAccessor(String field, ExecutionConfig config) {
    +		throw new InvalidFieldReferenceException("Selecting a field from an array type is only supported by index.");
    --- End diff --
    
    We could also add an additional constructor in `ArrayFieldAccessor` that takes a string and parses the int position there. Then we don't need to throw exceptions. What do you think?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---