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

    https://github.com/apache/flink/pull/2115#discussion_r67940988
  
    --- Diff: 
flink-libraries/flink-python/src/main/python/org/apache/flink/python/api/flink/plan/DataSet.py
 ---
    @@ -192,6 +193,30 @@ def reduce(self, operator):
             self._env._sets.append(child)
             return child_set
     
    +    def aggregate(self, aggregation, field):
    +        """
    +        Applies an Aggregate transformation (using a GroupReduceFunction) 
on a non-grouped Tuple DataSet.
    +        :param aggregation: The built-in aggregation function to apply on 
the DataSet.
    +        :param field: The index of the Tuple field on which to perform the 
function.
    +        :return: A GroupReduceOperator that represents the aggregated 
DataSet.
    +        """
    +        child_set = self.reduce_group(aggregation(field), combinable=True)
    +        child_set._info.name = "PythonAggregate"
    +        return child_set
    +
    +    def agg_and(self, aggregation, field):
    +        """
    +        Applies an additional Aggregate transformation.
    +        :param aggregation: The built-in aggregation operation to apply on 
the DataSet.
    +        :param field: The index of the Tuple field on which to perform the 
function.
    +        :return: A GroupReduceOperator that represents the aggregated 
DataSet.
    +        """
    +        if self._info.name == "PythonAggregate":
    --- End diff --
    
    this is a bit icky. it would be better to create a separate 
AggregateOperator class that inherits from DataSet and contains the agg_and 
method. (similar to how cross/join works)


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to