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:05:37 GMT
Github user twalthr commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2094#discussion_r75827289
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/common/typeinfo/TypeInformation.java
---
    @@ -160,6 +161,53 @@ public boolean isSortKeyType() {
     	@PublicEvolving
     	public abstract TypeSerializer<T> createSerializer(ExecutionConfig config);
     
    +
    +	/**
    +	 * Creates a {@link FieldAccessor} for the given field position, which can be used to
get and set
    +	 * the specified field on instances of this type.
    +	 *
    +	 * @param pos The field position (zero-based)
    +	 * @param config Configuration object
    +	 * @param <F> The type of the field to access
    +	 * @return The created FieldAccessor
    +	 */
    +	@PublicEvolving
    +	public <F> FieldAccessor<T, F> getFieldAccessor(int pos, ExecutionConfig
config){
    +		throw new InvalidFieldReferenceException("Cannot reference field by position on " +
this.toString()
    +			+ "Referencing a field by position is supported on tuples, case classes, and arrays.
"
    +			+ "Additionally, you can select the 0th field of a primitive/basic type (e.g. int).");
    +	}
    +
    +	/**
    +	 * Creates a {@link FieldAccessor} for the field that is given by a field expression,
    +	 * which can be used to get and set the specified field on instances of this type.
    +	 *
    +	 * @see <a href="https://ci.apache.org/projects/flink/flink-docs-master/apis/common/index.html#define-keys-using-field-expressions">
    --- End diff --
    
    Don't use links to the documentation. They change over time and become invalid.


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