Let's assume that I have PCollection with following format:
-----------------------------------------
| sale_id | product_id | amount |
|-----------|---------------|-----------|
| 1 | a | 1 |
|-----------|---------------|-----------|
| 2 | b | 12 |
|-----------|---------------|-----------|
| 3 | c | 3 |
|-----------|---------------|-----------|
| 4 | d | 100 |
|-----------|---------------|-----------|
| 5 | e | 4 |
-----------------------------------------
My target is to filter only X bestseller records, i.e order by amount, limit X
What is the way to do it in apache beam?
Thanks!