Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. val df = ... // some data frame
  2. df.groupBy("A").agg(
  3. max("B").where("B").less(10), // there is no such method as `where` :(
  4. max("C").where("C").less(5)
  5. )
  6.  
  7. | A | B | C |
  8. | 1| 14| 4|
  9. | 1| 9| 3|
  10. | 2| 5| 6|
  11.  
  12. |A|max(B)|max(C)|
  13. |1| 9| 4|
  14. |2| 5| null|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement