maxΒΆ

max is an aggregate function that returns the maximum value in a group.

Syntax:

  • max(SparkDataFrame$column)

Parameters:

  • SparkDataFrame: Any SparkDataFrame
  • column: Column in SparkDataFrame

Output:

  • Column Object
require(SparkR)

# Create SparkDataFrame using the faithful dataset from R
df <- createDataFrame(faithful)

# Displays the content of the SparkDataFrame to stdout
head(df)
# Return first value of column df$waiting
collect(select(df, max(df$waiting)))