Aggregate functions

Most aggregations can be done using functions that can be found in the org.apache.spark.sql.functions package. In addition, custom aggregation functions can also be created, also known as User Defined Aggregation Functions (UDAF).

Each grouping operation returns a RelationalGroupeddataset, on which you can specify aggregations.

We will load the sample data to illustrate all the different types of aggregate functions in this section:

val statesPopulationDF = spark.read.option("header", "true").option("inferschema", "true").option("sep", ",").csv("statesPopulation.csv")
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.157.182