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

    https://github.com/apache/flink/pull/5961#discussion_r186477977
  
    --- Diff: 
flink-java/src/main/java/org/apache/flink/api/java/functions/SelectByMinFunction.java
 ---
    @@ -41,7 +41,7 @@
         * is regarded in the reduce function. First index has highest priority 
and last index has
         * least priority.
         */
    -   public SelectByMinFunction(TupleTypeInfo<T> type, int... fields) {
    +   public SelectByMinFunction(TupleTypeInfoBase<T> type, int... fields) {
    --- End diff --
    
    The `ReduceFunction` is still typed to `T extends Tuple` such that this 
will still fail at runtime. The same is true for all other built-in aggregation 
method like `sum()` and `min()` on `DataSet` and `UnsortedGrouping`. 
    
    This cannot be resolved without major changes. I don't think we should add 
these features, but rather throw meaningful error messages instead of 
`ClassCastException`. 
    
    Can you try to override the the `isTupleType()` method in `RowTypeInfo` and 
return `false`? 
    This would prevent `Row` from being used in contexts that are only 
supported for `Tuple`.


---

Reply via email to