flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twalthr <...@git.apache.org>
Subject [GitHub] flink pull request #2094: [FLINK-3702] Make FieldAccessors support nested fi...
Date Tue, 23 Aug 2016 09:03:01 GMT
Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2094#discussion_r75826929
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/common/typeinfo/BasicTypeInfo.java
---
    @@ -171,6 +172,23 @@ public boolean isKeyType() {
     		}
     	}
     
    +	@Override
    +	@PublicEvolving
    +	@SuppressWarnings("unchecked")
    +	public <F> FieldAccessor<T, F> getFieldAccessor(int pos, ExecutionConfig
config) {
    +		if(pos != 0) {
    +			throw new InvalidFieldReferenceException("Not the 0th field selected for a basic type.");
    +		}
    +		return (FieldAccessor<T, F>) new FieldAccessor.SimpleFieldAccessor<T>(this);
    +	}
    +
    +	@Override
    +	@PublicEvolving
    +	public <F> FieldAccessor<T, F> getFieldAccessor(String field, ExecutionConfig
config) {
    +		throw new InvalidFieldReferenceException("Field expressions are not supported on basic
types."
    --- End diff --
    
    What about using `*` or also `0` here and get rid of the exception?


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

Mime
View raw message