ReducedPivot

class ReducedPivot<T>(val pivot: Pivot<T>, val reducer: Selector<DataFrame<T>, DataRow<T>?>)

An intermediate class used in Pivot reducing operations.

Serves as a transitional step between performing a reduction on pivot groups and specifying how the resulting reduced rows should be represented in a resulting DataRow.

Available transformation methods:

  • values — creates a new row containing the values from the reduced rows in the selected columns and produces a DataRow of these values;

  • with — computes a new value for each reduced row using a RowExpression, and produces a DataRow containing these computed values.

Each method returns a new DataRow with pivot keys as top-level columns (or as column groups) and values composed of the reduced results from each group.

Check out Pivot grammar.

For more information, refer to: See "Pivot Reducing" on the documentation website.

Constructors

Link copied to clipboard
constructor(pivot: Pivot<T>, reducer: Selector<DataFrame<T>, DataRow<T>?>)

Properties

Link copied to clipboard
internal val pivot: Pivot<T>
Link copied to clipboard

Functions

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun <T> ReducedPivot<T>.values(separate: Boolean = false): DataRow<T>
fun <T> ReducedPivot<T>.values(separate: Boolean = false, columns: ColumnsForAggregateSelector<T, *>): DataRow<T>
fun <T> ReducedPivot<T>.values(vararg columns: String, separate: Boolean = false): DataRow<T>
fun <T> ReducedPivot<T>.values(vararg columns: KProperty<*>, separate: Boolean = false): DataRow<T>
fun <T> ReducedPivot<T>.values(vararg columns: ColumnReference<*>, separate: Boolean = false): DataRow<T>
Link copied to clipboard
inline fun <T, reified V> ReducedPivot<T>.with(noinline expression: RowExpression<T, V>): DataRow<T>

Aggregates this ReducedPivot by evaluating the given row expression on the single row selected by the reducer in each pivot group.