【发布时间】:2019-03-13 14:45:07
【问题描述】:
假设我有以下格式的 PCollection:
-----------------------------------------
| sale_id | product_id | amount |
|-----------|---------------|-----------|
| 1 | a | 1 |
|-----------|---------------|-----------|
| 2 | b | 12 |
|-----------|---------------|-----------|
| 3 | c | 3 |
|-----------|---------------|-----------|
| 4 | d | 100 |
|-----------|---------------|-----------|
| 5 | e | 4 |
-----------------------------------------
我的目标是只过滤X个畅销记录,即按数量排序,限制X个
在 apache Beam 中的实现方式是什么?
谢谢!
【问题讨论】:
标签: google-cloud-dataflow apache-beam