我正在使用带有Python SDK的Google Cloud Dataflow.
我想要 :
我怎样才能获得该列表?在下面的combine变换之后,我创建了一个ListPCollectionView对象但是我无法迭代该对象:
class ToUniqueList(beam.CombineFn):
def create_accumulator(self):
return []
def add_input(self, accumulator, element):
if element not in accumulator:
accumulator.append(element)
return accumulator
def merge_accumulators(self, accumulators):
return list(set(accumulators))
def extract_output(self, accumulator):
return accumulator
def get_list_of_dates(pcoll):
return (pcoll
| 'get the list of dates' >> beam.CombineGlobally(ToUniqueList()))
Run Code Online (Sandbox Code Playgroud)
我做错了吗?最好的方法是什么?
谢谢.