Skip to contents

Create a multi-dimensional rollup for the SparkDataFrame using the specified columns.

Usage

rollup(x, ...)

# S4 method for SparkDataFrame
rollup(x, ...)

Arguments

x

a SparkDataFrame.

...

character name(s) or Column(s) to group on.

Value

A GroupedData.

Details

If grouping expression is missing rollup creates a single global aggregate and is equivalent to direct application of agg.

Note

rollup since 2.3.0

Examples

if (FALSE) {
df <- createDataFrame(mtcars)
mean(rollup(df, "cyl", "gear", "am"), "mpg")

# Following calls are equivalent
agg(rollup(df), mean(df$mpg))
agg(df, mean(df$mpg))
}