Example #1
0
    def __init__(self, function_type, *args):
        """Build the Each constructor for the Python function.

        Arguments:
        function_type -- CascadingFunctionWrapper or CascadingFilterWrapper,
            whether we are calling Each with a function or filter
        *args -- the arguments passed on to Cascading Each
        """
        Operation.__init__(self)

        self.__function = None
        # The default argument selector is Fields.ALL (per Cascading sources
        # for Operator.java)
        self.__argument_selector = None
        # The default output selector is Fields.RESULTS (per Cascading sources
        # for Operator.java)
        self.__output_selector = None

        if len(args) == 1:
            self.__function = args[0]
        elif len(args) == 2:
            (self.__argument_selector, self.__function) = args
        elif len(args) == 3:
            (self.__argument_selector, self.__function,
             self.__output_selector) = args
        else:
            raise Exception('The number of parameters to Apply/Filter ' \
                            'should be between 1 and 3')
        # This is the Cascading Function type
        self.__function = wrap_function(self.__function, function_type)
Example #2
0
    def __init__(self, function_type, *args):
        """Build the Each constructor for the Python function.

        Arguments:
        function_type -- CascadingFunctionWrapper or CascadingFilterWrapper,
            whether we are calling Each with a function or filter
        *args -- the arguments passed on to Cascading Each
        """
        Operation.__init__(self)

        self.__function = None
        # The default argument selector is Fields.ALL (per Cascading sources
        # for Operator.java)
        self.__argument_selector = None
        # The default output selector is Fields.RESULTS (per Cascading sources
        # for Operator.java)
        self.__output_selector = None

        if len(args) == 1:
            self.__function = args[0]
        elif len(args) == 2:
            (self.__argument_selector, self.__function) = args
        elif len(args) == 3:
            (self.__argument_selector, self.__function,
             self.__output_selector) = args
        else:
            raise Exception('The number of parameters to Apply/Filter ' \
                            'should be between 1 and 3')
        # This is the Cascading Function type
        self.__function = wrap_function(self.__function, function_type)
Example #3
0
    def __init__(self, *args, **kwargs):
        """Create a Cascading Every pipe.

        Keyword arguments:
        aggregator -- a Cascading aggregator (only either aggregator or buffer
            should be used)
        buffer -- a Cascading Buffer or a PyCascading @reduce function
        output_selector -- the outputSelector parameter for Cascading
        argument_selector -- the argumentSelector parameter for Cascading
        assertion_level -- the assertionLevel parameter for Cascading
        assertion -- the assertion parameter for Cascading
        """
        Operation.__init__(self)
        self.__args = args
        self.__kwargs = kwargs
Example #4
0
    def __init__(self, *args, **kwargs):
        """Create a Cascading Every pipe.

        Keyword arguments:
        aggregator -- a Cascading aggregator (only either aggregator or buffer
            should be used)
        buffer -- a Cascading Buffer or a PyCascading @reduce function
        output_selector -- the outputSelector parameter for Cascading
        argument_selector -- the argumentSelector parameter for Cascading
        assertion_level -- the assertionLevel parameter for Cascading
        assertion -- the assertion parameter for Cascading
        """
        Operation.__init__(self)
        self.__args = args
        self.__kwargs = kwargs
Example #5
0
    def __init__(self, *args, **kwargs):
        """Create a Cascading Every pipe.

        Arguments:
        args[0] -- the fields on which to group

        Keyword arguments:
        group_name -- the groupName parameter for Cascading
        group_fields -- the fields on which to group
        sort_fields -- the sortFields parameter for Cascading
        reverse_order -- the reverseOrder parameter for Cascading
        lhs_pipe -- the lhsPipe parameter for Cascading
        rhs_pipe -- the rhsPipe parameter for Cascading
        """
        Operation.__init__(self)
        self.__args = args
        self.__kwargs = kwargs
Example #6
0
    def __init__(self, *args, **kwargs):
        """Create a Cascading Every pipe.

        Arguments:
        args[0] -- the fields on which to group

        Keyword arguments:
        group_name -- the groupName parameter for Cascading
        group_fields -- the fields on which to group
        sort_fields -- the sortFields parameter for Cascading
        reverse_order -- the reverseOrder parameter for Cascading
        lhs_pipe -- the lhsPipe parameter for Cascading
        rhs_pipe -- the rhsPipe parameter for Cascading
        """
        Operation.__init__(self)
        self.__args = args
        self.__kwargs = kwargs
Example #7
0
    def __init__(self, *args, **kwargs):
        """Create a Cascading CoGroup pipe.

        Arguments:
        args[0] -- the fields on which to join

        Keyword arguments:
        group_name -- the groupName parameter for Cascading
        group_fields -- the fields on which to group
        declared_fields -- the declaredFields parameter for Cascading
        result_group_fields -- the resultGroupFields parameter for Cascading
        joiner -- the joiner parameter for Cascading
        num_self_joins -- the numSelfJoins parameter for Cascading
        lhs -- the lhs parameter for Cascading
        lhs_group_fields -- the lhsGroupFields parameter for Cascading
        rhs -- the rhs parameter for Cascading
        rhs_group_fields -- the rhsGroupFields parameter for Cascading
        """
        Operation.__init__(self)
        self.__args = args
        self.__kwargs = kwargs
Example #8
0
    def __init__(self, *args, **kwargs):
        """Create a Cascading CoGroup pipe.

        Arguments:
        args[0] -- the fields on which to join

        Keyword arguments:
        group_name -- the groupName parameter for Cascading
        group_fields -- the fields on which to group
        declared_fields -- the declaredFields parameter for Cascading
        result_group_fields -- the resultGroupFields parameter for Cascading
        joiner -- the joiner parameter for Cascading
        num_self_joins -- the numSelfJoins parameter for Cascading
        lhs -- the lhs parameter for Cascading
        lhs_group_fields -- the lhsGroupFields parameter for Cascading
        rhs -- the rhs parameter for Cascading
        rhs_group_fields -- the rhsGroupFields parameter for Cascading
        """
        Operation.__init__(self)
        self.__args = args
        self.__kwargs = kwargs
Example #9
0
 def __init__(self, callback):
     Operation.__init__(self)
     self.__callback = callback
Example #10
0
 def __init__(self, callback):
     Operation.__init__(self)
     self.__callback = callback