A Spark DataFrame expression is df.filter("amount > 0").groupBy("region").sum("amount"). What does it compute?

Published
  1. The sum of positive amounts for each region
  2. One global sum with no region grouping
  3. Only the largest amount in each region
  4. The count of all rows regardless of amount

Comments — 0