flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhueske <...@git.apache.org>
Subject [GitHub] flink pull request #5043: [FLINK-2170] [connectors] Add OrcRowInputFormat an...
Date Wed, 22 Nov 2017 14:00:29 GMT
Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5043#discussion_r152571674
  
    --- Diff: flink-core/src/main/java/org/apache/flink/api/java/typeutils/RowTypeInfo.java
---
    @@ -355,4 +355,21 @@ public void addComparatorField(int fieldId, TypeComparator<?>
comparator) {
     				comparatorOrders);
     		}
     	}
    +
    +	/**
    +	 * Creates a {@link RowTypeInfo} with projected fields.
    +	 *
    +	 * @param rowType The original RowTypeInfo whose fields are projected
    +	 * @param fieldMapping The field mapping of the projection
    +	 * @return A RowTypeInfo with projected fields.
    +	 */
    +	public static RowTypeInfo projectFields(RowTypeInfo rowType, int[] fieldMapping) {
    --- End diff --
    
    I think it is cleaner to have this as a static method than an instance method. 
    A static method makes it explicit that this creates a new (immutable) `RowTypeInfo`.


---

Mime
View raw message