concept avg() in category spark

appears as: vg()
Spark in Action, Second Edition

This is an excerpt from Manning's book Spark in Action, Second Edition.

There are 37 functions in this category: abs() , acos() , asin() , atan() , atan2() , avg() , bround() , cbrt() , ceil() , cos() , cosh() , covar_pop() , covar_samp() , degrees() , exp() , expm1() , factorial() , floor() , hypot() , log() , log10() , log1p() , log2() , negate() , pmod() , pow() , radians() , rand() , randn() , rint() , round() , signum() , sin() , sinh() , sqrt() , tan() , and tanh() .

Let’s have a look at the dataframe API to perform an aggregation in listing 15.5. You will use the dataframe as your source and use the groupBy() method. Using method chaining, you can directly apply an aggregate method such as agg() , avg() , count() , and so on.