Functional Programming - Reduce - Reduction Operation (fold)

Imperative Vs Functional

About

A (reduction|reduce) operation (also called a fold) is a functional programming function.

Reduction operations are terminal operations.

They takes a sequence of input elements and returns:

  • a single summary result
  • a collection
  • or a map

Example:

  • finding the sum or maximum of a set of numbers,
  • finding the average of values
  • grouping elements into categories
  • accumulating elements into a list (collections) - group by, partitioningBy
  • summarizing elements according to various criteria
  • etc..

Property

Batch

A reduction operates on the stream as a whole rather than on individual elements. See Data Processing - Batch

Parallel

A properly constructed reduce operation is inherently parallelizable. See Parallel Programming - (Function|Operation)

Documentation / Reference





Discover More
Imperative Vs Functional
Code - Functional programming (FP) - Collection Operations

Functional programming (FP) defines standard operations on collections. It is a declarative paradigm that treats computation as the evaluation of mathematical functions. Most of the operations, you perform...
Model Funny
Function - (Aggregate | Aggregation)

Aggregate functions return a single value calculated or selected from values that are in a aggregation relationship (ie a set) This values are also known as summary because they try to summarize...
Imperative Vs Functional
Functional Programming - Group by

grouping by is a function that group elements with the same attribute in a apart collection. The output of a group by operations is normally a map where: the key is the elements to group by and the...
Imperative Vs Functional
Functional Programming - Reduce - Reduction Operation (fold)

A (reduction|reduce) operation (also called a fold) is a functional programming function. Reduction operations are terminal operations. They takes a sequence of input elements and returns: a single...
Imperative Vs Functional
Functional Programming - Terminal Operations

Terminal operations return one value by combining the contents of a stream. Type Example reduction operation average, sum, min, max, and count Collect collect the stream in a collection
Java Conceptuel Diagram
Java - Stream Processing

Map objects to another value as specified by a Function object Perform an action as specified by a Consumer object void forEach(Consumer action) filter, map, forEach lambda expressionsiterators...
Mapreduce Pipeline
MapReduce - Reducer

in Hadoop.
Card Puncher Data Processing
Python - Reduce Function

The implementation in Python. Reduce operates on pairs of elements in a series. It applies a function that takes in two values and returns a single value. Using this function, reduce is able to, iteratively,...
Spark Pipeline
Spark - (Reduce|Aggregate) function

Spark permits to reduce a data set through: a reduce function or The reduce function of the map reduce framework Reduce is a spark action that aggregates a data set (RDD) element using a function....
Data System Architecture
Statistics - (Data|Data Set) (Summary|Description) - Descriptive Statistics

Summary are a single value summarizing a array of data. They are: selected or calculated through reduction operations. They are an important element of descriptive analysis One of the most important...



Share this page:
Follow us:
Task Runner